text
stringlengths
2
1.05M
var React = require('react'); var ReactDOM = require('react-dom'); require('./index.css'); var App = require('./components/App'); ReactDOM.render( <App />, document.getElementById('app') );
/** * @license Licensed under the Apache License, Version 2.0 (the "License"): * http://www.apache.org/licenses/LICENSE-2.0 */ /** * @fileoverview Block for the Arduino map functionality. * The Arduino built in functions syntax can be found at: * http://arduino.cc/en/Reference/HomePage * * TODO: This block can be improved to set the new range properly. */ 'use strict'; goog.require('Blockly.Blocks'); goog.require('Blockly.Types'); /** Common HSV hue for all blocks in this category. */ Blockly.Blocks.variables.HUE = 330; Blockly.Blocks.variables = {}; Blockly.Blocks.variables.HUE = 330; Blockly.Blocks.variables.HUE2 = 75; Blockly.Blocks.variables.HUE3 = 290; var booleanValues = [ ["On", true], ["Off", false] ] // Blockly.Blocks.variables_get = { // init: function () { // this.setHelpUrl(Blockly.Msg.VARIABLES_GET_HELPURL); // this.setColour(Blockly.Blocks.variables.HUE); // this.appendDummyInput().appendField(new Blockly.FieldVariable(Blockly.Msg.VARIABLES_DEFAULT_NAME), "VAR"); // this.setOutput(!0, "Number"); // this.setTooltip(Blockly.Msg.VARIABLES_GET_TOOLTIP); // this.contextMenuMsg_ = Blockly.Msg.VARIABLES_GET_CREATE_SET // }, // getVars: function () { // return [this.getFieldValue("VAR")] // }, // renameVar: function (a, b) { // Blockly.Names.equals(a, this.getFieldValue("VAR")) && // this.setFieldValue(b, "VAR") // }, // contextMenuType_: "variables_set", // customContextMenu: function (a) { // var b = { // enabled: !0 // }, // c = this.getFieldValue("VAR"); // b.text = this.contextMenuMsg_.replace("%1", c); // c = goog.dom.createDom("field", null, c); // c.setAttribute("name", "VAR"); // c = goog.dom.createDom("block", null, c); // c.setAttribute("type", this.contextMenuType_); // b.callback = Blockly.ContextMenu.callbackFactory(this, c); // a.push(b) // } // }; // Blockly.Blocks.variables_set = { // init: function () { // this.setColour(Blockly.Blocks.variables.HUE); // this.appendValueInput("VALUE") // .appendField("Set") // .appendField(new Blockly.FieldVariable(Blockly.Msg.VARIABLES_DEFAULT_NAME), "VAR") // .appendField("=") // .setCheck(null) // // this.contextMenuMsg_ = Blockly.Msg.VARIABLES_SET_CREATE_GET; // // this.setPreviousStatement(!0); // // this.setNextStatement(!0); // // this.setTooltip(Blockly.Msg.VARIABLES_SET_TOOLTIP) // }, // getVars: function () { // return [this.getFieldValue("VAR")] // }, // renameVar: function (a, // b) { // Blockly.Names.equals(a, this.getFieldValue("VAR")) && this.setFieldValue(b, "VAR") // }, // contextMenuType_: "variables_get", // customContextMenu: Blockly.Blocks.variables_get.customContextMenu // }; // Blockly.Blocks.variables_get_text = { // init: function () { // this.setHelpUrl(Blockly.Msg.VARIABLES_GET_HELPURL); // this.setColour(Blockly.Blocks.variables.HUE2); // this.appendDummyInput().appendField(new Blockly.FieldTextInput('text'), "VARTEXT"); // this.setOutput(!0, "String"); // this.setTooltip(Blockly.Msg.VARIABLES_GET_TOOLTIP); // this.contextMenuMsg_ = Blockly.Msg.VARIABLES_GET_CREATE_SET // }, // getVarsText: function () { // return [this.getFieldValue("VARTEXT")] // }, // renameVarText: function (a, b) { // Blockly.Names.equals(a, // this.getFieldValue("VARTEXT")) && this.setFieldValue(b, "VARTEXT") // }, // contextMenuType_: "variables_set_text", // customContextMenu: function (a) { // var b = { // enabled: !0 // }, // c = this.getFieldValue("VARTEXT"); // b.text = this.contextMenuMsg_.replace("%1", c); // c = goog.dom.createDom("field", null, c); // c.setAttribute("name", "VARTEXT"); // c = goog.dom.createDom("block", null, c); // c.setAttribute("type", this.contextMenuType_); // b.callback = Blockly.ContextMenu.callbackFactory(this, c); // a.push(b) // } // }; // Blockly.Blocks.variables_set_text = { // init: function () { // this.setColour(Blockly.Blocks.variables.HUE2); // this.appendValueInput("VALUE") // .appendField("Set") // // .appendField(new Blockly.FieldTextInput(Blockly.Msg.VARIABLES_DEFAULT_NAME_TEXT), "VARTEXT") // .appendField(new Blockly.FieldVariable( // 'text'), 'VARTEXT') // .appendField("=") // // .setCheck("String"); // this.setPreviousStatement(!0); // this.setNextStatement(!0); // // this.setTooltip(Blockly.Msg.VARIABLES_SET_TOOLTIP) // }, // getVarsText: function () { // return [this.getFieldValue("VARTEXT")] // }, // renameVarText: function (a, b) { // Blockly.Names.equals(a, // this.getFieldValue("VARTEXT")) && this.setFieldValue(b, "VARTEXT") // } // }; Blockly.Blocks.variables_get_bool = { init: function () { this.setHelpUrl(Blockly.Msg.VARIABLES_GET_HELPURL); this.setColour(Blockly.Blocks.variables.HUE3); this.appendDummyInput() .appendField(new Blockly.FieldVariable('state'), "VARBOOL"); this.setOutput(!0, "Boolean"); this.setTooltip(Blockly.Msg.VARIABLES_GET_TOOLTIP); this.contextMenuMsg_ = Blockly.Msg.VARIABLES_GET_CREATE_SET }, getVarsBool: function () { return [this.getFieldValue("VARBOOL")] }, renameVarBool: function (a, b) { Blockly.Names.equals(a, this.getFieldValue("VARBOOL")) && this.setFieldValue(b, "VARBOOL") }, contextMenuType_: "variables_set_bool", customContextMenu: function (a) { var b = { enabled: !0 }, c = this.getFieldValue("VARBOOL"); b.text = this.contextMenuMsg_.replace("%1", c); c = goog.dom.createDom("field", null, c); c.setAttribute("name", "VARBOOL"); c = goog.dom.createDom("block", null, c); c.setAttribute("type", this.contextMenuType_); b.callback = Blockly.ContextMenu.callbackFactory(this, c); a.push(b) } }; // Blockly.Blocks.variables_set_bool = { // init: function () { // this.setColour(Blockly.Blocks.variables.HUE3); // this.appendValueInput("VALUE") // .appendField("Set") // .appendField(new Blockly.FieldVariable('state'), "VARBOOL") // .appendField("=").setCheck("Boolean"); // this.setPreviousStatement(!0); // this.setNextStatement(!0); // this.setTooltip(Blockly.Msg.VARIABLES_SET_TOOLTIP) // }, // getVarsBool: function () { // return [this.getFieldValue("VARBOOL")] // }, // renameVarBool: function (a, b) { // Blockly.Names.equals(a, // this.getFieldValue("VARBOOL")) && this.setFieldValue(b, "VARBOOL") // } // }; Blockly.Blocks['variables_set_type'] = { /** * Block for variable casting. * @this Blockly.Block */ init: function() { this.setHelpUrl('http://arduino.cc/en/Reference/HomePage'); this.setColour(Blockly.Blocks.variables.HUE); this.appendValueInput('VARIABLE_SETTYPE_INPUT'); this.appendDummyInput() .appendField(Blockly.Msg.ARD_VAR_AS) .appendField(new Blockly.FieldDropdown( Blockly.Types.getValidTypeArray()), 'VARIABLE_SETTYPE_TYPE'); this.setInputsInline(true); this.setOutput(true); this.setTooltip(Blockly.Msg.ARD_VAR_AS_TIP); }, /** * Assigns a type to the block based on the selected type to cast. * @return {!string} Blockly type for this block configuration. * @this Blockly.Block */ getBlockType: function() { var blocklyTypeKey = this.getFieldValue('VARIABLE_SETTYPE_TYPE'); return Blockly.Types[blocklyTypeKey]; } }; Blockly.Blocks.logic_boolean2 = { init: function () { this.jsonInit({ message0: "%1", args0: [{ type: "field_dropdown", name: "BOOL", options: [ ["On", "TRUE"], ["Off", "FALSE"] ] }], output: "Boolean", colour: Blockly.Blocks.logic.HUE, tooltip: Blockly.Msg.LOGIC_BOOLEAN_TOOLTIP, helpUrl: Blockly.Msg.LOGIC_BOOLEAN_HELPURL }) } };
const and = require("./and"); describe("unit: and", () => { let validate; let values; beforeEach(() => { validate = jest.fn(() => true); values = ["a", "b", "c"]; validate.mockClear(); }); test("it should call validate for each value while it returns true", () => { and(validate, values); expect(validate).toHaveBeenCalledTimes(3); expect(validate).toHaveBeenCalledWith(values[0]); expect(validate).toHaveBeenCalledWith(values[1]); expect(validate).toHaveBeenCalledWith(values[2]); }); test("it should return true if all of values validate to true", () => { expect(and(validate, values)).toBe(true); }); it("it should return false if only a single value validates to false", () => { validate.mockImplementation(value => value !== "a"); expect(and(validate, values)).toBe(false); validate.mockImplementation(value => value !== "c"); expect(and(validate, values)).toBe(false); }); test("it should stop validating values if one has validated to false", () => { validate.mockImplementation(value => value !== "b"); expect(and(validate, values)).toBe(false); expect(validate).toHaveBeenCalledTimes(2); expect(validate).toHaveBeenCalledWith(values[0]); expect(validate).toHaveBeenCalledWith(values[1]); expect(validate).not.toHaveBeenCalledWith(values[2]); }); });
var a00419 = [ [ "BUCK_VIN_ADC_TRGDLY", "a00419.html#gaebdc8f2678e3d0bc7d44bfb45c57f496", null ], [ "BUCK_VIN_FEEDBACK_GAIN", "a00419.html#ga0400a9956f7aa27d775cdfb00cd12e5d", null ], [ "BUCK_VIN_HYST", "a00419.html#ga34bc0d6f4ab547c99b2c02c1302f5ecf", null ], [ "BUCK_VIN_MAX", "a00419.html#gaab4319c2b78139af3fe8eb251d01fadf", null ], [ "BUCK_VIN_MIN", "a00419.html#gaa29edd273b98ce34192834726820635c", null ], [ "BUCK_VIN_NOM", "a00419.html#gab5fe8834938982fdd2e9c6773866542b", null ], [ "BUCK_VIN_NORM_FACTOR", "a00419.html#ga22cf517ef3554a6157e25905d7d1755a", null ], [ "BUCK_VIN_NORM_INV_G", "a00419.html#ga7eea84f9319a9c04857d0061c8c8b332", null ], [ "BUCK_VIN_NORM_SCALER", "a00419.html#ga961467f632e6d14a705ae5bde5026acc", null ], [ "BUCK_VIN_OFFSET", "a00419.html#gabd59b02a2ace754dfccc9c42b45e2b7e", null ], [ "BUCK_VIN_OVLO_RELEASE", "a00419.html#ga88fedea7d8380c9ca87e2e98f05a7339", null ], [ "BUCK_VIN_OVLO_TRIP", "a00419.html#gac98e158cb73b23b08617446fb8839e16", null ], [ "BUCK_VIN_RANGE_MAX", "a00419.html#ga9d3deddd69546a95751204fe12f2a30c", null ], [ "BUCK_VIN_UVLO_RELEASE", "a00419.html#ga4e30efeba3e4eabf4d96b1649dc7866d", null ], [ "BUCK_VIN_UVLO_TRIP", "a00419.html#ga2b2b1af5d1f595d3d30d8b33fe20049e", null ] ];
// Wrap whole file in a function to avoid polluting the global namespace (function() { _parsePath = function() { var dbpath = ""; for( var i = 0; i < arguments.length; ++i ) if ( arguments[ i ] == "--dbpath" ) dbpath = arguments[ i + 1 ]; if ( dbpath == "" ) throw Error("No dbpath specified"); return dbpath; } _parsePort = function() { var port = ""; for( var i = 0; i < arguments.length; ++i ) if ( arguments[ i ] == "--port" ) port = arguments[ i + 1 ]; if ( port == "" ) throw Error("No port specified"); return port; } connectionURLTheSame = function( a , b ){ if ( a == b ) return true; if ( ! a || ! b ) return false; if( a.host ) return connectionURLTheSame( a.host, b ) if( b.host ) return connectionURLTheSame( a, b.host ) if( a.name ) return connectionURLTheSame( a.name, b ) if( b.name ) return connectionURLTheSame( a, b.name ) if( a.indexOf( "/" ) < 0 && b.indexOf( "/" ) < 0 ){ a = a.split( ":" ) b = b.split( ":" ) if( a.length != b.length ) return false if( a.length == 2 && a[1] != b[1] ) return false if( a[0] == "localhost" || a[0] == "127.0.0.1" ) a[0] = getHostName() if( b[0] == "localhost" || b[0] == "127.0.0.1" ) b[0] = getHostName() return a[0] == b[0] } else { var a0 = a.split( "/" )[0] var b0 = b.split( "/" )[0] return a0 == b0 } } assert( connectionURLTheSame( "foo" , "foo" ) ) assert( ! connectionURLTheSame( "foo" , "bar" ) ) assert( connectionURLTheSame( "foo/a,b" , "foo/b,a" ) ) assert( ! connectionURLTheSame( "foo/a,b" , "bar/a,b" ) ) createMongoArgs = function( binaryName , args ){ var fullArgs = [ binaryName ]; if ( args.length == 1 && isObject( args[0] ) ){ var o = args[0]; for ( var k in o ){ if ( o.hasOwnProperty(k) ){ if ( k == "v" && isNumber( o[k] ) ){ var n = o[k]; if ( n > 0 ){ if ( n > 10 ) n = 10; var temp = "-"; while ( n-- > 0 ) temp += "v"; fullArgs.push( temp ); } } else { fullArgs.push( "--" + k ); if ( o[k] != "" ) fullArgs.push( "" + o[k] ); } } } } else { for ( var i=0; i<args.length; i++ ) fullArgs.push( args[i] ) } return fullArgs; } MongoRunner = function(){} MongoRunner.dataDir = "/data/db" MongoRunner.dataPath = "/data/db/" MongoRunner.usedPortMap = {} MongoRunner.VersionSub = function(regex, version) { this.regex = regex; this.version = version; } // These patterns allow substituting the binary versions used for each // version string to support the dev/stable MongoDB release cycle. MongoRunner.binVersionSubs = [ new MongoRunner.VersionSub(/^latest$/, ""), new MongoRunner.VersionSub(/^oldest-supported$/, "1.8"), // To-be-updated when 2.8 becomes available new MongoRunner.VersionSub(/^last-stable$/, "2.6"), // Latest unstable and next stable are effectively the // same release new MongoRunner.VersionSub(/^2\.7(\..*){0,1}/, ""), new MongoRunner.VersionSub(/^2\.8(\..*){0,1}/, "") ]; MongoRunner.getBinVersionFor = function(version) { // If this is a version iterator, iterate the version via toString() if (version instanceof MongoRunner.versionIterator.iterator) { version = version.toString(); } // No version set means we use no suffix, this is *different* from "latest" // since latest may be mapped to a different version. if (version == null) version = ""; version = version.trim(); if (version === "") return ""; // See if this version is affected by version substitutions for (var i = 0; i < MongoRunner.binVersionSubs.length; i++) { var sub = MongoRunner.binVersionSubs[i]; if (sub.regex.test(version)) { version = sub.version; } } return version; } MongoRunner.areBinVersionsTheSame = function(versionA, versionB) { versionA = MongoRunner.getBinVersionFor(versionA); versionB = MongoRunner.getBinVersionFor(versionB); if (versionA === "" || versionB === "") { return versionA === versionB; } return versionA.startsWith(versionB) || versionB.startsWith(versionA); } MongoRunner.logicalOptions = { runId : true, pathOpts : true, remember : true, noRemember : true, appendOptions : true, restart : true, noCleanData : true, cleanData : true, startClean : true, forceLock : true, useLogFiles : true, logFile : true, useHostName : true, useHostname : true, noReplSet : true, forgetPort : true, arbiter : true, noJournalPrealloc : true, noJournal : true, binVersion : true, waitForConnect : true } MongoRunner.toRealPath = function( path, pathOpts ){ // Replace all $pathOptions with actual values pathOpts = pathOpts || {} path = path.replace( /\$dataPath/g, MongoRunner.dataPath ) path = path.replace( /\$dataDir/g, MongoRunner.dataDir ) for( key in pathOpts ){ path = path.replace( RegExp( "\\$" + RegExp.escape(key), "g" ), pathOpts[ key ] ) } // Relative path // Detect Unix and Windows absolute paths // as well as Windows drive letters // Also captures Windows UNC paths if( ! path.match( /^(\/|\\|[A-Za-z]:)/ ) ){ if( path != "" && ! path.endsWith( "/" ) ) path += "/" path = MongoRunner.dataPath + path } return path } MongoRunner.toRealDir = function( path, pathOpts ){ path = MongoRunner.toRealPath( path, pathOpts ) if( path.endsWith( "/" ) ) path = path.substring( 0, path.length - 1 ) return path } MongoRunner.toRealFile = MongoRunner.toRealDir MongoRunner.nextOpenPort = function(){ var i = 0; while( MongoRunner.usedPortMap[ "" + ( 27000 + i ) ] ) i++; MongoRunner.usedPortMap[ "" + ( 27000 + i ) ] = true return 27000 + i } /** * Returns an iterator object which yields successive versions on toString(), starting from a * random initial position, from an array of versions. * * If passed a single version string or an already-existing version iterator, just returns the * object itself, since it will yield correctly on toString() * * @param {Array.<String>}|{String}|{versionIterator} */ MongoRunner.versionIterator = function( arr, isRandom ){ // If this isn't an array of versions, or is already an iterator, just use it if( typeof arr == "string" ) return arr if( arr.isVersionIterator ) return arr if (isRandom == undefined) isRandom = false; // Starting pos var i = isRandom ? parseInt( Random.rand() * arr.length ) : 0; return new MongoRunner.versionIterator.iterator(i, arr); } MongoRunner.versionIterator.iterator = function(i, arr) { this.toString = function() { i = ( i + 1 ) % arr.length print( "Returning next version : " + i + " (" + arr[i] + ") from " + tojson( arr ) + "..." ); return arr[ i ] } this.isVersionIterator = true; } /** * Converts the args object by pairing all keys with their value and appending * dash-dash (--) to the keys. The only exception to this rule are keys that * are defined in MongoRunner.logicalOptions, of which they will be ignored. * * @param {string} binaryName * @param {Object} args * * @return {Array.<String>} an array of parameter strings that can be passed * to the binary. */ MongoRunner.arrOptions = function( binaryName , args ){ var fullArgs = [ "" ] // isObject returns true even if "args" is an array, so the else branch of this statement is // dead code. See SERVER-14220. if ( isObject( args ) || ( args.length == 1 && isObject( args[0] ) ) ){ var o = isObject( args ) ? args : args[0] // If we've specified a particular binary version, use that if (o.binVersion && o.binVersion != "") { binaryName += "-" + o.binVersion; } // Manage legacy options var isValidOptionForBinary = function( option, value ){ if( ! o.binVersion ) return true // Version 1.x options if( o.binVersion.startsWith( "1." ) ){ return [ "nopreallocj" ].indexOf( option ) < 0 } return true } for ( var k in o ){ // Make sure our logical option should be added to the array of options if( ! o.hasOwnProperty( k ) || k in MongoRunner.logicalOptions || ! isValidOptionForBinary( k, o[k] ) ) continue if ( ( k == "v" || k == "verbose" ) && isNumber( o[k] ) ){ var n = o[k] if ( n > 0 ){ if ( n > 10 ) n = 10 var temp = "-" while ( n-- > 0 ) temp += "v" fullArgs.push( temp ) } } else { if( o[k] == undefined || o[k] == null ) continue fullArgs.push( "--" + k ) if ( o[k] != "" ) fullArgs.push( "" + o[k] ) } } } else { for ( var i=0; i<args.length; i++ ) fullArgs.push( args[i] ) } fullArgs[ 0 ] = binaryName return fullArgs } MongoRunner.arrToOpts = function( arr ){ var opts = {} for( var i = 1; i < arr.length; i++ ){ if( arr[i].startsWith( "-" ) ){ var opt = arr[i].replace( /^-/, "" ).replace( /^-/, "" ) if( arr.length > i + 1 && ! arr[ i + 1 ].startsWith( "-" ) ){ opts[ opt ] = arr[ i + 1 ] i++ } else{ opts[ opt ] = "" } if( opt.replace( /v/g, "" ) == "" ){ opts[ "verbose" ] = opt.length } } } return opts } MongoRunner.savedOptions = {} MongoRunner.mongoOptions = function( opts ){ // Don't remember waitForConnect var waitForConnect = opts.waitForConnect; delete opts.waitForConnect; // If we're a mongo object if( opts.getDB ){ opts = { restart : opts.runId } } // Initialize and create a copy of the opts opts = Object.merge( opts || {}, {} ) if( ! opts.restart ) opts.restart = false // RunId can come from a number of places // If restart is passed as an old connection if( opts.restart && opts.restart.getDB ){ opts.runId = opts.restart.runId opts.restart = true } // If it's the runId itself else if( isObject( opts.restart ) ){ opts.runId = opts.restart opts.restart = true } if( isObject( opts.remember ) ){ opts.runId = opts.remember opts.remember = true } else if( opts.remember == undefined ){ // Remember by default if we're restarting opts.remember = opts.restart } // If we passed in restart : <conn> or runId : <conn> if( isObject( opts.runId ) && opts.runId.runId ) opts.runId = opts.runId.runId if( opts.restart && opts.remember ) opts = Object.merge( MongoRunner.savedOptions[ opts.runId ], opts ) // Create a new runId opts.runId = opts.runId || ObjectId() // Save the port if required if( ! opts.forgetPort ) opts.port = opts.port || MongoRunner.nextOpenPort() var shouldRemember = ( ! opts.restart && ! opts.noRemember ) || ( opts.restart && opts.appendOptions ) // Normalize and get the binary version to use opts.binVersion = MongoRunner.getBinVersionFor(opts.binVersion); if ( shouldRemember ){ MongoRunner.savedOptions[ opts.runId ] = Object.merge( opts, {} ) } // Default for waitForConnect is true opts.waitForConnect = (waitForConnect == undefined || waitForConnect == null) ? true : waitForConnect; if( jsTestOptions().useSSL ) { if (!opts.sslMode) opts.sslMode = "requireSSL"; if (!opts.sslPEMKeyFile) opts.sslPEMKeyFile = "jstests/libs/server.pem"; if (!opts.sslCAFile) opts.sslCAFile = "jstests/libs/ca.pem"; // Needed for jstest/ssl/upgrade_to_ssl.js opts.sslWeakCertificateValidation = ""; // Needed for jstest/ssl/ssl_hostname_validation.js opts.sslAllowInvalidHostnames = ""; } if ( jsTestOptions().useX509 && !opts.clusterAuthMode ) { opts.clusterAuthMode = "x509"; } opts.port = opts.port || MongoRunner.nextOpenPort() MongoRunner.usedPortMap[ "" + parseInt( opts.port ) ] = true opts.pathOpts = Object.merge( opts.pathOpts || {}, { port : "" + opts.port, runId : "" + opts.runId } ) return opts } /** * @option {object} opts * * { * dbpath {string} * useLogFiles {boolean}: use with logFile option. * logFile {string}: path to the log file. If not specified and useLogFiles * is true, automatically creates a log file inside dbpath. * noJournalPrealloc {boolean} * noJournal {boolean} * keyFile * replSet * oplogSize * } */ MongoRunner.mongodOptions = function( opts ){ opts = MongoRunner.mongoOptions( opts ) opts.dbpath = MongoRunner.toRealDir( opts.dbpath || "$dataDir/mongod-$port", opts.pathOpts ) opts.pathOpts = Object.merge( opts.pathOpts, { dbpath : opts.dbpath } ) if( ! opts.logFile && opts.useLogFiles ){ opts.logFile = opts.dbpath + "/mongod.log" } else if( opts.logFile ){ opts.logFile = MongoRunner.toRealFile( opts.logFile, opts.pathOpts ) } if ( opts.logFile !== undefined ) { opts.logpath = opts.logFile; } if( jsTestOptions().noJournalPrealloc || opts.noJournalPrealloc ) opts.nopreallocj = "" if( jsTestOptions().noJournal || opts.noJournal ) opts.nojournal = "" if( jsTestOptions().keyFile && !opts.keyFile) { opts.keyFile = jsTestOptions().keyFile } if( jsTestOptions().useSSL ) { if (!opts.sslMode) opts.sslMode = "requireSSL"; if (!opts.sslPEMKeyFile) opts.sslPEMKeyFile = "jstests/libs/server.pem"; if (!opts.sslCAFile) opts.sslCAFile = "jstests/libs/ca.pem"; // Needed for jstest/ssl/upgrade_to_ssl.js opts.sslWeakCertificateValidation = ""; // Needed for jstest/ssl/ssl_hostname_validation.js opts.sslAllowInvalidHostnames = ""; } if ( jsTestOptions().useX509 && !opts.clusterAuthMode ) { opts.clusterAuthMode = "x509"; } if( opts.noReplSet ) opts.replSet = null if( opts.arbiter ) opts.oplogSize = 1 return opts } MongoRunner.mongosOptions = function( opts ){ opts = MongoRunner.mongoOptions( opts ) // Normalize configdb option to be host string if currently a host if( opts.configdb && opts.configdb.getDB ){ opts.configdb = opts.configdb.host } opts.pathOpts = Object.merge( opts.pathOpts, { configdb : opts.configdb.replace( /:|,/g, "-" ) } ) if( ! opts.logFile && opts.useLogFiles ){ opts.logFile = MongoRunner.toRealFile( "$dataDir/mongos-$configdb-$port.log", opts.pathOpts ) } else if( opts.logFile ){ opts.logFile = MongoRunner.toRealFile( opts.logFile, opts.pathOpts ) } if ( opts.logFile !== undefined ){ opts.logpath = opts.logFile; } if( jsTestOptions().keyFile && !opts.keyFile) { opts.keyFile = jsTestOptions().keyFile } return opts } /** * Starts a mongod instance. * * @param {Object} opts * * { * useHostName {boolean}: Uses hostname of machine if true * forceLock {boolean}: Deletes the lock file if set to true * dbpath {string}: location of db files * cleanData {boolean}: Removes all files in dbpath if true * startClean {boolean}: same as cleanData * noCleanData {boolean}: Do not clean files (cleanData takes priority) * * @see MongoRunner.mongodOptions for other options * } * * @return {Mongo} connection object to the started mongod instance. * * @see MongoRunner.arrOptions */ MongoRunner.runMongod = function( opts ){ opts = opts || {} var useHostName = false; var runId = null; var waitForConnect = true; var fullOptions = opts; if( isObject( opts ) ) { opts = MongoRunner.mongodOptions( opts ); fullOptions = opts; useHostName = opts.useHostName || opts.useHostname; runId = opts.runId; waitForConnect = opts.waitForConnect; if( opts.forceLock ) removeFile( opts.dbpath + "/mongod.lock" ) if( ( opts.cleanData || opts.startClean ) || ( ! opts.restart && ! opts.noCleanData ) ){ print( "Resetting db path '" + opts.dbpath + "'" ) resetDbpath( opts.dbpath ) } opts = MongoRunner.arrOptions( "mongod", opts ) } var mongod = MongoRunner.startWithArgs(opts, waitForConnect); if (!waitForConnect) mongos = {}; if (!mongod) return null; mongod.commandLine = MongoRunner.arrToOpts( opts ) mongod.name = (useHostName ? getHostName() : "localhost") + ":" + mongod.commandLine.port mongod.host = mongod.name mongod.port = parseInt( mongod.commandLine.port ) mongod.runId = runId || ObjectId() mongod.savedOptions = MongoRunner.savedOptions[ mongod.runId ]; mongod.fullOptions = fullOptions; return mongod } MongoRunner.runMongos = function( opts ){ opts = opts || {} var useHostName = false; var runId = null; var waitForConnect = true; var fullOptions = opts; if( isObject( opts ) ) { opts = MongoRunner.mongosOptions( opts ); fullOptions = opts; useHostName = opts.useHostName || opts.useHostname; runId = opts.runId; waitForConnect = opts.waitForConnect; opts = MongoRunner.arrOptions( "mongos", opts ) } var mongos = MongoRunner.startWithArgs(opts, waitForConnect); if (!waitForConnect) mongos = {}; if (!mongos) return null; mongos.commandLine = MongoRunner.arrToOpts( opts ) mongos.name = (useHostName ? getHostName() : "localhost") + ":" + mongos.commandLine.port mongos.host = mongos.name mongos.port = parseInt( mongos.commandLine.port ) mongos.runId = runId || ObjectId() mongos.savedOptions = MongoRunner.savedOptions[ mongos.runId ] mongos.fullOptions = fullOptions; return mongos } /** * Kills a mongod process. * * @param {number} port the port of the process to kill * @param {number} signal The signal number to use for killing * @param {Object} opts Additional options. Format: * { * auth: { * user {string}: admin user name * pwd {string}: admin password * } * } * * Note: The auth option is required in a authenticated mongod running in Windows since * it uses the shutdown command, which requires admin credentials. */ MongoRunner.stopMongod = function( port, signal, opts ){ if( ! port ) { print( "Cannot stop mongo process " + port ) return } signal = signal || 15 if( port.port ) port = parseInt( port.port ) if( port instanceof ObjectId ){ var opts = MongoRunner.savedOptions( port ) if( opts ) port = parseInt( opts.port ) } var exitCode = stopMongod( parseInt( port ), parseInt( signal ), opts ) delete MongoRunner.usedPortMap[ "" + parseInt( port ) ] return exitCode } MongoRunner.stopMongos = MongoRunner.stopMongod MongoRunner.isStopped = function( port ){ if( ! port ) { print( "Cannot detect if process " + port + " is stopped." ) return } if( port.port ) port = parseInt( port.port ) if( port instanceof ObjectId ){ var opts = MongoRunner.savedOptions( port ) if( opts ) port = parseInt( opts.port ) } return MongoRunner.usedPortMap[ "" + parseInt( port ) ] ? false : true } /** * Starts an instance of the specified mongo tool * * @param {String} binaryName The name of the tool to run * @param {Object} opts options to pass to the tool * { * binVersion {string}: version of tool to run * } * * @see MongoRunner.arrOptions */ MongoRunner.runMongoTool = function( binaryName, opts ){ var opts = opts || {} // Normalize and get the binary version to use opts.binVersion = MongoRunner.getBinVersionFor(opts.binVersion); var argsArray = MongoRunner.arrOptions(binaryName, opts) return runMongoProgram.apply(null, argsArray); } // Given a test name figures out a directory for that test to use for dump files and makes sure // that directory exists and is empty. MongoRunner.getAndPrepareDumpDirectory = function(testName) { var dir = MongoRunner.dataPath + testName + "_external/"; resetDbpath(dir); return dir; } // Start a mongod instance and return a 'Mongo' object connected to it. // This function's arguments are passed as command line arguments to mongod. // The specified 'dbpath' is cleared if it exists, created if not. // var conn = startMongodEmpty("--port", 30000, "--dbpath", "asdf"); startMongodEmpty = function () { var args = createMongoArgs("mongod", arguments); var dbpath = _parsePath.apply(null, args); resetDbpath(dbpath); return startMongoProgram.apply(null, args); } startMongod = function () { print("startMongod WARNING DELETES DATA DIRECTORY THIS IS FOR TESTING ONLY"); return startMongodEmpty.apply(null, arguments); } startMongodNoReset = function(){ var args = createMongoArgs( "mongod" , arguments ); return startMongoProgram.apply( null, args ); } startMongos = function(args){ return MongoRunner.runMongos(args); } /** * Returns a new argArray with any test-specific arguments added. */ function appendSetParameterArgs(argArray) { var programName = argArray[0]; if (programName.endsWith('mongod') || programName.endsWith('mongos')) { if (jsTest.options().enableTestCommands) { argArray.push.apply(argArray, ['--setParameter', "enableTestCommands=1"]); } if (jsTest.options().authMechanism && jsTest.options().authMechanism != "SCRAM-SHA-1") { var hasAuthMechs = false; for (i in argArray) { if (typeof argArray[i] === 'string' && argArray[i].indexOf('authenticationMechanisms') != -1) { hasAuthMechs = true; break; } } if (!hasAuthMechs) { argArray.push.apply(argArray, ['--setParameter', "authenticationMechanisms=" + jsTest.options().authMechanism]); } } if (jsTest.options().auth) { argArray.push.apply(argArray, ['--setParameter', "enableLocalhostAuthBypass=false"]); } // mongos only options if (programName.endsWith('mongos')) { // apply setParameters for mongos if (jsTest.options().setParametersMongos) { var params = jsTest.options().setParametersMongos.split(","); if (params && params.length > 0) { params.forEach(function(p) { if (p) argArray.push.apply(argArray, ['--setParameter', p]) }); } } } // mongod only options else if (programName.endsWith('mongod')) { // set storageEngine for mongod if (jsTest.options().storageEngine) { if ( argArray.indexOf( "--storageEngine" ) < 0 ) { argArray.push.apply(argArray, ['--storageEngine', jsTest.options().storageEngine]); } } if (jsTest.options().wiredTigerEngineConfig) { argArray.push.apply(argArray, ['--wiredTigerEngineConfig', jsTest.options().wiredTigerEngineConfig]); } if (jsTest.options().wiredTigerCollectionConfig) { argArray.push.apply(argArray, ['--wiredTigerCollectionConfig', jsTest.options().wiredTigerCollectionConfig]); } if (jsTest.options().wiredTigerIndexConfig) { argArray.push.apply(argArray, ['--wiredTigerIndexConfig', jsTest.options().wiredTigerIndexConfig]); } // apply setParameters for mongod if (jsTest.options().setParameters) { var params = jsTest.options().setParameters.split(","); if (params && params.length > 0) { params.forEach(function(p) { if (p) argArray.push.apply(argArray, ['--setParameter', p]) }); } } } } return argArray; }; /** * Start a mongo process with a particular argument array. If we aren't waiting for connect, * return null. */ MongoRunner.startWithArgs = function(argArray, waitForConnect) { // TODO: Make there only be one codepath for starting mongo processes argArray = appendSetParameterArgs(argArray); var port = _parsePort.apply(null, argArray); var pid = _startMongoProgram.apply(null, argArray); var conn = null; if (waitForConnect) { assert.soon( function() { try { conn = new Mongo("127.0.0.1:" + port); return true; } catch( e ) { if (!checkProgram(pid)) { print("Could not start mongo program at " + port + ", process ended") // Break out return true; } } return false; }, "unable to connect to mongo program on port " + port, 600 * 1000); } return conn; } /** * DEPRECATED * * Start mongod or mongos and return a Mongo() object connected to there. * This function's first argument is "mongod" or "mongos" program name, \ * and subsequent arguments to this function are passed as * command line arguments to the program. */ startMongoProgram = function(){ var port = _parsePort.apply( null, arguments ); // Enable test commands. // TODO: Make this work better with multi-version testing so that we can support // enabling this on 2.4 when testing 2.6 var args = argumentsToArray( arguments ); args = appendSetParameterArgs(args); var pid = _startMongoProgram.apply( null, args ); var m; assert.soon ( function() { try { m = new Mongo( "127.0.0.1:" + port ); return true; } catch( e ) { if (!checkProgram(pid)) { print("Could not start mongo program at " + port + ", process ended") // Break out m = null; return true; } } return false; }, "unable to connect to mongo program on port " + port, 600 * 1000 ); return m; } runMongoProgram = function() { var args = argumentsToArray( arguments ); var progName = args[0]; if ( jsTestOptions().auth ) { args = args.slice(1); args.unshift( progName, '-u', jsTestOptions().authUser, '-p', jsTestOptions().authPassword, '--authenticationDatabase=admin' ); } if (progName == 'mongo' && !_useWriteCommandsDefault()) { progName = args[0]; args = args.slice(1); args.unshift(progName, '--useLegacyWriteOps'); } return _runMongoProgram.apply( null, args ); } // Start a mongo program instance. This function's first argument is the // program name, and subsequent arguments to this function are passed as // command line arguments to the program. Returns pid of the spawned program. startMongoProgramNoConnect = function() { var args = argumentsToArray( arguments ); var progName = args[0]; if ( jsTestOptions().auth ) { args = args.slice(1); args.unshift(progName, '-u', jsTestOptions().authUser, '-p', jsTestOptions().authPassword, '--authenticationDatabase=admin'); } if (progName == 'mongo' && !_useWriteCommandsDefault()) { args = args.slice(1); args.unshift(progName, '--useLegacyWriteOps'); } return _startMongoProgram.apply( null, args ); } myPort = function() { var m = db.getMongo(); if ( m.host.match( /:/ ) ) return m.host.match( /:(.*)/ )[ 1 ]; else return 27017; } }());
var Jabaku = (function(module) { 'use strict'; function DepthPeelingRenderer(engine, backgroundColor) { this._engine = engine; this._backgroundColor = backgroundColor; this.debugRender = false; var size = engine.getDrawingBufferSize(); this._rt1 = engine.createRenderTexture('depthPeelingRT1', size); this._rt2 = engine.createRenderTexture('depthPeelingRT2', size); this._rt3 = engine.createRenderTexture('depthPeelingRT3', size); this._rt4 = engine.createRenderTexture('depthPeelingRT4', size); this._dt1 = engine.createDepthTexture('depthPeelingDT1', size); this._dt2 = engine.createDepthTexture('depthPeelingDT2', size); this._dt3 = engine.createDepthTexture('depthPeelingDT3', size); this._fb1 = engine.createFrameBuffer('depthPeelingFB1', this._rt1, this._dt1); this._fb2 = engine.createFrameBuffer('depthPeelingFB2', this._rt2, this._dt2); this._fb3 = engine.createFrameBuffer('depthPeelingFB3', this._rt3, this._dt3); this._fb4 = engine.createFrameBuffer('depthPeelingFB4', this._rt4, this._dt1); this._finalCombineProgram = Engine3D.createProgram('dp_final_combine', FileUtils.loadFile('jabaku/shaders/pass_through.vshader'), FileUtils.loadFile('jabaku/shaders/dp_final_combine.fshader')); } DepthPeelingRenderer.extends(Object, { _prepareFrameBuffer: function(frameBuffer) { var engine = this._engine; if (frameBuffer) { engine.setFrameBuffer(frameBuffer); } else { engine.setDefaultFrameBuffer(); } engine.setClearColor(this._backgroundColor); engine.clear(); }, _renderObjects: function(objects, params, blendMode) { var engine = this._engine; for (var i = 0; i < objects.length; ++i) { var object = objects[i]; object.prepare(engine); object.setParams(params); var material = object.material; engine.setBlendMode(blendMode); engine.setProgram(material.programs.depthPeeling, params); object.render(engine); } }, _clearFB: function(frameBuffer, depthValue) { var engine = this._engine; engine.setFrameBuffer(frameBuffer); engine.setClearDepth(depthValue); engine.clear(); }, render: function(objects, camera, lightSettings, frameBuffer, viewport) { this._prepareFrameBuffer(frameBuffer); var engine = this._engine; var utils = Jabaku.RendererUtils; var params = {}; utils.setViewport(engine, viewport, params); utils.setCameraParameters(camera, params); utils.setForwardLightParameters(lightSettings, params); engine.setBlendMode(BlendMode.NONE); this._clearFB('depthPeelingFB1', 1.0); this._clearFB('depthPeelingFB2', 0.0); engine.setFrameBuffer('depthPeelingFB1'); params.uDepthTexture = {texture: this._dt2, sampler: 1}; this._renderObjects(objects, params, BlendMode.SOLID); this._clearFB('depthPeelingFB2', 1.0); engine.setFrameBuffer('depthPeelingFB2'); params.uDepthTexture = {texture: this._dt1, sampler: 1}; this._renderObjects(objects, params, BlendMode.SOLID); this._clearFB('depthPeelingFB3', 1.0); engine.setFrameBuffer('depthPeelingFB3'); params.uDepthTexture = {texture: this._dt2, sampler: 1}; this._renderObjects(objects, params, BlendMode.SOLID); this._clearFB('depthPeelingFB4', 1.0); engine.setFrameBuffer('depthPeelingFB4'); params.uDepthTexture = {texture: this._dt3, sampler: 1}; this._renderObjects(objects, params, BlendMode.SOLID); if (frameBuffer) { engine.setFrameBuffer(frameBuffer); } else { engine.setDefaultFrameBuffer(); } engine.setBlendMode(BlendMode.NONE); engine.setProgram(this._finalCombineProgram, { uTexture1: {texture: this._rt1, sampler: 0}, uTexture2: {texture: this._rt2, sampler: 1}, uTexture3: {texture: this._rt3, sampler: 2}, uTexture4: {texture: this._rt4, sampler: 3} }); utils.setViewport(engine, viewport, params); engine.renderScreenQuad(); if (this.debugRender) { engine.renderDepthTexture(this._dt1, 0, 0, 200, 200); engine.renderDepthTexture(this._dt2, 200, 0, 200, 200); engine.renderDepthTexture(this._dt3, 400, 0, 200, 200); engine.renderDebugQuad(this._rt1, 0, 568, 200, 200); engine.renderDebugQuad(this._rt2, 200, 568, 200, 200); engine.renderDebugQuad(this._rt3, 400, 568, 200, 200); engine.renderDebugQuad(this._rt4, 600, 568, 200, 200); } } }); module.DepthPeelingRenderer = DepthPeelingRenderer; return module; })(Jabaku || {});
function Lrb(){} function Frb(){} function Krb(){var b;while(Grb){b=Grb;Grb=Grb.c;!Grb&&(Hrb=null);rEb(b.b.b,y0b())}} function y0b(){var b,c,d;c=new wAc;HPc(c.N,Rgd,cWd);for(d=0;d<30;++d){b=new Bsc(PTd+d);_u(b.N,dWd,true);Kqc(c,b,c.N)}return c} function Nrb(){Irb=new Lrb;OB((LB(),KB),28);!!$stats&&$stats(FC(bWd,_gd,-1,-1));Irb.ld();!!$stats&&$stats(FC(bWd,KEd,-1,-1))} var eWd='AsyncLoader28',dWd='cw-FlowPanel-checkBox',cWd='cwFlowPanel',bWd='runCallbacks28';_=Lrb.prototype=Frb.prototype=new ir;_.gC=function Mrb(){return S4};_.ld=function Qrb(){Krb()};_.cM={};var S4=t_c(gxd,eWd);$entry(Nrb)();
angular.module('Fablab').directive('ngImage', [function () { return { restrict: 'A', scope: { 'ngImage': '=' }, link: function (scope, element, attrs) { var fallbakImg = './images/no-image-available.png'; element.bind('error', function () { element.attr('src', fallbakImg); }); scope.$watch('ngImage', function (newValue) { if (newValue) { element.attr('src', newValue); } else { element.attr('src', fallbakImg); } }) } } }]);
import { nanoid } from 'nanoid'; // HEAD DATA export const headData = { title: 'Edits Underway', // e.g: 'Name | Developer' lang: 'en', // e.g: en, es, fr, jp description: '', // e.g: Welcome to my website }; // HERO DATA export const heroData = { name: "You've written your story", subtitle: "Now you're ready to share it", cta: "See what's possible...", }; // ABOUT DATA export const aboutData = { img: 'frontpage-image.jpg', paragraphOne: "Want your story polished, but concerned your voice will be lost?", paragraphTwo: "We understand how it feels when you've created the perfect story, and just want that extra bit of help or second look.", paragraphThree: "Whether you're going indie or seeking representation, you need to make a strong first impression.", paragraphFour: "We specialize in personalized copyediting and critique services for:", paragraphFive: "Adventure • Book Club Fiction • Culture • General Fiction •", paragraphSix: "Memoir • Romance • Women's Fiction • Travel •", resume: '', // if no resume, the button will not show up cta: 'Ready to see your story shine?', btn: 'Get an estimate for your project', link: 'https://editsunderway.typeform.com/to/X0OdHM3T', }; // PROJECTS DATA export const projectsData = [ { id: nanoid(), img: 'light-edit.jpg', title: 'Light Edit', info: 'A light copyedit to catch grammar, punctuation, and other mechanical errors.', info2: 'The fastest and most inexpensive way to get you publish-ready, while retaining your voice.', info3: '', url: '', repo: '', // if no repo, the button will not show up }, { id: nanoid(), img: 'heavy-edit.jpg', title: 'Heavy Edit', info: 'Everything in a Light Edit, plus:', info2: '• A deeper look at character and story consistency', info3: '• Specific suggestions to keep your reader engaged', url: '', repo: '', // if no repo, the button will not show up }, { id: nanoid(), img: 'critique-img.jpg', title: 'Critique', info: "Need to know if you're hitting the mark? Get a structured review of pitch, query letter, book jacket material, synopsis, or first pages.", info2: 'Includes feedback on hook, story elements, dialogue, and more.', info3: 'Beta reading also available.', url: '', repo: '', // if no repo, the button will not show up }, { id: nanoid(), img: 'custom-package.jpg', title: 'Custom Packages', info: "Unsure where to start? We can design a custom editorial package designed for your unique needs.", info2: 'Contact us today to learn how we can work for you.', info3: '', url: '', repo: '', // if no repo, the button will not show up }, ]; // CONTACT DATA export const contactData = { cta: 'Ready to see your story shine?', btn: 'Get an estimate now', link: 'https://editsunderway.typeform.com/to/X0OdHM3T', }; // FOOTER DATA export const footerData = { networks: [ { id: nanoid(), name: 'twitter', url: 'https://twitter.com/editsunderway', }, ], }; // Github start/fork buttons export const githubButtons = { isEnabled: false, // set to false to disable the GitHub stars/fork buttons };
module.exports = { //--------------------------------------------------------------------- // Action Name // // This is the name of the action displayed in the editor. //--------------------------------------------------------------------- name: "Create Invite", //--------------------------------------------------------------------- // Action Section // // This is the section the action will fall into. //--------------------------------------------------------------------- section: "Channel Control", //--------------------------------------------------------------------- // Action Subtitle // // This function generates the subtitle displayed next to the name. //--------------------------------------------------------------------- subtitle(data, presets) { return `Invite to ${presets.getChannelText(data.channel, data.varName)}`; }, //--------------------------------------------------------------------- // Action Storage Function // // Stores the relevant variable info for the editor. //--------------------------------------------------------------------- variableStorage(data, varType) { const type = parseInt(data.storage, 10); if (type !== varType) return; return [data.varName2, "Text"]; }, //--------------------------------------------------------------------- // Action Meta Data // // Helps check for updates and provides info if a custom mod. // If this is a third-party mod, please set "author" and "authorUrl". // // It's highly recommended "preciseCheck" is set to false for third-party mods. // This will make it so the patch version (0.0.X) is not checked. //--------------------------------------------------------------------- meta: { version: "2.0.9", preciseCheck: true, author: null, authorUrl: null, downloadUrl: null }, //--------------------------------------------------------------------- // Action Fields // // These are the fields for the action. These fields are customized // by creating elements with corresponding IDs in the HTML. These // are also the names of the fields stored in the action's JSON data. //--------------------------------------------------------------------- fields: ["channel", "varName", "maxUses", "lifetime", "tempInvite", "unique", "storage", "varName2", "reason"], //--------------------------------------------------------------------- // Command HTML // // This function returns a string containing the HTML used for // editing actions. // // The "isEvent" parameter will be true if this action is being used // for an event. Due to their nature, events lack certain information, // so edit the HTML to reflect this. //--------------------------------------------------------------------- html(isEvent, data) { return ` <channel-input dropdownLabel="Source Channel" selectId="channel" variableContainerId="varNameContainer" variableInputId="varName"></channel-input> <br><br><br> <div style="padding-top: 8px;"> <div style="float: left; width: calc(70% - 12px);"> <span class="dbminputlabel">Max Uses</span><br> <input id="maxUses" class="round" type="text" placeholder="Leave blank for infinite uses!"><br> <span class="dbminputlabel">Invite Lifetime (in seconds)</span><br> <input id="lifetime" class="round" type="text" placeholder="Leave blank to last forever!"><br> </div> <div style="float: right; width: calc(30% - 12px);"> <span class="dbminputlabel">Temporary Invite</span><br> <select id="tempInvite" class="round"> <option value="true">Yes</option> <option value="false" selected>No</option> </select><br> <span class="dbminputlabel">Is Unique</span><br> <select id="unique" class="round"> <option value="true" selected>Yes</option> <option value="false">No</option> </select> </div> </div> <br><br><br><br><br><br><br> <hr class="subtlebar"> <br> <div> <span class="dbminputlabel">Reason</span><br> <input id="reason" placeholder="Optional" class="round" type="text"> </div> <br> <store-in-variable allowNone selectId="storage" variableInputId="varName2" variableContainerId="varNameContainer2"></store-in-variable>`; }, //--------------------------------------------------------------------- // Action Editor Init Code // // When the HTML is first applied to the action editor, this code // is also run. This helps add modifications or setup reactionary // functions for the DOM elements. //--------------------------------------------------------------------- init() {}, //--------------------------------------------------------------------- // Action Bot Function // // This is the function for the action within the Bot's Action class. // Keep in mind event calls won't have access to the "msg" parameter, // so be sure to provide checks for variable existence. //--------------------------------------------------------------------- action(cache) { const data = cache.actions[cache.index]; const storage = parseInt(data.channel, 10); const varName = this.evalMessage(data.varName, cache); const channel = this.getChannel(storage, varName, cache); const reason = this.evalMessage(data.reason, cache); /** @type {import('discord.js').CreateInviteOptions} */ const options = {}; if (data.maxUses) { options.maxUses = parseInt(this.evalMessage(data.maxUses, cache), 10); } else { options.maxUses = 0; } if (data.lifetime) { options.maxAge = parseInt(this.evalMessage(data.lifetime, cache), 10); } else { options.maxAge = 0; } if (options.maxAge > 86400) options.maxAge = 86400; if (reason) options.reason = reason; options.temporary = data.temporary === "true"; options.unique = data.unique === "true"; if (Array.isArray(channel)) { this.callListFunc(channel, "createInvite", [options]).then((invite) => { const varName2 = this.evalMessage(data.varName2, cache); const storage2 = parseInt(data.storage, 10); this.storeValue(invite.url, storage2, varName2, cache); this.callNextAction(cache); }); } else if (channel?.createInvite) { channel .createInvite(options) .then((invite) => { const varName2 = this.evalMessage(data.varName2, cache); const storage2 = parseInt(data.storage, 10); this.storeValue(invite.url, storage2, varName2, cache); this.callNextAction(cache); }) .catch((err) => this.displayError(data, cache, err)); } else { this.callNextAction(cache); } }, //--------------------------------------------------------------------- // Action Bot Mod // // Upon initialization of the bot, this code is run. Using the bot's // DBM namespace, one can add/modify existing functions if necessary. // In order to reduce conflicts between mods, be sure to alias // functions you wish to overwrite. //--------------------------------------------------------------------- mod() {}, };
var path = require('path'); var fs = require('fs'); module.exports = { 'init': function(browser) { browser .url('file://' + path.join(__dirname, 'index.html')) .waitForElementVisible('body', 1000) .assert.value('input', 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAWgAAAFoCAYAAAB65WHVAAAgAElEQVR4Xu2dzZIeR44Eyduu3v9VZ3XUWo+szUT2TwEZyCrPTz5XAuiAByqU1iZxfv7nf3789cP/SU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Okl8SApCVhmvSSGJC0JExveX7JNbAAAACcSURBVEG/CTz9P1ZJDN+xP01PcoQrvbT9aXpWmCY9tP1pelbZGtBFcjTDaXqKGMfKaPvT9IyBLg6i7U/TU8T4zK84drwgVxde7aMZTtOzynW1j7Y/Tc8q19U+2v40PatcfUEXydEMp+kpYhwro+1P0zMGujiItj9NTxHjcy/ok1/Rqdk7didqWj3Cbh9xd6KmLtfVeuLuRE0rfP8fK5+ZE2JeYlAAAAAASUVORK5CYII=') .end(); } };
import { Link } from 'gatsby'; import React from 'react'; // Context import { useStore } from '../store/Store'; const NavLink = ({ link, children }) => { // Получаем глобальные переменные const { menuHandler } = useStore(); return ( <Link className="nav-link" to={`/${link}`} replace onKeyDown={() => menuHandler({ active: false })} onClick={() => menuHandler({ active: false })}> {children} </Link> ); }; export default NavLink;
import { cryptoWaitReady, randomAsHex } from '@polkadot/util-crypto'; import { Keyring } from '@polkadot/api'; import { generateEcdsaSecp256k1Keypair, getPublicKeyFromKeyringPair, getSignatureFromKeyringPair, verifyEcdsaSecp256k1Sig, } from '../../src/utils/misc'; import { PublicKeyEd25519, PublicKeySr25519, PublicKeySecp256k1 } from '../../src/public-keys'; import { SignatureEd25519, SignatureSr25519, SignatureSecp256k1 } from '../../src/signatures'; import { isHexWithGivenByteSize } from '../../src/utils/codec'; describe('Testing isHexWithGivenByteSize', () => { test('isHexWithGivenByteSize rejects strings not starting with 0x', () => { expect(isHexWithGivenByteSize('12')).toBe(false); }); test('isHexWithGivenByteSize rejects strings with invalid hex', () => { expect(isHexWithGivenByteSize('0x1h')).toBe(false); }); test('isHexWithGivenByteSize rejects strings with non-full byte', () => { expect(isHexWithGivenByteSize('0x123')).toBe(false); }); test('isHexWithGivenByteSize rejects strings with byte size 0', () => { expect(isHexWithGivenByteSize('0x')).toBe(false); }); test('isHexWithGivenByteSize rejects strings not matching expected byte size', () => { expect(isHexWithGivenByteSize('0x12', 2)).toBe(false); expect(isHexWithGivenByteSize('0x1234', 1)).toBe(false); expect(isHexWithGivenByteSize('0x1234', 0)).toBe(false); }); test('isHexWithGivenByteSize accepts correct hex string with full bytes', () => { expect(isHexWithGivenByteSize('0x12')).toBe(true); expect(isHexWithGivenByteSize('0x1234')).toBe(true); expect(isHexWithGivenByteSize('0x1234ef')).toBe(true); }); test('isHexWithGivenByteSize accepts correct hex string matching expected byte size', () => { expect(isHexWithGivenByteSize('0x12', 1)).toBe(true); expect(isHexWithGivenByteSize('0x1234', 2)).toBe(true); expect(isHexWithGivenByteSize('0x1234ef', 3)).toBe(true); }); }); describe('Testing public key and signature instantiation from keyring', () => { beforeAll(async (done) => { await cryptoWaitReady(); done(); }); test('getCorrectPublicKeyFromKeyringPair returns correct public key from ed25519 pair', () => { const keyring = new Keyring(); const pair = keyring.addFromUri(randomAsHex(32), null, 'ed25519'); const pk = getPublicKeyFromKeyringPair(pair); expect(pk instanceof PublicKeyEd25519).toBe(true); }); test('getCorrectPublicKeyFromKeyringPair returns correct public key from sr25519 pair', () => { const keyring = new Keyring(); const pair = keyring.addFromUri(randomAsHex(32), null, 'sr25519'); const pk = getPublicKeyFromKeyringPair(pair); expect(pk instanceof PublicKeySr25519).toBe(true); }); test('getCorrectPublicKeyFromKeyringPair returns correct public key from secp256k1 pair', () => { const pair = generateEcdsaSecp256k1Keypair(); const pk = getPublicKeyFromKeyringPair(pair); expect(pk instanceof PublicKeySecp256k1).toBe(true); }); test('getCorrectSignatureFromKeyringPair returns correct signature from ed25519 pair', () => { const keyring = new Keyring(); const pair = keyring.addFromUri(randomAsHex(32), null, 'ed25519'); const sig = getSignatureFromKeyringPair(pair, [1, 2]); expect(sig instanceof SignatureEd25519).toBe(true); }); test('getCorrectSignatureFromKeyringPair returns correct signature from sr25519 pair', () => { const keyring = new Keyring(); const pair = keyring.addFromUri(randomAsHex(32), null, 'sr25519'); const sig = getSignatureFromKeyringPair(pair, [1, 2]); expect(sig instanceof SignatureSr25519).toBe(true); }); test('getCorrectSignatureFromKeyringPair returns correct signature from secp256k1 pair', () => { const pair = generateEcdsaSecp256k1Keypair('my pers string', randomAsHex(32)); const sig = getSignatureFromKeyringPair(pair, [1, 2]); expect(sig instanceof SignatureSecp256k1).toBe(true); }); }); describe('Testing Ecdsa with secp256k1', () => { test('Signing and verification works', () => { const msg = [1, 2, 3, 4]; const pair = generateEcdsaSecp256k1Keypair(); const pk = PublicKeySecp256k1.fromKeyringPair(pair); const sig = new SignatureSecp256k1(msg, pair); expect(verifyEcdsaSecp256k1Sig(msg, sig, pk)).toBe(true); }); });
// All material copyright ESRI, All Rights Reserved, unless otherwise specified. // See http://js.arcgis.com/3.34/esri/copyright.txt for details. //>>built define("esri/dijit/editing/nls/Editor-all_ca",{"dijit/_editor/nls/commands":{bold:"Negreta",copy:"Copia",cut:"Retalla","delete":"Suprimeix",indent:"Sagnat",insertHorizontalRule:"Regla horitzontal",insertOrderedList:"Llista numerada",insertUnorderedList:"Llista de vinyetes",italic:"Cursiva",justifyCenter:"Alineaci\u00f3 centrada",justifyFull:"Justifica",justifyLeft:"Alineaci\u00f3 a l'esquerra",justifyRight:"Alineaci\u00f3 a la dreta",outdent:"Sagnat a l'esquerra",paste:"Enganxa",redo:"Ref\u00e9s", removeFormat:"Elimina el format",selectAll:"Selecciona-ho tot",strikethrough:"Ratllat",subscript:"Sub\u00edndex",superscript:"Super\u00edndex",underline:"Subratllat",undo:"Desf\u00e9s",unlink:"Elimina l'enlla\u00e7",createLink:"Crea un enlla\u00e7",toggleDir:"Inverteix la direcci\u00f3",insertImage:"Insereix imatge",insertTable:"Insereix/edita la taula",toggleTableBorder:"Inverteix els contorns de taula",deleteTable:"Suprimeix la taula",tableProp:"Propietat de taula",htmlToggle:"Font HTML",foreColor:"Color de primer pla", hiliteColor:"Color de fons",plainFormatBlock:"Estil de par\u00e0graf",formatBlock:"Estil de par\u00e0graf",fontSize:"Mida del tipus de lletra",fontName:"Nom del tipus de lletra",tabIndent:"Sagnat",fullScreen:"Commuta pantalla completa",viewSource:"Visualitza font HTML",print:"Imprimeix",newPage:"P\u00e0gina nova",systemShortcut:"L'acci\u00f3 \"${0}\" \u00e9s l'\u00fanica disponible al navegador utilitzant una drecera del teclat. Utilitzeu ${1}.",ctrlKey:"control+${0}",appleKey:"\u2318${0}",_localized:{}}, "dijit/form/nls/ComboBox":{previousMessage:"Opcions anteriors",nextMessage:"M\u00e9s opcions",_localized:{}},"dojo/cldr/nls/islamic":{"dateFormatItem-Ehm":"E h:mm a","days-standAlone-short":"Sun Mon Tue Wed Thu Fri Sat".split(" "),"months-format-narrow":"1 2 3 4 5 6 7 8 9 10 11 12".split(" "),"field-second-relative+0":"now","quarters-standAlone-narrow":["1","2","3","4"],"field-weekday":"Day of the Week","field-wed-relative+0":"this Wednesday","field-wed-relative+1":"next Wednesday","dateFormatItem-GyMMMEd":"G y MMM d, E", "dateFormatItem-MMMEd":"MMM d, E",eraNarrow:["AH"],"field-tue-relative+-1":"last Tuesday","days-format-short":"Sun Mon Tue Wed Thu Fri Sat".split(" "),"dateTimeFormats-appendItem-Day-Of-Week":"{0} {1}","dateFormat-long":"G y MMMM d","field-fri-relative+-1":"last Friday","field-wed-relative+-1":"last Wednesday","months-format-wide":"Muharram;Safar;Rabi\u02bb I;Rabi\u02bb II;Jumada I;Jumada II;Rajab;Sha\u02bbban;Ramadan;Shawwal;Dhu\u02bbl-Qi\u02bbdah;Dhu\u02bbl-Hijjah".split(";"),"dateFormatItem-yyyyQQQ":"G y QQQ", "dateTimeFormat-medium":"{1} {0}","dayPeriods-format-wide-pm":"PM","dateFormat-full":"G y MMMM d, EEEE","dateFormatItem-yyyyMEd":"GGGGG y-MM-dd, E","field-thu-relative+-1":"last Thursday","dateFormatItem-Md":"MM-dd","dayPeriods-format-abbr-am":"AM","dateTimeFormats-appendItem-Second":"{0} ({2}: {1})","dayPeriods-format-wide-noon":"noon","field-era":"Era","months-standAlone-wide":"Muharram;Safar;Rabi\u02bb I;Rabi\u02bb II;Jumada I;Jumada II;Rajab;Sha\u02bbban;Ramadan;Shawwal;Dhu\u02bbl-Qi\u02bbdah;Dhu\u02bbl-Hijjah".split(";"), "timeFormat-short":"HH:mm","quarters-format-wide":["Q1","Q2","Q3","Q4"],"timeFormat-long":"HH:mm:ss z","field-year":"Year","dateTimeFormats-appendItem-Era":"{1} {0}","field-hour":"Hour","months-format-abbr":"Muh.;Saf.;Rab. I;Rab. II;Jum. I;Jum. II;Raj.;Sha.;Ram.;Shaw.;Dhu\u02bbl-Q.;Dhu\u02bbl-H.".split(";"),"field-sat-relative+0":"this Saturday","field-sat-relative+1":"next Saturday","timeFormat-full":"HH:mm:ss zzzz","dateTimeFormats-appendItem-Week":"{0} ({2}: {1})","field-day-relative+0":"today", "field-thu-relative+0":"this Thursday","field-day-relative+1":"tomorrow","field-thu-relative+1":"next Thursday","dateFormatItem-GyMMMd":"G y MMM d","dateFormatItem-H":"HH","months-standAlone-abbr":"Muh.;Saf.;Rab. I;Rab. II;Jum. I;Jum. II;Raj.;Sha.;Ram.;Shaw.;Dhu\u02bbl-Q.;Dhu\u02bbl-H.".split(";"),"quarters-format-abbr":["Q1","Q2","Q3","Q4"],"quarters-standAlone-wide":["Q1","Q2","Q3","Q4"],"dateFormatItem-Gy":"G y","dateFormatItem-yyyyMMMEd":"G y MMM d, E","dateFormatItem-M":"L","days-standAlone-wide":"Sun Mon Tue Wed Thu Fri Sat".split(" "), "dateFormatItem-yyyyMMM":"G y MMM","dateFormatItem-yyyyMMMd":"G y MMM d","dayPeriods-format-abbr-noon":"noon","timeFormat-medium":"HH:mm:ss","field-sun-relative+0":"this Sunday","dateFormatItem-Hm":"HH:mm","field-sun-relative+1":"next Sunday","quarters-standAlone-abbr":["Q1","Q2","Q3","Q4"],eraAbbr:["AH"],"field-minute":"Minute","field-dayperiod":"Dayperiod","days-standAlone-abbr":"Sun Mon Tue Wed Thu Fri Sat".split(" "),"dateFormatItem-d":"d","dateFormatItem-ms":"mm:ss","quarters-format-narrow":["1", "2","3","4"],"field-day-relative+-1":"yesterday","dateTimeFormat-long":"{1} {0}","dayPeriods-format-narrow-am":"a","dateFormatItem-h":"h a","dateFormatItem-MMMd":"MMM d","dateFormatItem-MEd":"MM-dd, E","dateTimeFormat-full":"{1} {0}","field-fri-relative+0":"this Friday","field-fri-relative+1":"next Friday","field-day":"Day","days-format-wide":"Sun Mon Tue Wed Thu Fri Sat".split(" "),"field-zone":"Zone","months-standAlone-narrow":"1 2 3 4 5 6 7 8 9 10 11 12".split(" "),"dateFormatItem-y":"G y","dateTimeFormats-appendItem-Day":"{0} ({2}: {1})", "field-year-relative+-1":"last year","field-month-relative+-1":"last month","dateTimeFormats-appendItem-Year":"{1} {0}","dateFormatItem-hm":"h:mm a","dateTimeFormats-appendItem-Hour":"{0} ({2}: {1})","dayPeriods-format-abbr-pm":"PM","days-format-abbr":"Sun Mon Tue Wed Thu Fri Sat".split(" "),eraNames:["AH"],"days-format-narrow":"SMTWTFS".split(""),"dateFormatItem-yyyyMd":"GGGGG y-MM-dd","field-month":"Month","days-standAlone-narrow":"SMTWTFS".split(""),"dateFormatItem-MMM":"LLL","field-tue-relative+0":"this Tuesday", "field-tue-relative+1":"next Tuesday","dateTimeFormats-appendItem-Quarter":"{0} ({2}: {1})","dayPeriods-format-wide-am":"AM","dateTimeFormats-appendItem-Month":"{0} ({2}: {1})","dateTimeFormats-appendItem-Minute":"{0} ({2}: {1})","dateFormatItem-EHm":"E HH:mm","field-mon-relative+0":"this Monday","field-mon-relative+1":"next Monday","dateFormat-short":"GGGGG y-MM-dd","dateFormatItem-EHms":"E HH:mm:ss","dateFormatItem-Ehms":"E h:mm:ss a","dayPeriods-format-narrow-noon":"n","field-second":"Second", "field-sat-relative+-1":"last Saturday","field-sun-relative+-1":"last Sunday","field-month-relative+0":"this month","field-month-relative+1":"next month","dateTimeFormats-appendItem-Timezone":"{0} {1}","dateFormatItem-Ed":"d, E","field-week":"Week","dateFormat-medium":"G y MMM d","field-week-relative+-1":"last week","field-year-relative+0":"this year","dateFormatItem-yyyyM":"GGGGG y-MM","field-year-relative+1":"next year","dayPeriods-format-narrow-pm":"p","dateFormatItem-yyyyQQQQ":"G y QQQQ","dateTimeFormat-short":"{1} {0}", "dateFormatItem-Hms":"HH:mm:ss","dateFormatItem-hms":"h:mm:ss a","dateFormatItem-GyMMM":"G y MMM","field-mon-relative+-1":"last Monday","dateFormatItem-yyyy":"G y","field-week-relative+0":"this week","field-week-relative+1":"next week",_localized:{}}});
/* * ATTENTION: An "eval-source-map" devtool has been used. * This devtool is neither made for production nor for readable output files. * It uses "eval()" calls to create a separate source file with attached SourceMaps in the browser devtools. * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/) * or disable the default devtool with "devtool: false". * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/). */ (self["webpackChunk_lux_laravel_starter"] = self["webpackChunk_lux_laravel_starter"] || []).push([["auth-signin"],{ /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5[0].rules[0].use[0]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/js/pages/auth/SigninPage.vue?vue&type=script&lang=js&": /*!*****************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5[0].rules[0].use[0]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/js/pages/auth/SigninPage.vue?vue&type=script&lang=js& ***! \*****************************************************************************************************************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vee_validate__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vee-validate */ \"./node_modules/vee-validate/dist/vee-validate.esm.js\");\n/* harmony import */ var vee_validate_dist_rules__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vee-validate/dist/rules */ \"./node_modules/vee-validate/dist/rules.js\");\n/* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vuex */ \"./node_modules/vuex/dist/vuex.esm.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n/*\n|---------------------------------------------------------------------\n| Sign In Page Component\n|---------------------------------------------------------------------\n|\n| Sign in template for user authentication into the application\n|\n*/\n\n\n\n(0,vee_validate__WEBPACK_IMPORTED_MODULE_0__.extend)('required', _objectSpread(_objectSpread({}, vee_validate_dist_rules__WEBPACK_IMPORTED_MODULE_1__.required), {}, {\n message: 'The {_field_} field is required'\n}));\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n components: {\n ValidationObserver: vee_validate__WEBPACK_IMPORTED_MODULE_0__.ValidationObserver,\n ValidationProvider: vee_validate__WEBPACK_IMPORTED_MODULE_0__.ValidationProvider\n },\n data: function data() {\n return {\n // sign in buttons\n isLoading: false,\n isSignInDisabled: false,\n // form\n form: {\n username: '',\n password: ''\n },\n // show password field\n showPassword: false\n };\n },\n methods: _objectSpread(_objectSpread({}, (0,vuex__WEBPACK_IMPORTED_MODULE_2__.mapActions)('authentication', ['login'])), {}, {\n submit: function submit() {\n var _this = this;\n\n this.isLoading = true;\n this.isSignInDisabled = true;\n this.login(this.form).then(function () {\n _this.$router.replace({\n name: 'dashboard-analytics'\n });\n })[\"catch\"](function (error) {\n _this.flash('Invalid username or password', 'red');\n\n _this.reset();\n });\n },\n reset: function reset() {\n this.isLoading = false;\n this.isSignInDisabled = false;\n }\n })\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9AbHV4L2xhcmF2ZWwtc3RhcnRlci9yZXNvdXJjZXMvanMvcGFnZXMvYXV0aC9TaWduaW5QYWdlLnZ1ZT8xNmExIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBZ0VBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFFQTtBQUFBO0FBQUE7QUFFQTtBQUNBO0FBQ0Esb0ZBREE7QUFFQTtBQUZBLEdBREE7QUFLQSxNQUxBLGtCQUtBO0FBQ0E7QUFDQTtBQUNBLHNCQUZBO0FBR0EsNkJBSEE7QUFLQTtBQUNBO0FBQ0Esb0JBREE7QUFFQTtBQUZBLE9BTkE7QUFXQTtBQUNBO0FBWkE7QUFjQSxHQXBCQTtBQXFCQSwyQ0FDQSw2RUFEQTtBQUVBLFVBRkEsb0JBRUE7QUFBQTs7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUFBO0FBQU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AgICAgICAgICB2LW1vZGVsPVwiZm9ybS51c2VybmFtZVwiXG4gICAgICAgICAgICAgICAgOmxhYmVsPVwiJHQoJ2xvZ2luLnVzZXJuYW1lJylcIlxuICAgICAgICAgICAgICAgIG5hbWU9XCJlbWFpbFwiXG4gICAgICAgICAgICAgICAgb3V0bGluZWRcbiAgICAgICAgICAgICAgICA6ZXJyb3ItbWVzc2FnZXM9XCJlcnJvcnNbMF1cIlxuICAgICAgICAgICAgICA+PC92LXRleHQtZmllbGQ+XG4gICAgICAgICAgICA8L3ZhbGlkYXRpb24tcHJvdmlkZXI+XG5cbiAgICAgICAgICAgIDx2YWxpZGF0aW9uLXByb3ZpZGVyIHYtc2xvdD1cInsgZXJyb3JzIH1cIiBuYW1lPVwicGFzc3dvcmRcIiBydWxlcz1cInJlcXVpcmVkXCI+XG4gICAgICAgICAgICAgIDx2LXRleHQtZmllbGRcbiAgICAgICAgICAgICAgICB2LW1vZGVsPVwiZm9ybS5wYXNzd29yZFwiXG4gICAgICAgICAgICAgICAgOmFwcGVuZC1pY29uPVwic2hvd1Bhc3N3b3JkID8gJ21kaS1leWUnIDogJ21kaS1leWUtb2ZmJ1wiXG4gICAgICAgICAgICAgICAgOnR5cGU9XCJzaG93UGFzc3dvcmQgPyAndGV4dCcgOiAncGFzc3dvcmQnXCJcbiAgICAgICAgICAgICAgICA6ZXJyb3ItbWVzc2FnZXM9XCJlcnJvcnNbMF1cIlxuICAgICAgICAgICAgICAgIDpsYWJlbD1cIiR0KCdsb2dpbi5wYXNzd29yZCcpXCJcbiAgICAgICAgICAgICAgICBuYW1lPVwicGFzc3dvcmRcIlxuICAgICAgICAgICAgICAgIG91dGxpbmVkXG4gICAgICAgICAgICAgICAgQGNsaWNrOmFwcGVuZD1cInNob3dQYXNzd29yZCA9ICFzaG93UGFzc3dvcmRcIlxuICAgICAgICAgICAgICA+PC92LXRleHQtZmllbGQ+XG4gICAgICAgICAgICA8L3ZhbGlkYXRpb24tcHJvdmlkZXI+XG5cbiAgICAgICAgICAgIDx2LWJ0blxuICAgICAgICAgICAgICA6bG9hZGluZz1cImlzTG9hZGluZ1wiXG4gICAgICAgICAgICAgIDpkaXNhYmxlZD1cImludmFsaWQgfHwgaXNTaWduSW5EaXNhYmxlZFwiXG4gICAgICAgICAgICAgIGJsb2NrXG4gICAgICAgICAgICAgIHgtbGFyZ2VcbiAgICAgICAgICAgICAgY29sb3I9XCJwcmltYXJ5XCJcbiAgICAgICAgICAgICAgQGNsaWNrPVwic3VibWl0XCJcbiAgICAgICAgICAgID5cbiAgICAgICAgICAgICAge3sgJHQoJ2xvZ2luLmJ1dHRvbicpIH19XG4gICAgICAgICAgICA8L3YtYnRuPlxuXG4gICAgICAgICAgICA8ZGl2IGNsYXNzPVwibXQtNVwiPlxuICAgICAgICAgICAgICA8cm91dGVyLWxpbmsgdG89XCIvYXV0aC9mb3Jnb3QtcGFzc3dvcmRcIj5cbiAgICAgICAgICAgICAgICB7eyAkdCgnbG9naW4uZm9yZ290JykgfX1cbiAgICAgICAgICAgICAgPC9yb3V0ZXItbGluaz5cbiAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgIDwvdi1mb3JtPlxuICAgICAgICA8L3ZhbGlkYXRpb24tb2JzZXJ2ZXI+XG4gICAgICA8L3YtY2FyZC10ZXh0PlxuICAgIDwvdi1jYXJkPlxuXG4gICAgPGRpdiBjbGFzcz1cInRleHQtY2VudGVyIG10LTZcIj5cbiAgICAgIHt7ICR0KCdsb2dpbi5ub2FjY291bnQnKSB9fVxuICAgICAgPHJvdXRlci1saW5rIHRvPVwiL2F1dGgvc2lnbnVwXCIgY2xhc3M9XCJmb250LXdlaWdodC1ib2xkXCI+XG4gICAgICAgIHt7ICR0KCdsb2dpbi5jcmVhdGUnKSB9fVxuICAgICAgPC9yb3V0ZXItbGluaz5cbiAgICA8L2Rpdj5cbiAgPC9kaXY+XG48L3RlbXBsYXRlPlxuXG48c2NyaXB0PlxuLypcbnwtLS0tLS0tLS0tLS0tLS0t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b3JkOiBmYWxzZVxuICAgIH1cbiAgfSxcbiAgbWV0aG9kczoge1xuICAgIC4uLm1hcEFjdGlvbnMoJ2F1dGhlbnRpY2F0aW9uJywgWydsb2dpbiddKSxcbiAgICBzdWJtaXQoKSB7XG4gICAgICB0aGlzLmlzTG9hZGluZyA9IHRydWVcbiAgICAgIHRoaXMuaXNTaWduSW5EaXNhYmxlZCA9IHRydWVcbiAgICAgIHRoaXMubG9naW4odGhpcy5mb3JtKS50aGVuKCgpID0+IHtcbiAgICAgICAgdGhpcy4kcm91dGVyLnJlcGxhY2UoeyBuYW1lOiAnZGFzaGJvYXJkLWFuYWx5dGljcycgfSk7XG4gICAgICB9KS5jYXRjaCgoZXJyb3IpID0+IHtcbiAgICAgICAgdGhpcy5mbGFzaCgnSW52YWxpZCB1c2VybmFtZSBvciBwYXNzd29yZCcsICdyZWQnKVxuICAgICAgICB0aGlzLnJlc2V0KCk7XG4gICAgICB9KVxuICAgIH0sXG4gICAgcmVzZXQoKSB7XG4gICAgICB0aGlzLmlzTG9hZGluZyA9IGZhbHNlO1xuICAgICAgdGhpcy5pc1NpZ25JbkRpc2FibGVkID0gZmFsc2U7XG4gICAgfVxuICB9XG59XG48L3NjcmlwdD5cbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/babel-loader/lib/index.js??clonedRuleSet-5[0].rules[0].use[0]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/js/pages/auth/SigninPage.vue?vue&type=script&lang=js&\n"); /***/ }), /***/ "./node_modules/vee-validate/dist/rules.js": /*!*************************************************!*\ !*** ./node_modules/vee-validate/dist/rules.js ***! \*************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"alpha\": function() { return /* binding */ alpha$1; },\n/* harmony export */ \"alpha_dash\": function() { return /* binding */ alpha_dash; },\n/* harmony export */ \"alpha_num\": function() { return /* binding */ alpha_num; },\n/* harmony export */ \"alpha_spaces\": function() { return /* binding */ alpha_spaces; },\n/* harmony export */ \"between\": function() { return /* binding */ between; },\n/* harmony export */ \"confirmed\": function() { return /* binding */ confirmed; },\n/* harmony export */ \"digits\": function() { return /* binding */ digits; },\n/* harmony export */ \"dimensions\": function() { return /* binding */ dimensions; },\n/* harmony export */ \"double\": function() { return /* binding */ double; },\n/* harmony export */ \"email\": function() { return /* binding */ email; },\n/* harmony export */ \"excluded\": function() { return /* binding */ excluded; },\n/* harmony export */ \"ext\": function() { return /* binding */ ext; },\n/* harmony export */ \"image\": function() { return /* binding */ image; },\n/* harmony export */ \"integer\": function() { return /* binding */ integer; },\n/* harmony export */ \"is\": function() { return /* binding */ is; },\n/* harmony export */ \"is_not\": function() { return /* binding */ is_not; },\n/* harmony export */ \"length\": function() { return /* binding */ length; },\n/* harmony export */ \"max\": function() { return /* binding */ max; },\n/* harmony export */ \"max_value\": function() { return /* binding */ max_value; },\n/* harmony export */ \"mimes\": function() { return /* binding */ mimes; },\n/* harmony export */ \"min\": function() { return /* binding */ min; },\n/* harmony export */ \"min_value\": function() { return /* binding */ min_value; },\n/* harmony export */ \"numeric\": function() { return /* binding */ numeric; },\n/* harmony export */ \"oneOf\": function() { return /* binding */ oneOf; },\n/* harmony export */ \"regex\": function() { return /* binding */ regex; },\n/* harmony export */ \"required\": function() { return /* binding */ required; },\n/* harmony export */ \"required_if\": function() { return /* binding */ required_if; },\n/* harmony export */ \"size\": function() { return /* binding */ size; }\n/* harmony export */ });\n/**\n * vee-validate v3.4.5\n * (c) 2020 Abdelrahman Awad\n * @license MIT\n */\n/**\r\n * Some Alpha Regex helpers.\r\n * https://github.com/chriso/validator.js/blob/master/src/lib/alpha.js\r\n */\r\n/* eslint-disable no-misleading-character-class */\r\nvar alpha = {\r\n en: /^[A-Z]*$/i,\r\n cs: /^[A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]*$/i,\r\n da: /^[A-ZÆØÅ]*$/i,\r\n de: /^[A-ZÄÖÜß]*$/i,\r\n es: /^[A-ZÁÉÍÑÓÚÜ]*$/i,\r\n fa: /^[ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰپژگچکی]*$/,\r\n fr: /^[A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]*$/i,\r\n it: /^[A-Z\\xC0-\\xFF]*$/i,\r\n lt: /^[A-ZĄČĘĖĮŠŲŪŽ]*$/i,\r\n nl: /^[A-ZÉËÏÓÖÜ]*$/i,\r\n hu: /^[A-ZÁÉÍÓÖŐÚÜŰ]*$/i,\r\n pl: /^[A-ZĄĆĘŚŁŃÓŻŹ]*$/i,\r\n pt: /^[A-ZÃÁÀÂÇÉÊÍÕÓÔÚÜ]*$/i,\r\n ro: /^[A-ZĂÂÎŞŢ]*$/i,\r\n ru: /^[А-ЯЁ]*$/i,\r\n sk: /^[A-ZÁÄČĎÉÍĹĽŇÓŔŠŤÚÝŽ]*$/i,\r\n sr: /^[A-ZČĆŽŠĐ]*$/i,\r\n sv: /^[A-ZÅÄÖ]*$/i,\r\n tr: /^[A-ZÇĞİıÖŞÜ]*$/i,\r\n uk: /^[А-ЩЬЮЯЄІЇҐ]*$/i,\r\n ar: /^[ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]*$/,\r\n az: /^[A-ZÇƏĞİıÖŞÜ]*$/i,\r\n el: /^[Α-ώ]*$/i\r\n};\r\nvar alphaSpaces = {\r\n en: /^[A-Z\\s]*$/i,\r\n cs: /^[A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ\\s]*$/i,\r\n da: /^[A-ZÆØÅ\\s]*$/i,\r\n de: /^[A-ZÄÖÜß\\s]*$/i,\r\n es: /^[A-ZÁÉÍÑÓÚÜ\\s]*$/i,\r\n fa: /^[ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰپژگچکی]*$/,\r\n fr: /^[A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ\\s]*$/i,\r\n it: /^[A-Z\\xC0-\\xFF\\s]*$/i,\r\n lt: /^[A-ZĄČĘĖĮŠŲŪŽ\\s]*$/i,\r\n nl: /^[A-ZÉËÏÓÖÜ\\s]*$/i,\r\n hu: /^[A-ZÁÉÍÓÖŐÚÜŰ\\s]*$/i,\r\n pl: /^[A-ZĄĆĘŚŁŃÓŻŹ\\s]*$/i,\r\n pt: /^[A-ZÃÁÀÂÇÉÊÍÕÓÔÚÜ\\s]*$/i,\r\n ro: /^[A-ZĂÂÎŞŢ\\s]*$/i,\r\n ru: /^[А-ЯЁ\\s]*$/i,\r\n sk: /^[A-ZÁÄČĎÉÍĹĽŇÓŔŠŤÚÝŽ\\s]*$/i,\r\n sr: /^[A-ZČĆŽŠĐ\\s]*$/i,\r\n sv: /^[A-ZÅÄÖ\\s]*$/i,\r\n tr: /^[A-ZÇĞİıÖŞÜ\\s]*$/i,\r\n uk: /^[А-ЩЬЮЯЄІЇҐ\\s]*$/i,\r\n ar: /^[ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ\\s]*$/,\r\n az: /^[A-ZÇƏĞİıÖŞÜ\\s]*$/i,\r\n el: /^[Α-ώ\\s]*$/i\r\n};\r\nvar alphanumeric = {\r\n en: /^[0-9A-Z]*$/i,\r\n cs: /^[0-9A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]*$/i,\r\n da: /^[0-9A-ZÆØÅ]$/i,\r\n de: /^[0-9A-ZÄÖÜß]*$/i,\r\n es: /^[0-9A-ZÁÉÍÑÓÚÜ]*$/i,\r\n fa: /^[ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰپژگچکی]*$/,\r\n fr: /^[0-9A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]*$/i,\r\n it: /^[0-9A-Z\\xC0-\\xFF]*$/i,\r\n lt: /^[0-9A-ZĄČĘĖĮŠŲŪŽ]*$/i,\r\n hu: /^[0-9A-ZÁÉÍÓÖŐÚÜŰ]*$/i,\r\n nl: /^[0-9A-ZÉËÏÓÖÜ]*$/i,\r\n pl: /^[0-9A-ZĄĆĘŚŁŃÓŻŹ]*$/i,\r\n pt: /^[0-9A-ZÃÁÀÂÇÉÊÍÕÓÔÚÜ]*$/i,\r\n ro: /^[0-9A-ZĂÂÎŞŢ]*$/i,\r\n ru: /^[0-9А-ЯЁ]*$/i,\r\n sk: /^[0-9A-ZÁÄČĎÉÍĹĽŇÓŔŠŤÚÝŽ]*$/i,\r\n sr: /^[0-9A-ZČĆŽŠĐ]*$/i,\r\n sv: /^[0-9A-ZÅÄÖ]*$/i,\r\n tr: /^[0-9A-ZÇĞİıÖŞÜ]*$/i,\r\n uk: /^[0-9А-ЩЬЮЯЄІЇҐ]*$/i,\r\n ar: /^[٠١٢٣٤٥٦٧٨٩0-9ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]*$/,\r\n az: /^[0-9A-ZÇƏĞİıÖŞÜ]*$/i,\r\n el: /^[0-9Α-ώ]*$/i\r\n};\r\nvar alphaDash = {\r\n en: /^[0-9A-Z_-]*$/i,\r\n cs: /^[0-9A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ_-]*$/i,\r\n da: /^[0-9A-ZÆØÅ_-]*$/i,\r\n de: /^[0-9A-ZÄÖÜß_-]*$/i,\r\n es: /^[0-9A-ZÁÉÍÑÓÚÜ_-]*$/i,\r\n fa: /^[ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰپژگچکی]*$/,\r\n fr: /^[0-9A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ_-]*$/i,\r\n it: /^[0-9A-Z\\xC0-\\xFF_-]*$/i,\r\n lt: /^[0-9A-ZĄČĘĖĮŠŲŪŽ_-]*$/i,\r\n nl: /^[0-9A-ZÉËÏÓÖÜ_-]*$/i,\r\n hu: /^[0-9A-ZÁÉÍÓÖŐÚÜŰ_-]*$/i,\r\n pl: /^[0-9A-ZĄĆĘŚŁŃÓŻŹ_-]*$/i,\r\n pt: /^[0-9A-ZÃÁÀÂÇÉÊÍÕÓÔÚÜ_-]*$/i,\r\n ro: /^[0-9A-ZĂÂÎŞŢ_-]*$/i,\r\n ru: /^[0-9А-ЯЁ_-]*$/i,\r\n sk: /^[0-9A-ZÁÄČĎÉÍĹĽŇÓŔŠŤÚÝŽ_-]*$/i,\r\n sr: /^[0-9A-ZČĆŽŠĐ_-]*$/i,\r\n sv: /^[0-9A-ZÅÄÖ_-]*$/i,\r\n tr: /^[0-9A-ZÇĞİıÖŞÜ_-]*$/i,\r\n uk: /^[0-9А-ЩЬЮЯЄІЇҐ_-]*$/i,\r\n ar: /^[٠١٢٣٤٥٦٧٨٩0-9ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ_-]*$/,\r\n az: /^[0-9A-ZÇƏĞİıÖŞÜ_-]*$/i,\r\n el: /^[0-9Α-ώ_-]*$/i\r\n};\n\nvar validate = function (value, _a) {\r\n var _b = (_a === void 0 ? {} : _a).locale, locale = _b === void 0 ? '' : _b;\r\n if (Array.isArray(value)) {\r\n return value.every(function (val) { return validate(val, { locale: locale }); });\r\n }\r\n // Match at least one locale.\r\n if (!locale) {\r\n return Object.keys(alpha).some(function (loc) { return alpha[loc].test(value); });\r\n }\r\n return (alpha[locale] || alpha.en).test(value);\r\n};\r\nvar params = [\r\n {\r\n name: 'locale'\r\n }\r\n];\r\nvar alpha$1 = {\r\n validate: validate,\r\n params: params\r\n};\n\nvar validate$1 = function (value, _a) {\r\n var _b = (_a === void 0 ? {} : _a).locale, locale = _b === void 0 ? '' : _b;\r\n if (Array.isArray(value)) {\r\n return value.every(function (val) { return validate$1(val, { locale: locale }); });\r\n }\r\n // Match at least one locale.\r\n if (!locale) {\r\n return Object.keys(alphaDash).some(function (loc) { return alphaDash[loc].test(value); });\r\n }\r\n return (alphaDash[locale] || alphaDash.en).test(value);\r\n};\r\nvar params$1 = [\r\n {\r\n name: 'locale'\r\n }\r\n];\r\nvar alpha_dash = {\r\n validate: validate$1,\r\n params: params$1\r\n};\n\nvar validate$2 = function (value, _a) {\r\n var _b = (_a === void 0 ? {} : _a).locale, locale = _b === void 0 ? '' : _b;\r\n if (Array.isArray(value)) {\r\n return value.every(function (val) { return validate$2(val, { locale: locale }); });\r\n }\r\n // Match at least one locale.\r\n if (!locale) {\r\n return Object.keys(alphanumeric).some(function (loc) { return alphanumeric[loc].test(value); });\r\n }\r\n return (alphanumeric[locale] || alphanumeric.en).test(value);\r\n};\r\nvar params$2 = [\r\n {\r\n name: 'locale'\r\n }\r\n];\r\nvar alpha_num = {\r\n validate: validate$2,\r\n params: params$2\r\n};\n\nvar validate$3 = function (value, _a) {\r\n var _b = (_a === void 0 ? {} : _a).locale, locale = _b === void 0 ? '' : _b;\r\n if (Array.isArray(value)) {\r\n return value.every(function (val) { return validate$3(val, { locale: locale }); });\r\n }\r\n // Match at least one locale.\r\n if (!locale) {\r\n return Object.keys(alphaSpaces).some(function (loc) { return alphaSpaces[loc].test(value); });\r\n }\r\n return (alphaSpaces[locale] || alphaSpaces.en).test(value);\r\n};\r\nvar params$3 = [\r\n {\r\n name: 'locale'\r\n }\r\n];\r\nvar alpha_spaces = {\r\n validate: validate$3,\r\n params: params$3\r\n};\n\nvar validate$4 = function (value, _a) {\r\n var _b = _a === void 0 ? {} : _a, min = _b.min, max = _b.max;\r\n if (Array.isArray(value)) {\r\n return value.every(function (val) { return !!validate$4(val, { min: min, max: max }); });\r\n }\r\n return Number(min) <= value && Number(max) >= value;\r\n};\r\nvar params$4 = [\r\n {\r\n name: 'min'\r\n },\r\n {\r\n name: 'max'\r\n }\r\n];\r\nvar between = {\r\n validate: validate$4,\r\n params: params$4\r\n};\n\nvar validate$5 = function (value, _a) {\r\n var target = _a.target;\r\n return String(value) === String(target);\r\n};\r\nvar params$5 = [\r\n {\r\n name: 'target',\r\n isTarget: true\r\n }\r\n];\r\nvar confirmed = {\r\n validate: validate$5,\r\n params: params$5\r\n};\n\nvar validate$6 = function (value, _a) {\r\n var length = _a.length;\r\n if (Array.isArray(value)) {\r\n return value.every(function (val) { return validate$6(val, { length: length }); });\r\n }\r\n var strVal = String(value);\r\n return /^[0-9]*$/.test(strVal) && strVal.length === length;\r\n};\r\nvar params$6 = [\r\n {\r\n name: 'length',\r\n cast: function (value) {\r\n return Number(value);\r\n }\r\n }\r\n];\r\nvar digits = {\r\n validate: validate$6,\r\n params: params$6\r\n};\n\nvar validateImage = function (file, width, height) {\r\n var URL = window.URL || window.webkitURL;\r\n return new Promise(function (resolve) {\r\n var image = new Image();\r\n image.onerror = function () { return resolve(false); };\r\n image.onload = function () { return resolve(image.width === width && image.height === height); };\r\n image.src = URL.createObjectURL(file);\r\n });\r\n};\r\nvar validate$7 = function (files, _a) {\r\n var width = _a.width, height = _a.height;\r\n var list = [];\r\n files = Array.isArray(files) ? files : [files];\r\n for (var i = 0; i < files.length; i++) {\r\n // if file is not an image, reject.\r\n if (!/\\.(jpg|svg|jpeg|png|bmp|gif)$/i.test(files[i].name)) {\r\n return Promise.resolve(false);\r\n }\r\n list.push(files[i]);\r\n }\r\n return Promise.all(list.map(function (file) { return validateImage(file, width, height); })).then(function (values) {\r\n return values.every(function (v) { return v; });\r\n });\r\n};\r\nvar params$7 = [\r\n {\r\n name: 'width',\r\n cast: function (value) {\r\n return Number(value);\r\n }\r\n },\r\n {\r\n name: 'height',\r\n cast: function (value) {\r\n return Number(value);\r\n }\r\n }\r\n];\r\nvar dimensions = {\r\n validate: validate$7,\r\n params: params$7\r\n};\n\nvar validate$8 = function (value, _a) {\r\n var multiple = (_a === void 0 ? {} : _a).multiple;\r\n // eslint-disable-next-line\r\n var re = /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\r\n if (multiple && !Array.isArray(value)) {\r\n value = String(value)\r\n .split(',')\r\n .map(function (emailStr) { return emailStr.trim(); });\r\n }\r\n if (Array.isArray(value)) {\r\n return value.every(function (val) { return re.test(String(val)); });\r\n }\r\n return re.test(String(value));\r\n};\r\nvar params$8 = [\r\n {\r\n name: 'multiple',\r\n default: false\r\n }\r\n];\r\nvar email = {\r\n validate: validate$8,\r\n params: params$8\r\n};\n\nfunction isNullOrUndefined(value) {\r\n return value === null || value === undefined;\r\n}\r\nfunction isEmptyArray(arr) {\r\n return Array.isArray(arr) && arr.length === 0;\r\n}\r\nfunction isCallable(fn) {\r\n return typeof fn === 'function';\r\n}\n\nfunction includes(collection, item) {\r\n return collection.indexOf(item) !== -1;\r\n}\r\n/**\r\n * Converts an array-like object to array, provides a simple polyfill for Array.from\r\n */\r\nfunction toArray(arrayLike) {\r\n if (isCallable(Array.from)) {\r\n return Array.from(arrayLike);\r\n }\r\n /* istanbul ignore next */\r\n return _copyArray(arrayLike);\r\n}\r\n/* istanbul ignore next */\r\nfunction _copyArray(arrayLike) {\r\n var array = [];\r\n var length = arrayLike.length;\r\n for (var i = 0; i < length; i++) {\r\n array.push(arrayLike[i]);\r\n }\r\n return array;\r\n}\n\nvar validate$9 = function (value, options) {\r\n if (Array.isArray(value)) {\r\n return value.every(function (val) { return validate$9(val, options); });\r\n }\r\n return toArray(options).some(function (item) {\r\n // eslint-disable-next-line\r\n return item == value;\r\n });\r\n};\r\nvar oneOf = {\r\n validate: validate$9\r\n};\n\nvar validate$a = function (value, args) {\r\n return !validate$9(value, args);\r\n};\r\nvar excluded = {\r\n validate: validate$a\r\n};\n\nvar validate$b = function (files, extensions) {\r\n var regex = new RegExp(\".(\" + extensions.join('|') + \")$\", 'i');\r\n if (Array.isArray(files)) {\r\n return files.every(function (file) { return regex.test(file.name); });\r\n }\r\n return regex.test(files.name);\r\n};\r\nvar ext = {\r\n validate: validate$b\r\n};\n\nvar validate$c = function (files) {\r\n var regex = /\\.(jpg|svg|jpeg|png|bmp|gif|webp)$/i;\r\n if (Array.isArray(files)) {\r\n return files.every(function (file) { return regex.test(file.name); });\r\n }\r\n return regex.test(files.name);\r\n};\r\nvar image = {\r\n validate: validate$c\r\n};\n\nvar validate$d = function (value) {\r\n if (Array.isArray(value)) {\r\n return value.every(function (val) { return /^-?[0-9]+$/.test(String(val)); });\r\n }\r\n return /^-?[0-9]+$/.test(String(value));\r\n};\r\nvar integer = {\r\n validate: validate$d\r\n};\n\nvar validate$e = function (value, _a) {\r\n var other = _a.other;\r\n return value === other;\r\n};\r\nvar params$9 = [\r\n {\r\n name: 'other'\r\n }\r\n];\r\nvar is = {\r\n validate: validate$e,\r\n params: params$9\r\n};\n\nvar validate$f = function (value, _a) {\r\n var other = _a.other;\r\n return value !== other;\r\n};\r\nvar params$a = [\r\n {\r\n name: 'other'\r\n }\r\n];\r\nvar is_not = {\r\n validate: validate$f,\r\n params: params$a\r\n};\n\nvar validate$g = function (value, _a) {\r\n var length = _a.length;\r\n if (isNullOrUndefined(value)) {\r\n return false;\r\n }\r\n if (typeof value === 'string') {\r\n value = toArray(value);\r\n }\r\n if (typeof value === 'number') {\r\n value = String(value);\r\n }\r\n if (!value.length) {\r\n value = toArray(value);\r\n }\r\n return value.length === length;\r\n};\r\nvar params$b = [\r\n {\r\n name: 'length',\r\n cast: function (value) { return Number(value); }\r\n }\r\n];\r\nvar length = {\r\n validate: validate$g,\r\n params: params$b\r\n};\n\nvar validate$h = function (value, _a) {\r\n var length = _a.length;\r\n if (isNullOrUndefined(value)) {\r\n return length >= 0;\r\n }\r\n if (Array.isArray(value)) {\r\n return value.every(function (val) { return validate$h(val, { length: length }); });\r\n }\r\n return String(value).length <= length;\r\n};\r\nvar params$c = [\r\n {\r\n name: 'length',\r\n cast: function (value) {\r\n return Number(value);\r\n }\r\n }\r\n];\r\nvar max = {\r\n validate: validate$h,\r\n params: params$c\r\n};\n\nvar validate$i = function (value, _a) {\r\n var max = _a.max;\r\n if (isNullOrUndefined(value) || value === '') {\r\n return false;\r\n }\r\n if (Array.isArray(value)) {\r\n return value.length > 0 && value.every(function (val) { return validate$i(val, { max: max }); });\r\n }\r\n return Number(value) <= max;\r\n};\r\nvar params$d = [\r\n {\r\n name: 'max',\r\n cast: function (value) {\r\n return Number(value);\r\n }\r\n }\r\n];\r\nvar max_value = {\r\n validate: validate$i,\r\n params: params$d\r\n};\n\nvar validate$j = function (files, mimes) {\r\n var regex = new RegExp(mimes.join('|').replace('*', '.+') + \"$\", 'i');\r\n if (Array.isArray(files)) {\r\n return files.every(function (file) { return regex.test(file.type); });\r\n }\r\n return regex.test(files.type);\r\n};\r\nvar mimes = {\r\n validate: validate$j\r\n};\n\nvar validate$k = function (value, _a) {\r\n var length = _a.length;\r\n if (isNullOrUndefined(value)) {\r\n return false;\r\n }\r\n if (Array.isArray(value)) {\r\n return value.every(function (val) { return validate$k(val, { length: length }); });\r\n }\r\n return String(value).length >= length;\r\n};\r\nvar params$e = [\r\n {\r\n name: 'length',\r\n cast: function (value) {\r\n return Number(value);\r\n }\r\n }\r\n];\r\nvar min = {\r\n validate: validate$k,\r\n params: params$e\r\n};\n\nvar validate$l = function (value, _a) {\r\n var min = _a.min;\r\n if (isNullOrUndefined(value) || value === '') {\r\n return false;\r\n }\r\n if (Array.isArray(value)) {\r\n return value.length > 0 && value.every(function (val) { return validate$l(val, { min: min }); });\r\n }\r\n return Number(value) >= min;\r\n};\r\nvar params$f = [\r\n {\r\n name: 'min',\r\n cast: function (value) {\r\n return Number(value);\r\n }\r\n }\r\n];\r\nvar min_value = {\r\n validate: validate$l,\r\n params: params$f\r\n};\n\nvar ar = /^[٠١٢٣٤٥٦٧٨٩]+$/;\r\nvar en = /^[0-9]+$/;\r\nvar validate$m = function (value) {\r\n var testValue = function (val) {\r\n var strValue = String(val);\r\n return en.test(strValue) || ar.test(strValue);\r\n };\r\n if (Array.isArray(value)) {\r\n return value.every(testValue);\r\n }\r\n return testValue(value);\r\n};\r\nvar numeric = {\r\n validate: validate$m\r\n};\n\nvar validate$n = function (value, _a) {\r\n var regex = _a.regex;\r\n if (Array.isArray(value)) {\r\n return value.every(function (val) { return validate$n(val, { regex: regex }); });\r\n }\r\n return regex.test(String(value));\r\n};\r\nvar params$g = [\r\n {\r\n name: 'regex',\r\n cast: function (value) {\r\n if (typeof value === 'string') {\r\n return new RegExp(value);\r\n }\r\n return value;\r\n }\r\n }\r\n];\r\nvar regex = {\r\n validate: validate$n,\r\n params: params$g\r\n};\n\nvar validate$o = function (value, _a) {\r\n var allowFalse = (_a === void 0 ? { allowFalse: true } : _a).allowFalse;\r\n var result = {\r\n valid: false,\r\n required: true\r\n };\r\n if (isNullOrUndefined(value) || isEmptyArray(value)) {\r\n return result;\r\n }\r\n // incase a field considers `false` as an empty value like checkboxes.\r\n if (value === false && !allowFalse) {\r\n return result;\r\n }\r\n result.valid = !!String(value).trim().length;\r\n return result;\r\n};\r\nvar computesRequired = true;\r\nvar params$h = [\r\n {\r\n name: 'allowFalse',\r\n default: true\r\n }\r\n];\r\nvar required = {\r\n validate: validate$o,\r\n params: params$h,\r\n computesRequired: computesRequired\r\n};\n\nvar testEmpty = function (value) {\r\n return isEmptyArray(value) || includes([false, null, undefined], value) || !String(value).trim().length;\r\n};\r\nvar validate$p = function (value, _a) {\r\n var target = _a.target, values = _a.values;\r\n var required;\r\n if (values && values.length) {\r\n if (!Array.isArray(values) && typeof values === 'string') {\r\n values = [values];\r\n }\r\n // eslint-disable-next-line\r\n required = values.some(function (val) { return val == String(target).trim(); });\r\n }\r\n else {\r\n required = !testEmpty(target);\r\n }\r\n if (!required) {\r\n return {\r\n valid: true,\r\n required: required\r\n };\r\n }\r\n return {\r\n valid: !testEmpty(value),\r\n required: required\r\n };\r\n};\r\nvar params$i = [\r\n {\r\n name: 'target',\r\n isTarget: true\r\n },\r\n {\r\n name: 'values'\r\n }\r\n];\r\nvar computesRequired$1 = true;\r\nvar required_if = {\r\n validate: validate$p,\r\n params: params$i,\r\n computesRequired: computesRequired$1\r\n};\n\nvar validate$q = function (files, _a) {\r\n var size = _a.size;\r\n if (isNaN(size)) {\r\n return false;\r\n }\r\n var nSize = size * 1024;\r\n if (!Array.isArray(files)) {\r\n return files.size <= nSize;\r\n }\r\n for (var i = 0; i < files.length; i++) {\r\n if (files[i].size > nSize) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n};\r\nvar params$j = [\r\n {\r\n name: 'size',\r\n cast: function (value) {\r\n return Number(value);\r\n }\r\n }\r\n];\r\nvar size = {\r\n validate: validate$q,\r\n params: params$j\r\n};\n\nvar validate$r = function (value, params) {\r\n var _a = params || {}, _b = _a.decimals, decimals = _b === void 0 ? 0 : _b, _c = _a.separator, separator = _c === void 0 ? 'dot' : _c;\r\n var separators = {\r\n dot: '.',\r\n comma: ','\r\n };\r\n var regexPart = +decimals === 0 ? '+' : \"{\" + decimals + \"}\";\r\n var regex = new RegExp(\"^-?\\\\d+\\\\\" + (separators[separator] || '.') + \"\\\\d\" + regexPart + \"$\");\r\n return Array.isArray(value) ? value.every(function (val) { return regex.test(String(val)); }) : regex.test(String(value));\r\n};\r\nvar params$k = [\r\n {\r\n name: 'decimals',\r\n default: 0\r\n },\r\n {\r\n name: 'separator',\r\n default: 'dot'\r\n }\r\n];\r\nvar double = {\r\n validate: validate$r,\r\n params: params$k\r\n};\n\n\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9AbHV4L2xhcmF2ZWwtc3RhcnRlci8uL25vZGVfbW9kdWxlcy92ZWUtdmFsaWRhdGUvZGlzdC9ydWxlcy5qcz80YzkzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7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aXNBcnJheSh2YWx1ZSkgPyB2YWx1ZS5ldmVyeShmdW5jdGlvbiAodmFsKSB7IHJldHVybiByZWdleC50ZXN0KFN0cmluZyh2YWwpKTsgfSkgOiByZWdleC50ZXN0KFN0cmluZyh2YWx1ZSkpO1xyXG59O1xyXG52YXIgcGFyYW1zJGsgPSBbXHJcbiAgICB7XHJcbiAgICAgICAgbmFtZTogJ2RlY2ltYWxzJyxcclxuICAgICAgICBkZWZhdWx0OiAwXHJcbiAgICB9LFxyXG4gICAge1xyXG4gICAgICAgIG5hbWU6ICdzZXBhcmF0b3InLFxyXG4gICAgICAgIGRlZmF1bHQ6ICdkb3QnXHJcbiAgICB9XHJcbl07XHJcbnZhciBkb3VibGUgPSB7XHJcbiAgICB2YWxpZGF0ZTogdmFsaWRhdGUkcixcclxuICAgIHBhcmFtczogcGFyYW1zJGtcclxufTtcblxuZXhwb3J0IHsgYWxwaGEkMSBhcyBhbHBoYSwgYWxwaGFfZGFzaCwgYWxwaGFfbnVtLCBhbHBoYV9zcGFjZXMsIGJldHdlZW4sIGNvbmZpcm1lZCwgZGlnaXRzLCBkaW1lbnNpb25zLCBkb3VibGUsIGVtYWlsLCBleGNsdWRlZCwgZXh0LCBpbWFnZSwgaW50ZWdlciwgaXMsIGlzX25vdCwgbGVuZ3RoLCBtYXgsIG1heF92YWx1ZSwgbWltZXMsIG1pbiwgbWluX3ZhbHVlLCBudW1lcmljLCBvbmVPZiwgcmVnZXgsIHJlcXVpcmVkLCByZXF1aXJlZF9pZiwgc2l6ZSB9O1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/vee-validate/dist/rules.js\n"); /***/ }), /***/ "./node_modules/vee-validate/dist/vee-validate.esm.js": /*!************************************************************!*\ !*** ./node_modules/vee-validate/dist/vee-validate.esm.js ***! \************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"ValidationObserver\": function() { return /* binding */ ValidationObserver; },\n/* harmony export */ \"ValidationProvider\": function() { return /* binding */ ValidationProvider; },\n/* harmony export */ \"configure\": function() { return /* binding */ configure; },\n/* harmony export */ \"extend\": function() { return /* binding */ extend; },\n/* harmony export */ \"localeChanged\": function() { return /* binding */ localeChanged; },\n/* harmony export */ \"localize\": function() { return /* binding */ localize; },\n/* harmony export */ \"normalizeRules\": function() { return /* binding */ normalizeRules; },\n/* harmony export */ \"setInteractionMode\": function() { return /* binding */ setInteractionMode; },\n/* harmony export */ \"validate\": function() { return /* binding */ validate; },\n/* harmony export */ \"version\": function() { return /* binding */ version; },\n/* harmony export */ \"withValidation\": function() { return /* binding */ withValidation; }\n/* harmony export */ });\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ \"./node_modules/vue/dist/vue.esm.js\");\n/**\n * vee-validate v3.4.5\n * (c) 2020 Abdelrahman Awad\n * @license MIT\n */\n\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n\r\nvar __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n};\r\n\r\nfunction __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nfunction __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nfunction __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\n\nfunction isNaN(value) {\r\n // NaN is the one value that does not equal itself.\r\n // eslint-disable-next-line\r\n return value !== value;\r\n}\r\nfunction isNullOrUndefined(value) {\r\n return value === null || value === undefined;\r\n}\r\nfunction isEmptyArray(arr) {\r\n return Array.isArray(arr) && arr.length === 0;\r\n}\r\nvar isObject = function (obj) {\r\n return obj !== null && obj && typeof obj === 'object' && !Array.isArray(obj);\r\n};\r\n/**\r\n * A reference comparison function with NaN support\r\n */\r\nfunction isRefEqual(lhs, rhs) {\r\n if (isNaN(lhs) && isNaN(rhs)) {\r\n return true;\r\n }\r\n return lhs === rhs;\r\n}\r\n/**\r\n * Shallow object comparison.\r\n */\r\nfunction isEqual(lhs, rhs) {\r\n if (lhs instanceof RegExp && rhs instanceof RegExp) {\r\n return isEqual(lhs.source, rhs.source) && isEqual(lhs.flags, rhs.flags);\r\n }\r\n if (Array.isArray(lhs) && Array.isArray(rhs)) {\r\n if (lhs.length !== rhs.length)\r\n return false;\r\n for (var i = 0; i < lhs.length; i++) {\r\n if (!isEqual(lhs[i], rhs[i])) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n // if both are objects, compare each key recursively.\r\n if (isObject(lhs) && isObject(rhs)) {\r\n return (Object.keys(lhs).every(function (key) {\r\n return isEqual(lhs[key], rhs[key]);\r\n }) &&\r\n Object.keys(rhs).every(function (key) {\r\n return isEqual(lhs[key], rhs[key]);\r\n }));\r\n }\r\n return isRefEqual(lhs, rhs);\r\n}\r\n// Checks if a given value is not an empty string or null or undefined.\r\nfunction isSpecified(val) {\r\n if (val === '') {\r\n return false;\r\n }\r\n return !isNullOrUndefined(val);\r\n}\r\nfunction isCallable(fn) {\r\n return typeof fn === 'function';\r\n}\r\nfunction isLocator(value) {\r\n return isCallable(value) && !!value.__locatorRef;\r\n}\n\nfunction findIndex(arrayLike, predicate) {\r\n var array = Array.isArray(arrayLike) ? arrayLike : toArray(arrayLike);\r\n if (isCallable(array.findIndex)) {\r\n return array.findIndex(predicate);\r\n }\r\n /* istanbul ignore next */\r\n for (var i = 0; i < array.length; i++) {\r\n if (predicate(array[i], i)) {\r\n return i;\r\n }\r\n }\r\n /* istanbul ignore next */\r\n return -1;\r\n}\r\n/**\r\n * finds the first element that satisfies the predicate callback, polyfills array.find\r\n */\r\nfunction find(arrayLike, predicate) {\r\n var array = Array.isArray(arrayLike) ? arrayLike : toArray(arrayLike);\r\n var idx = findIndex(array, predicate);\r\n return idx === -1 ? undefined : array[idx];\r\n}\r\nfunction includes(collection, item) {\r\n return collection.indexOf(item) !== -1;\r\n}\r\n/**\r\n * Converts an array-like object to array, provides a simple polyfill for Array.from\r\n */\r\nfunction toArray(arrayLike) {\r\n if (isCallable(Array.from)) {\r\n return Array.from(arrayLike);\r\n }\r\n /* istanbul ignore next */\r\n return _copyArray(arrayLike);\r\n}\r\n/* istanbul ignore next */\r\nfunction _copyArray(arrayLike) {\r\n var array = [];\r\n var length = arrayLike.length;\r\n for (var i = 0; i < length; i++) {\r\n array.push(arrayLike[i]);\r\n }\r\n return array;\r\n}\r\nfunction values(obj) {\r\n if (isCallable(Object.values)) {\r\n return Object.values(obj);\r\n }\r\n // fallback to keys()\r\n /* istanbul ignore next */\r\n return Object.keys(obj).map(function (k) { return obj[k]; });\r\n}\r\nfunction merge(target, source) {\r\n Object.keys(source).forEach(function (key) {\r\n if (isObject(source[key])) {\r\n if (!target[key]) {\r\n target[key] = {};\r\n }\r\n merge(target[key], source[key]);\r\n return;\r\n }\r\n target[key] = source[key];\r\n });\r\n return target;\r\n}\n\nfunction createFlags() {\r\n return {\r\n untouched: true,\r\n touched: false,\r\n dirty: false,\r\n pristine: true,\r\n valid: false,\r\n invalid: false,\r\n validated: false,\r\n pending: false,\r\n required: false,\r\n changed: false,\r\n passed: false,\r\n failed: false\r\n };\r\n}\n\nfunction identity(x) {\r\n return x;\r\n}\r\nfunction debounce(fn, wait, token) {\r\n if (wait === void 0) { wait = 0; }\r\n if (token === void 0) { token = { cancelled: false }; }\r\n if (wait === 0) {\r\n return fn;\r\n }\r\n var timeout;\r\n return function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var later = function () {\r\n timeout = undefined;\r\n // check if the fn call was cancelled.\r\n if (!token.cancelled)\r\n fn.apply(void 0, args);\r\n };\r\n // because we might want to use Node.js setTimout for SSR.\r\n clearTimeout(timeout);\r\n timeout = setTimeout(later, wait);\r\n };\r\n}\n\n/**\r\n * Emits a warning to the console\r\n */\r\nfunction warn(message) {\r\n console.warn(\"[vee-validate] \" + message);\r\n}\r\n/**\r\n * Replaces placeholder values in a string with their actual values\r\n */\r\nfunction interpolate(template, values) {\r\n return template.replace(/{([^}]+)}/g, function (_, p) {\r\n return p in values ? values[p] : \"{\" + p + \"}\";\r\n });\r\n}\n\nvar RULES = {};\r\nfunction normalizeSchema(schema) {\r\n var _a;\r\n if ((_a = schema.params) === null || _a === void 0 ? void 0 : _a.length) {\r\n schema.params = schema.params.map(function (param) {\r\n if (typeof param === 'string') {\r\n return { name: param };\r\n }\r\n return param;\r\n });\r\n }\r\n return schema;\r\n}\r\nvar RuleContainer = /** @class */ (function () {\r\n function RuleContainer() {\r\n }\r\n RuleContainer.extend = function (name, schema) {\r\n // if rule already exists, overwrite it.\r\n var rule = normalizeSchema(schema);\r\n if (RULES[name]) {\r\n RULES[name] = merge(RULES[name], schema);\r\n return;\r\n }\r\n RULES[name] = __assign({ lazy: false, computesRequired: false }, rule);\r\n };\r\n RuleContainer.isLazy = function (name) {\r\n var _a;\r\n return !!((_a = RULES[name]) === null || _a === void 0 ? void 0 : _a.lazy);\r\n };\r\n RuleContainer.isRequireRule = function (name) {\r\n var _a;\r\n return !!((_a = RULES[name]) === null || _a === void 0 ? void 0 : _a.computesRequired);\r\n };\r\n RuleContainer.getRuleDefinition = function (ruleName) {\r\n return RULES[ruleName];\r\n };\r\n return RuleContainer;\r\n}());\r\n/**\r\n * Adds a custom validator to the list of validation rules.\r\n */\r\nfunction extend(name, schema) {\r\n // makes sure new rules are properly formatted.\r\n guardExtend(name, schema);\r\n // Full schema object.\r\n if (typeof schema === 'object') {\r\n RuleContainer.extend(name, schema);\r\n return;\r\n }\r\n RuleContainer.extend(name, {\r\n validate: schema\r\n });\r\n}\r\n/**\r\n * Guards from extension violations.\r\n */\r\nfunction guardExtend(name, validator) {\r\n if (isCallable(validator)) {\r\n return;\r\n }\r\n if (isCallable(validator.validate)) {\r\n return;\r\n }\r\n if (RuleContainer.getRuleDefinition(name)) {\r\n return;\r\n }\r\n throw new Error(\"Extension Error: The validator '\" + name + \"' must be a function or have a 'validate' method.\");\r\n}\n\nvar DEFAULT_CONFIG = {\r\n defaultMessage: \"{_field_} is not valid.\",\r\n skipOptional: true,\r\n classes: {\r\n touched: 'touched',\r\n untouched: 'untouched',\r\n valid: 'valid',\r\n invalid: 'invalid',\r\n pristine: 'pristine',\r\n dirty: 'dirty' // control has been interacted with\r\n },\r\n bails: true,\r\n mode: 'aggressive',\r\n useConstraintAttrs: true\r\n};\r\nvar currentConfig = __assign({}, DEFAULT_CONFIG);\r\nvar getConfig = function () { return currentConfig; };\r\nvar setConfig = function (newConf) {\r\n currentConfig = __assign(__assign({}, currentConfig), newConf);\r\n};\r\nvar configure = function (cfg) {\r\n setConfig(cfg);\r\n};\n\n/**\r\n * Normalizes the given rules expression.\r\n */\r\nfunction normalizeRules(rules) {\r\n // if falsy value return an empty object.\r\n var acc = {};\r\n Object.defineProperty(acc, '_$$isNormalized', {\r\n value: true,\r\n writable: false,\r\n enumerable: false,\r\n configurable: false\r\n });\r\n if (!rules) {\r\n return acc;\r\n }\r\n // Object is already normalized, skip.\r\n if (isObject(rules) && rules._$$isNormalized) {\r\n return rules;\r\n }\r\n if (isObject(rules)) {\r\n return Object.keys(rules).reduce(function (prev, curr) {\r\n var params = [];\r\n if (rules[curr] === true) {\r\n params = [];\r\n }\r\n else if (Array.isArray(rules[curr])) {\r\n params = rules[curr];\r\n }\r\n else if (isObject(rules[curr])) {\r\n params = rules[curr];\r\n }\r\n else {\r\n params = [rules[curr]];\r\n }\r\n if (rules[curr] !== false) {\r\n prev[curr] = buildParams(curr, params);\r\n }\r\n return prev;\r\n }, acc);\r\n }\r\n /* istanbul ignore if */\r\n if (typeof rules !== 'string') {\r\n warn('rules must be either a string or an object.');\r\n return acc;\r\n }\r\n return rules.split('|').reduce(function (prev, rule) {\r\n var parsedRule = parseRule(rule);\r\n if (!parsedRule.name) {\r\n return prev;\r\n }\r\n prev[parsedRule.name] = buildParams(parsedRule.name, parsedRule.params);\r\n return prev;\r\n }, acc);\r\n}\r\nfunction buildParams(ruleName, provided) {\r\n var ruleSchema = RuleContainer.getRuleDefinition(ruleName);\r\n if (!ruleSchema) {\r\n return provided;\r\n }\r\n var params = {};\r\n if (!ruleSchema.params && !Array.isArray(provided)) {\r\n throw new Error('You provided an object params to a rule that has no defined schema.');\r\n }\r\n // Rule probably uses an array for their args, keep it as is.\r\n if (Array.isArray(provided) && !ruleSchema.params) {\r\n return provided;\r\n }\r\n var definedParams;\r\n // collect the params schema.\r\n if (!ruleSchema.params || (ruleSchema.params.length < provided.length && Array.isArray(provided))) {\r\n var lastDefinedParam_1;\r\n // collect any additional parameters in the last item.\r\n definedParams = provided.map(function (_, idx) {\r\n var _a;\r\n var param = (_a = ruleSchema.params) === null || _a === void 0 ? void 0 : _a[idx];\r\n lastDefinedParam_1 = param || lastDefinedParam_1;\r\n if (!param) {\r\n param = lastDefinedParam_1;\r\n }\r\n return param;\r\n });\r\n }\r\n else {\r\n definedParams = ruleSchema.params;\r\n }\r\n // Match the provided array length with a temporary schema.\r\n for (var i = 0; i < definedParams.length; i++) {\r\n var options = definedParams[i];\r\n var value = options.default;\r\n // if the provided is an array, map element value.\r\n if (Array.isArray(provided)) {\r\n if (i in provided) {\r\n value = provided[i];\r\n }\r\n }\r\n else {\r\n // If the param exists in the provided object.\r\n if (options.name in provided) {\r\n value = provided[options.name];\r\n // if the provided is the first param value.\r\n }\r\n else if (definedParams.length === 1) {\r\n value = provided;\r\n }\r\n }\r\n // if the param is a target, resolve the target value.\r\n if (options.isTarget) {\r\n value = createLocator(value, options.cast);\r\n }\r\n // A target param using interpolation\r\n if (typeof value === 'string' && value[0] === '@') {\r\n value = createLocator(value.slice(1), options.cast);\r\n }\r\n // If there is a transformer defined.\r\n if (!isLocator(value) && options.cast) {\r\n value = options.cast(value);\r\n }\r\n // already been set, probably multiple values.\r\n if (params[options.name]) {\r\n params[options.name] = Array.isArray(params[options.name]) ? params[options.name] : [params[options.name]];\r\n params[options.name].push(value);\r\n }\r\n else {\r\n // set the value.\r\n params[options.name] = value;\r\n }\r\n }\r\n return params;\r\n}\r\n/**\r\n * Parses a rule string expression.\r\n */\r\nvar parseRule = function (rule) {\r\n var params = [];\r\n var name = rule.split(':')[0];\r\n if (includes(rule, ':')) {\r\n params = rule\r\n .split(':')\r\n .slice(1)\r\n .join(':')\r\n .split(',');\r\n }\r\n return { name: name, params: params };\r\n};\r\nfunction createLocator(value, castFn) {\r\n var locator = function (crossTable) {\r\n var val = crossTable[value];\r\n return castFn ? castFn(val) : val;\r\n };\r\n locator.__locatorRef = value;\r\n return locator;\r\n}\r\nfunction extractLocators(params) {\r\n if (Array.isArray(params)) {\r\n return params.filter(function (param) {\r\n return isLocator(param) || (typeof param === 'string' && param[0] === '@');\r\n });\r\n }\r\n return Object.keys(params)\r\n .filter(function (key) { return isLocator(params[key]); })\r\n .map(function (key) { return params[key]; });\r\n}\n\n/**\r\n * Validates a value against the rules.\r\n */\r\nfunction validate(value, rules, options) {\r\n if (options === void 0) { options = {}; }\r\n return __awaiter(this, void 0, void 0, function () {\r\n var shouldBail, skipIfEmpty, field, result, errors, failedRules, regenerateMap;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n shouldBail = options === null || options === void 0 ? void 0 : options.bails;\r\n skipIfEmpty = options === null || options === void 0 ? void 0 : options.skipIfEmpty;\r\n field = {\r\n name: (options === null || options === void 0 ? void 0 : options.name) || '{field}',\r\n rules: normalizeRules(rules),\r\n bails: shouldBail !== null && shouldBail !== void 0 ? shouldBail : true,\r\n skipIfEmpty: skipIfEmpty !== null && skipIfEmpty !== void 0 ? skipIfEmpty : true,\r\n forceRequired: false,\r\n crossTable: (options === null || options === void 0 ? void 0 : options.values) || {},\r\n names: (options === null || options === void 0 ? void 0 : options.names) || {},\r\n customMessages: (options === null || options === void 0 ? void 0 : options.customMessages) || {}\r\n };\r\n return [4 /*yield*/, _validate(field, value, options)];\r\n case 1:\r\n result = _a.sent();\r\n errors = [];\r\n failedRules = {};\r\n regenerateMap = {};\r\n result.errors.forEach(function (e) {\r\n var msg = e.msg();\r\n errors.push(msg);\r\n failedRules[e.rule] = msg;\r\n regenerateMap[e.rule] = e.msg;\r\n });\r\n return [2 /*return*/, {\r\n valid: result.valid,\r\n errors: errors,\r\n failedRules: failedRules,\r\n regenerateMap: regenerateMap\r\n }];\r\n }\r\n });\r\n });\r\n}\r\n/**\r\n * Starts the validation process.\r\n */\r\nfunction _validate(field, value, _a) {\r\n var _b = (_a === void 0 ? {} : _a).isInitial, isInitial = _b === void 0 ? false : _b;\r\n return __awaiter(this, void 0, void 0, function () {\r\n var _c, shouldSkip, errors, rules, length, i, rule, result;\r\n return __generator(this, function (_d) {\r\n switch (_d.label) {\r\n case 0: return [4 /*yield*/, _shouldSkip(field, value)];\r\n case 1:\r\n _c = _d.sent(), shouldSkip = _c.shouldSkip, errors = _c.errors;\r\n if (shouldSkip) {\r\n return [2 /*return*/, {\r\n valid: !errors.length,\r\n errors: errors\r\n }];\r\n }\r\n rules = Object.keys(field.rules).filter(function (rule) { return !RuleContainer.isRequireRule(rule); });\r\n length = rules.length;\r\n i = 0;\r\n _d.label = 2;\r\n case 2:\r\n if (!(i < length)) return [3 /*break*/, 5];\r\n if (isInitial && RuleContainer.isLazy(rules[i])) {\r\n return [3 /*break*/, 4];\r\n }\r\n rule = rules[i];\r\n return [4 /*yield*/, _test(field, value, {\r\n name: rule,\r\n params: field.rules[rule]\r\n })];\r\n case 3:\r\n result = _d.sent();\r\n if (!result.valid && result.error) {\r\n errors.push(result.error);\r\n if (field.bails) {\r\n return [2 /*return*/, {\r\n valid: false,\r\n errors: errors\r\n }];\r\n }\r\n }\r\n _d.label = 4;\r\n case 4:\r\n i++;\r\n return [3 /*break*/, 2];\r\n case 5: return [2 /*return*/, {\r\n valid: !errors.length,\r\n errors: errors\r\n }];\r\n }\r\n });\r\n });\r\n}\r\nfunction _shouldSkip(field, value) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var requireRules, length, errors, isEmpty, isEmptyAndOptional, isRequired, i, rule, result;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n requireRules = Object.keys(field.rules).filter(RuleContainer.isRequireRule);\r\n length = requireRules.length;\r\n errors = [];\r\n isEmpty = isNullOrUndefined(value) || value === '' || isEmptyArray(value);\r\n isEmptyAndOptional = isEmpty && field.skipIfEmpty;\r\n isRequired = false;\r\n i = 0;\r\n _a.label = 1;\r\n case 1:\r\n if (!(i < length)) return [3 /*break*/, 4];\r\n rule = requireRules[i];\r\n return [4 /*yield*/, _test(field, value, {\r\n name: rule,\r\n params: field.rules[rule]\r\n })];\r\n case 2:\r\n result = _a.sent();\r\n if (!isObject(result)) {\r\n throw new Error('Require rules has to return an object (see docs)');\r\n }\r\n if (result.required) {\r\n isRequired = true;\r\n }\r\n if (!result.valid && result.error) {\r\n errors.push(result.error);\r\n // Exit early as the field is required and failed validation.\r\n if (field.bails) {\r\n return [2 /*return*/, {\r\n shouldSkip: true,\r\n errors: errors\r\n }];\r\n }\r\n }\r\n _a.label = 3;\r\n case 3:\r\n i++;\r\n return [3 /*break*/, 1];\r\n case 4:\r\n if (isEmpty && !isRequired && !field.skipIfEmpty) {\r\n return [2 /*return*/, {\r\n shouldSkip: false,\r\n errors: errors\r\n }];\r\n }\r\n // field is configured to run through the pipeline regardless\r\n if (!field.bails && !isEmptyAndOptional) {\r\n return [2 /*return*/, {\r\n shouldSkip: false,\r\n errors: errors\r\n }];\r\n }\r\n // skip if the field is not required and has an empty value.\r\n return [2 /*return*/, {\r\n shouldSkip: !isRequired && isEmpty,\r\n errors: errors\r\n }];\r\n }\r\n });\r\n });\r\n}\r\n/**\r\n * Tests a single input value against a rule.\r\n */\r\nfunction _test(field, value, rule) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var ruleSchema, normalizedValue, params, result, values_1;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n ruleSchema = RuleContainer.getRuleDefinition(rule.name);\r\n if (!ruleSchema || !ruleSchema.validate) {\r\n throw new Error(\"No such validator '\" + rule.name + \"' exists.\");\r\n }\r\n normalizedValue = ruleSchema.castValue ? ruleSchema.castValue(value) : value;\r\n params = fillTargetValues(rule.params, field.crossTable);\r\n return [4 /*yield*/, ruleSchema.validate(normalizedValue, params)];\r\n case 1:\r\n result = _a.sent();\r\n if (typeof result === 'string') {\r\n values_1 = __assign(__assign({}, (params || {})), { _field_: field.name, _value_: value, _rule_: rule.name });\r\n return [2 /*return*/, {\r\n valid: false,\r\n error: { rule: rule.name, msg: function () { return interpolate(result, values_1); } }\r\n }];\r\n }\r\n if (!isObject(result)) {\r\n result = { valid: result };\r\n }\r\n return [2 /*return*/, {\r\n valid: result.valid,\r\n required: result.required,\r\n error: result.valid ? undefined : _generateFieldError(field, value, ruleSchema, rule.name, params)\r\n }];\r\n }\r\n });\r\n });\r\n}\r\n/**\r\n * Generates error messages.\r\n */\r\nfunction _generateFieldError(field, value, ruleSchema, ruleName, params) {\r\n var _a;\r\n var message = (_a = field.customMessages[ruleName]) !== null && _a !== void 0 ? _a : ruleSchema.message;\r\n var ruleTargets = _getRuleTargets(field, ruleSchema, ruleName);\r\n var _b = _getUserTargets(field, ruleSchema, ruleName, message), userTargets = _b.userTargets, userMessage = _b.userMessage;\r\n var values = __assign(__assign(__assign(__assign({}, (params || {})), { _field_: field.name, _value_: value, _rule_: ruleName }), ruleTargets), userTargets);\r\n return {\r\n msg: function () { return _normalizeMessage(userMessage || getConfig().defaultMessage, field.name, values); },\r\n rule: ruleName\r\n };\r\n}\r\nfunction _getRuleTargets(field, ruleSchema, ruleName) {\r\n var params = ruleSchema.params;\r\n if (!params) {\r\n return {};\r\n }\r\n var numTargets = params.filter(function (param) { return param.isTarget; }).length;\r\n if (numTargets <= 0) {\r\n return {};\r\n }\r\n var names = {};\r\n var ruleConfig = field.rules[ruleName];\r\n if (!Array.isArray(ruleConfig) && isObject(ruleConfig)) {\r\n ruleConfig = params.map(function (param) {\r\n return ruleConfig[param.name];\r\n });\r\n }\r\n for (var index = 0; index < params.length; index++) {\r\n var param = params[index];\r\n var key = ruleConfig[index];\r\n if (!isLocator(key)) {\r\n continue;\r\n }\r\n key = key.__locatorRef;\r\n var name_1 = field.names[key] || key;\r\n names[param.name] = name_1;\r\n names[\"_\" + param.name + \"_\"] = field.crossTable[key];\r\n }\r\n return names;\r\n}\r\nfunction _getUserTargets(field, ruleSchema, ruleName, userMessage) {\r\n var userTargets = {};\r\n var rules = field.rules[ruleName];\r\n var params = ruleSchema.params || [];\r\n // early return if no rules\r\n if (!rules) {\r\n return {};\r\n }\r\n // check all rules to convert targets\r\n Object.keys(rules).forEach(function (key, index) {\r\n // get the rule\r\n var rule = rules[key];\r\n if (!isLocator(rule)) {\r\n return {};\r\n }\r\n // get associated parameter\r\n var param = params[index];\r\n if (!param) {\r\n return {};\r\n }\r\n // grab the name of the target\r\n var name = rule.__locatorRef;\r\n userTargets[param.name] = field.names[name] || name;\r\n userTargets[\"_\" + param.name + \"_\"] = field.crossTable[name];\r\n });\r\n return {\r\n userTargets: userTargets,\r\n userMessage: userMessage\r\n };\r\n}\r\nfunction _normalizeMessage(template, field, values) {\r\n if (typeof template === 'function') {\r\n return template(field, values);\r\n }\r\n return interpolate(template, __assign(__assign({}, values), { _field_: field }));\r\n}\r\nfunction fillTargetValues(params, crossTable) {\r\n if (Array.isArray(params)) {\r\n return params.map(function (param) {\r\n var targetPart = typeof param === 'string' && param[0] === '@' ? param.slice(1) : param;\r\n if (targetPart in crossTable) {\r\n return crossTable[targetPart];\r\n }\r\n return param;\r\n });\r\n }\r\n var values = {};\r\n var normalize = function (value) {\r\n if (isLocator(value)) {\r\n return value(crossTable);\r\n }\r\n return value;\r\n };\r\n Object.keys(params).forEach(function (param) {\r\n values[param] = normalize(params[param]);\r\n });\r\n return values;\r\n}\n\nvar aggressive = function () { return ({\r\n on: ['input', 'blur']\r\n}); };\r\nvar lazy = function () { return ({\r\n on: ['change', 'blur']\r\n}); };\r\nvar eager = function (_a) {\r\n var errors = _a.errors;\r\n if (errors.length) {\r\n return {\r\n on: ['input', 'change']\r\n };\r\n }\r\n return {\r\n on: ['change', 'blur']\r\n };\r\n};\r\nvar passive = function () { return ({\r\n on: []\r\n}); };\r\nvar modes = {\r\n aggressive: aggressive,\r\n eager: eager,\r\n passive: passive,\r\n lazy: lazy\r\n};\r\nvar setInteractionMode = function (mode, implementation) {\r\n setConfig({ mode: mode });\r\n if (!implementation) {\r\n return;\r\n }\r\n if (!isCallable(implementation)) {\r\n throw new Error('A mode implementation must be a function');\r\n }\r\n modes[mode] = implementation;\r\n};\n\nvar EVENT_BUS = new vue__WEBPACK_IMPORTED_MODULE_0__.default();\r\nfunction localeChanged() {\r\n EVENT_BUS.$emit('change:locale');\r\n}\n\nvar Dictionary = /** @class */ (function () {\r\n function Dictionary(locale, dictionary) {\r\n this.container = {};\r\n this.locale = locale;\r\n this.merge(dictionary);\r\n }\r\n Dictionary.prototype.resolve = function (field, rule, values) {\r\n return this.format(this.locale, field, rule, values);\r\n };\r\n Dictionary.prototype.format = function (locale, field, rule, values) {\r\n var _a, _b, _c, _d, _e, _f, _g, _h;\r\n var message;\r\n // find if specific message for that field was specified.\r\n var fieldContainer = (_c = (_b = (_a = this.container[locale]) === null || _a === void 0 ? void 0 : _a.fields) === null || _b === void 0 ? void 0 : _b[field]) === null || _c === void 0 ? void 0 : _c[rule];\r\n var messageContainer = (_e = (_d = this.container[locale]) === null || _d === void 0 ? void 0 : _d.messages) === null || _e === void 0 ? void 0 : _e[rule];\r\n message = fieldContainer || messageContainer || '';\r\n if (!message) {\r\n message = '{_field_} is not valid';\r\n }\r\n field = (_h = (_g = (_f = this.container[locale]) === null || _f === void 0 ? void 0 : _f.names) === null || _g === void 0 ? void 0 : _g[field]) !== null && _h !== void 0 ? _h : field;\r\n return isCallable(message) ? message(field, values) : interpolate(message, __assign(__assign({}, values), { _field_: field }));\r\n };\r\n Dictionary.prototype.merge = function (dictionary) {\r\n merge(this.container, dictionary);\r\n };\r\n Dictionary.prototype.hasRule = function (name) {\r\n var _a, _b;\r\n return !!((_b = (_a = this.container[this.locale]) === null || _a === void 0 ? void 0 : _a.messages) === null || _b === void 0 ? void 0 : _b[name]);\r\n };\r\n return Dictionary;\r\n}());\r\nvar DICTIONARY;\r\nfunction localize(locale, dictionary) {\r\n var _a;\r\n if (!DICTIONARY) {\r\n DICTIONARY = new Dictionary('en', {});\r\n setConfig({\r\n defaultMessage: function (field, values) {\r\n return DICTIONARY.resolve(field, values === null || values === void 0 ? void 0 : values._rule_, values || {});\r\n }\r\n });\r\n }\r\n if (typeof locale === 'string') {\r\n DICTIONARY.locale = locale;\r\n if (dictionary) {\r\n DICTIONARY.merge((_a = {}, _a[locale] = dictionary, _a));\r\n }\r\n localeChanged();\r\n return;\r\n }\r\n DICTIONARY.merge(locale);\r\n}\n\nvar isEvent = function (evt) {\r\n if (!evt) {\r\n return false;\r\n }\r\n if (typeof Event !== 'undefined' && isCallable(Event) && evt instanceof Event) {\r\n return true;\r\n }\r\n // this is for IE\r\n /* istanbul ignore next */\r\n if (evt && evt.srcElement) {\r\n return true;\r\n }\r\n return false;\r\n};\r\nfunction normalizeEventValue(value) {\r\n var _a, _b;\r\n if (!isEvent(value)) {\r\n return value;\r\n }\r\n var input = value.target;\r\n if (input.type === 'file' && input.files) {\r\n return toArray(input.files);\r\n }\r\n // If the input has a `v-model.number` modifier applied.\r\n if ((_a = input._vModifiers) === null || _a === void 0 ? void 0 : _a.number) {\r\n // as per the spec the v-model.number uses parseFloat\r\n var valueAsNumber = parseFloat(input.value);\r\n if (isNaN(valueAsNumber)) {\r\n return input.value;\r\n }\r\n return valueAsNumber;\r\n }\r\n if ((_b = input._vModifiers) === null || _b === void 0 ? void 0 : _b.trim) {\r\n var trimmedValue = typeof input.value === 'string' ? input.value.trim() : input.value;\r\n return trimmedValue;\r\n }\r\n return input.value;\r\n}\n\nvar isTextInput = function (vnode) {\r\n var _a;\r\n var attrs = ((_a = vnode.data) === null || _a === void 0 ? void 0 : _a.attrs) || vnode.elm;\r\n // it will fallback to being a text input per browsers spec.\r\n if (vnode.tag === 'input' && (!attrs || !attrs.type)) {\r\n return true;\r\n }\r\n if (vnode.tag === 'textarea') {\r\n return true;\r\n }\r\n return includes(['text', 'password', 'search', 'email', 'tel', 'url', 'number'], attrs === null || attrs === void 0 ? void 0 : attrs.type);\r\n};\r\n// export const isCheckboxOrRadioInput = (vnode: VNode): boolean => {\r\n// const attrs = (vnode.data && vnode.data.attrs) || vnode.elm;\r\n// return includes(['radio', 'checkbox'], attrs && attrs.type);\r\n// };\r\n// Gets the model object on the vnode.\r\nfunction findModel(vnode) {\r\n if (!vnode.data) {\r\n return undefined;\r\n }\r\n // Component Model\r\n // THIS IS NOT TYPED IN OFFICIAL VUE TYPINGS\r\n // eslint-disable-next-line\r\n var nonStandardVNodeData = vnode.data;\r\n if ('model' in nonStandardVNodeData) {\r\n return nonStandardVNodeData.model;\r\n }\r\n if (!vnode.data.directives) {\r\n return undefined;\r\n }\r\n return find(vnode.data.directives, function (d) { return d.name === 'model'; });\r\n}\r\nfunction findValue(vnode) {\r\n var _a, _b;\r\n var model = findModel(vnode);\r\n if (model) {\r\n return { value: model.value };\r\n }\r\n var config = findModelConfig(vnode);\r\n var prop = (config === null || config === void 0 ? void 0 : config.prop) || 'value';\r\n if (((_a = vnode.componentOptions) === null || _a === void 0 ? void 0 : _a.propsData) && prop in vnode.componentOptions.propsData) {\r\n var propsDataWithValue = vnode.componentOptions.propsData;\r\n return { value: propsDataWithValue[prop] };\r\n }\r\n if (((_b = vnode.data) === null || _b === void 0 ? void 0 : _b.domProps) && 'value' in vnode.data.domProps) {\r\n return { value: vnode.data.domProps.value };\r\n }\r\n return undefined;\r\n}\r\nfunction extractChildren(vnode) {\r\n if (Array.isArray(vnode)) {\r\n return vnode;\r\n }\r\n if (Array.isArray(vnode.children)) {\r\n return vnode.children;\r\n }\r\n /* istanbul ignore next */\r\n if (vnode.componentOptions && Array.isArray(vnode.componentOptions.children)) {\r\n return vnode.componentOptions.children;\r\n }\r\n return [];\r\n}\r\nfunction findInputNodes(vnode) {\r\n if (!Array.isArray(vnode) && findValue(vnode) !== undefined) {\r\n return [vnode];\r\n }\r\n var children = extractChildren(vnode);\r\n return children.reduce(function (nodes, node) {\r\n var candidates = findInputNodes(node);\r\n if (candidates.length) {\r\n nodes.push.apply(nodes, candidates);\r\n }\r\n return nodes;\r\n }, []);\r\n}\r\n// Resolves v-model config if exists.\r\nfunction findModelConfig(vnode) {\r\n /* istanbul ignore next */\r\n if (!vnode.componentOptions)\r\n return null;\r\n // This is also not typed in the standard Vue TS.\r\n return vnode.componentOptions.Ctor.options.model;\r\n}\r\n// Adds a listener to vnode listener object.\r\nfunction mergeVNodeListeners(obj, eventName, handler) {\r\n // no listener at all.\r\n if (isNullOrUndefined(obj[eventName])) {\r\n obj[eventName] = [handler];\r\n return;\r\n }\r\n // Is an invoker.\r\n if (isCallable(obj[eventName]) && obj[eventName].fns) {\r\n var invoker = obj[eventName];\r\n invoker.fns = Array.isArray(invoker.fns) ? invoker.fns : [invoker.fns];\r\n if (!includes(invoker.fns, handler)) {\r\n invoker.fns.push(handler);\r\n }\r\n return;\r\n }\r\n if (isCallable(obj[eventName])) {\r\n var prev = obj[eventName];\r\n obj[eventName] = [prev];\r\n }\r\n if (Array.isArray(obj[eventName]) && !includes(obj[eventName], handler)) {\r\n obj[eventName].push(handler);\r\n }\r\n}\r\n// Adds a listener to a native HTML vnode.\r\nfunction addNativeNodeListener(node, eventName, handler) {\r\n /* istanbul ignore next */\r\n if (!node.data) {\r\n node.data = {};\r\n }\r\n if (isNullOrUndefined(node.data.on)) {\r\n node.data.on = {};\r\n }\r\n mergeVNodeListeners(node.data.on, eventName, handler);\r\n}\r\n// Adds a listener to a Vue component vnode.\r\nfunction addComponentNodeListener(node, eventName, handler) {\r\n /* istanbul ignore next */\r\n if (!node.componentOptions) {\r\n return;\r\n }\r\n /* istanbul ignore next */\r\n if (!node.componentOptions.listeners) {\r\n node.componentOptions.listeners = {};\r\n }\r\n mergeVNodeListeners(node.componentOptions.listeners, eventName, handler);\r\n}\r\nfunction addVNodeListener(vnode, eventName, handler) {\r\n if (vnode.componentOptions) {\r\n addComponentNodeListener(vnode, eventName, handler);\r\n return;\r\n }\r\n addNativeNodeListener(vnode, eventName, handler);\r\n}\r\n// Determines if `change` should be used over `input` for listeners.\r\nfunction getInputEventName(vnode, model) {\r\n var _a;\r\n // Is a component.\r\n if (vnode.componentOptions) {\r\n var event_1 = (findModelConfig(vnode) || { event: 'input' }).event;\r\n return event_1;\r\n }\r\n // Lazy Models typically use change event\r\n if ((_a = model === null || model === void 0 ? void 0 : model.modifiers) === null || _a === void 0 ? void 0 : _a.lazy) {\r\n return 'change';\r\n }\r\n // is a textual-type input.\r\n if (isTextInput(vnode)) {\r\n return 'input';\r\n }\r\n return 'change';\r\n}\r\nfunction isHTMLNode(node) {\r\n return includes(['input', 'select', 'textarea'], node.tag);\r\n}\r\n// TODO: Type this one properly.\r\nfunction normalizeSlots(slots, ctx) {\r\n var acc = [];\r\n return Object.keys(slots).reduce(function (arr, key) {\r\n slots[key].forEach(function (vnode) {\r\n if (!vnode.context) {\r\n slots[key].context = ctx;\r\n if (!vnode.data) {\r\n vnode.data = {};\r\n }\r\n vnode.data.slot = key;\r\n }\r\n });\r\n return arr.concat(slots[key]);\r\n }, acc);\r\n}\r\nfunction resolveTextualRules(vnode) {\r\n var _a;\r\n var attrs = (_a = vnode.data) === null || _a === void 0 ? void 0 : _a.attrs;\r\n var rules = {};\r\n if (!attrs)\r\n return rules;\r\n if (attrs.type === 'email' && RuleContainer.getRuleDefinition('email')) {\r\n rules.email = ['multiple' in attrs];\r\n }\r\n if (attrs.pattern && RuleContainer.getRuleDefinition('regex')) {\r\n rules.regex = attrs.pattern;\r\n }\r\n if (attrs.maxlength >= 0 && RuleContainer.getRuleDefinition('max')) {\r\n rules.max = attrs.maxlength;\r\n }\r\n if (attrs.minlength >= 0 && RuleContainer.getRuleDefinition('min')) {\r\n rules.min = attrs.minlength;\r\n }\r\n if (attrs.type === 'number') {\r\n if (isSpecified(attrs.min) && RuleContainer.getRuleDefinition('min_value')) {\r\n rules.min_value = Number(attrs.min);\r\n }\r\n if (isSpecified(attrs.max) && RuleContainer.getRuleDefinition('max_value')) {\r\n rules.max_value = Number(attrs.max);\r\n }\r\n }\r\n return rules;\r\n}\r\nfunction resolveRules(vnode) {\r\n var _a;\r\n var htmlTags = ['input', 'select', 'textarea'];\r\n var attrs = (_a = vnode.data) === null || _a === void 0 ? void 0 : _a.attrs;\r\n if (!includes(htmlTags, vnode.tag) || !attrs) {\r\n return {};\r\n }\r\n var rules = {};\r\n if ('required' in attrs && attrs.required !== false && RuleContainer.getRuleDefinition('required')) {\r\n rules.required = attrs.type === 'checkbox' ? [true] : true;\r\n }\r\n if (isTextInput(vnode)) {\r\n return normalizeRules(__assign(__assign({}, rules), resolveTextualRules(vnode)));\r\n }\r\n return normalizeRules(rules);\r\n}\r\nfunction normalizeChildren(context, slotProps) {\r\n if (context.$scopedSlots.default) {\r\n return context.$scopedSlots.default(slotProps) || [];\r\n }\r\n return context.$slots.default || [];\r\n}\n\n/**\r\n * Determines if a provider needs to run validation.\r\n */\r\nfunction shouldValidate(ctx, value) {\r\n // when an immediate/initial validation is needed and wasn't done before.\r\n if (!ctx._ignoreImmediate && ctx.immediate) {\r\n return true;\r\n }\r\n // when the value changes for whatever reason.\r\n if (!isRefEqual(ctx.value, value) && ctx.normalizedEvents.length) {\r\n return true;\r\n }\r\n // when it needs validation due to props/cross-fields changes.\r\n if (ctx._needsValidation) {\r\n return true;\r\n }\r\n // when the initial value is undefined and the field wasn't rendered yet.\r\n if (!ctx.initialized && value === undefined) {\r\n return true;\r\n }\r\n return false;\r\n}\r\nfunction createValidationCtx(ctx) {\r\n return __assign(__assign({}, ctx.flags), { errors: ctx.errors, classes: ctx.classes, failedRules: ctx.failedRules, reset: function () { return ctx.reset(); }, validate: function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n return ctx.validate.apply(ctx, args);\r\n }, ariaInput: {\r\n 'aria-invalid': ctx.flags.invalid ? 'true' : 'false',\r\n 'aria-required': ctx.isRequired ? 'true' : 'false',\r\n 'aria-errormessage': \"vee_\" + ctx.id\r\n }, ariaMsg: {\r\n id: \"vee_\" + ctx.id,\r\n 'aria-live': ctx.errors.length ? 'assertive' : 'off'\r\n } });\r\n}\r\nfunction onRenderUpdate(vm, value) {\r\n if (!vm.initialized) {\r\n vm.initialValue = value;\r\n }\r\n var validateNow = shouldValidate(vm, value);\r\n vm._needsValidation = false;\r\n vm.value = value;\r\n vm._ignoreImmediate = true;\r\n if (!validateNow) {\r\n return;\r\n }\r\n var validate = function () {\r\n if (vm.immediate || vm.flags.validated) {\r\n return triggerThreadSafeValidation(vm);\r\n }\r\n vm.validateSilent();\r\n };\r\n if (vm.initialized) {\r\n validate();\r\n return;\r\n }\r\n vm.$once('hook:mounted', function () { return validate(); });\r\n}\r\nfunction computeModeSetting(ctx) {\r\n var compute = (isCallable(ctx.mode) ? ctx.mode : modes[ctx.mode]);\r\n return compute(ctx);\r\n}\r\nfunction triggerThreadSafeValidation(vm) {\r\n var pendingPromise = vm.validateSilent();\r\n // avoids race conditions between successive validations.\r\n vm._pendingValidation = pendingPromise;\r\n return pendingPromise.then(function (result) {\r\n if (pendingPromise === vm._pendingValidation) {\r\n vm.applyResult(result);\r\n vm._pendingValidation = undefined;\r\n }\r\n return result;\r\n });\r\n}\r\n// Creates the common handlers for a validatable context.\r\nfunction createCommonHandlers(vm) {\r\n if (!vm.$veeOnInput) {\r\n vm.$veeOnInput = function (e) {\r\n vm.syncValue(e); // track and keep the value updated.\r\n vm.setFlags({ dirty: true, pristine: false });\r\n };\r\n }\r\n var onInput = vm.$veeOnInput;\r\n if (!vm.$veeOnBlur) {\r\n vm.$veeOnBlur = function () {\r\n vm.setFlags({ touched: true, untouched: false });\r\n };\r\n }\r\n // Blur event listener.\r\n var onBlur = vm.$veeOnBlur;\r\n var onValidate = vm.$veeHandler;\r\n var mode = computeModeSetting(vm);\r\n // Handle debounce changes.\r\n if (!onValidate || vm.$veeDebounce !== vm.debounce) {\r\n onValidate = debounce(function () {\r\n vm.$nextTick(function () {\r\n if (!vm._pendingReset) {\r\n triggerThreadSafeValidation(vm);\r\n }\r\n vm._pendingReset = false;\r\n });\r\n }, mode.debounce || vm.debounce);\r\n // Cache the handler so we don't create it each time.\r\n vm.$veeHandler = onValidate;\r\n // cache the debounce value so we detect if it was changed.\r\n vm.$veeDebounce = vm.debounce;\r\n }\r\n return { onInput: onInput, onBlur: onBlur, onValidate: onValidate };\r\n}\r\n// Adds all plugin listeners to the vnode.\r\nfunction addListeners(vm, node) {\r\n var value = findValue(node);\r\n // cache the input eventName.\r\n vm._inputEventName = vm._inputEventName || getInputEventName(node, findModel(node));\r\n onRenderUpdate(vm, value === null || value === void 0 ? void 0 : value.value);\r\n var _a = createCommonHandlers(vm), onInput = _a.onInput, onBlur = _a.onBlur, onValidate = _a.onValidate;\r\n addVNodeListener(node, vm._inputEventName, onInput);\r\n addVNodeListener(node, 'blur', onBlur);\r\n // add the validation listeners.\r\n vm.normalizedEvents.forEach(function (evt) {\r\n addVNodeListener(node, evt, onValidate);\r\n });\r\n vm.initialized = true;\r\n}\n\nvar PROVIDER_COUNTER = 0;\r\nfunction data() {\r\n var errors = [];\r\n var fieldName = '';\r\n var defaultValues = {\r\n errors: errors,\r\n value: undefined,\r\n initialized: false,\r\n initialValue: undefined,\r\n flags: createFlags(),\r\n failedRules: {},\r\n isActive: true,\r\n fieldName: fieldName,\r\n id: ''\r\n };\r\n return defaultValues;\r\n}\r\nvar ValidationProvider = vue__WEBPACK_IMPORTED_MODULE_0__.default.extend({\r\n inject: {\r\n $_veeObserver: {\r\n from: '$_veeObserver',\r\n default: function () {\r\n if (!this.$vnode.context.$_veeObserver) {\r\n this.$vnode.context.$_veeObserver = createObserver();\r\n }\r\n return this.$vnode.context.$_veeObserver;\r\n }\r\n }\r\n },\r\n props: {\r\n vid: {\r\n type: String,\r\n default: ''\r\n },\r\n name: {\r\n type: String,\r\n default: null\r\n },\r\n mode: {\r\n type: [String, Function],\r\n default: function () {\r\n return getConfig().mode;\r\n }\r\n },\r\n rules: {\r\n type: [Object, String],\r\n default: null\r\n },\r\n immediate: {\r\n type: Boolean,\r\n default: false\r\n },\r\n bails: {\r\n type: Boolean,\r\n default: function () { return getConfig().bails; }\r\n },\r\n skipIfEmpty: {\r\n type: Boolean,\r\n default: function () { return getConfig().skipOptional; }\r\n },\r\n debounce: {\r\n type: Number,\r\n default: 0\r\n },\r\n tag: {\r\n type: String,\r\n default: 'span'\r\n },\r\n slim: {\r\n type: Boolean,\r\n default: false\r\n },\r\n disabled: {\r\n type: Boolean,\r\n default: false\r\n },\r\n customMessages: {\r\n type: Object,\r\n default: function () {\r\n return {};\r\n }\r\n },\r\n detectInput: {\r\n type: Boolean,\r\n default: true\r\n }\r\n },\r\n watch: {\r\n rules: {\r\n deep: true,\r\n handler: function (val, oldVal) {\r\n this._needsValidation = !isEqual(val, oldVal);\r\n }\r\n }\r\n },\r\n data: data,\r\n computed: {\r\n fieldDeps: function () {\r\n var _this = this;\r\n return Object.keys(this.normalizedRules).reduce(function (acc, rule) {\r\n var deps = extractLocators(_this.normalizedRules[rule]).map(function (dep) {\r\n return isLocator(dep) ? dep.__locatorRef : dep.slice(1);\r\n });\r\n acc.push.apply(acc, deps);\r\n deps.forEach(function (depName) {\r\n watchCrossFieldDep(_this, depName);\r\n });\r\n return acc;\r\n }, []);\r\n },\r\n normalizedEvents: function () {\r\n var _this = this;\r\n var on = computeModeSetting(this).on;\r\n return (on || []).map(function (e) {\r\n if (e === 'input') {\r\n return _this._inputEventName;\r\n }\r\n return e;\r\n });\r\n },\r\n isRequired: function () {\r\n var rules = __assign(__assign({}, this._resolvedRules), this.normalizedRules);\r\n var isRequired = Object.keys(rules).some(RuleContainer.isRequireRule);\r\n this.flags.required = !!isRequired;\r\n return isRequired;\r\n },\r\n classes: function () {\r\n var names = getConfig().classes;\r\n return computeClassObj(names, this.flags);\r\n },\r\n normalizedRules: function () {\r\n return normalizeRules(this.rules);\r\n }\r\n },\r\n mounted: function () {\r\n var _this = this;\r\n var onLocaleChanged = function () {\r\n if (!_this.flags.validated) {\r\n return;\r\n }\r\n var regenerateMap = _this._regenerateMap;\r\n if (regenerateMap) {\r\n var errors_1 = [];\r\n var failedRules_1 = {};\r\n Object.keys(regenerateMap).forEach(function (rule) {\r\n var msg = regenerateMap[rule]();\r\n errors_1.push(msg);\r\n failedRules_1[rule] = msg;\r\n });\r\n _this.applyResult({ errors: errors_1, failedRules: failedRules_1, regenerateMap: regenerateMap });\r\n return;\r\n }\r\n _this.validate();\r\n };\r\n EVENT_BUS.$on('change:locale', onLocaleChanged);\r\n this.$on('hook:beforeDestroy', function () {\r\n EVENT_BUS.$off('change:locale', onLocaleChanged);\r\n });\r\n },\r\n render: function (h) {\r\n var _this = this;\r\n this.registerField();\r\n var ctx = createValidationCtx(this);\r\n var children = normalizeChildren(this, ctx);\r\n // Automatic v-model detection\r\n if (this.detectInput) {\r\n var inputs = findInputNodes(children);\r\n if (inputs.length) {\r\n inputs.forEach(function (input, idx) {\r\n var _a, _b, _c, _d, _e, _f;\r\n // If the elements are not checkboxes and there are more input nodes\r\n if (!includes(['checkbox', 'radio'], (_b = (_a = input.data) === null || _a === void 0 ? void 0 : _a.attrs) === null || _b === void 0 ? void 0 : _b.type) && idx > 0) {\r\n return;\r\n }\r\n var resolved = getConfig().useConstraintAttrs ? resolveRules(input) : {};\r\n if (!isEqual(_this._resolvedRules, resolved)) {\r\n _this._needsValidation = true;\r\n }\r\n if (isHTMLNode(input)) {\r\n _this.fieldName = ((_d = (_c = input.data) === null || _c === void 0 ? void 0 : _c.attrs) === null || _d === void 0 ? void 0 : _d.name) || ((_f = (_e = input.data) === null || _e === void 0 ? void 0 : _e.attrs) === null || _f === void 0 ? void 0 : _f.id);\r\n }\r\n _this._resolvedRules = resolved;\r\n addListeners(_this, input);\r\n });\r\n }\r\n }\r\n return this.slim && children.length <= 1 ? children[0] : h(this.tag, children);\r\n },\r\n beforeDestroy: function () {\r\n // cleanup reference.\r\n this.$_veeObserver.unobserve(this.id);\r\n },\r\n activated: function () {\r\n this.isActive = true;\r\n },\r\n deactivated: function () {\r\n this.isActive = false;\r\n },\r\n methods: {\r\n setFlags: function (flags) {\r\n var _this = this;\r\n Object.keys(flags).forEach(function (flag) {\r\n _this.flags[flag] = flags[flag];\r\n });\r\n },\r\n syncValue: function (v) {\r\n var value = normalizeEventValue(v);\r\n this.value = value;\r\n this.flags.changed = this.initialValue !== value;\r\n },\r\n reset: function () {\r\n var _this = this;\r\n this.errors = [];\r\n this.initialValue = this.value;\r\n var flags = createFlags();\r\n flags.required = this.isRequired;\r\n this.setFlags(flags);\r\n this.failedRules = {};\r\n this.validateSilent();\r\n this._pendingValidation = undefined;\r\n this._pendingReset = true;\r\n setTimeout(function () {\r\n _this._pendingReset = false;\r\n }, this.debounce);\r\n },\r\n validate: function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n if (args.length > 0) {\r\n this.syncValue(args[0]);\r\n }\r\n return [2 /*return*/, triggerThreadSafeValidation(this)];\r\n });\r\n });\r\n },\r\n validateSilent: function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var rules, result;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n this.setFlags({ pending: true });\r\n rules = __assign(__assign({}, this._resolvedRules), this.normalizedRules);\r\n Object.defineProperty(rules, '_$$isNormalized', {\r\n value: true,\r\n writable: false,\r\n enumerable: false,\r\n configurable: false\r\n });\r\n return [4 /*yield*/, validate(this.value, rules, __assign(__assign({ name: this.name || this.fieldName }, createLookup(this)), { bails: this.bails, skipIfEmpty: this.skipIfEmpty, isInitial: !this.initialized, customMessages: this.customMessages }))];\r\n case 1:\r\n result = _a.sent();\r\n this.setFlags({\r\n pending: false,\r\n valid: result.valid,\r\n invalid: !result.valid\r\n });\r\n return [2 /*return*/, result];\r\n }\r\n });\r\n });\r\n },\r\n setErrors: function (errors) {\r\n this.applyResult({ errors: errors, failedRules: {} });\r\n },\r\n applyResult: function (_a) {\r\n var errors = _a.errors, failedRules = _a.failedRules, regenerateMap = _a.regenerateMap;\r\n this.errors = errors;\r\n this._regenerateMap = regenerateMap;\r\n this.failedRules = __assign({}, (failedRules || {}));\r\n this.setFlags({\r\n valid: !errors.length,\r\n passed: !errors.length,\r\n invalid: !!errors.length,\r\n failed: !!errors.length,\r\n validated: true,\r\n changed: this.value !== this.initialValue\r\n });\r\n },\r\n registerField: function () {\r\n updateRenderingContextRefs(this);\r\n }\r\n }\r\n});\r\nfunction computeClassObj(names, flags) {\r\n var acc = {};\r\n var keys = Object.keys(flags);\r\n var length = keys.length;\r\n var _loop_1 = function (i) {\r\n var flag = keys[i];\r\n var className = (names && names[flag]) || flag;\r\n var value = flags[flag];\r\n if (isNullOrUndefined(value)) {\r\n return \"continue\";\r\n }\r\n if ((flag === 'valid' || flag === 'invalid') && !flags.validated) {\r\n return \"continue\";\r\n }\r\n if (typeof className === 'string') {\r\n acc[className] = value;\r\n }\r\n else if (Array.isArray(className)) {\r\n className.forEach(function (cls) {\r\n acc[cls] = value;\r\n });\r\n }\r\n };\r\n for (var i = 0; i < length; i++) {\r\n _loop_1(i);\r\n }\r\n return acc;\r\n}\r\nfunction createLookup(vm) {\r\n var providers = vm.$_veeObserver.refs;\r\n var reduced = {\r\n names: {},\r\n values: {}\r\n };\r\n return vm.fieldDeps.reduce(function (acc, depName) {\r\n if (!providers[depName]) {\r\n return acc;\r\n }\r\n acc.values[depName] = providers[depName].value;\r\n acc.names[depName] = providers[depName].name;\r\n return acc;\r\n }, reduced);\r\n}\r\nfunction extractId(vm) {\r\n if (vm.vid) {\r\n return vm.vid;\r\n }\r\n if (vm.name) {\r\n return vm.name;\r\n }\r\n if (vm.id) {\r\n return vm.id;\r\n }\r\n if (vm.fieldName) {\r\n return vm.fieldName;\r\n }\r\n PROVIDER_COUNTER++;\r\n return \"_vee_\" + PROVIDER_COUNTER;\r\n}\r\nfunction updateRenderingContextRefs(vm) {\r\n var providedId = extractId(vm);\r\n var id = vm.id;\r\n // Nothing has changed.\r\n if (!vm.isActive || (id === providedId && vm.$_veeObserver.refs[id])) {\r\n return;\r\n }\r\n // vid was changed.\r\n if (id !== providedId && vm.$_veeObserver.refs[id] === vm) {\r\n vm.$_veeObserver.unobserve(id);\r\n }\r\n vm.id = providedId;\r\n vm.$_veeObserver.observe(vm);\r\n}\r\nfunction createObserver() {\r\n return {\r\n refs: {},\r\n observe: function (vm) {\r\n this.refs[vm.id] = vm;\r\n },\r\n unobserve: function (id) {\r\n delete this.refs[id];\r\n }\r\n };\r\n}\r\nfunction watchCrossFieldDep(ctx, depName, withHooks) {\r\n if (withHooks === void 0) { withHooks = true; }\r\n var providers = ctx.$_veeObserver.refs;\r\n if (!ctx._veeWatchers) {\r\n ctx._veeWatchers = {};\r\n }\r\n if (!providers[depName] && withHooks) {\r\n return ctx.$once('hook:mounted', function () {\r\n watchCrossFieldDep(ctx, depName, false);\r\n });\r\n }\r\n if (!isCallable(ctx._veeWatchers[depName]) && providers[depName]) {\r\n ctx._veeWatchers[depName] = providers[depName].$watch('value', function () {\r\n if (ctx.flags.validated) {\r\n ctx._needsValidation = true;\r\n ctx.validate();\r\n }\r\n });\r\n }\r\n}\n\nvar FLAGS_STRATEGIES = [\r\n ['pristine', 'every'],\r\n ['dirty', 'some'],\r\n ['touched', 'some'],\r\n ['untouched', 'every'],\r\n ['valid', 'every'],\r\n ['invalid', 'some'],\r\n ['pending', 'some'],\r\n ['validated', 'every'],\r\n ['changed', 'some'],\r\n ['passed', 'every'],\r\n ['failed', 'some']\r\n];\r\nvar OBSERVER_COUNTER = 0;\r\nfunction data$1() {\r\n var refs = {};\r\n var errors = {};\r\n var flags = createObserverFlags();\r\n var fields = {};\r\n // FIXME: Not sure of this one can be typed, circular type reference.\r\n var observers = [];\r\n return {\r\n id: '',\r\n refs: refs,\r\n observers: observers,\r\n errors: errors,\r\n flags: flags,\r\n fields: fields\r\n };\r\n}\r\nfunction provideSelf() {\r\n return {\r\n $_veeObserver: this\r\n };\r\n}\r\nvar ValidationObserver = vue__WEBPACK_IMPORTED_MODULE_0__.default.extend({\r\n name: 'ValidationObserver',\r\n provide: provideSelf,\r\n inject: {\r\n $_veeObserver: {\r\n from: '$_veeObserver',\r\n default: function () {\r\n if (!this.$vnode.context.$_veeObserver) {\r\n return null;\r\n }\r\n return this.$vnode.context.$_veeObserver;\r\n }\r\n }\r\n },\r\n props: {\r\n tag: {\r\n type: String,\r\n default: 'span'\r\n },\r\n vid: {\r\n type: String,\r\n default: function () {\r\n return \"obs_\" + OBSERVER_COUNTER++;\r\n }\r\n },\r\n slim: {\r\n type: Boolean,\r\n default: false\r\n },\r\n disabled: {\r\n type: Boolean,\r\n default: false\r\n }\r\n },\r\n data: data$1,\r\n created: function () {\r\n var _this = this;\r\n this.id = this.vid;\r\n register(this);\r\n var onChange = debounce(function (_a) {\r\n var errors = _a.errors, flags = _a.flags, fields = _a.fields;\r\n _this.errors = errors;\r\n _this.flags = flags;\r\n _this.fields = fields;\r\n }, 16);\r\n this.$watch(computeObserverState, onChange);\r\n },\r\n activated: function () {\r\n register(this);\r\n },\r\n deactivated: function () {\r\n unregister(this);\r\n },\r\n beforeDestroy: function () {\r\n unregister(this);\r\n },\r\n render: function (h) {\r\n var children = normalizeChildren(this, prepareSlotProps(this));\r\n return this.slim && children.length <= 1 ? children[0] : h(this.tag, { on: this.$listeners }, children);\r\n },\r\n methods: {\r\n observe: function (subscriber, kind) {\r\n var _a;\r\n if (kind === void 0) { kind = 'provider'; }\r\n if (kind === 'observer') {\r\n this.observers.push(subscriber);\r\n return;\r\n }\r\n this.refs = __assign(__assign({}, this.refs), (_a = {}, _a[subscriber.id] = subscriber, _a));\r\n },\r\n unobserve: function (id, kind) {\r\n if (kind === void 0) { kind = 'provider'; }\r\n if (kind === 'provider') {\r\n var provider = this.refs[id];\r\n if (!provider) {\r\n return;\r\n }\r\n this.$delete(this.refs, id);\r\n return;\r\n }\r\n var idx = findIndex(this.observers, function (o) { return o.id === id; });\r\n if (idx !== -1) {\r\n this.observers.splice(idx, 1);\r\n }\r\n },\r\n validateWithInfo: function (_a) {\r\n var _b = (_a === void 0 ? {} : _a).silent, silent = _b === void 0 ? false : _b;\r\n return __awaiter(this, void 0, void 0, function () {\r\n var results, isValid, _c, errors, flags, fields;\r\n return __generator(this, function (_d) {\r\n switch (_d.label) {\r\n case 0: return [4 /*yield*/, Promise.all(__spreadArrays(values(this.refs)\r\n .filter(function (r) { return !r.disabled; })\r\n .map(function (ref) { return ref[silent ? 'validateSilent' : 'validate']().then(function (r) { return r.valid; }); }), this.observers.filter(function (o) { return !o.disabled; }).map(function (obs) { return obs.validate({ silent: silent }); })))];\r\n case 1:\r\n results = _d.sent();\r\n isValid = results.every(function (r) { return r; });\r\n _c = computeObserverState.call(this), errors = _c.errors, flags = _c.flags, fields = _c.fields;\r\n this.errors = errors;\r\n this.flags = flags;\r\n this.fields = fields;\r\n return [2 /*return*/, {\r\n errors: errors,\r\n flags: flags,\r\n fields: fields,\r\n isValid: isValid\r\n }];\r\n }\r\n });\r\n });\r\n },\r\n validate: function (_a) {\r\n var _b = (_a === void 0 ? {} : _a).silent, silent = _b === void 0 ? false : _b;\r\n return __awaiter(this, void 0, void 0, function () {\r\n var isValid;\r\n return __generator(this, function (_c) {\r\n switch (_c.label) {\r\n case 0: return [4 /*yield*/, this.validateWithInfo({ silent: silent })];\r\n case 1:\r\n isValid = (_c.sent()).isValid;\r\n return [2 /*return*/, isValid];\r\n }\r\n });\r\n });\r\n },\r\n handleSubmit: function (cb) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var isValid;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, this.validate()];\r\n case 1:\r\n isValid = _a.sent();\r\n if (!isValid || !cb) {\r\n return [2 /*return*/];\r\n }\r\n return [2 /*return*/, cb()];\r\n }\r\n });\r\n });\r\n },\r\n reset: function () {\r\n return __spreadArrays(values(this.refs), this.observers).forEach(function (ref) { return ref.reset(); });\r\n },\r\n setErrors: function (errors) {\r\n var _this = this;\r\n Object.keys(errors).forEach(function (key) {\r\n var provider = _this.refs[key];\r\n if (!provider)\r\n return;\r\n var errorArr = errors[key] || [];\r\n errorArr = typeof errorArr === 'string' ? [errorArr] : errorArr;\r\n provider.setErrors(errorArr);\r\n });\r\n this.observers.forEach(function (observer) {\r\n observer.setErrors(errors);\r\n });\r\n }\r\n }\r\n});\r\nfunction unregister(vm) {\r\n if (vm.$_veeObserver) {\r\n vm.$_veeObserver.unobserve(vm.id, 'observer');\r\n }\r\n}\r\nfunction register(vm) {\r\n if (vm.$_veeObserver) {\r\n vm.$_veeObserver.observe(vm, 'observer');\r\n }\r\n}\r\nfunction prepareSlotProps(vm) {\r\n return __assign(__assign({}, vm.flags), { errors: vm.errors, fields: vm.fields, validate: vm.validate, validateWithInfo: vm.validateWithInfo, passes: vm.handleSubmit, handleSubmit: vm.handleSubmit, reset: vm.reset });\r\n}\r\n// Creates a modified version of validation flags\r\nfunction createObserverFlags() {\r\n return __assign(__assign({}, createFlags()), { valid: true, invalid: false });\r\n}\r\nfunction computeObserverState() {\r\n var vms = __spreadArrays(values(this.refs), this.observers.filter(function (o) { return !o.disabled; }));\r\n var errors = {};\r\n var flags = createObserverFlags();\r\n var fields = {};\r\n var length = vms.length;\r\n for (var i = 0; i < length; i++) {\r\n var vm = vms[i];\r\n // validation provider\r\n if (Array.isArray(vm.errors)) {\r\n errors[vm.id] = vm.errors;\r\n fields[vm.id] = __assign({ id: vm.id, name: vm.name, failedRules: vm.failedRules }, vm.flags);\r\n continue;\r\n }\r\n // Nested observer, merge errors and fields\r\n errors = __assign(__assign({}, errors), vm.errors);\r\n fields = __assign(__assign({}, fields), vm.fields);\r\n }\r\n FLAGS_STRATEGIES.forEach(function (_a) {\r\n var flag = _a[0], method = _a[1];\r\n flags[flag] = vms[method](function (vm) { return vm.flags[flag]; });\r\n });\r\n return { errors: errors, flags: flags, fields: fields };\r\n}\n\nfunction withValidation(component, mapProps) {\r\n var _a;\r\n if (mapProps === void 0) { mapProps = identity; }\r\n var options = 'options' in component ? component.options : component;\r\n var providerOpts = ValidationProvider.options;\r\n var hoc = {\r\n name: (options.name || 'AnonymousHoc') + \"WithValidation\",\r\n props: __assign({}, providerOpts.props),\r\n data: providerOpts.data,\r\n computed: __assign({}, providerOpts.computed),\r\n methods: __assign({}, providerOpts.methods),\r\n beforeDestroy: providerOpts.beforeDestroy,\r\n inject: providerOpts.inject\r\n };\r\n var eventName = ((_a = options === null || options === void 0 ? void 0 : options.model) === null || _a === void 0 ? void 0 : _a.event) || 'input';\r\n hoc.render = function (h) {\r\n var _a;\r\n this.registerField();\r\n var vctx = createValidationCtx(this);\r\n var listeners = __assign({}, this.$listeners);\r\n var model = findModel(this.$vnode);\r\n this._inputEventName = this._inputEventName || getInputEventName(this.$vnode, model);\r\n var value = findValue(this.$vnode);\r\n onRenderUpdate(this, value === null || value === void 0 ? void 0 : value.value);\r\n var _b = createCommonHandlers(this), onInput = _b.onInput, onBlur = _b.onBlur, onValidate = _b.onValidate;\r\n mergeVNodeListeners(listeners, eventName, onInput);\r\n mergeVNodeListeners(listeners, 'blur', onBlur);\r\n this.normalizedEvents.forEach(function (evt) {\r\n mergeVNodeListeners(listeners, evt, onValidate);\r\n });\r\n // Props are any attrs not associated with ValidationProvider Plus the model prop.\r\n // WARNING: Accidental prop overwrite will probably happen.\r\n var prop = (findModelConfig(this.$vnode) || { prop: 'value' }).prop;\r\n var props = __assign(__assign(__assign({}, this.$attrs), (_a = {}, _a[prop] = model === null || model === void 0 ? void 0 : model.value, _a)), mapProps(vctx));\r\n return h(options, {\r\n attrs: this.$attrs,\r\n props: props,\r\n on: listeners,\r\n scopedSlots: this.$scopedSlots\r\n }, normalizeSlots(this.$slots, this.$vnode.context));\r\n };\r\n return hoc;\r\n}\n\nvar version = '3.4.5';\n\n\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9AbHV4L2xhcmF2ZWwtc3RhcnRlci8uL25vZGVfbW9kdWxlcy92ZWUtdmFsaWRhdGUvZGlzdC92ZWUtdmFsaWRhdGUuZXNtLmpzPzdiYjEiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7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sIHZdKTsgfTsgfVxyXG4gICAgZnVuY3Rpb24gc3RlcChvcCkge1xyXG4gICAgICAgIGlmIChmKSB0aHJvdyBuZXcgVHlwZUVycm9yKFwiR2VuZXJhdG9yIGlzIGFscmVhZHkgZXhlY3V0aW5nLlwiKTtcclxuICAgICAgICB3aGlsZSAoXykgdHJ5IHtcclxuICAgICAgICAgICAgaWYgKGYgPSAxLCB5ICYmICh0ID0gb3BbMF0gJiAyID8geVtcInJldHVyblwiXSA6IG9wWzBdID8geVtcInRocm93XCJdIHx8ICgodCA9IHlbXCJyZXR1cm5cIl0pICYmIHQuY2FsbCh5KSwgMCkgOiB5Lm5leHQpICYmICEodCA9IHQuY2FsbCh5LCBvcFsxXSkpLmRvbmUpIHJldHVybiB0O1xyXG4gICAgICAgICAgICBpZiAoeSA9IDAsIHQpIG9wID0gW29wWzBdICYgMiwgdC52YWx1ZV07XHJcbiAgICAgICAgICAgIHN3aXRjaCAob3BbMF0pIHtcclxuICAgICAgICAgICAgICAgIGNhc2UgMDogY2FzZSAxOiB0ID0gb3A7IGJyZWFrO1xyXG4gICAgICAgICAgICAgICAgY2FzZSA0OiBfLmxhYmVsKys7IHJldHVybiB7IHZhbHVlOiBvcFsxXSwgZG9uZTogZmFsc2UgfTtcclxuICAgICAgICAgICAgICAgIGNhc2UgNTogXy5sYWJlbCsrOyB5ID0gb3BbMV07IG9wID0gWzBdOyBjb250aW51ZTtcclxuICAgICAgICAgICAgICAgIGNhc2UgNzogb3AgPSBfLm9wcy5wb3AoKTsgXy50cnlzLnBvcCgpOyBjb250aW51ZTtcclxuICAgICAgICAgICAgICAgIGRlZmF1bHQ6XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCEodCA9IF8udHJ5cywgdCA9IHQubGVuZ3RoID4gMCAmJiB0W3QubGVuZ3RoIC0gMV0pICYmIChvcFswXSA9PT0gNiB8fCBvcFswXSA9PT0gMikpIHsgXyA9IDA7IGNvbnRpbnVlOyB9XHJcbiAgICAgICAgICAgIC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CA9IGEubGVuZ3RoOyBqIDwgamw7IGorKywgaysrKVxyXG4gICAgICAgICAgICByW2tdID0gYVtqXTtcclxuICAgIHJldHVybiByO1xyXG59XG5cbmZ1bmN0aW9uIGlzTmFOKHZhbHVlKSB7XHJcbiAgICAvLyBOYU4gaXMgdGhlIG9uZSB2YWx1ZSB0aGF0IGRvZXMgbm90IGVxdWFsIGl0c2VsZi5cclxuICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZVxyXG4gICAgcmV0dXJuIHZhbHVlICE9PSB2YWx1ZTtcclxufVxyXG5mdW5jdGlvbiBpc051bGxPclVuZGVmaW5lZCh2YWx1ZSkge1xyXG4gICAgcmV0dXJuIHZhbHVlID09PSBudWxsIHx8IHZhbHVlID09PSB1bmRlZmluZWQ7XHJcbn1cclxuZnVuY3Rpb24gaXNFbXB0eUFycmF5KGFycikge1xyXG4gICAgcmV0dXJuIEFycmF5LmlzQXJyYXkoYXJyKSAmJiBhcnIubGVuZ3RoID09PSAwO1xyXG59XHJcbnZhciBpc09iamVjdCA9IGZ1bmN0aW9uIChvYmopIHtcclxuICAgIHJldHVybiBvYmogIT09IG51bGwgJiYgb2JqICYmIHR5cGVvZiBvYmogPT09ICdvYmplY3QnICYmICFBcnJheS5pc0FycmF5KG9iaik7XHJcbn07XHJcbi8qKlxyXG4gKiBBIHJlZmVyZW5jZSBjb21wYXJpc29uIGZ1bmN0aW9uIHdpdGggTmFOIHN1cHBvcnRcclxuICovXHJcbmZ1bmN0aW9uIGlzUmVmRXF1YWwobGhzLCByaHMpIHtcclxuICAgIGlmIChpc05hTihsaHMpICYmIGlzTmFOKHJocykpIHtcclxuICAgICAgICByZXR1cm4gdHJ1ZTtcclxuICAgIH1cclxuICAgIHJldHVybiBsaHMgPT09IHJocztcclxufVxyXG4vKipcclxuICogU2hhbGxvdyBvYmplY3QgY29tcGFyaXNvbi5cclxuICovXHJcbmZ1bmN0aW9uIGlzRXF1YWwobGhzLCByaHMpIHtcclxuICAgIGlmIChsaHMgaW5zdGFuY2VvZiBSZWdFeHAgJiYgcmhzIGluc3RhbmNlb2YgUmVnRXhwKSB7XHJcbiAgICAgICAgcmV0dXJuIGlzRXF1YWwobGhzLnNvdXJjZSwgcmhzLnNvdXJjZSkgJiYgaXNFcXVhbChsaHMuZmxhZ3MsIHJocy5mbGFncyk7XHJcbiAgICB9XHJcbiAgICBpZiAoQXJyYXkuaXNBcnJheShsaHMpICYmIEFycmF5LmlzQXJyYXkocmhzKSkge1xyXG4gICAgICAgIGlmIChsaHMubGVuZ3RoICE9PSByaHMubGVuZ3RoKVxyXG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XHJcbiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBsaHMubGVuZ3RoOyBpKyspIHtcclxuICAgICAgICAgICAgaWYgKCFpc0VxdWFsKGxoc1tpXSwgcmhzW2ldKSkge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiB0cnVlO1xyXG4gICAgfVxyXG4gICAgLy8gaWYgYm90aCBhcmUgb2JqZWN0cywgY29tcGFyZSBlYWNoIGtleSByZWN1cnNpdmVseS5cclxuICAgIGlmIChpc09iamVjdChsaHMpICYmIGlzT2JqZWN0KHJocykpIHtcclxuICAgICAgICByZXR1cm4gKE9iamVjdC5rZXlzKGxocykuZXZlcnkoZnVuY3Rpb24gKGtleSkge1xyXG4gICAgICAgICAgICByZXR1cm4gaXNFcXVhbChsaHNba2V5XSwgcmhzW2tleV0pO1xyXG4gICAgICAgIH0pICYmXHJcbiAgICAgICAgICAgIE9iamVjdC5rZXlzKHJocykuZXZlcnkoZnVuY3Rpb24gKGtleSkge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIGlzRXF1YWwobGhzW2tleV0sIHJoc1trZXldKTtcclxuICAgICAgICAgICAgfSkpO1xyXG4gICAgfVxyXG4gICAgcmV0dXJuIG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ge1xyXG4gICAgdmFyIGFycmF5ID0gW107XHJcbiAgICB2YXIgbGVuZ3RoID0gYXJyYXlMaWtlLmxlbmd0aDtcclxuICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbGVuZ3RoOyBpKyspIHtcclxuICAgICAgICBhcnJheS5wdXNoKGFycmF5TGlrZVtpXSk7XHJcbiAgICB9XHJcbiAgICByZXR1cm4gYXJyYXk7XHJcbn1cclxuZnVuY3Rpb24gdmFsdWVzKG9iaikge1xyXG4gICAgaWYgKGlzQ2FsbGFibGUoT2JqZWN0LnZhbHVlcykpIHtcclxuICAgICAgICByZXR1cm4gT2JqZWN0LnZhbHVlcyhvYmopO1xyXG4gICAgfVxyXG4gICAgLy8gZmFsbGJhY2sgdG8ga2V5cygpXHJcbiAgICAvKiBpc3RhbmJ1bCBpZ25vcmUgbmV4dCAqL1xyXG4gICAgcmV0dXJuIE9iamVjdC5rZXlzKG9iaikubWFwKGZ1bmN0aW9uIChrKSB7IHJldHVybiBvYmpba107IH0pO1xyXG59XHJcbmZ1bmN0aW9uIG1lcmdlKHRhcmdldCwgc291cmNlKSB7XHJcbiAgICBPYmplY3Qua2V5cyhzb3VyY2UpLmZvckVhY2goZnVuY3Rpb24gKGtleSkge1xyXG4gICAgICAgIGlmIChpc09iamVjdChzb3VyY2Vba2V5XSkpIHtcclxuICAgICAgICAgICAgaWYgKCF0YXJnZXRba2V5XSkge1xyXG4gICAgICAgICAgICAgICAgdGFyZ2V0W2tleV0gPSB7fTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBtZXJnZSh0YXJnZXRba2V5XSwgc291cmNlW2tleV0pO1xyXG4gICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHRhcmdldFtrZXldID0gc291cmNlW2tleV07XHJcbiAgICB9KTtcclxuICAgIHJldHVybiB0YXJnZXQ7XHJcbn1cblxuZnVuY3Rpb24gY3JlYXRlRmxhZ3MoKSB7XHJcbiAgICByZXR1cm4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FkeSBub3JtYWxpemVkLCBza2lwLlxyXG4gICAgaWYgKGlzT2JqZWN0KHJ1bGVzKSAmJiBydWxlcy5fJCRpc05vcm1hbGl6ZWQpIHtcclxuICAgICAgICByZXR1cm4gcnVsZXM7XHJcbiAgICB9XHJcbiAgICBpZiAoaXNPYmplY3QocnVsZXMpKSB7XHJcbiAgICAgICAgcmV0dXJuIE9iamVjdC5rZXlzKHJ1bGVzKS5yZWR1Y2UoZnVuY3Rpb24gKHByZXYsIGN1cnIpIHtcclxuICAgICAgICAgICAgdmFyIHBhcmFtcyA9IFtdO1xyXG4gICAgICAgICAgICBpZiAocnVsZXNbY3Vycl0gPT09IHRydWUpIHtcclxuICAgICAgICAgICAgICAgIHBhcmFtcyA9IFtdO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2UgaWYgKEFycmF5LmlzQXJyYXkocnVsZXNbY3Vycl0pKSB7XHJcbiAgICAgICAgICAgICAgICBwYXJhbXMgPSBydWxlc1tjdXJyXTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIGlmIChpc09iamVjdChydWxlc1tjdXJyXSkpIHtcclxuICAgICAgICAgICAgICAgIHBhcmFtcyA9IHJ1bGVzW2N1cnJdO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgcGFyYW1zID0gW3J1bGVzW2N1cnJdXTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBpZiAocnVsZXNbY3Vycl0gIT09IGZhbHNlKSB7XHJcbiAgICAgICAgICAgICAgICBwcmV2W2N1cnJdID0gYnVpbGRQYXJhbXMoY3VyciwgcGFyYW1zKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICByZXR1cm4gcHJldjtcclxuICAgICAgICB9LCBhY2MpO1xyXG4gICAgfVxyXG4gICAgLyogaXN0YW5idWwgaWdub3JlIGlmICovXHJcbiAgICBpZiAodHlwZW9m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pZCAwIDogb3B0aW9ucy5iYWlscztcclxuICAgICAgICAgICAgICAgICAgICBza2lwSWZFbXB0eSA9IG9wdGlvbnMgPT09IG51bGwgfHwgb3B0aW9ucyA9PT0gdm9pZCAwID8gdm9pZCAwIDogb3B0aW9ucy5za2lwSWZFbXB0eTtcclxuICAgICAgICAgICAgICAgICAgICBmaWVsZCA9IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTogKG9wdGlvbnMgPT09IG51bGwgfHwgb3B0aW9ucyA9PT0gdm9pZCAwID8gdm9pZCAwIDogb3B0aW9ucy5uYW1lKSB8fCAne2ZpZWxkfScsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJ1bGVzOiBub3JtYWxpemVSdWxlcyhydWxlcyksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJhaWxzOiBzaG91bGRCYWlsICE9PSBudWxsICYmIHNob3VsZEJhaWwgIT09IHZvaWQgMCA/IHNob3VsZEJhaWwgOiB0cnVlLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBza2lwSWZFbXB0eTogc2tpcElmRW1wdHkgIT09IG51bGwgJiYgc2tpcElmRW1wdHkgIT09IHZvaWQgMCA/IHNraXBJZkVtcHR5IDogdHJ1ZSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yY2VSZXF1aXJlZDogZmFsc2UsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNyb3NzVGFibGU6IChvcHRpb25zID09PSBudWxsIHx8IG9wdGlvbnMgPT09IHZvaWQgMCA/IHZvaWQgMCA6IG9wdGlvbnMudmFsdWVzKSB8fCB7fSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgbmFtZXM6IChvcHRpb25zID09PSBudWxsIHx8IG9wdGlvbnMgPT09IHZvaWQgMCA/IHZvaWQgMCA6IG9wdGlvbnMubmFtZXMpIHx8IHt9LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBjdXN0b21NZXNzYWdlczogKG9wdGlvbnMgPT09IG51bGwgfHwgb3B0aW9ucyA9PT0gdm9pZCAwID8gdm9pZCAwIDogb3B0aW9ucy5jdXN0b21NZXNzYWdlcykgfHwge31cclxuICAgICAgICAgICAgICAgICAgICB9O1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBbNCAvKnlpZWxkKi8sIF92YWxpZGF0ZShmaWVsZCwgdmFsdWUsIG9wdGlvbnMpXTtcclxuICAgICAgICAgICAgICAgIGNhc2UgMTpcclxuICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSBfYS5zZW50KCk7XHJcbiAgICAgICAgICAgICAgICAgICAgZXJyb3JzID0gW107XHJcbiAgICAgICAgICAgICAgICAgICAgZmFpbGVkUnVsZXMgPSB7fTtcclxuICAgICAgICAgICAgICAgICAgICByZWdlbmVyYXRlTWFwID0ge307XHJcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0LmVycm9ycy5mb3JFYWNoKGZ1bmN0aW9uIChlKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBtc2cgPSBlLm1zZygpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBlcnJvcnMucHVzaChtc2cpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBmYWlsZWRSdWxlc1tlLnJ1bGVdID0gbXNnO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICByZWdlbmVyYXRlTWFwW2UucnVsZV0gPSBlLm1zZztcclxuICAgICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gWzIgLypyZXR1cm4qLywge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsaWQ6IHJlc3VsdC52YWxpZCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVycm9yczogZXJyb3JzLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmFpbGVkUnVsZXM6IGZhaWxlZFJ1bGVzLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVnZW5lcmF0ZU1hcDogcmVnZW5lcmF0ZU1hcFxyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH0pO1xyXG4gICAgfSk7XHJcbn1cclxuLyoqXHJcbiAqIFN0YXJ0cyB0aGUgdmFsaWRhdGlvbiBwcm9jZXNzLlxyXG4gKi9cclxuZnVuY3Rpb24gX3ZhbGlkYXRlKGZpZWxkLCB2YWx1ZSwgX2EpIHtcclxuICAgIHZhciBfYiA9IChfYSA9PT0gdm9pZCAwID8ge30gOiBfYSkuaXNJbml0aWFsLCBpc0luaXRpYWwgPSBfYiA9PT0gdm9pZCAwID8gZmFsc2UgOiBfYjtcclxuICAgIHJldHVybiBfX2F3YWl0ZXIodGhpcywgdm9pZCAwLCB2b2lkIDAsIGZ1bmN0aW9uICgpIHtcclxuICAgICAgICB2YXIgX2MsIHNob3VsZFNraXAsIGVycm9ycywgcnVsZXMsIGxlbmd0aCwgaSwgcnVsZSwgcmVzdWx0O1xyXG4gICAgICAgIHJldHVybiBfX2dlbmVyYXRvcih0aGlzLCBmdW5jdGlvbiAoX2QpIHtcclxuICAgICAgICAgICAgc3dpdGNoIChfZC5sYWJlbCkge1xyXG4gICAgICAgICAgICAgICAgY2FzZSAwOiByZXR1cm4gWzQgLyp5aWVsZCovLCBfc2hvdWxkU2tpcChmaWVsZCwgdmFsdWUpXTtcclxuICAgICAgICAgICAgICAgIGNhc2UgMTpcclxuICAgICAgICAgICAgICAgICAgICBfYyA9IF9kLnNlbnQoKSwgc2hvdWxkU2tpcCA9IF9jLnNob3VsZFNraXAsIGVycm9ycyA9IF9jLmVycm9ycztcclxuICAgICAgICAgICAgICAgICAgICBpZiAoc2hvdWxkU2tpcCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gWzIgLypyZXR1cm4qLywge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbGlkOiAhZXJyb3JzLmxlbmd0aCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlcnJvcnM6IGVycm9yc1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfV07XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIHJ1bGVzID0gT2JqZWN0LmtleXMoZmllbGQucnVsZXMpLmZpbHRlcihmdW5jdGlvbiAocnVsZSkgeyByZXR1cm4gIVJ1bGVDb250YWluZXIuaXNSZXF1aXJlUnVsZShydWxlKTsgfSk7XHJcbiAgICAgICAgICAgICAgICAgICAgbGVuZ3RoID0gcnVsZXMubGVuZ3RoO1xyXG4gICAgICAgICAgICAgICAgICAgIGkgPSAwO1xyXG4gICAgICAgICAgICAgICAgICAgIF9kLmxhYmVsID0gMjtcclxuICAgICAgICAgICAgICAgIGNhc2UgMjpcclxuICAgICAgICAgICAgICAgICAgICBpZiAoIShpIDwgbGVuZ3RoKSkgcmV0dXJuIFszIC8qYnJlYWsqLywgNV07XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlzSW5pdGlhbCAmJiBSdWxlQ29udGFpbmVyLmlzTGF6eShydWxlc1tpXSkpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFszIC8qYnJlYWsqLywgNF07XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIHJ1bGUgPSBydWxlc1tpXTtcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gWzQgLyp5aWVsZCovLCBfdGVzdChmaWVsZCwgdmFsdWUsIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWU6IHJ1bGUsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJhbXM6IGZpZWxkLnJ1bGVzW3J1bGVdXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXTtcclxuICAgICAgICAgICAgICAgIGNhc2UgMzpcclxuICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSBfZC5zZW50KCk7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFyZXN1bHQudmFsaWQgJiYgcmVzdWx0LmVycm9yKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGVycm9ycy5wdXNoKHJlc3VsdC5lcnJvcik7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmaWVsZC5iYWlscykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFsyIC8qcmV0dXJuKi8sIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsaWQ6IGZhbHNlLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlcnJvcnM6IGVycm9yc1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1dO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIF9kLmxhYmVsID0gNDtcclxuICAgICAgICAgICAgICAgIGNhc2UgNDpcclxuICAgICAgICAgICAgICAgICAgICBpKys7XHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFszIC8qYnJlYWsqLywgMl07XHJcbiAgICAgICAgICAgICAgICBjYXNlIDU6IHJldHVybiBbMiAvKnJldHVybiovLCB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhbGlkOiAhZXJyb3JzLmxlbmd0aCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgZXJyb3JzOiBlcnJvcnNcclxuICAgICAgICAgICAgICAgICAgICB9XTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH0pO1xyXG4gICAgfSk7XHJcbn1cclxuZnVuY3Rpb24gX3Nob3VsZFNraXAoZmllbGQsIHZhbHVlKSB7XHJcbiAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgdmFyIHJlcXVpcmVSdWxlcywgbGVuZ3RoLCBlcnJvcnMsIGlzRW1wdHksIGlzRW1wdHlBbmRPcHRpb25hbCwgaXNSZXF1aXJlZCwgaSwgcnVsZSwgcmVzdWx0O1xyXG4gICAgICAgIHJldHVybiBfX2dlbmVyYXRvcih0aGlzLCBmdW5jdGlvbiAoX2EpIHtcclxuICAgICAgICAgICAgc3dpdGNoIChfYS5sYWJlbCkge1xyXG4gICAgICAgICAgICAgICAgY2FzZSAwOlxyXG4gICAgICAgICAgICAgICAgICAgIHJlcXVpcmVSdWxlcyA9IE9iamVjdC5rZXlzKGZpZWxkLnJ1bGVzKS5maWx0ZXIoUnVsZUNvbnRhaW5lci5pc1JlcXVpcmVSdWxlKTtcclxuICAgICAgICAgICAgICAgICAgICBsZW5ndGggPSByZXF1aXJlUnVsZXMubGVuZ3RoO1xyXG4gICAgICAgICAgICAgICAgICAgIGVycm9ycyA9IFtdO1xyXG4gICAgICAgICAgICAgICAgICAgIGlzRW1wdHkgPSBpc051bGxPclVuZGVmaW5lZCh2YWx1ZSkgfHwgdmFsdWUgPT09ICcnIHx8IGlzRW1wdHlBcnJheSh2YWx1ZSk7XHJcbiAgICAgICAgICAgICAgICAgICAgaXNFbXB0eUFuZE9wdGlvbmFsID0gaXNFbXB0eSAmJiBmaWVsZC5za2lwSWZFbXB0eTtcclxuICAgICAgICAgICAgICAgICAgICBpc1JlcXVpcmVkID0gZmFsc2U7XHJcbiAgICAgICAgICAgICAgICAgICAgaSA9IDA7XHJcbiAgICAgICAgICAgICAgICAgICAgX2EubGFiZWwgPSAxO1xyXG4gICAgICAgICAgICAgICAgY2FzZSAxOlxyXG4gICAgICAgICAgICAgICAgICAgIGlmICghKGkgPCBsZW5ndGgpKSByZXR1cm4gWzMgLypicmVhayovLCA0XTtcclxuICAgICAgICAgICAgICAgICAgICBydWxlID0gcmVxdWlyZVJ1bGVzW2ldO1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBbNCAvKnlpZWxkKi8sIF90ZXN0KGZpZWxkLCB2YWx1ZSwge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTogcnVsZSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtczogZmllbGQucnVsZXNbcnVsZV1cclxuICAgICAgICAgICAgICAgICAgICAgICAgfSldO1xyXG4gICAgICAgICAgICAgICAgY2FzZSAyOlxyXG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IF9hLnNlbnQoKTtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoIWlzT2JqZWN0KHJlc3VsdCkpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdSZXF1aXJlIHJ1bGVzIGhhcyB0byByZXR1cm4gYW4gb2JqZWN0IChzZWUgZG9jcyknKTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3VsdC5yZXF1aXJlZCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBpc1JlcXVpcmVkID0gdHJ1ZTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFyZXN1bHQudmFsaWQgJiYgcmVzdWx0LmVycm9yKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGVycm9ycy5wdXNoKHJlc3VsdC5lcnJvcik7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIEV4aXQgZWFybHkgYXMgdGhlIGZpZWxkIGlzIHJlcXVpcmVkIGFuZCBmYWlsZWQgdmFsaWRhdGlvbi5cclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZpZWxkLmJhaWxzKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gWzIgLypyZXR1cm4qLywge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaG91bGRTa2lwOiB0cnVlLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlcnJvcnM6IGVycm9yc1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1dO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIF9hLmxhYmVsID0gMztcclxuICAgICAgICAgICAgICAgIGNhc2UgMzpcclxuICAgICAgICAgICAgICAgICAgICBpKys7XHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFszIC8qYnJlYWsqLywgMV07XHJcbiAgICAgICAgICAgICAgICBjYXNlIDQ6XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlzRW1wdHkgJiYgIWlzUmVxdWlyZWQgJiYgIWZpZWxkLnNraXBJZkVtcHR5KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbMiAvKnJldHVybiovLCB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2hvdWxkU2tpcDogZmFsc2UsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXJyb3JzOiBlcnJvcnNcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1dO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAvLyBmaWVsZCBpcyBjb25maWd1cmVkIHRvIHJ1biB0aHJvdWdoIHRoZSBwaXBlbGluZSByZWdhcmRsZXNzXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFmaWVsZC5iYWlscyAmJiAhaXNFbXB0eUFuZE9wdGlvbmFsKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbMiAvKnJldHVybiovLCB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2hvdWxkU2tpcDogZmFsc2UsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXJyb3JzOiBlcnJvcnNcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1dO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAvLyBza2lwIGlmIHRoZSBmaWVsZCBpcyBub3QgcmVxdWlyZWQgYW5kIGhhcyBhbiBlbXB0eSB2YWx1ZS5cclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gWzIgLypyZXR1cm4qLywge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2hvdWxkU2tpcDogIWlzUmVxdWlyZWQgJiYgaXNFbXB0eSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVycm9yczogZXJyb3JzXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1dO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSk7XHJcbiAgICB9KTtcclxufVxyXG4vKipcclxuICogVGVzdHMgYSBzaW5nbGUgaW5wdXQgdmFsdWUgYWdhaW5zdCBhIHJ1bGUuXHJcbiAqL1xyXG5mdW5jdGlvbiBfdGVzdChmaWVsZCwgdmFsdWUsIHJ1bGUpIHtcclxuICAgIHJldHVybiBfX2F3YWl0ZXIodGhpcywgdm9pZCAwLCB2b2lkIDAsIGZ1bmN0aW9uICgpIHtcclxuICAgICAgICB2YXIgcnVsZVNjaGVtYSwgbm9ybWFsaXplZFZhbHVlLCBwYXJhbXMsIHJlc3VsdCwgdmFsdWVzXzE7XHJcbiAgICAgICAgcmV0dXJuIF9fZ2VuZXJhdG9yKHRoaXMsIGZ1bmN0aW9uIChfYSkge1xyXG4gICAgICAgICAgICBzd2l0Y2ggKF9hLmxhYmVsKSB7XHJcbiAgICAgICAgICAgICAgICBjYXNlIDA6XHJcbiAgICAgICAgICAgICAgICAgICAgcnVsZVNjaGVtYSA9IFJ1bGVDb250YWluZXIuZ2V0UnVsZURlZmluaXRpb24ocnVsZS5uYW1lKTtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoIXJ1bGVTY2hlbWEgfHwgIXJ1bGVTY2hlbWEudmFsaWRhdGUpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiTm8gc3VjaCB2YWxpZGF0b3IgJ1wiICsgcnVsZS5uYW1lICsgXCInIGV4aXN0cy5cIik7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIG5vcm1hbGl6ZWRWYWx1ZSA9IHJ1bGVTY2hlbWEuY2FzdFZhbHVlID8gcnVsZVNjaGVtYS5jYXN0VmFsdWUodmFsdWUpIDogdmFsdWU7XHJcbiAgICAgICAgICAgICAgICAgICAgcGFyYW1zID0gZmlsbFRhcmdldFZhbHVlcyhydWxlLnBhcmFtcywgZmllbGQuY3Jvc3NUYWJsZSk7XHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFs0IC8qeWllbGQqLywgcnVsZVNjaGVtYS52YWxpZGF0ZShub3JtYWxpemVkVmFsdWUsIHBhcmFtcyldO1xyXG4gICAgICAgICAgICAgICAgY2FzZSAxOlxyXG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IF9hLnNlbnQoKTtcclxuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHJlc3VsdCA9PT0gJ3N0cmluZycpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWVzXzEgPSBfX2Fzc2lnbihfX2Fzc2lnbih7fSwgKHBhcmFtcyB8fCB7fSkpLCB7IF9maWVsZF86IGZpZWxkLm5hbWUsIF92YWx1ZV86IHZhbHVlLCBfcnVsZV86IHJ1bGUubmFtZSB9KTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFsyIC8qcmV0dXJuKi8sIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWxpZDogZmFsc2UsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXJyb3I6IHsgcnVsZTogcnVsZS5uYW1lLCBtc2c6IGZ1bmN0aW9uICgpIHsgcmV0dXJuIGludGVycG9sYXRlKHJlc3VsdCwgdmFsdWVzXzEpOyB9IH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1dO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICBpZiAoIWlzT2JqZWN0KHJlc3VsdCkpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0geyB2YWxpZDogcmVzdWx0IH07XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBbMiAvKnJldHVybiovLCB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWxpZDogcmVzdWx0LnZhbGlkLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVxdWlyZWQ6IHJlc3VsdC5yZXF1aXJlZCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVycm9yOiByZXN1bHQudmFsaWQgPyB1bmRlZmluZWQgOiBfZ2VuZXJhdGVGaWVsZEVycm9yKGZpZWxkLCB2YWx1ZSwgcnVsZVNjaGVtYSwgcnVsZS5uYW1lLCBwYXJhbXMpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1dO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSk7XHJcbiAgICB9KTtcclxufVxyXG4vKipcclxuICogR2VuZXJhdGVzIGVycm9yIG1lc3NhZ2VzLlxyXG4gKi9cclxuZnVuY3Rpb24gX2dlbmVyYXRlRmllbGRFcnJvcihmaWVsZCwgdmFsdWUsIHJ1bGVTY2hlbWEsIHJ1bGVOYW1lLCBwYXJhbXMpIHtcclxuICAgIHZhciBfYTtcclxuICAgIHZhciBtZXNzYWdlID0gKF9hID0gZmllbGQuY3VzdG9tTWVzc2FnZXNbcnVsZU5hbWVdKSAhPT0gbnVsbCAmJiBfYSAhPT0gdm9pZCAwID8gX2EgOiBydWxlU2NoZW1hLm1lc3NhZ2U7XHJcbiAgICB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XBvbmVudE9wdGlvbnMuQ3Rvci5vcHRpb25zLm1vZGVsO1xyXG59XHJcbi8vIEFkZHMgYSBsaXN0ZW5lciB0byB2bm9kZSBsaXN0ZW5lciBvYmplY3QuXHJcbmZ1bmN0aW9uIG1lcmdlVk5vZGVMaXN0ZW5lcnMob2JqLCBldmVudE5hbWUsIGhhbmRsZXIpIHtcclxuICAgIC8vIG5vIGxpc3RlbmVyIGF0IGFsbC5cclxuICAgIGlmIChpc051bGxPclVuZGVmaW5lZChvYmpbZXZlbnROYW1lXSkpIHtcclxuICAgICAgICBvYmpbZXZlbnROYW1lXSA9IFtoYW5kbGVyXTtcclxuICAgICAgICByZXR1cm47XHJcbiAgICB9XHJcbiAgICAvLyBJcyBhbiBpbnZva2VyLlxyXG4gICAgaWYgKGlzQ2FsbGFibGUob2JqW2V2ZW50TmFtZV0pICYmIG9ialtldmVudE5hbWVdLmZucykge1xyXG4gICAgICAgIHZhciBpbnZva2VyID0gb2JqW2V2ZW50TmFtZV07XHJcbiAgICAgICAgaW52b2tlci5mbnMgPSBBcnJheS5pc0FycmF5KGludm9rZXIuZm5zKSA/IGludm9rZXIuZm5zIDogW2ludm9rZXIuZm5zXTtcclxuICAgICAgICBpZiAoIWluY2x1ZGVzKGludm9rZXIuZm5zLCBoYW5kbGVyKSkge1xyXG4gICAgICAgICAgICBpbnZva2VyLmZucy5wdXNoKGhhbmRsZXIpO1xyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm47XHJcbiAgICB9XHJcbiAgICBpZiAoaXNDYWxsYWJsZShvYmpbZXZlbnROYW1lXSkpIHtcclxuICAgICAgICB2YXIgcHJldiA9IG9ialtldmVudE5hbWVdO1xyXG4gICAgICAgIG9ialtldmVudE5hbWVdID0gW3ByZXZdO1xyXG4gICAgfVxyXG4gICAgaWYgKEFycmF5LmlzQXJyYXkob2JqW2V2ZW50TmFtZV0pICYmICFpbmNsdWRlcyhvYmpbZXZlbnROYW1lXSwgaGFuZGxlcikpIHtcclxuIC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ICAgIGlmIChpc1RleHRJbnB1dCh2bm9kZSkpIHtcclxuICAgICAgICByZXR1cm4gJ2lucHV0JztcclxuICAgIH1cclxuICAgIHJldHVybiAnY2hhbmdlJztcclxufVxyXG5mdW5jdGlvbiBpc0hUTUxOb2RlKG5vZGUpIHtcclxuICAgIHJldHVybiBpbmNsdWRlcyhbJ2lucHV0JywgJ3NlbGVjdCcsICd0ZXh0YXJlYSddLCBub2RlLnRhZyk7XHJcbn1cclxuLy8gVE9ETzogVHlwZSB0aGlzIG9uZSBwcm9wZXJseS5cclxuZnVuY3Rpb24gbm9ybWFsaXplU2xvdHMoc2xvdHMsIGN0eCkge1xyXG4gICAgdmFyIGFjYyA9IFtdO1xyXG4gICAgcmV0dXJuIE9iamVjdC5rZXlzKHNsb3RzKS5yZWR1Y2UoZnVuY3Rpb24gKGFyciwga2V5KSB7XHJcbiAgICAgICAgc2xvdHNba2V5XS5mb3JFYWNoKGZ1bmN0aW9uICh2bm9kZSkge1xyXG4gICAgICAgICAgICBpZiAoIXZub2RlLmNvbnRleHQpIHtcclxuICAgICAgICAgICAgICAgIHNsb3RzW2tleV0uY29udGV4dCA9IGN0eDtcclxuICAgICAgICAgICAgICAgIGlmICghdm5vZGUuZGF0YSkge1xyXG4gICAgICAgICAgICAgICAgICAgIHZub2RlLmRhdGEgPSB7fTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIHZub2RlLmRhdGEuc2xvdCA9IGtleTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH0pO1xyXG4gICAgICAgIHJldHVybiBhcnIuY29uY2F0KHNsb3RzW2tleV0pO1xyXG4gICAgfSwgYWNjKTtcclxufVxyXG5mdW5jdGlvbiByZXNvbHZlVGV4dHVhbFJ1bGVzKHZub2RlKSB7XHJcbiAgICB2YXIgX2E7XHJcbiAgICB2YXIgYXR0cnMgPSAoX2EgPSB2bm9kZS5kYXRhKSA9PT0gbnVsbCB8fCBfYSA9PT0gdm9pZCAwID8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YnNlcnZlcicsXHJcbiAgICAgICAgICAgIGRlZmF1bHQ6IGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgIGlmICghdGhpcy4kdm5vZGUuY29udGV4dC4kX3ZlZU9ic2VydmVyKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy4kdm5vZGUuY29udGV4dC4kX3ZlZU9ic2VydmVyID0gY3JlYXRlT2JzZXJ2ZXIoKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLiR2bm9kZS5jb250ZXh0LiRfdmVlT2JzZXJ2ZXI7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICB9LFxyXG4gICAgcHJvcHM6IHtcclxuICAgICAgICB2aWQ6IHtcclxuICAgICAgICAgICAgdHlwZTogU3RyaW5nLFxyXG4gICAgICAgICAgICBkZWZhdWx0OiAnJ1xyXG4gICAgICAgIH0sXHJcbiAgICAgICAgbmFtZToge1xyXG4gICAgICAgICAgICB0eXBlOiBTdHJpbmcsXHJcbiAgICAgICAgICAgIGRlZmF1bHQ6IG51bGxcclxuICAgICAgICB9LFxyXG4gICAgICAgIG1vZGU6IHtcclxuICAgICAgICAgICAgdHlwZTogW1N0cmluZywgRnVuY3Rpb25dLFxyXG4gICAgICAgICAgICBkZWZhdWx0OiBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gZ2V0Q29uZmlnKCkubW9kZTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH0sXHJcbiAgICAgICAgcnVsZXM6IHtcclxuICAgICAgICAgICAgdHlwZTogW09iamVjdCwgU3RyaW5nXSxcclxuICAgICAgICAgICAgZGVmYXVsdDogbnVsbFxyXG4gICAgICAgIH0sXHJcbiAgICAgICAgaW1tZWRpYXRlOiB7XHJcbiAgICAgICAgICAgIHR5cGU6IEJvb2xlYW4sXHJcbiAgICAgICAgICAgIGRlZmF1bHQ6IGZhbHNlXHJcbiAgICAgICAgfSxcclxuICAgICAgICBiYWlsczoge1xyXG4gICAgICAgICAgICB0eXBlOiBCb29sZWFuLFxyXG4gICAgICAgICAgICBkZWZhdWx0OiBmdW5jdGlvbiAoKSB7IHJldHVybiBnZXRDb25maWcoKS5iYWlsczsgfVxyXG4gICAgICAgIH0sXHJcbiAgICAgICAgc2tpcElmRW1wdHk6IHtcclxuICAgICAgICAgICAgdHlwZTogQm9vbGVhbixcclxuICAgICAgICAgICAgZGVmYXVsdDogZnVuY3Rpb24gKCkgeyByZXR1cm4gZ2V0Q29uZmlnKCkuc2tpcE9wdGlvbmFsOyB9XHJcbiAgICAgICAgfSxcclxuICAgICAgICBkZWJvdW5jZToge1xyXG4gICAgICAgICAgICB0eXBlOiBOdW1iZXIsXHJcbiAgICAgICAgICAgIGRlZmF1bHQ6IDBcclxuICAgICAgICB9LFxyXG4gICAgICAgIHRhZzoge1xyXG4gICAgICAgICAgICB0eXBlOiBTdHJpbmcsXHJcbiAgICAgICAgICAgIGRlZmF1bHQ6ICdzcGFuJ1xyXG4gICAgICAgIH0sXHJcbiAgICAgICAgc2xpbToge1xyXG4gICAgICAgICAgICB0eXBlOiBCb29sZWFuLFxyXG4gICAgICAgICAgICBkZWZhdWx0OiBmYWxzZVxyXG4gICAgICAgIH0sXHJcbiAgICAgICAgZGlzYWJsZWQ6IHtcclxuICAgICAgICAgICAgdHlwZTogQm9vbGVhbixcclxuICAgICAgICAgICAgZGVmYXVsdDogZmFsc2VcclxuICAgICAgICB9LFxyXG4gICAgICAgIGN1c3RvbU1lc3NhZ2VzOiB7XHJcbiAgICAgICAgICAgIHR5cGU6IE9iamVjdCxcclxuICAgICAgICAgICAgZGVmYXVsdDogZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIHt9O1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSxcclxuICAgICAgICBkZXRlY3RJbnB1dDoge1xyXG4gICAgICAgICAgICB0eXBlOiBCb29sZWFuLFxyXG4gICAgICAgICAgICBkZWZhdWx0OiB0cnVlXHJcbiAgICAgICAgfVxyXG4gICAgfSxcclxuICAgIHdhdGNoOiB7XHJcbiAgICAgICAgcnVsZXM6IHtcclxuICAgICAgICAgICAgZGVlcDogdHJ1ZSxcclxuICAgICAgICAgICAgaGFuZGxlcjogZnVuY3Rpb24gKHZhbCwgb2xkVmFsKSB7XHJcbiAgICAgICAgICAgICAgICB0aGlzLl9uZWVkc1ZhbGlkYXRpb24gPSAhaXNFcXVhbCh2YWwsIG9sZFZhbCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICB9LFxyXG4gICAgZGF0YTogZGF0YSxcclxuICAgIGNvbXB1dGVkOiB7XHJcbiAgICAgICAgZmllbGREZXBzOiBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XHJcbiAgICAgICAgICAgIHJldHVybiBPYmplY3Qua2V5cyh0aGlzLm5vcm1hbGl6ZWRSdWxlcykucmVkdWNlKGZ1bmN0aW9uIChhY2MsIHJ1bGUpIHtcclxuICAgICAgICAgICAgICAgIHZhciBkZXBzID0gZXh0cmFjdExvY2F0b3JzKF90aGlzLm5vcm1hbGl6ZWRSdWxlc1tydWxlXSkubWFwKGZ1bmN0aW9uIChkZXApIHtcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gaXNMb2NhdG9yKGRlcCkgPyBkZXAuX19sb2NhdG9yUmVmIDogZGVwLnNsaWNlKDEpO1xyXG4gICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgICAgICBhY2MucHVzaC5hcHBseShhY2MsIGRlcHMpO1xyXG4gICAgICAgICAgICAgICAgZGVwcy5mb3JFYWNoKGZ1bmN0aW9uIChkZXBOYW1lKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgd2F0Y2hDcm9zc0ZpZWxkRGVwKF90aGlzLCBkZXBOYW1lKTtcclxuICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIGFjYztcclxuICAgICAgICAgICAgfSwgW10pO1xyXG4gICAgICAgIH0sXHJcbiAgICAgICAgbm9ybWFsaXplZEV2ZW50czogZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICB2YXIgX3RoaXMgPSB0aGlzO1xyXG4gICAgICAgICAgICB2YXIgb24gPSBjb21wdXRlTW9kZVNldHRpbmcodGhpcykub247XHJcbiAgICAgICAgICAgIHJldHVybiAob24gfHwgW10pLm1hcChmdW5jdGlvbiAoZSkge1xyXG4gICAgICAgICAgICAgICAgaWYgKGUgPT09ICdpbnB1dCcpIHtcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gX3RoaXMuX2lucHV0RXZlbnROYW1lO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgcmV0dXJuIGU7XHJcbiAgICAgICAgICAgIH0pO1xyXG4gICAgICAgIH0sXHJcbiAgICAgICAgaXNSZXF1aXJlZDogZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICB2YXIgcnVsZXMgPSBfX2Fzc2lnbihfX2Fzc2lnbih7fSwgdGhpcy5fcmVzb2x2ZWRSdWxlcyksIHRoaXMubm9ybWFsaXplZFJ1bGVzKTtcclxuICAgICAgICAgICAgdmFyIGlzUmVxdWlyZWQgPSBPYmplY3Qua2V5cyhydWxlcykuc29tZShSdWxlQ29udGFpbmVyLmlzUmVxdWlyZVJ1bGUpO1xyXG4gICAgICAgICAgICB0aGlzLmZsYWdzLnJlcXVpcmVkID0gISFpc1JlcXVpcmVkO1xyXG4gICAgICAgICAgICByZXR1cm4gaXNSZXF1aXJlZDtcclxuICAgICAgICB9LFxyXG4gICAgICAgIGNsYXNzZXM6IGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgdmFyIG5hbWVzID0gZ2V0Q29uZmlnKCkuY2xhc3NlcztcclxuICAgICAgICAgICAgcmV0dXJuIGNvbXB1dGVDbGFzc09iaihuYW1lcywgdGhpcy5mbGFncyk7XHJcbiAgICAgICAgfSxcclxuICAgICAgICBub3JtYWxpemVkUnVsZXM6IGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgcmV0dXJuIG5vcm1hbGl6ZVJ1bGVzKHRoaXMucnVsZXMpO1xyXG4gICAgICAgIH1cclxuICAgIH0sXHJcbiAgICBtb3VudGVkOiBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgdmFyIF90aGlzID0gdGhpcztcclxuICAgICAgICB2YXIgb25Mb2NhbGVDaGFuZ2VkID0gZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICBpZiAoIV90aGlzLmZsYWdzLnZhbGlkYXRlZCkge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIHZhciByZWdlbmVyYXRlTWFwID0gX3RoaXMuX3JlZ2VuZXJhdGVNYXA7XHJcbiAgICAgICAgICAgIGlmIChyZWdlbmVyYXRlTWFwKSB7XHJcbiAgICAgICAgICAgICAgICB2YXIgZXJyb3JzXzEgPSBbXTtcclxuICAgICAgICAgICAgICAgIHZhciBmYWlsZWRSdWxlc18xID0ge307XHJcbiAgICAgICAgICAgICAgICBPYmplY3Qua2V5cyhyZWdlbmVyYXRlTWFwKS5mb3JFYWNoKGZ1bmN0aW9uIChydWxlKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgdmFyIG1zZyA9IHJlZ2VuZXJhdGVNYXBbcnVsZV0oKTtcclxuICAgICAgICAgICAgICAgICAgICBlcnJvcnNfMS5wdXNoKG1zZyk7XHJcbiAgICAgICAgICAgICAgICAgICAgZmFpbGVkUnVsZXNfMVtydWxlXSA9IG1zZztcclxuICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgX3RoaXMuYXBwbHlSZXN1bHQoeyBlcnJvcnM6IGVycm9yc18xLCBmYWlsZWRSdWxlczogZmFpbGVkUnVsZXNfMSwgcmVnZ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AgICAgICB2YXIgYXJncyA9IFtdO1xyXG4gICAgICAgICAgICBmb3IgKHZhciBfaSA9IDA7IF9pIDwgYXJndW1lbnRzLmxlbmd0aDsgX2krKykge1xyXG4gICAgICAgICAgICAgICAgYXJnc1tfaV0gPSBhcmd1bWVudHNbX2ldO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIHJldHVybiBfX2F3YWl0ZXIodGhpcywgdm9pZCAwLCB2b2lkIDAsIGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgIHJldHVybiBfX2dlbmVyYXRvcih0aGlzLCBmdW5jdGlvbiAoX2EpIHtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoYXJncy5sZW5ndGggPiAwKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuc3luY1ZhbHVlKGFyZ3NbMF0pO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gWzIgLypyZXR1cm4qLywgdHJpZ2dlclRocmVhZFNhZmVWYWxpZGF0aW9uKHRoaXMpXTtcclxuICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICB9KTtcclxuICAgICAgICB9LFxyXG4gICAgICAgIHZhbGlkYXRlU2lsZW50OiBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgIHJldHVybiBfX2F3YWl0ZXIodGhpcywgdm9pZCAwLCB2b2lkIDAsIGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgIHZhciBydWxlcywgcmVzdWx0O1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIF9fZ2VuZXJhdG9yKHRoaXMsIGZ1bmN0aW9uIChfYSkge1xyXG4gICAgICAgICAgICAgICAgICAgIHN3aXRjaCAoX2EubGFiZWwpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAwOlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXRGbGFncyh7IHBlbmRpbmc6IHRydWUgfSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBydWxlcyA9IF9fYXNzaWduKF9fYXNzaWduKHt9LCB0aGlzLl9yZXNvbHZlZFJ1bGVzKSwgdGhpcy5ub3JtYWxpemVkUnVsZXMpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KHJ1bGVzLCAnXyQkaXNOb3JtYWxpemVkJywge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiB0cnVlLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRhYmxlOiBmYWxzZSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtZXJhYmxlOiBmYWxzZSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maWd1cmFibGU6IGZhbHNlXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbNCAvKnlpZWxkKi8sIHZhbGlkYXRlKHRoaXMudmFsdWUsIHJ1bGVzLCBfX2Fzc2lnbihfX2Fzc2lnbih7IG5hbWU6IHRoaXMubmFtZSB8fCB0aGlzLmZpZWxkTmFtZSB9LCBjcmVhdGVMb29rdXAodGhpcykpLCB7IGJhaWxzOiB0aGlzLmJhaWxzLCBza2lwSWZFbXB0eTogdGhpcy5za2lwSWZFbXB0eSwgaXNJbml0aWFsOiAhdGhpcy5pbml0aWFsaXplZCwgY3VzdG9tTWVzc2FnZXM6IHRoaXMuY3VzdG9tTWVzc2FnZXMgfSkpXTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAxOlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gX2Euc2VudCgpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXRGbGFncyh7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGVuZGluZzogZmFsc2UsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsaWQ6IHJlc3VsdC52YWxpZCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnZhbGlkOiAhcmVzdWx0LnZhbGlkXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbMiAvKnJldHVybiovLCByZXN1bHRdO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICB9KTtcclxuICAgICAgICB9LFxyXG4gICAgICAgIHNldEVycm9yczogZnVuY3Rpb24gKGVycm9ycykge1xyXG4gICAgICAgICAgICB0aGlzLmFwcGx5UmVzdWx0KHsgZXJyb3JzOiBlcnJvcnMsIGZhaWxlZFJ1bGVzOiB7fSB9KTtcclxuICAgICAgICB9LFxyXG4gICAgICAgIGFwcGx5UmVzdWx0OiBmdW5jdGlvbiAoX2EpIHtcclxuICAgICAgICAgICAgdmFyIGVycm9ycyA9IF9hLmVycm9ycywgZmFpbGVkUnVsZXMgPSBfYS5mYWlsZWRSdWxlcywgcmVnZW5lcmF0ZU1hcCA9IF9hLnJlZ2VuZXJhdGVNYXA7XHJcbiAgICAgICAgICAgIHRoaXMuZXJyb3JzID0gZXJyb3JzO1xyXG4gICAgICAgICAgICB0aGlzLl9yZWdlbmVyYXRlTWFwID0gcmVnZW5lcmF0ZU1hcDtcclxuICAgICAgICAgICAgdGhpcy5mYWlsZWRSdWxlcyA9IF9fYXNzaWduKHt9LCAoZmFpbGVkUnVsZXMgfHwge30pKTtcclxuICAgICAgICAgICAgdGhpcy5zZXRGbGFncyh7XHJcbiAgICAgICAgICAgICAgICB2YWxpZDogIWVycm9ycy5sZW5ndGgsXHJcbiAgICAgICAgICAgICAgICBwYXNzZWQ6ICFlcnJvcn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ldHVybiBcImNvbnRpbnVlXCI7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmICh0eXBlb2YgY2xhc3NOYW1lID09PSAnc3RyaW5nJykge1xyXG4gICAgICAgICAgICBhY2NbY2xhc3NOYW1lXSA9IHZhbHVlO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIGlmIChBcnJheS5pc0FycmF5KGNsYXNzTmFtZSkpIHtcclxuICAgICAgICAgICAgY2xhc3NOYW1lLmZvckVhY2goZnVuY3Rpb24gKGNscykge1xyXG4gICAgICAgICAgICAgICAgYWNjW2Nsc10gPSB2YWx1ZTtcclxuICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgfVxyXG4gICAgfTtcclxuICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbGVuZ3RoOyBpKyspIHtcclxuICAgICAgICBfbG9vcF8xKGkpO1xyXG4gICAgfVxyXG4gICAgcmV0dXJuIGFjYztcclxufVxyXG5mdW5jdGlvbiBjcmVhdGVMb29rdXAodm0pIHtcclxuICAgIHZhciBwcm92aWRlcnMgPSB2bS4kX3ZlZU9ic2VydmVyLnJlZnM7XHJcbiAgICB2YXIgcmVkdWNlZCA9IHtcclxuICAgICAgICBuYW1lczoge30sXHJcbiAgICAgICAgdmFsdWVzOiB7fVxyXG4gICAgfTtcclxuICAgIHJldHVybiB2bS5maWVsZERlcHMucmVkdWNlKGZ1bmN0aW9uIChhY2MsIGRlcE5hbWUpIHtcclxuICAgICAgICBpZiAoIXByb3ZpZGVyc1tkZXBOYW1lXSkge1xyXG4gICAgICAgICAgICByZXR1cm4gYWNjO1xyXG4gICAgICAgIH1cclxuICAgICAgICBhY2MudmFsdWVzW2RlcE5hbWVdID0gcHJvdmlkZXJzW2RlcE5hbWVdLnZhbHVlO1xyXG4gICAgICAgIGFjYy5uYW1lc1tkZXBOYW1lXSA9IHByb3ZpZGVyc1tkZXBOYW1lXS5uYW1lO1xyXG4gICAgICAgIHJldHVybiBhY2M7XHJcbiAgICB9LCByZ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AgICBvYnNlcnZlcnM6IG9ic2VydmVycyxcclxuICAgICAgICBlcnJvcnM6IGVycm9ycyxcclxuICAgICAgICBmbGFnczogZmxhZ3MsXHJcbiAgICAgICAgZmllbGRzOiBmaWVsZHNcclxuICAgIH07XHJcbn1cclxuZnVuY3Rpb24gcHJvdmlkZVNlbGYoKSB7XHJcbiAgICByZXR1cm4ge1xyXG4gICAgICAgICRfdmVlT2JzZXJ2ZXI6IHRoaXNcclxuICAgIH07XHJcbn1cclxudmFyIFZhbGlkYXRpb25PYnNlcnZlciA9IFZ1ZS5leHRlbmQoe1xyXG4gICAgbmFtZTogJ1ZhbGlkYXRpb25PYnNlcnZlcicsXHJcbiAgICBwcm92aWRlOiBwcm92aWRlU2VsZixcclxuICAgIGluamVjdDoge1xyXG4gICAgICAgICRfdmVlT2JzZXJ2ZXI6IHtcclxuICAgICAgICAgICAgZnJvbTogJyRfdmVlT2JzZXJ2ZXInLFxyXG4gICAgICAgICAgICBkZWZhdWx0OiBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICBpZiAoIXRoaXMuJHZub2RlLmNvbnRleHQuJF92ZWVPYnNlcnZlcikge1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudWxsO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuJHZub2RlLmNvbnRleHQuJF92ZWVPYnNlcnZlcjtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgIH0sXHJcbiAgICBwcm9wczoge1xyXG4gICAgICAgIHRhZzoge1xyXG4gICAgICAgICAgICB0eXBlOiBTdHJpbmcsXHJcbiAgICAgICAgICAgIGRlZmF1bHQ6ICdzcGFuJ1xyXG4gICAgICAgIH0sXHJcbiAgICAgICAgdmlkOiB7XHJcbiAgICAgICAgICAgIHR5cGU6IFN0cmluZyxcclxuICAgICAgICAgICAgZGVmYXVsdDogZnVuY3Rpb24gKCkge1xyXG4gICAgICA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0aW9uICgpIHtcclxuICAgICAgICB1bnJlZ2lzdGVyKHRoaXMpO1xyXG4gICAgfSxcclxuICAgIGJlZm9yZURlc3Ryb3k6IGZ1bmN0aW9uICgpIHtcclxuICAgICAgICB1bnJlZ2lzdGVyKHRoaXMpO1xyXG4gICAgfSxcclxuICAgIHJlbmRlcjogZnVuY3Rpb24gKGgpIHtcclxuICAgICAgICB2YXIgY2hpbGRyZW4gPSBub3JtYWxpemVDaGlsZHJlbih0aGlzLCBwcmVwYXJlU2xvdFByb3BzKHRoaXMpKTtcclxuICAgICAgICByZXR1cm4gdGhpcy5zbGltICYmIGNoaWxkcmVuLmxlbmd0aCA8PSAxID8gY2hpbGRyZW5bMF0gOiBoKHRoaXMudGFnLCB7IG9uOiB0aGlzLiRsaXN0ZW5lcnMgfSwgY2hpbGRyZW4pO1xyXG4gICAgfSxcclxuICAgIG1ldGhvZHM6IHtcclxuICAgICAgICBvYnNlcnZlOiBmdW5jdGlvbiAoc3Vic2NyaWJlciwga2luZCkge1xyXG4gICAgICAgICAgICB2YXIgX2E7XHJcbiAgICAgICAgICAgIGlmIChraW5kID09PSB2b2lkIDApIHsga2luZCA9ICdwcm92aWRlcic7IH1cclxuICAgICAgICAgICAgaWYgKGtpbmQgPT09ICdvYnNlcnZlcicpIHtcclxuICAgICAgICAgICAgICAgIHRoaXMub2JzZXJ2ZXJzLnB1c2goc3Vic2NyaWJlcik7XHJcbiAgICAgICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgdGhpcy5yZWZzID0gX19hc3NpZ24oX19hc3NpZ24oe30sIHRoaXMucmVmcyksIChfYSA9IHt9LCBfYVtzdWJzY3JpYmVyLmlkXSA9IHN1YnNjcmliZXIsIF9hKSk7XHJcbiAgICAgICAgfSxcclxuICAgICAgICB1bm9ic2VydmU6IGZ1bmN0aW9uIChpZCwga2luZCkge1xyXG4gICAgICAgICAgICBpZiAoa2luZCA9PT0gdm9pZCAwKSB7IGtpbmQgPSAncHJvdmlkZXInOyB9XHJcbiAgICAgICAgICAgIGlmIChraW5kID09PSAncHJvdmlkZXInKSB7XHJcbiAgICAgICAgICAgICAgICB2YXIgcHJvdmlkZXIgPSB0aGlzLnJlZnNbaWRdO1xyXG4gICAgICAgICAgICAgICAgaWYgKCFwcm92aWRlcikge1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIHRoaXMuJGRlbGV0ZSh0aGlzLnJlZnMsIGlkKTtcclxuICAgICAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB2YXIgaWR4ID0gZmluZEluZGV4KHRoaXMub2JzZXJ2ZXJzLCBmdW5jdGlvbiAobykgeyByZXR1cm4gby5pZCA9PT0gaWQ7IH0pO1xyXG4gICAgICAgICAgICBpZiAoaWR4ICE9PSAtMSkge1xyXG4gICAgICAgICAgICAgICAgdGhpcy5vYnNlcnZlcnMuc3BsaWNlKGlkeCwgMSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9LFxyXG4gICAgICAgIHZhbGlkYXRlV2l0aEluZm86IGZ1bmN0aW9uIChfYSkge1xyXG4gICAgICAgICAgICB2YXIgX2IgPSAoX2EgPT09IHZvaWQgMCA/IHt9IDogX2EpLnNpbGVudCwgc2lsZW50ID0gX2IgPT09IHZvaWQgMCA/IGZhbHNlIDogX2I7XHJcbiAgICAgICAgICAgIHJldHVybiBfX2F3YWl0ZXIodGhpcywgdm9pZCAwLCB2b2lkIDAsIGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgIHZhciByZXN1bHRzLCBpc1ZhbGlkLCBfYywgZXJyb3JzLCBmbGFncywgZmllbGRzO1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIF9fZ2VuZXJhdG9yKHRoaXMsIGZ1bmN0aW9uIChfZCkge1xyXG4gICAgICAgICAgICAgICAgICAgIHN3aXRjaCAoX2QubGFiZWwpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAwOiByZXR1cm4gWzQgLyp5aWVsZCovLCBQcm9taXNlLmFsbChfX3NwcmVhZEFycmF5cyh2YWx1ZXModGhpcy5yZWZzKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5maWx0ZXIoZnVuY3Rpb24gKHIpIHsgcmV0dXJuICFyLmRpc2FibGVkOyB9KVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5tYXAoZnVuY3Rpb24gKHJlZikgeyByZXR1cm4gcmVmW3NpbGVudCA/ICd2YWxpZGF0ZVNpbGVudCcgOiAndmFsaWRhdGUnXSgpLnRoZW4oZnVuY3Rpb24gKHIpIHsgcmV0dXJuIHIudmFsaWQ7IH0pOyB9KSwgdGhpcy5vYnNlcnZlcnMuZmlsdGVyKGZ1bmN0aW9uIChvKSB7IHJldHVybiAhby5kaXNhYmxlZDsgfSkubWFwKGZ1bmN0aW9uIChvYnMpIHsgcmV0dXJuIG9icy52YWxpZGF0ZSh7IHNpbGVudDogc2lsZW50IH0pOyB9KSkpXTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAxOlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0cyA9IF9kLnNlbnQoKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzVmFsaWQgPSByZXN1bHRzLmV2ZXJ5KGZ1bmN0aW9uIChyKSB7IHJldHVybiByOyB9KTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9jID0gY29tcHV0ZU9ic2VydmVyU3RhdGUuY2FsbCh0aGlzKSwgZXJyb3JzID0gX2MuZXJyb3JzLCBmbGFncyA9IF9jLmZsYWdzLCBmaWVsZHMgPSBfYy5maWVsZHM7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmVycm9ycyA9IGVycm9ycztcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuZmxhZ3MgPSBmbGFncztcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuZmllbGRzID0gZmllbGRzO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFsyIC8qcmV0dXJuKi8sIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXJyb3JzOiBlcnJvcnMsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsYWdzOiBmbGFncyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmllbGRzOiBmaWVsZHMsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzVmFsaWQ6IGlzVmFsaWRcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgfSxcclxuICAgICAgICB2YWxpZGF0ZTogZnVuY3Rpb24gKF9hKSB7XHJcbiAgICAgICAgICAgIHZhciBfYiA9IChfYSA9PT0gdm9pZCAwID8ge30gOiBfYSkuc2lsZW50LCBzaWxlbnQgPSBfYiA9PT0gdm9pZCAwID8gZmFsc2UgOiBfYjtcclxuICAgICAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgdmFyIGlzVmFsaWQ7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gX19nZW5lcmF0b3IodGhpcywgZnVuY3Rpb24gKF9jKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChfYy5sYWJlbCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDA6IHJldHVybiBbNCAvKnlpZWxkKi8sIHRoaXMudmFsaWRhdGVXaXRoSW5mbyh7IHNpbGVudDogc2lsZW50IH0pXTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAxOlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNWYWxpZCA9IChfYy5zZW50KCkpLmlzVmFsaWQ7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gWzIgLypyZXR1cm4qLywgaXNWYWxpZF07XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgIH0pO1xyXG4gICAgICAgIH0sXHJcbiAgICAgICAgaGFuZGxlU3VibWl0OiBmdW5jdGlvbiAoY2IpIHtcclxuICAgICAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgdmFyIGlzVmFsaWQ7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gX19nZW5lcmF0b3IodGhpcywgZnVuY3Rpb24gKF9hKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChfYS5sYWJlbCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDA6IHJldHVybiBbNCAvKnlpZWxkKi8sIHRoaXMudmFsaWRhdGUoKV07XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMTpcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzVmFsaWQgPSBfYS5zZW50KCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWlzVmFsaWQgfHwgIWNiKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFsyIC8qcmV0dXJuKi9dO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFsyIC8qcmV0dXJuKi8sIGNiKCldO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICB9KTtcclxuICAgICAgICB9LFxyXG4gICAgICAgIHJlc2V0OiBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgIHJldHVybiBfX3NwcmVhZEFycmF5cyh2YWx1ZXModGhpcy5yZWZzKSwgdGhpcy5vYnNlcnZlcnMpLmZvckVhY2goZnVuY3Rpb24gKHJlZikgeyByZXR1cm4gcmVmLnJlc2V0KCk7IH0pO1xyXG4gICAgICAgIH0sXHJcbiAgICAgICAgc2V0RXJyb3JzOiBmdW5jdGlvbiAoZXJyb3JzKSB7XHJcbiAgICAgICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XHJcbiAgICAgICAgICAgIE9iamVjdC5rZXlzKGVycm9ycykuZm9yRWFjaChmdW5jdGlvbiAoa2V5KSB7XHJcbiAgICAgICAgICAgICAgICB2YXIgcHJvdmlkZXIgPSBfdGhpcy5yZWZzW2tleV07XHJcbiAgICAgICAgICAgICAgICBpZiAoIXByb3ZpZGVyKVxyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICAgICAgICAgIHZhciBlcnJvckFyciA9IGVycm9yc1trZXldIHx8IFtdO1xyXG4gICAgICAgICAgICAgICAgZXJyb3JBcnIgPSB0eXBlb2YgZXJyb3JBcnIgPT09ICdzdHJpbmcnID8gW2Vycm9yQXJyXSA6IGVycm9yQXJyO1xyXG4gICAgICAgICAgICAgICAgcHJvdmlkZXIuc2V0RXJyb3JzKGVycm9yQXJyKTtcclxuICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgIHRoaXMub2JzZXJ2ZXJzLmZvckVhY2goZnVuY3Rpb24gKG9ic2VydmVyKSB7XHJcbiAgICAgICAgICAgICAgICBvYnNlcnZlci5zZXRFcnJvcnMoZXJyb3JzKTtcclxuICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG59KTtcclxuZnVuY3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A9ICczLjQuNSc7XG5cbmV4cG9ydCB7IFZhbGlkYXRpb25PYnNlcnZlciwgVmFsaWRhdGlvblByb3ZpZGVyLCBjb25maWd1cmUsIGV4dGVuZCwgbG9jYWxlQ2hhbmdlZCwgbG9jYWxpemUsIG5vcm1hbGl6ZVJ1bGVzLCBzZXRJbnRlcmFjdGlvbk1vZGUsIHZhbGlkYXRlLCB2ZXJzaW9uLCB3aXRoVmFsaWRhdGlvbiB9O1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/vee-validate/dist/vee-validate.esm.js\n"); /***/ }), /***/ "./resources/js/pages/auth/SigninPage.vue?vue&type=script&lang=js&": /*!*************************************************************************!*\ !*** ./resources/js/pages/auth/SigninPage.vue?vue&type=script&lang=js& ***! \*************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_0_rules_0_use_0_node_modules_vue_loader_lib_index_js_vue_loader_options_SigninPage_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5[0].rules[0].use[0]!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./SigninPage.vue?vue&type=script&lang=js& */ \"./node_modules/babel-loader/lib/index.js??clonedRuleSet-5[0].rules[0].use[0]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/js/pages/auth/SigninPage.vue?vue&type=script&lang=js&\");\n /* harmony default export */ __webpack_exports__[\"default\"] = (_node_modules_babel_loader_lib_index_js_clonedRuleSet_5_0_rules_0_use_0_node_modules_vue_loader_lib_index_js_vue_loader_options_SigninPage_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__.default); //# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9AbHV4L2xhcmF2ZWwtc3RhcnRlci8uL3Jlc291cmNlcy9qcy9wYWdlcy9hdXRoL1NpZ25pblBhZ2UudnVlPzMxNzEiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBME4sQ0FBQywrREFBZSw0TUFBRyxFQUFDIiwiZmlsZSI6Ii4vcmVzb3VyY2VzL2pzL3BhZ2VzL2F1dGgvU2lnbmluUGFnZS52dWU/dnVlJnR5cGU9c2NyaXB0Jmxhbmc9anMmLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IG1vZCBmcm9tIFwiLSEuLi8uLi8uLi8uLi9ub2RlX21vZHVsZXMvYmFiZWwtbG9hZGVyL2xpYi9pbmRleC5qcz8/Y2xvbmVkUnVsZVNldC01WzBdLnJ1bGVzWzBdLnVzZVswXSEuLi8uLi8uLi8uLi9ub2RlX21vZHVsZXMvdnVlLWxvYWRlci9saWIvaW5kZXguanM/P3Z1ZS1sb2FkZXItb3B0aW9ucyEuL1NpZ25pblBhZ2UudnVlP3Z1ZSZ0eXBlPXNjcmlwdCZsYW5nPWpzJlwiOyBleHBvcnQgZGVmYXVsdCBtb2Q7IGV4cG9ydCAqIGZyb20gXCItIS4uLy4uLy4uLy4uL25vZGVfbW9kdWxlcy9iYWJlbC1sb2FkZXIvbGliL2luZGV4LmpzPz9jbG9uZWRSdWxlU2V0LTVbMF0ucnVsZXNbMF0udXNlWzBdIS4uLy4uLy4uLy4uL25vZGVfbW9kdWxlcy92dWUtbG9hZGVyL2xpYi9pbmRleC5qcz8/dnVlLWxvYWRlci1vcHRpb25zIS4vU2lnbmluUGFnZS52dWU/dnVlJnR5cGU9c2NyaXB0Jmxhbmc9anMmXCIiXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./resources/js/pages/auth/SigninPage.vue?vue&type=script&lang=js&\n"); /***/ }), /***/ "./resources/js/pages/auth/SigninPage.vue?vue&type=template&id=1a6ff1df&": /*!*******************************************************************************!*\ !*** ./resources/js/pages/auth/SigninPage.vue?vue&type=template&id=1a6ff1df& ***! \*******************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "render": function() { return /* reexport safe */ _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_SigninPage_vue_vue_type_template_id_1a6ff1df___WEBPACK_IMPORTED_MODULE_0__.render; }, /* harmony export */ "staticRenderFns": function() { return /* reexport safe */ _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_SigninPage_vue_vue_type_template_id_1a6ff1df___WEBPACK_IMPORTED_MODULE_0__.staticRenderFns; } /* harmony export */ }); /* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_SigninPage_vue_vue_type_template_id_1a6ff1df___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./SigninPage.vue?vue&type=template&id=1a6ff1df& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/js/pages/auth/SigninPage.vue?vue&type=template&id=1a6ff1df&"); /***/ }), /***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/js/pages/auth/SigninPage.vue?vue&type=template&id=1a6ff1df&": /*!**********************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/js/pages/auth/SigninPage.vue?vue&type=template&id=1a6ff1df& ***! \**********************************************************************************************************************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"render\": function() { return /* binding */ render; },\n/* harmony export */ \"staticRenderFns\": function() { return /* binding */ staticRenderFns; }\n/* harmony export */ });\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\n \"div\",\n [\n _c(\n \"v-card\",\n { staticClass: \"text-center pa-1\" },\n [\n _c(\"v-card-title\", { staticClass: \"justify-center display-1 mb-2\" }, [\n _vm._v(\"Welcome\")\n ]),\n _vm._v(\" \"),\n _c(\"v-card-subtitle\", [_vm._v(\"Sign in to your account\")]),\n _vm._v(\" \"),\n _c(\n \"v-card-text\",\n [\n _c(\"validation-observer\", {\n ref: \"form\",\n scopedSlots: _vm._u([\n {\n key: \"default\",\n fn: function(ref) {\n var invalid = ref.invalid\n return [\n _c(\n \"v-form\",\n [\n _c(\"validation-provider\", {\n attrs: { name: \"username\", rules: \"required\" },\n scopedSlots: _vm._u(\n [\n {\n key: \"default\",\n fn: function(ref) {\n var errors = ref.errors\n return [\n _c(\"v-text-field\", {\n attrs: {\n label: _vm.$t(\"login.username\"),\n name: \"email\",\n outlined: \"\",\n \"error-messages\": errors[0]\n },\n model: {\n value: _vm.form.username,\n callback: function($$v) {\n _vm.$set(\n _vm.form,\n \"username\",\n $$v\n )\n },\n expression: \"form.username\"\n }\n })\n ]\n }\n }\n ],\n null,\n true\n )\n }),\n _vm._v(\" \"),\n _c(\"validation-provider\", {\n attrs: { name: \"password\", rules: \"required\" },\n scopedSlots: _vm._u(\n [\n {\n key: \"default\",\n fn: function(ref) {\n var errors = ref.errors\n return [\n _c(\"v-text-field\", {\n attrs: {\n \"append-icon\": _vm.showPassword\n ? \"mdi-eye\"\n : \"mdi-eye-off\",\n type: _vm.showPassword\n ? \"text\"\n : \"password\",\n \"error-messages\": errors[0],\n label: _vm.$t(\"login.password\"),\n name: \"password\",\n outlined: \"\"\n },\n on: {\n \"click:append\": function($event) {\n _vm.showPassword = !_vm.showPassword\n }\n },\n model: {\n value: _vm.form.password,\n callback: function($$v) {\n _vm.$set(\n _vm.form,\n \"password\",\n $$v\n )\n },\n expression: \"form.password\"\n }\n })\n ]\n }\n }\n ],\n null,\n true\n )\n }),\n _vm._v(\" \"),\n _c(\n \"v-btn\",\n {\n attrs: {\n loading: _vm.isLoading,\n disabled: invalid || _vm.isSignInDisabled,\n block: \"\",\n \"x-large\": \"\",\n color: \"primary\"\n },\n on: { click: _vm.submit }\n },\n [\n _vm._v(\n \"\\n \" +\n _vm._s(_vm.$t(\"login.button\")) +\n \"\\n \"\n )\n ]\n ),\n _vm._v(\" \"),\n _c(\n \"div\",\n { staticClass: \"mt-5\" },\n [\n _c(\n \"router-link\",\n { attrs: { to: \"/auth/forgot-password\" } },\n [\n _vm._v(\n \"\\n \" +\n _vm._s(_vm.$t(\"login.forgot\")) +\n \"\\n \"\n )\n ]\n )\n ],\n 1\n )\n ],\n 1\n )\n ]\n }\n }\n ])\n })\n ],\n 1\n )\n ],\n 1\n ),\n _vm._v(\" \"),\n _c(\n \"div\",\n { staticClass: \"text-center mt-6\" },\n [\n _vm._v(\"\\n \" + _vm._s(_vm.$t(\"login.noaccount\")) + \"\\n \"),\n _c(\n \"router-link\",\n { staticClass: \"font-weight-bold\", attrs: { to: \"/auth/signup\" } },\n [_vm._v(\"\\n \" + _vm._s(_vm.$t(\"login.create\")) + \"\\n \")]\n )\n ],\n 1\n )\n ],\n 1\n )\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9AbHV4L2xhcmF2ZWwtc3RhcnRlci8uL3Jlc291cmNlcy9qcy9wYWdlcy9hd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m0gPSB0aGlzXG4gIHZhciBfaCA9IF92bS4kY3JlYXRlRWxlbWVudFxuICB2YXIgX2MgPSBfdm0uX3NlbGYuX2MgfHwgX2hcbiAgcmV0dXJuIF9jKFxuICAgIFwiZGl2XCIsXG4gICAgW1xuICAgICAgX2MoXG4gICAgICAgIFwidi1jYXJkXCIsXG4gICAgICAgIHsgc3RhdGljQ2xhc3M6IFwidGV4dC1jZW50ZXIgcGEtMVwiIH0sXG4gICAgICAgIFtcbiAgICAgICAgICBfYyhcInYtY2FyZC10aXRsZVwiLCB7IHN0YXRpY0NsYXNzOiBcImp1c3RpZnktY2VudGVyIGRpc3BsYXktMSBtYi0yXCIgfSwgW1xuICAgICAgICAgICAgX3ZtLl92KFwiV2VsY29tZVwiKVxuICAgICAgICAgIF0pLFxuICAgICAgICAgIF92bS5fdihcIiBcIiksXG4gICAgICAgICAgX2MoXCJ2LWNhcmQtc3VidGl0bGVcIiwgW192bS5fdihcIlNpZ24gaW4gdG8geW91ciBhY2NvdW50XCIpXSksXG4gICAgICAgICAgX3ZtLl92KFwiIFwiKSxcbiAgICAgICAgICBfYyhcbiAgICAgICAgICAgIFwidi1jYXJkLXRleHRcIixcbiAgICAgICAgICAgIFtcbiAgICAgICAgICAgICAgX2MoXCJ2YWxpZGF0aW9uLW9ic2VydmVyXCIsIHtcbiAgICAgICAgICAgICAgICByZWY6IFwiZm9ybVwiLFxuICAgICAgICAgICAgICAgIHNjb3BlZFNsb3RzOiBfdm0uX3UoW1xuICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICBrZXk6IFwiZGVmYXVsdFwiLFxuICAgICAgICAgICAgICAgICAgICBmbjogZnVuY3Rpb24ocmVmKSB7XG4gICAgICAgICAgICAgICAgICAgICAgdmFyIGludmFsaWQgPSByZWYuaW52YWxpZFxuICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbXG4gICAgICAgICAgICAgICAgICAgICAgICBfYyhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgXCJ2LWZvcm1cIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9jKFwidmFsaWRhdGlvbi1wcm92aWRlclwiLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdHRyczogeyBuYW1lOiBcInVzZXJuYW1lXCIsIHJ1bGVzOiBcInJlcXVpcmVkXCIgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlZFNsb3RzOiBfdm0uX3UoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXk6IFwiZGVmYXVsdFwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm46IGZ1bmN0aW9uKHJlZikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZXJyb3JzID0gcmVmLmVycm9yc1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9jKFwidi10ZXh0LWZpZWxkXCIsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF0dHJzOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxhYmVsOiBfdm0uJHQoXCJsb2dpbi51c2VybmFtZVwiKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTogXCJlbWFpbFwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdXRsaW5lZDogXCJcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJlcnJvci1tZXNzYWdlc1wiOiBlcnJvcnNbMF1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2RlbDoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZTogX3ZtLmZvcm0udXNlcm5hbWUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrOiBmdW5jdGlvbigkJHYpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfdm0uJHNldChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF92bS5mb3JtLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJ1c2VybmFtZVwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJCR2XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHByZXNzaW9uOiBcImZvcm0udXNlcm5hbWVcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRydWVcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfdm0uX3YoXCIgXCIpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9jKFwidmFsaWRhdGlvbi1wcm92aWRlclwiLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdHRyczogeyBuYW1lOiBcInBhc3N3b3JkXCIsIHJ1bGVzOiBcInJlcXVpcmVkXCIgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlZFNsb3RzOiBfdm0uX3UoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXk6IFwiZGVmYXVsdFwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm46IGZ1bmN0aW9uKHJlZikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZXJyb3JzID0gcmVmLmVycm9yc1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9jKFwidi10ZXh0LWZpZWxkXCIsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF0dHJzOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwiYXBwZW5kLWljb25cIjogX3ZtLnNob3dQYXNzd29yZFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gXCJtZGktZXllXCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IFwibWRpLWV5ZS1vZmZcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogX3ZtLnNob3dQYXNzd29yZFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gXCJ0ZXh0XCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IFwicGFzc3dvcmRcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJlcnJvci1tZXNzYWdlc1wiOiBlcnJvcnNbMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxhYmVsOiBfdm0uJHQoXCJsb2dpbi5wYXNzd29yZFwiKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTogXCJwYXNzd29yZFwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdXRsaW5lZDogXCJcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwiY2xpY2s6YXBwZW5kXCI6IGZ1bmN0aW9uKCRldmVudCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF92bS5zaG93UGFzc3dvcmQgPSAhX3ZtLnNob3dQYXNzd29yZFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbW9kZWw6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU6IF92bS5mb3JtLnBhc3N3b3JkLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYWxsYmFjazogZnVuY3Rpb24oJCR2KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX3ZtLiRzZXQoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfdm0uZm9ybSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwicGFzc3dvcmRcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICQkdlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXhwcmVzc2lvbjogXCJmb3JtLnBhc3N3b3JkXCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBudWxsLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cnVlXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICApXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgX3ZtLl92KFwiIFwiKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfYyhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwidi1idG5cIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXR0cnM6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2FkaW5nOiBfdm0uaXNMb2FkaW5nLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpc2FibGVkOiBpbnZhbGlkIHx8IF92bS5pc1NpZ25JbkRpc2FibGVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJsb2NrOiBcIlwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwieC1sYXJnZVwiOiBcIlwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbG9yOiBcInByaW1hcnlcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbjogeyBjbGljazogX3ZtLnN1Ym1pdCB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfdm0uX3YoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJcXG4gICAgICAgICAgICBcIiArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfdm0uX3MoX3ZtLiR0KFwibG9naW4uYnV0dG9uXCIpKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcIlxcbiAgICAgICAgICBcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfdm0uX3YoXCIgXCIpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9jKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJkaXZcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgc3RhdGljQ2xhc3M6IFwibXQtNVwiIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9jKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwicm91dGVyLWxpbmtcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IGF0dHJzOiB7IHRvOiBcIi9hdXRoL2ZvcmdvdC1wYXNzd29yZFwiIH0gfSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfdm0uX3YoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwiXFxuICAgICAgICAgICAgICBcIiArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX3ZtLl9zKF92bS4kdChcImxvZ2luLmZvcmdvdFwiKSkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwiXFxuICAgICAgICAgICAgXCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKVxuICAgICAgICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAxXG4gICAgICAgICAgICAgICAgICAgICAgICApXG4gICAgICAgICAgICAgICAgICAgICAgXVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgXSlcbiAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAxXG4gICAgICAgICAgKVxuICAgICAgICBdLFxuICAgICAgICAxXG4gICAgICApLFxuICAgICAgX3ZtLl92KFwiIFwiKSxcbiAgICAgIF9jKFxuICAgICAgICBcImRpdlwiLFxuICAgICAgICB7IHN0YXRpY0NsYXNzOiBcInRleHQtY2VudGVyIG10LTZcIiB9LFxuICAgICAgICBbXG4gICAgICAgICAgX3ZtLl92KFwiXFxuICAgIFwiICsgX3ZtLl9zKF92bS4kdChcImxvZ2luLm5vYWNjb3VudFwiKSkgKyBcIlxcbiAgICBcIiksXG4gICAgICAgICAgX2MoXG4gICAgICAgICAgICBcInJvdXRlci1saW5rXCIsXG4gICAgICAgICAgICB7IHN0YXRpY0NsYXNzOiBcImZvbnQtd2VpZ2h0LWJvbGRcIiwgYXR0cnM6IHsgdG86IFwiL2F1dGgvc2lnbnVwXCIgfSB9LFxuICAgICAgICAgICAgW192bS5fdihcIlxcbiAgICAgIFwiICsgX3ZtLl9zKF92bS4kdChcImxvZ2luLmNyZWF0ZVwiKSkgKyBcIlxcbiAgICBcIildXG4gICAgICAgICAgKVxuICAgICAgICBdLFxuICAgICAgICAxXG4gICAgICApXG4gICAgXSxcbiAgICAxXG4gIClcbn1cbnZhciBzdGF0aWNSZW5kZXJGbnMgPSBbXVxucmVuZGVyLl93aXRoU3RyaXBwZWQgPSB0cnVlXG5cbmV4cG9ydCB7IHJlbmRlciwgc3RhdGljUmVuZGVyRm5zIH0iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/js/pages/auth/SigninPage.vue?vue&type=template&id=1a6ff1df&\n"); /***/ }), /***/ "./resources/js/pages/auth/SigninPage.vue": /*!************************************************!*\ !*** ./resources/js/pages/auth/SigninPage.vue ***! \************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _SigninPage_vue_vue_type_template_id_1a6ff1df___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SigninPage.vue?vue&type=template&id=1a6ff1df& */ \"./resources/js/pages/auth/SigninPage.vue?vue&type=template&id=1a6ff1df&\");\n/* harmony import */ var _SigninPage_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SigninPage.vue?vue&type=script&lang=js& */ \"./resources/js/pages/auth/SigninPage.vue?vue&type=script&lang=js&\");\n/* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ \"./node_modules/vue-loader/lib/runtime/componentNormalizer.js\");\n/* harmony import */ var _node_modules_vuetify_loader_lib_runtime_installComponents_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/vuetify-loader/lib/runtime/installComponents.js */ \"./node_modules/vuetify-loader/lib/runtime/installComponents.js\");\n/* harmony import */ var _node_modules_vuetify_loader_lib_runtime_installComponents_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_vuetify_loader_lib_runtime_installComponents_js__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var vuetify_lib_components_VBtn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vuetify/lib/components/VBtn */ \"./node_modules/vuetify/lib/components/VBtn/VBtn.js\");\n/* harmony import */ var vuetify_lib_components_VCard__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vuetify/lib/components/VCard */ \"./node_modules/vuetify/lib/components/VCard/VCard.js\");\n/* harmony import */ var vuetify_lib_components_VCard__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vuetify/lib/components/VCard */ \"./node_modules/vuetify/lib/components/VCard/index.js\");\n/* harmony import */ var vuetify_lib_components_VForm__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vuetify/lib/components/VForm */ \"./node_modules/vuetify/lib/components/VForm/VForm.js\");\n/* harmony import */ var vuetify_lib_components_VTextField__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! vuetify/lib/components/VTextField */ \"./node_modules/vuetify/lib/components/VTextField/VTextField.js\");\n\n\n\n\n\n/* normalize component */\n;\nvar component = (0,_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__.default)(\n _SigninPage_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__.default,\n _SigninPage_vue_vue_type_template_id_1a6ff1df___WEBPACK_IMPORTED_MODULE_0__.render,\n _SigninPage_vue_vue_type_template_id_1a6ff1df___WEBPACK_IMPORTED_MODULE_0__.staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\n/* vuetify-loader */\n;\n\n\n\n\n\n\n\n_node_modules_vuetify_loader_lib_runtime_installComponents_js__WEBPACK_IMPORTED_MODULE_3___default()(component, {VBtn: vuetify_lib_components_VBtn__WEBPACK_IMPORTED_MODULE_4__.default,VCard: vuetify_lib_components_VCard__WEBPACK_IMPORTED_MODULE_5__.default,VCardSubtitle: vuetify_lib_components_VCard__WEBPACK_IMPORTED_MODULE_6__.VCardSubtitle,VCardText: vuetify_lib_components_VCard__WEBPACK_IMPORTED_MODULE_6__.VCardText,VCardTitle: vuetify_lib_components_VCard__WEBPACK_IMPORTED_MODULE_6__.VCardTitle,VForm: vuetify_lib_components_VForm__WEBPACK_IMPORTED_MODULE_7__.default,VTextField: vuetify_lib_components_VTextField__WEBPACK_IMPORTED_MODULE_8__.default})\n\n\n/* hot reload */\nif (false) { var api; }\ncomponent.options.__file = \"resources/js/pages/auth/SigninPage.vue\"\n/* harmony default export */ __webpack_exports__[\"default\"] = (component.exports);//# sourceURL=[module]\n//# sourceMappingUR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0=\n//# sourceURL=webpack-internal:///./resources/js/pages/auth/SigninPage.vue\n"); /***/ }), /***/ "./node_modules/vuetify/lib/components/VCard/index.js": /*!************************************************************!*\ !*** ./node_modules/vuetify/lib/components/VCard/index.js ***! \************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"VCard\": function() { return /* reexport safe */ _VCard__WEBPACK_IMPORTED_MODULE_1__.default; },\n/* harmony export */ \"VCardActions\": function() { return /* binding */ VCardActions; },\n/* harmony export */ \"VCardSubtitle\": function() { return /* binding */ VCardSubtitle; },\n/* harmony export */ \"VCardText\": function() { return /* binding */ VCardText; },\n/* harmony export */ \"VCardTitle\": function() { return /* binding */ VCardTitle; }\n/* harmony export */ });\n/* harmony import */ var _VCard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VCard */ \"./node_modules/vuetify/lib/components/VCard/VCard.js\");\n/* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util/helpers */ \"./node_modules/vuetify/lib/util/helpers.js\");\n\n\nconst VCardActions = (0,_util_helpers__WEBPACK_IMPORTED_MODULE_0__.createSimpleFunctional)('v-card__actions');\nconst VCardSubtitle = (0,_util_helpers__WEBPACK_IMPORTED_MODULE_0__.createSimpleFunctional)('v-card__subtitle');\nconst VCardText = (0,_util_helpers__WEBPACK_IMPORTED_MODULE_0__.createSimpleFunctional)('v-card__text');\nconst VCardTitle = (0,_util_helpers__WEBPACK_IMPORTED_MODULE_0__.createSimpleFunctional)('v-card__title');\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n $_vuetify_subcomponents: {\n VCard: _VCard__WEBPACK_IMPORTED_MODULE_1__.default,\n VCardActions,\n VCardSubtitle,\n VCardText,\n VCardTitle\n }\n});\n//# sourceMappingURL=index.js.map//# sourceURL=[module]\n//# sourceMapping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cG9ydCB7IFZDYXJkLCBWQ2FyZEFjdGlvbnMsIFZDYXJkU3VidGl0bGUsIFZDYXJkVGV4dCwgVkNhcmRUaXRsZSB9O1xuZXhwb3J0IGRlZmF1bHQge1xuICAkX3Z1ZXRpZnlfc3ViY29tcG9uZW50czoge1xuICAgIFZDYXJkLFxuICAgIFZDYXJkQWN0aW9ucyxcbiAgICBWQ2FyZFN1YnRpdGxlLFxuICAgIFZDYXJkVGV4dCxcbiAgICBWQ2FyZFRpdGxlXG4gIH1cbn07XG4vLyMgc291cmNlTWFwcGluZ1VSTD1pbmRleC5qcy5tYXAiXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/vuetify/lib/components/VCard/index.js\n"); /***/ }), /***/ "./node_modules/vuetify/lib/components/VForm/VForm.js": /*!************************************************************!*\ !*** ./node_modules/vuetify/lib/components/VForm/VForm.js ***! \************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util/mixins */ \"./node_modules/vuetify/lib/util/mixins.js\");\n/* harmony import */ var _mixins_binds_attrs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/binds-attrs */ \"./node_modules/vuetify/lib/mixins/binds-attrs/index.js\");\n/* harmony import */ var _mixins_registrable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/registrable */ \"./node_modules/vuetify/lib/mixins/registrable/index.js\");\n// Mixins\n\n\n\n/* @vue/component */\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ((0,_util_mixins__WEBPACK_IMPORTED_MODULE_0__.default)(_mixins_binds_attrs__WEBPACK_IMPORTED_MODULE_1__.default, (0,_mixins_registrable__WEBPACK_IMPORTED_MODULE_2__.provide)('form')\n/* @vue/component */\n).extend({\n name: 'v-form',\n\n provide() {\n return {\n form: this\n };\n },\n\n inheritAttrs: false,\n props: {\n disabled: Boolean,\n lazyValidation: Boolean,\n readonly: Boolean,\n value: Boolean\n },\n data: () => ({\n inputs: [],\n watchers: [],\n errorBag: {}\n }),\n watch: {\n errorBag: {\n handler(val) {\n const errors = Object.values(val).includes(true);\n this.$emit('input', !errors);\n },\n\n deep: true,\n immediate: true\n }\n },\n methods: {\n watchInput(input) {\n const watcher = input => {\n return input.$watch('hasError', val => {\n this.$set(this.errorBag, input._uid, val);\n }, {\n immediate: true\n });\n };\n\n const watchers = {\n _uid: input._uid,\n valid: () => {},\n shouldValidate: () => {}\n };\n\n if (this.lazyValidation) {\n // Only start watching inputs if we need to\n watchers.shouldValidate = input.$watch('shouldValidate', val => {\n if (!val) return; // Only watch if we're not already doing it\n\n if (this.errorBag.hasOwnProperty(input._uid)) return;\n watchers.valid = watcher(input);\n });\n } else {\n watchers.valid = watcher(input);\n }\n\n return watchers;\n },\n\n /** @public */\n validate() {\n return this.inputs.filter(input => !input.validate(true)).length === 0;\n },\n\n /** @public */\n reset() {\n this.inputs.forEach(input => input.reset());\n this.resetErrorBag();\n },\n\n resetErrorBag() {\n if (this.lazyValidation) {\n // Account for timeout in validatable\n setTimeout(() => {\n this.errorBag = {};\n }, 0);\n }\n },\n\n /** @public */\n resetValidation() {\n this.inputs.forEach(input => input.resetValidation());\n this.resetErrorBag();\n },\n\n register(input) {\n this.inputs.push(input);\n this.watchers.push(this.watchInput(input));\n },\n\n unregister(input) {\n const found = this.inputs.find(i => i._uid === input._uid);\n if (!found) return;\n const unwatch = this.watchers.find(i => i._uid === found._uid);\n\n if (unwatch) {\n unwatch.valid();\n unwatch.shouldValidate();\n }\n\n this.watchers = this.watchers.filter(i => i._uid !== found._uid);\n this.inputs = this.inputs.filter(i => i._uid !== found._uid);\n this.$delete(this.errorBag, found._uid);\n }\n\n },\n\n render(h) {\n return h('form', {\n staticClass: 'v-form',\n attrs: {\n novalidate: true,\n ...this.attrs$\n },\n on: {\n submit: e => this.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XMuYXR0cnMkXG4gICAgICB9LFxuICAgICAgb246IHtcbiAgICAgICAgc3VibWl0OiBlID0+IHRoaXMuJGVtaXQoJ3N1Ym1pdCcsIGUpXG4gICAgICB9XG4gICAgfSwgdGhpcy4kc2xvdHMuZGVmYXVsdCk7XG4gIH1cblxufSk7XG4vLyMgc291cmNlTWFwcGluZ1VSTD1WRm9ybS5qcy5tYXAiXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/vuetify/lib/components/VForm/VForm.js\n"); /***/ }) }]);
/** * Kendo UI v2016.3.1118 (http://www.telerik.com/kendo-ui) * Copyright 2016 Telerik AD. All rights reserved. * * Kendo UI commercial licenses may be obtained at * http://www.telerik.com/purchase/license-agreement/kendo-ui-complete * If you do not own a commercial license, this file shall be governed by the trial license terms. */ !function(e){"function"==typeof define&&define.amd?define(["kendo.core.min"],e):e()}(function(){!function(e,M){kendo.cultures.tn={name:"tn",numberFormat:{pattern:["-n"],decimals:2,",":",",".":".",groupSize:[3],percent:{pattern:["-%n","%n"],decimals:2,",":",",".":".",groupSize:[3],symbol:"%"},currency:{name:"",abbr:"",pattern:["$-n","$ n"],decimals:2,",":",",".":".",groupSize:[3],symbol:"R"}},calendars:{standard:{days:{names:["Sontaga","Mosupologo","Labobedi","Laboraro","Labone","Labotlhano","Matlhatso"],namesAbbr:["Sont.","Mos.","Lab.","Labr.","Labn.","Labt.","Matlh."],namesShort:["So","Ms","Lb","Lr","Ln","Lt","Ma"]},months:{names:["Ferikgong","Tlhakole","Mopitlwe","Moranang","Motsheganong","Seetebosigo","Phukwi","Phatwe","Lwetse","Diphalane","Ngwanatsele","Sedimothole"],namesAbbr:["Fer.","Tlh.","Mop.","Mor.","Motsh.","Seet.","Phk.","Pht.","Lwetse.","Diph.","Ngwn.","Sed."]},AM:["Mo Mosong","mo mosong","MO MOSONG"],PM:["Mo Maitseboeng","mo maitseboeng","MO MAITSEBOENG"],patterns:{d:"dd/MM/yy",D:"dd MMMM yyyy",F:"dd MMMM yyyy hh:mm:ss tt",g:"dd/MM/yy hh:mm tt",G:"dd/MM/yy hh:mm:ss tt",m:"d MMMM",M:"d MMMM",s:"yyyy'-'MM'-'dd'T'HH':'mm':'ss",t:"hh:mm tt",T:"hh:mm:ss tt",u:"yyyy'-'MM'-'dd HH':'mm':'ss'Z'",y:"MMMM yyyy",Y:"MMMM yyyy"},"/":"/",":":":",firstDay:1}}}}(this)}); //# sourceMappingURL=kendo.culture.tn.min.js.map
window.addEventListener("deviceorientation", on_device_orientation); function on_device_orientation(evt){ var alpha=evt.alpha; var beta=evt.beta; var gamma=evt.gamma; document.getElementById("a").innerHTML ="Alpha="+Math.round(alpha).toString(); document.getElementById("b").innerHTML = "Beta="+Math.round(beta).toString(); document.getElementById("c").innerHTML = "Gamma="+Math.round(gamma).toString(); var canvas=document.getElementById("canvas"); var ctx= canvas.getContext("2d"); ctx.clearRect(0,0, canvas.width,canvas.height); var raza=20; var centru={x:canvas.width/2, y:canvas.height/2}; ctx.beginPath(); ctx.arc(centru.x +gamma*(canvas.width /2-raza), centru.y+beta*(canvas.height /2-raza), raza, 0, 2 * Math.PI); ctx.stroke(); }
import React, { useState, useEffect, useRef } from "react" import { useStaticQuery, graphql } from "gatsby" import PropTypes from "prop-types" import LogoSvg from "../images/gpo_logo_min.svg" import PhoneSvg from "../images/gpo-phone.svg" import GarageSvg from "../images/gpo-garage.svg" import BackgroundImage from "gatsby-background-image" import Navtabs from "../components/navtabs" function Header(props) { const [navClass, setNavClass] = useState("gpo-header") const [navColor, setNavColor] = useState("transparent") const headerHeight = 75 const [tabsHeight, setTabsHeight]=useState(0) const tabsRef=useRef(null) useEffect() const listenScrollEvent = () => { window.scrollY > headerHeight ? setNavColor("#252734") : setNavColor("transparent") window.scrollY > headerHeight ? setNavClass("gpo-header gpo-header--scrolled") : setNavClass("gpo-header") } useEffect(() => { window.addEventListener("scroll", listenScrollEvent) return () => { window.removeEventListener("scroll", listenScrollEvent) } }, []) const data = useStaticQuery(graphql` query{ indexImage:file(relativePath:{ eq:"gpo-hero-webp.webp" }){ childImageSharp{ fluid(maxWidth:1800){ ...GatsbyImageSharpFluid } } }, } `); return ( <> <header className={navClass} > <div className="gpo-header__left"> <div className="gpo-tel-icon"> <PhoneSvg /> </div> <div className="gpo-tel-numbers"> <a href="tel:+40751126339" className="gpo-header-phone"> (+4)0751-126-339 <br /> </a> <a href="tel:+40741093493" className="gpo-header-phone"> (+4)0741-093-493 </a> </div> </div> <div className="gpo-header__mid"> <LogoSvg /> </div> <div className="gpo-header__right"> <GarageSvg /> </div> </header> <section className="gpo-hero-tabs" > <div className="wrapper" > <BackgroundImage className="gpo-heroImage" fluid={data.indexImage.childImageSharp.fluid} fadeIn > <div className="gpo-black-overlay" > <div className="gpo-content-box"> <h3> <button onClick={() => { console.log('clicked') }}>Call To Action</button> </h3> </div> </div> </BackgroundImage> <Navtabs /> </div> </section > </> ) } Header.propTypes = { siteTitle: PropTypes.string, } Header.defaultProps = { siteTitle: ``, } export default Header
module.exports = { name: require('./package').name };
import { createElement as h, options, render, createRef, Component, Fragment } from 'preact'; import { setupScratch, teardown, clearOptions } from '../../../test/_util/helpers'; import { serializeVNode, initDebug } from '../../src/debug'; import * as PropTypes from 'prop-types'; /** @jsx h */ describe('debug', () => { let scratch; let errors = []; let diffSpy; beforeEach(() => { errors = []; scratch = setupScratch(); sinon.stub(console, 'error').callsFake(e => errors.push(e)); clearOptions(); diffSpy = sinon.spy(); options.diff = diffSpy; initDebug(); }); afterEach(() => { /** @type {*} */ (console.error).restore(); teardown(scratch); }); it('should call previous options', () => { render(<div />, scratch); expect(diffSpy, 'diff').to.have.been.called; }); it('should print an error on undefined component', () => { let fn = () => render(h(undefined), scratch); expect(fn).to.throw(/createElement/); }); it('should print an error on invalid refs', () => { let fn = () => render(<div ref="a" />, scratch); expect(fn).to.throw(/createRef/); // Allow strings for compat let vnode = <div ref="a" />; /** @type {*} */ (vnode).$$typeof = 'foo'; render(vnode, scratch); expect(console.error).to.not.be.called; }); it('should print an error on invalid handler', () => { let fn = () => render(<div onclick="a" />, scratch); expect(fn).to.throw(/"onclick" property should be a function/); }); it('should NOT print an error on valid refs', () => { let noop = () => {}; render(<div ref={noop} />, scratch); let ref = createRef(); render(<div ref={ref} />, scratch); expect(console.error).to.not.be.called; }); describe('duplicate keys', () => { const List = props => <ul>{props.children}</ul>; const ListItem = props => <li>{props.children}</li>; it('should print an error on duplicate keys with DOM nodes', () => { render(<div><span key="a" /><span key="a" /></div>, scratch); expect(console.error).to.be.calledOnce; }); it('should allow distinct object keys', () => { const A = { is: 'A' }; const B = { is: 'B' }; render(<div><span key={A} /><span key={B} /></div>, scratch); expect(console.error).not.to.be.called; }); it('should print an error for duplicate object keys', () => { const A = { is: 'A' }; render(<div><span key={A} /><span key={A} /></div>, scratch); expect(console.error).to.be.calledOnce; }); it('should print an error on duplicate keys with Components', () => { function App() { return ( <List> <ListItem key="a">a</ListItem> <ListItem key="b">b</ListItem> <ListItem key="b">d</ListItem> <ListItem key="d">d</ListItem> </List> ); } render(<App />, scratch); // The error is printed twice. Once for children of <List> // and again for children of <ul> (since List returns props.children) expect(console.error).to.be.calledTwice; }); it('should print an error on duplicate keys with Fragments', () => { function App() { return ( <Fragment> <List key="list"> <ListItem key="a">a</ListItem> <ListItem key="b">b</ListItem> <Fragment key="b"> {/* Should be okay to dupliate keys since these are inside a Fragment */} <ListItem key="a">c</ListItem> <ListItem key="b">d</ListItem> <ListItem key="c">e</ListItem> </Fragment> <ListItem key="f">f</ListItem> </List>, <div key="list">sibling</div> </Fragment> ); } render(<App />, scratch); // One error is printed twice. Once for children of <List> // and again for children of <ul> (since List returns props.children) expect(console.error).to.be.calledThrice; }); }); describe('serializeVNode', () => { it('should prefer a function component\'s displayName', () => { function Foo() { return <div />; } Foo.displayName = 'Bar'; expect(serializeVNode(<Foo />)).to.equal('<Bar />'); }); it('should prefer a class component\'s displayName', () => { class Bar extends Component { render() { return <div />; } } Bar.displayName = 'Foo'; expect(serializeVNode(<Bar />)).to.equal('<Foo />'); }); it('should serialize vnodes without children', () => { expect(serializeVNode(<br />)).to.equal('<br />'); }); it('should serialize vnodes with children', () => { expect(serializeVNode(<div>Hello World</div>)).to.equal('<div>..</div>'); }); it('should serialize components', () => { function Foo() { return <div />; } expect(serializeVNode(<Foo />)).to.equal('<Foo />'); }); it('should serialize props', () => { expect(serializeVNode(<div class="foo" />)).to.equal('<div class="foo" />'); let noop = () => {}; expect(serializeVNode(<div onClick={noop} />)) .to.equal('<div onClick="function noop() {}" />'); function Foo(props) { return props.foo; } expect(serializeVNode(<Foo foo={[1, 2, 3]} />)) .to.equal('<Foo foo="1,2,3" />'); }); }); describe('PropTypes', () => { it('should fail if props don\'t match prop-types', () => { function Foo(props) { return <h1>{props.text}</h1>; } Foo.propTypes = { text: PropTypes.string.isRequired }; render(<Foo />, scratch); expect(console.error).to.be.calledOnce; expect(errors[0].includes('required')).to.equal(true); }); it('should not print to console when types are correct', () => { function Bar(props) { return <h1>{props.text}</h1>; } Bar.propTypes = { text: PropTypes.string.isRequired }; render(<Bar text="foo" />, scratch); expect(console.error).to.not.be.called; }); }); });
var _ = require('./lib/underscore'), async = require('async'), cache = require('./server/state').dbCache, caps = require('./server/caps'), common = require('./common'), config = require('./config'), events = require('events'), fs = require('fs'), hooks = require('./hooks'), ipUtils = require('ip'), Muggle = require('./etc').Muggle, tail = require('./tail'), util = require('util'), winston = require('winston'); var imager = require('./imager'); /* set up hooks */ var OPs = exports.OPs = cache.OPs; var TAGS = exports.TAGS = cache.opTags; var SUBS = exports.SUBS = cache.threadSubs; var LUA = {}; function register_lua(name) { var src = fs.readFileSync('lua/' + name + '.lua', 'UTF-8'); LUA[name] = {src: src}; } function redis_client() { var conn = require('redis').createClient(config.REDIS_PORT || undefined); // ASYNC SETUP RACE! for (var k in LUA) load(LUA[k]); function load(entry) { conn.script('load', entry.src, function (err, sha) { if (err) throw err; entry.sha = sha; }); } return conn; } exports.redis_client = redis_client; // wait for the `register_lua` calls before connecting process.nextTick(function () { global.redis = redis_client(); }); /* REAL-TIME UPDATES */ function Subscription(targetInfo) { events.EventEmitter.call(this); this.setMaxListeners(0); this.fullKey = targetInfo.key; this.target = targetInfo.target; this.channel = targetInfo.channel; SUBS[this.fullKey] = this; this.pending_subscriptions = []; this.subscription_callbacks = []; this.k = redis_client(); this.k.on('error', this.on_sub_error.bind(this)); this.k.on('subscribe', this.on_one_sub.bind(this)); this.k.subscribe(this.target); this.subscriptions = [this.target]; this.pending_subscriptions.push(this.target); if (this.target != this.fullKey) { this.k.subscribe(this.fullKey); this.pending_subscriptions.push(this.fullKey); } }; util.inherits(Subscription, events.EventEmitter); var S = Subscription.prototype; Subscription.full_key = function (target, ident) { var channel; if (ident && ident.priv) channel = 'priv:' + ident.priv; else if (caps.can_moderate(ident)) channel = 'auth'; var key = channel ? channel + ':' + target : target; return {key: key, channel: channel, target: target}; }; Subscription.get = function (target, ident) { var full = Subscription.full_key(target, ident); var sub = SUBS[full.key]; if (!sub) sub = new Subscription(full); return sub; }; S.when_ready = function (cb) { if (this.subscription_callbacks) this.subscription_callbacks.push(cb); else cb(null); }; S.on_one_sub = function (name) { var i = this.pending_subscriptions.indexOf(name); if (i < 0) throw "Obtained unasked-for subscription " + name + "?!"; this.pending_subscriptions.splice(i, 1); if (this.pending_subscriptions.length == 0) this.on_all_subs(); }; S.on_all_subs = function () { var k = this.k; k.removeAllListeners('subscribe'); k.on('message', this.on_message.bind(this)); k.removeAllListeners('error'); k.on('error', this.sink_sub.bind(this)); this.subscription_callbacks.forEach(function (cb) { cb(null); }); delete this.pending_subscriptions; delete this.subscription_callbacks; }; function parse_pub_message(msg) { var m = msg.match(/^(\d+)\|/); var prefixLen = m[0].length; var bodyLen = parse_number(m[1]); var info = {body: msg.substr(prefixLen, bodyLen)}; var suffixPos = prefixLen + bodyLen; if (msg.length > suffixPos) info.suffixPos = suffixPos; return info; } S.on_message = function (chan, msg) { /* Do we need to clarify whether this came from target or fullKey? */ var parsed = parse_pub_message(msg), extra; if (this.channel && parsed.suffixPos) { var suffix = JSON.parse(msg.slice(parsed.suffixPos)); extra = suffix[this.channel]; } msg = parsed.body; var m = msg.match(/^(\d+),(\d+)/); var op = parse_number(m[1]); var kind = parse_number(m[2]); if (extra && kind == common.INSERT_POST) { // add ip to INSERT_POST var m = msg.match(/^(\d+,2,\d+,{)(.+)$/); if (m && extra.ip) { if (/"ip":/.test(msg)) throw "`ip` in public pub " + chan; msg = m[1] + '"ip":' + JSON.stringify(extra.ip) + ',' + m[2]; } } this.emit('update', op, kind, '[[' + msg + ']]'); }; S.on_sub_error = function (err) { winston.error("Subscription error:", (err.stack || err)); this.commit_sudoku(); this.subscription_callbacks.forEach(function (cb) { cb(err); }); this.subscription_callbacks = null; }; S.sink_sub = function (err) { if (config.DEBUG) throw err; this.emit('error', this.target, err); this.commit_sudoku(); }; S.commit_sudoku = function () { var k = this.k; k.removeAllListeners('error'); k.removeAllListeners('message'); k.removeAllListeners('subscribe'); k.quit(); if (SUBS[this.fullKey] === this) delete SUBS[this.fullKey]; this.removeAllListeners('update'); this.removeAllListeners('error'); }; S.has_no_listeners = function () { /* Possibly idle out after a while */ var self = this; if (this.idleOutTimer) clearTimeout(this.idleOutTimer); this.idleOutTimer = setTimeout(function () { self.idleOutTimer = null; if (self.listeners('update').length == 0) self.commit_sudoku(); }, 30 * 1000); }; /* OP CACHE */ function add_OP_tag(tagIndex, op) { var tags = TAGS[op]; if (tags === undefined) TAGS[op] = tagIndex; else if (typeof tags == 'number') { if (tagIndex != tags) TAGS[op] = [tags, tagIndex]; } else if (tags.indexOf(tagIndex) < 0) tags.push(tagIndex); } function set_OP_tag(tagIndex, op) { TAGS[op] = tagIndex; } function OP_has_tag(tag, op) { var index = config.BOARDS.indexOf(tag); if (index < 0) return false; var tags = TAGS[op]; if (tags === undefined) return false; if (typeof tags == 'number') return index == tags; else return tags.indexOf(index) >= 0; }; exports.OP_has_tag = OP_has_tag; exports.first_tag_of = function (op) { var tags = TAGS[op]; if (tags === undefined) return false; else if (typeof tags == 'number') return config.BOARDS[tags]; else return config.BOARDS[tags[0]]; }; function tags_of(op) { var tags = TAGS[op]; if (tags === undefined) return false; else if (typeof tags == 'number') return [config.BOARDS[tags]]; else return tags.map(function (i) { return config.BOARDS[i]; }); } exports.tags_of = tags_of; function update_cache(chan, msg) { msg = JSON.parse(msg); var op = msg.op, kind = msg.kind, tag = msg.tag; if (kind == common.INSERT_POST) { if (msg.num) OPs[msg.num] = op; else { add_OP_tag(config.BOARDS.indexOf(tag), op); OPs[op] = op; } } else if (kind == common.MOVE_THREAD) { set_OP_tag(config.BOARDS.indexOf(tag), op); } else if (kind == common.DELETE_POSTS) { msg.nums.forEach(function (num) { delete OPs[num]; }); } else if (kind == common.DELETE_THREAD) { msg.nums.forEach(function (num) { delete OPs[num]; }); delete TAGS[op]; } } exports.track_OPs = function (callback) { var k = redis_client(); k.subscribe('cache'); k.once('subscribe', function () { load_OPs(callback); }); k.on('message', update_cache); /* k persists for the purpose of cache updates */ }; exports.on_pub = function (name, handler) { // TODO: share redis connection var k = redis_client(); k.subscribe(name); k.on('message', handler); /* k persists */ }; function load_OPs(callback) { var r = global.redis; var boards = config.BOARDS; // Want consistent ordering in the TAGS entries for multi-tag threads // (so do them in series) tail.forEach(boards, scan_board, callback); var threadsKey; function scan_board(tag, cb) { var tagIndex = boards.indexOf(tag); threadsKey = 'tag:' + tag_key(tag) + ':threads'; r.zrange(threadsKey, 0, -1, function (err, threads) { if (err) return cb(err); async.forEach(threads, function (op, cb) { op = parse_number(op); var ps = [scan_thread.bind(null,tagIndex,op)]; if (!config.READ_ONLY && config.THREAD_EXPIRY && tag != 'archive' && tag != 'reien') { ps.push(refresh_expiry.bind(null, tag, op)); } async.parallel(ps, cb); }, cb); }); } function scan_thread(tagIndex, op, cb) { op = parse_number(op); add_OP_tag(tagIndex, op); OPs[op] = op; get_all_replies_and_privs(r, op, function (err, posts) { if (err) return cb(err); posts.forEach(function (num) { OPs[parse_number(num)] = op; }); cb(null); }); } function refresh_expiry(tag, op, cb) { var expiryKey = expiry_queue_key(tag); if (tag == config.STAFF_BOARD) return cb(null); var entry = op + ':' + tag_key(tag); var queries = ['time', 'immortal']; hmget_obj(r, 'thread:'+op, queries, function (err, thread) { if (err) return cb(err); if (!thread.time) { winston.warn('Thread '+op+" doesn't exist."); var m = r.multi(); m.zrem(threadsKey, op); m.zrem(expiryKey, entry); m.exec(cb); return; } if (thread.immortal) return r.zrem(expiryKey, entry, cb); var score = expiry_queue_score(thread.time, tag); r.zadd(expiryKey, score, entry, cb); }); } } function expiry_queue_score(time, tag) { if ((config.CURFEW_BOARDS || []).indexOf(tag) < 0) return Math.floor(parse_number(time)/1000 + config.THREAD_EXPIRY); else return Math.floor(parse_number(time)/1000 + config.THREAD_EXPIRY_CURFEW); } function expiry_queue_key(tag) { if ((config.CURFEW_BOARDS || []).indexOf(tag) < 0) return 'expiry:' + config.THREAD_EXPIRY; else return 'expiry:' + config.THREAD_EXPIRY_CURFEW; } exports.expiry_queue_key = expiry_queue_key; /* SOCIETY */ exports.is_board = function (board) { return config.BOARDS.indexOf(board) >= 0; }; exports.UPKEEP_IDENT = {auth: 'Upkeep', ip: '127.0.0.1'}; function Yakusoku(board, ident) { events.EventEmitter.call(this); this.id = ++(cache.YAKUMAN); this.tag = board; this.ident = ident; this.subs = []; } util.inherits(Yakusoku, events.EventEmitter); exports.Yakusoku = Yakusoku; var Y = Yakusoku.prototype; Y.connect = function () { // multiple redis connections are pointless (without slaves) return global.redis; }; Y.disconnect = function () { this.removeAllListeners('end'); }; function forEachInObject(obj, f, callback) { var total = 0, complete = 0, done = false, errors = []; function cb(err) { complete++; if (err) errors.push(err); if (done && complete == total) callback(errors.length ? errors : null); } for (var k in obj) { if (obj.hasOwnProperty(k)) { total++; f(k, cb); } } done = true; if (complete == total) callback(errors.length ? errors : null); } Y.target_key = function (id) { return (id == 'live') ? 'tag:' + this.tag : 'thread:' + id; }; Y.kiku = function (targets, on_update, on_sink, callback) { var self = this; this.on_update = on_update; this.on_sink = on_sink; forEachInObject(targets, function (id, cb) { var target = self.target_key(id); var sub = Subscription.get(target, self.ident); sub.on('update', on_update); sub.on('error', on_sink); self.subs.push(sub.fullKey); sub.when_ready(cb); }, callback); }; Y.kikanai = function () { var self = this; this.subs.forEach(function (key) { var sub = SUBS[key]; if (sub) { sub.removeListener('update', self.on_update); sub.removeListener('error', self.on_sink); if (sub.listeners('update').length == 0) sub.has_no_listeners(); } }); this.subs = []; }; function post_volume(view, body) { return (body ? body.length : 0) + (view ? (config.NEW_POST_WORTH || 0) : 0) + ((view && view.image) ? (config.IMAGE_WORTH || 0) : 0); } function update_throughput(m, ip, when, quant) { var key = 'ip:' + ip + ':throttle:'; var shortKey = key + short_term_timeslot(when); var longKey = key + long_term_timeslot(when); m.incrby(shortKey, quant); m.incrby(longKey, quant); /* Don't want to use expireat in case of timezone trickery or something dumb. (Really, UTC should be OK though...) */ // Conservative expirations m.expire(shortKey, 10 * 60); m.expire(longKey, 2 * 24 * 3600); } function short_term_timeslot(when) { return Math.floor(when / (1000 * 60 * 5)); } function long_term_timeslot(when) { return Math.floor(when / (1000 * 60 * 60 * 24)); } Y.reserve_post = function (op, ip, callback) { if (this.ident.readOnly) return callback(Muggle("Can't post right now.")); var r = this.connect(); if (ipUtils.isLoopback(ip)) return reserve(); var key = 'ip:' + ip + ':throttle:'; var now = Date.now(); var shortTerm = key + short_term_timeslot(now); var longTerm = key + long_term_timeslot(now); r.mget([shortTerm, longTerm], function (err, quants) { if (err) return callback(Muggle("Limiter failure.", err)); if (quants[0] > config.SHORT_TERM_LIMIT || quants[1] > config.LONG_TERM_LIMIT) return callback(Muggle('Reduce your speed.')); reserve(); }); function reserve() { r.incr('postctr', function (err, num) { if (err) return callback(err); OPs[num] = op || num; callback(null, num); }); } }; var optPostFields = 'name trip email auth subject'.split(' '); Y.insert_post = function (msg, body, extra, callback) { if (this.ident.readOnly) return callback(Muggle("Can't post right now.")); var r = this.connect(); if (!this.tag) return callback(Muggle("Can't retrieve board for posting.")); var ip = extra.ip, board = extra.board, num = msg.num, op = msg.op; if (!num) return callback(Muggle("No post num.")); else if (!ip) return callback(Muggle("No IP.")); else if (op) { if (OPs[op] != op || !OP_has_tag(board, op)) { delete OPs[num]; return callback(Muggle('Thread does not exist.')); } } var view = {time: msg.time, ip: ip, state: msg.state.join()}; optPostFields.forEach(function (field) { if (msg[field]) view[field] = msg[field]; }); var tagKey = 'tag:' + tag_key(this.tag); if (op) view.op = op; else { view.tags = tag_key(board); if (board == config.STAFF_BOARD) view.immortal = 1; } if (extra.image_alloc) { msg.image = extra.image_alloc.image; if (!op == msg.image.pinky) return callback(Muggle("Image is the wrong size.")); delete msg.image.pinky; } var key = (op ? 'post:' : 'thread:') + num; var bump = !op || !common.is_sage(view.email); var m = r.multi(); m.incr(tagKey + ':postctr'); // must be first if (op) m.hget('thread:' + op, 'subject'); // must be second if (bump) m.incr(tagKey + ':bumpctr'); m.sadd('liveposts', key); hooks.trigger_sync('inlinePost', {src: msg, dest: view}); if (msg.image) { if (op) m.hincrby('thread:' + op, 'imgctr', 1); else view.imgctr = 1; imager.note_hash(msg.image.hash, msg.num); view.dims = view.dims.toString(); } m.hmset(key, view); m.set(key + ':body', body); if (msg.links) m.hmset(key + ':links', msg.links); var etc = {cacheUpdate: {}}; var priv = this.ident.priv; if (op) { etc.ipNum = num; etc.cacheUpdate.num = num; var pre = 'thread:' + op; if (priv) { m.sadd(pre + ':privs', priv); m.rpush(pre + ':privs:' + priv, num); } else m.rpush(pre + ':posts', num); } else { // TODO: Add to alternate thread list? // set conditional hide? op = num; if (!view.immortal) { var score = expiry_queue_score(msg.time, this.tag); var entry = num + ':' + tag_key(this.tag); m.zadd(expiry_queue_key(this.tag), score, entry); } /* Rate-limit new threads */ if (ipUtils.isLoopback(ip)) m.setex('ip:'+ip+':throttle:thread', config.THREAD_THROTTLE, op); } /* Denormalize for backlog */ view.nonce = msg.nonce; view.body = body; if (msg.links) view.links = msg.links; extract(view); delete view.ip; var self = this; async.waterfall([ function (next) { if (!msg.image) return next(null); imager.commit_image_alloc(extra.image_alloc, next); }, function (next) { if (ip) { var n = post_volume(view, body); if (n > 0) update_throughput(m, ip, view.time, n); etc.ip = ip; } self._log(m, op, common.INSERT_POST, [num, view], etc); m.exec(next); }, function (results, next) { if (!bump) return next(); var postctr = results[0]; var subject = subject_val(op, op==num ? view.subject : results[1]); var m = r.multi(); m.zadd(tagKey + ':threads', postctr, op); if (subject) m.zadd(tagKey + ':subjects', postctr, subject); m.exec(next); }], function (err) { if (err) { delete OPs[num]; return callback(err); } callback(null); }); }; Y.remove_post = function (from_thread, num, callback) { num = parse_number(num); var op = OPs[num]; if (!op) return callback(Muggle('No such post.')); if (op == num) { if (!from_thread) return callback('Deletion loop?!'); return this.remove_thread(num, callback); } var r = this.connect(); var self = this; if (from_thread) { var key = 'thread:' + op; r.lrem(key + ':posts', -1, num, function (err, delCount) { if (err) return callback(err); /* did someone else already delete this? */ if (delCount != 1) return callback(null, -num); /* record deletion */ r.rpush(key + ':dels', num, function (err) { if (err) winston.warn(err); gone_from_thread(); }); }); } else gone_from_thread(); function gone_from_thread() { var key = 'post:' + num; r.hset(key, 'hide', '1', function (err) { if (err) { /* Difficult to recover. Whatever. */ winston.warn("Couldn't hide: " + err); } /* TODO push cache update? */ delete OPs[num]; callback(null, [op, num]); /* In the background, try to finish the post */ self.finish_quietly(key, warn); self.hide_image(key, warn); }); } }; Y.remove_posts = function (nums, callback) { var self = this; tail.map(nums, this.remove_post.bind(this, true), all_gone); function all_gone(err, dels) { if (err) return callback(err); var threads = {}, already_gone = []; dels.forEach(function (del) { if (Array.isArray(del)) { var op = del[0]; if (!(op in threads)) threads[op] = []; threads[op].push(del[1]); } else if (del < 0) already_gone.push(-del); else if (del) winston.warn('Unknown del: ' + del); }); if (already_gone.length) winston.warn("Tried to delete missing posts: " + already_gone); if (_.isEmpty(threads)) return callback(null); var m = self.connect().multi(); for (var op in threads) { var nums = threads[op]; nums.sort(); var opts = {cacheUpdate: {nums: nums}}; self._log(m, op, common.DELETE_POSTS, nums, opts); } m.exec(callback); } }; Y.remove_thread = function (op, callback) { if (OPs[op] != op) return callback(Muggle('Thread does not exist.')); var r = this.connect(); var key = 'thread:' + op, dead_key = 'dead:' + op; var graveyardKey = 'tag:' + tag_key('graveyard'); var privs = null; var etc = {cacheUpdate: {}}; var self = this; async.waterfall([ function (next) { get_all_replies_and_privs(r, op, next); }, function (nums, threadPrivs, next) { etc.cacheUpdate.nums = nums; privs = threadPrivs; if (!nums || !nums.length) return next(null, []); tail.map(nums, self.remove_post.bind(self, false), next); }, function (dels, next) { var m = r.multi(); m.incr(graveyardKey + ':bumpctr'); m.hgetall(key); m.exec(next); }, function (rs, next) { var deadCtr = rs[0], post = rs[1]; var tags = parse_tags(post.tags); var subject = subject_val(op, post.subject); /* Rename thread keys, move to graveyard */ var m = r.multi(); tags.forEach(function (tag) { var expiryKey = expiry_queue_key(tag); var tagKey = tag_key(tag); m.zrem(expiryKey, op + ':' + tagKey); m.zrem('tag:' + tagKey + ':threads', op); if (subject) m.zrem('tag:' + tagKey + ':subjects', subject); }); m.zadd(graveyardKey + ':threads', deadCtr, op); etc.tags = tags; self._log(m, op, common.DELETE_THREAD, [], etc); m.hset(key, 'hide', 1); /* Next two vals are checked */ m.renamenx(key, dead_key); m.renamenx(key + ':history', dead_key + ':history'); m.renamenx(key + ':ips', dead_key + ':ips'); m.exec(next); }, function (results, done) { var dels = results.slice(-2); if (dels.some(function (x) { return x === 0; })) return done("Already deleted?!"); delete OPs[op]; delete TAGS[op]; /* Extra renames now that we have renamenx exclusivity */ var m = r.multi(); m.rename(key + ':posts', dead_key + ':posts'); m.rename(key + ':links', dead_key + ':links'); if (privs.length) { m.rename(key + ':privs', dead_key + ':privs'); privs.forEach(function (priv) { var suff = ':privs:' + priv; m.rename(key + suff, dead_key + suff); }); } m.exec(function (err) { done(err, null); /* second arg is remove_posts dels */ }); /* Background, might not even be there */ self.finish_quietly(dead_key, warn); self.hide_image(dead_key, warn); }], callback); }; Y.archive_thread = function (op, callback) { var r = this.connect(); var key = 'thread:' + op, archiveKey = 'tag:' + tag_key('archive'); var self = this; async.waterfall([ function (next) { var m = r.multi(); m.exists(key); m.hget(key, 'immortal'); m.zscore('tag:' + tag_key('graveyard') + ':threads', op); m.exec(next); }, function (rs, next) { if (!rs[0]) return callback(Muggle(key + ' does not exist.')); if (parse_number(rs[1])) return callback(Muggle(key + ' is immortal.')); if (rs[2]) return callback(Muggle(key + ' is already deleted.')); var m = r.multi(); // order counts m.hgetall(key); m.hgetall(key + ':links'); m.llen(key + ':posts'); m.smembers(key + ':privs'); m.lrange(key + ':dels', 0, -1); m.exec(next); }, function (rs, next) { var view = rs[0], links = rs[1], replyCount = rs[2], privs = rs[3], dels = rs[4]; var subject = subject_val(op, view.subject); var tags = view.tags; var m = r.multi(); // move to archive tag only m.hset(key, 'origTags', tags); m.hset(key, 'tags', tag_key('archive')); tags = parse_tags(tags); tags.forEach(function (tag) { var tagKey = 'tag:' + tag_key(tag); m.zrem(tagKey + ':threads', op); if (subject) m.zrem(tagKey + ':subjects', subject); }); m.zadd(archiveKey + ':threads', op, op); self._log(m, op, common.DELETE_THREAD, [], {tags: tags}); // shallow thread insertion message in archive if (!_.isEmpty(links)) view.links = links; extract(view); delete view.ip; view.replyctr = replyCount; view.hctr = 0; var etc = {tags: ['archive'], cacheUpdate: {}}; self._log(m, op, common.MOVE_THREAD, [view], etc); // clear history; note new history could be added // for deletion in the archive // (a bit silly right after adding a new entry) m.hdel(key, 'hctr'); m.del(key + ':history'); m.del(key + ':ips'); // delete hidden posts dels.forEach(function (num) { m.del('post:' + num); m.del('post:' + num + ':links'); }); m.del(key + ':dels'); if (privs.length) { m.del(key + ':privs'); privs.forEach(function (priv) { m.del(key + ':privs:' + priv); }); } m.exec(next); }, function (results, done) { set_OP_tag(config.BOARDS.indexOf('archive'), op); done(); }], callback); }; Y.archive_thread_curfew = function (op, callback) { var r = this.connect(); var key = 'thread:' + op, archiveKey = 'tag:' + tag_key('reien'); var self = this; async.waterfall([ function (next) { var m = r.multi(); m.exists(key); m.hget(key, 'immortal'); m.zscore('tag:' + tag_key('graveyard') + ':threads', op); m.exec(next); }, function (rs, next) { if (!rs[0]) return callback(Muggle(key + ' does not exist.')); if (parse_number(rs[1])) return callback(Muggle(key + ' is immortal.')); if (rs[2]) return callback(Muggle(key + ' is already deleted.')); var m = r.multi(); // order counts m.hgetall(key); m.hgetall(key + ':links'); m.llen(key + ':posts'); m.smembers(key + ':privs'); m.lrange(key + ':dels', 0, -1); m.exec(next); }, function (rs, next) { var view = rs[0], links = rs[1], replyCount = rs[2], privs = rs[3], dels = rs[4]; var subject = subject_val(op, view.subject); var tags = view.tags; var m = r.multi(); // move to archive tag only m.hset(key, 'origTags', tags); m.hset(key, 'tags', tag_key('reien')); tags = parse_tags(tags); tags.forEach(function (tag) { var tagKey = 'tag:' + tag_key(tag); m.zrem(tagKey + ':threads', op); if (subject) m.zrem(tagKey + ':subjects', subject); }); m.zadd(archiveKey + ':threads', op, op); self._log(m, op, common.DELETE_THREAD, [], {tags: tags}); // shallow thread insertion message in archive if (!_.isEmpty(links)) view.links = links; extract(view); delete view.ip; view.replyctr = replyCount; view.hctr = 0; var etc = {tags: ['reien'], cacheUpdate: {}}; self._log(m, op, common.MOVE_THREAD, [view], etc); // clear history; note new history could be added // for deletion in the archive // (a bit silly right after adding a new entry) m.hdel(key, 'hctr'); m.del(key + ':history'); m.del(key + ':ips'); // delete hidden posts dels.forEach(function (num) { m.del('post:' + num); m.del('post:' + num + ':links'); }); m.del(key + ':dels'); if (privs.length) { m.del(key + ':privs'); privs.forEach(function (priv) { m.del(key + ':privs:' + priv); }); } m.exec(next); }, function (results, done) { set_OP_tag(config.BOARDS.indexOf('reien'), op); done(); }], callback); }; /* BOILERPLATE CITY */ Y.remove_images = function (nums, callback) { if (this.ident.readOnly) return callback(Muggle("Read-only right now.")); var threads = {}; var rem = this.remove_image.bind(this, threads); var self = this; tail.forEach(nums, rem, function (err) { if (err) return callback(err); var m = self.connect().multi(); for (var op in threads) self._log(m, op, common.DELETE_IMAGES, threads[op], {tags: tags_of(op)}); m.exec(callback); }); }; Y.remove_image = function (threads, num, callback) { if (this.ident.readOnly) return callback(Muggle("Read-only right now.")); var r = this.connect(); var op = OPs[num]; if (!op) callback(null, false); var key = (op == num ? 'thread:' : 'post:') + num; var self = this; r.hexists(key, 'src', function (err, exists) { if (err) return callback(err); if (!exists) return callback(null); self.hide_image(key, function (err) { if (err) return callback(err); r.hset(key, 'hideimg', 1, function (err, affected) { if (err) return callback(err); if (!affected) return callback(null); if (threads[op]) threads[op].push(num); else threads[op] = [num]; r.hincrby('thread:' + op, 'imgctr', -1, callback); }); }); }); }; Y.hide_image = function (key, callback) { if (this.ident.readOnly) return callback(Muggle("Read-only right now.")); var r = this.connect(); var hash; var imgKeys = ['hideimg', 'hash', 'src', 'thumb', 'realthumb', 'mid']; r.hmget(key, imgKeys, move_dead); function move_dead(err, rs) { if (err) return callback(err); if (!rs) return callback(null); var info = {}; for (var i = 0; i < rs.length; i++) info[imgKeys[i]] = rs[i]; if (info.hideimg) /* already gone */ return callback(null); hooks.trigger("buryImage", info, callback); } }; Y.force_image_spoilers = function (nums, callback) { if (this.ident.readOnly) return callback(Muggle("Read-only right now.")); var threads = {}; var rem = this.spoiler_image.bind(this, threads); var self = this; tail.forEach(nums, rem, function (err) { if (err) return callback(err); var m = self.connect().multi(); for (var op in threads) self._log(m, op, common.SPOILER_IMAGES, threads[op], {tags: tags_of(op)}); m.exec(callback); }); }; Y.spoiler_image = function (threads, num, callback) { if (this.ident.readOnly) return callback(Muggle("Read-only right now.")); var r = this.connect(); var op = OPs[num]; if (!op) callback(null, false); var key = (op == num ? 'thread:' : 'post:') + num; var self = this; var spoilerKeys = ['src', 'spoiler', 'realthumb']; r.hmget(key, spoilerKeys, function (err, info) { if (err) return callback(err); /* no image or already spoilt */ if (!info[0] || info[1] || info[2]) return callback(null); var index = common.pick_spoiler(-1).index; r.hmset(key, 'spoiler', index, function (err) { if (err) return callback(err); if (threads[op]) threads[op].push([num, index]); else threads[op] = [[num, index]]; callback(null); }); }); }; Y.toggle_thread_lock = function (op, callback) { if (this.ident.readOnly) return callback(Muggle("Read-only right now.")); if (OPs[op] != op) return callback(Muggle('Thread does not exist.')); var r = this.connect(); var key = 'thread:' + op; var self = this; r.hexists(key, 'locked', function (err, locked) { if (err) return callback(err); var m = r.multi(); if (locked) m.hdel(key, 'locked'); else m.hset(key, 'locked', '1'); var act = locked ? common.UNLOCK_THREAD : common.LOCK_THREAD; self._log(m, op, act, []); m.exec(callback); }); }; /* END BOILERPLATE CITY */ function warn(err) { if (err) winston.warn('Warning: ' + err); } Y.check_thread_locked = function (op, callback) { this.connect().hexists('thread:' + op, 'locked', function (err, lock) { if (err) callback(err); else callback(lock ? Muggle('Thread is locked.') : null); }); }; Y.check_throttle = function (ip, callback) { var key = 'ip:' + ip + ':throttle:thread'; this.connect().exists(key, function (err, exists) { if (err) callback(err); else callback(exists ? Muggle('Too soon.') : null); }); }; Y.add_image = function (post, alloc, ip, callback) { var r = this.connect(); var num = post.num, op = post.op; if (!op) return callback(Muggle("Can't add another image to an OP.")); var image = alloc.image; if (!image.pinky) return callback(Muggle("Image is wrong size.")); delete image.pinky; var key = 'post:' + num; r.exists(key, function (err, exists) { if (err) return callback(err); if (!exists) return callback(Muggle("Post does not exist.")); imager.commit_image_alloc(alloc, function (err) { if (err) return callback(err); add_it(); }); }); var self = this; function add_it() { var m = r.multi(); imager.note_hash(image.hash, post.num); // HACK: hmset doesn't like our array, but we need it var orig_dims = image.dims; image.dims = orig_dims.toString(); m.hmset(key, image); image.dims = orig_dims; m.hincrby('thread:' + op, 'imgctr', 1); delete image.hash; self._log(m, op, common.INSERT_IMAGE, [num, image]); var now = Date.now(); var n = post_volume({image: true}); update_throughput(m, ip, now, post_volume({image: true})); m.exec(callback); } }; Y.append_post = function (post, tail, old_state, extra, cb) { var m = this.connect().multi(); var key = (post.op ? 'post:' : 'thread:') + post.num; /* Don't need to check .exists() thanks to client state */ m.append(key + ':body', tail); /* XXX: fragile */ if (old_state[0] != post.state[0] || old_state[1] != post.state[1]) m.hset(key, 'state', post.state.join()); if (extra.ip) { var now = Date.now(); update_throughput(m, extra.ip, now, post_volume(null, tail)); } if (!_.isEmpty(extra.new_links)) m.hmset(key + ':links', extra.new_links); // possibly attach data for dice rolls etc. to the update var attached = {post: post, extra: extra, writeKeys: {}, attach: {}}; var self = this; hooks.trigger("attachToPost", attached, function (err, attached) { if (err) return cb(err); for (var h in attached.writeKeys) m.hset(key, h, attached.writeKeys[h]); var msg = [post.num, tail]; var links = extra.links || {}; var a = old_state[0], b = old_state[1]; // message tail is [... a, b, links, attachment] // default values [... 0, 0, {}, {}] don't need to be sent // to minimize log output if (!_.isEmpty(attached.attach)) msg.push(a, b, links, attached.attach); else if (!_.isEmpty(links)) msg.push(a, b, links); else if (b) msg.push(a, b); else if (a) msg.push(a); self._log(m, post.op || post.num, common.UPDATE_POST, msg); m.exec(cb); }); }; register_lua('finish'); function finish_off(m, key) { var body_key = key.replace('dead', 'thread') + ':body'; m.evalsha(LUA.finish.sha, 3, key, body_key, 'liveposts'); } Y.finish_post = function (post, callback) { var m = this.connect().multi(); var key = (post.op ? 'post:' : 'thread:') + post.num; /* Don't need to check .exists() thanks to client state */ finish_off(m, key); this._log(m, post.op || post.num, common.FINISH_POST, [post.num]); m.exec(callback); }; Y.finish_quietly = function (key, callback) { var m = this.connect().multi(); finish_off(m, key); m.exec(callback); }; Y.finish_all = function (callback) { var r = this.connect(); var self = this; r.smembers('liveposts', function (err, keys) { if (err) return callback(err); async.forEach(keys, function (key, cb) { var isPost = /^post:(\d+)$/.test(key); if (isPost) r.hget(key, 'op', fini); else fini(); function fini(err, op) { if (err) return cb(err); var m = r.multi(); finish_off(m, key); var n = parse_number(key.match(/:(\d+)$/)[1]); op = isPost ? parse_number(op) : n; self._log(m, op, common.FINISH_POST, [n]); m.srem('liveposts', key); m.exec(cb); } }, callback); }); }; Y._log = function (m, op, kind, msg, opts) { opts = opts || {}; msg = JSON.stringify(msg).slice(1, -1); msg = msg.length ? (kind + ',' + msg) : ('' + kind); winston.info("Log: " + msg); if (!op) throw new Error('No OP.'); var priv = this.ident.priv; var prefix = priv ? ('priv:' + priv + ':') : ''; var key = prefix + 'thread:' + op; if (common.is_pubsub(kind)) { m.rpush(key + ':history', msg); m.hincrby(key, 'hctr', 1); } if (opts.ipNum) m.hset(key + ':ips', opts.ipNum, opts.ip); var opBit = op + ','; var len = opBit.length + msg.length; msg = len + '|' + opBit + msg; // we can add an extra trailing message for secret info if (opts.ip) msg += JSON.stringify({auth: {ip: opts.ip}}); m.publish(key, msg); var tags = opts.tags || (this.tag ? [this.tag] : []); tags.forEach(function (tag) { m.publish(prefix + 'tag:' + tag, msg); }); if (opts.cacheUpdate) { var info = {kind: kind, tag: tags[0], op: op}; _.extend(info, opts.cacheUpdate); m.publish('cache', JSON.stringify(info)); } }; Y.fetch_backlogs = function (watching, callback) { var r = this.connect(); var combined = []; var inject_ips = caps.can_moderate(this.ident); forEachInObject(watching, function (thread, cb) { if (thread == 'live') return cb(null); var key = 'thread:' + thread; var sync = watching[thread]; var m = r.multi(); m.lrange(key + ':history', sync, -1); if (inject_ips) { // would be nice to fetch only the relevant ips...? m.hgetall(key + ':ips'); } m.exec(function (err, rs) { if (err) return cb(err); var prefix = thread + ','; var ips = inject_ips && rs[1]; // construct full messages from history entries rs[0].forEach(function (entry) { // attempt to inject ip to INSERT_POST log var m = ips && entry.match(/^2,(\d+),{(.+)$/); var ip = m && ips[m[1]]; if (ip) { var inject = '"ip":' + JSON.stringify(ip) + ','; entry = '2,' + m[1] + ',{' + inject + m[2]; } combined.push(prefix + entry); }); cb(null); }); }, function (errs) { callback(errs, combined); }); }; Y.get_post_op = function (num, callback) { var r = this.connect(); r.hget('post:' + num, 'op', function (err, op) { if (err) return callback(err); else if (op) return callback(null, num, op); r.exists('thread:' + num, function (err, exists) { if (err) callback(err); else if (!exists) callback(null, null, null); else callback(null, num, num); }); }); } Y.get_tag = function (page) { var r = this.connect(); var self = this; var key = 'tag:' + tag_key(this.tag) + ':threads'; var reverseOrder = (this.tag == 'archive' || this.tag == 'reien'); if (page < 0 && !reverseOrder) page = 0; var start = page * config.THREADS_PER_PAGE; var end = start + config.THREADS_PER_PAGE - 1; var m = r.multi(); if (reverseOrder) m.zrange(key, start, end); else m.zrevrange(key, start, end); m.zcard(key); m.exec(function (err, res) { if (err) return self.emit('error', err); var nums = res[0]; if (page > 0 && !nums.length) return self.emit('nomatch'); if (reverseOrder) nums.reverse(); self.emit('begin', res[1]); var reader = new Reader(self); reader.on('error', self.emit.bind(self, 'error')); reader.on('thread', self.emit.bind(self, 'thread')); reader.on('post', self.emit.bind(self, 'post')); reader.on('endthread', self.emit.bind(self, 'endthread')); self._get_each_thread(reader, 0, nums); }); }; Y._get_each_thread = function (reader, ix, nums) { if (!nums || ix >= nums.length) { this.emit('end'); reader.removeAllListeners('endthread'); reader.removeAllListeners('end'); return; } var self = this; var next_please = function () { reader.removeListener('end', next_please); reader.removeListener('nomatch', next_please); self._get_each_thread(reader, ix+1, nums); }; reader.on('end', next_please); reader.on('nomatch', next_please); reader.get_thread(this.tag, nums[ix], { abbrev: config.ABBREVIATED_REPLIES || 5 }); }; /* LURKERS */ register_lua('get_thread'); function lua_get_thread(r, key, abbrev, cb) { var body_key = key.replace('dead', 'thread') + ':body'; var posts_key = key + ':posts'; r.evalsha(LUA.get_thread.sha, 4, key, body_key, posts_key, 'liveposts', abbrev, function (err, rs) { if (err) return cb(err); if (!rs) return cb(null); if (rs.length != 4) throw new Error('get_thread.lua unexpected output'); // activePosts is a hash of hashes; needs to be unbulked on two levels var activeBulk = rs[2]; for (var i = 1; i < activeBulk.length; i += 2) activeBulk[i] = unbulk(activeBulk[i]); var active = unbulk(activeBulk); cb(null, { pre: unbulk(rs[0]), replies: rs[1].map(parse_number), active: active, total: rs[3], }); }); } function Reader(yakusoku) { events.EventEmitter.call(this); this.y = yakusoku; this.postCache = {}; if (caps.can_administrate(yakusoku.ident)) this.showPrivs = true; } util.inherits(Reader, events.EventEmitter); exports.Reader = Reader; Reader.prototype.get_thread = function (tag, num, opts) { var r = this.y.connect(); var graveyard = (tag == 'graveyard'); if (graveyard) opts.showDead = true; var key = (graveyard ? 'dead:' : 'thread:') + num; var abbrev = opts.abbrev || 0; var self = this; lua_get_thread(r, key, abbrev, function (err, result) { if (err) return self.emit('error', err); if (!result || !result.pre || !result.pre.time) { if (!opts.redirect) return self.emit('nomatch'); r.hget('post:' + num, 'op', function (err, op) { if (err) self.emit('error', err); else if (!op) self.emit('nomatch'); else self.emit('redirect', op); }); return; } var opPost = result.pre; var total = result.total; var nums = result.replies; self.postCache = result.active; var exists = self.is_visible(opPost, opts); var tags = parse_tags(opPost.tags); if (!graveyard && tags.indexOf(tag) < 0) { if (opts.redirect) { var op = OPs[num]; return self.emit('redirect', op || num, tags[0]); } else exists = false; } if (!exists) { self.emit('nomatch'); return; } self.emit('begin', opPost); opPost.num = num; refine_post(opPost); var priv = self.y.ident.priv; if (opts.showDead || priv) { var m = r.multi(); // order is important! if (opts.showDead) { var deadKey = key + ':dels'; m.lrange(deadKey, -abbrev, -1); if (abbrev) m.llen(deadKey); } if (priv) { var privsKey = key + ':privs:' + priv; m.lrange(privsKey, -abbrev, -1); if (abbrev) m.llen(privsKey); } m.exec(prepared); } else prepared(); function prepared(err, rs) { if (err) return self.emit('error', err); // get results in the same order as before var deadNums, privNums; if (opts.showDead) { deadNums = rs.shift(); if (abbrev) total += parse_number(rs.shift()); } if (priv) { privNums = rs.shift(); if (abbrev) total += parse_number(rs.shift()); } if (deadNums) nums = merge_posts(nums, deadNums, abbrev); if (priv) { nums = merge_posts(nums, privNums, abbrev); if (self.showPrivs) self.privNums = privNums; } var omit = Math.max(total - abbrev, 0); self.emit('thread', opPost, omit); self._get_each_reply(0, nums, opts); } }); }; function merge_posts(nums, privNums, abbrev) { var i = nums.length - 1, pi = privNums.length - 1; if (pi < 0) return nums; var merged = []; while (!abbrev || merged.length < abbrev) { if (i >= 0 && pi >= 0) { var num = nums[i], pNum = privNums[pi]; if (parse_number(num) > parse_number(pNum)) { merged.unshift(num); i--; } else { merged.unshift(pNum); pi--; } } else if (i >= 0) merged.unshift(nums[i--]); else if (pi >= 0) merged.unshift(privNums[pi--]); else break; } return merged; } function can_see_priv(priv, ident) { if (!priv) return true; // not private if (!ident) return false; if (ident.showPriv) return true; return priv == ident.priv; } Reader.prototype._get_each_reply = function (ix, nums, opts) { var cache = this.postCache; var limit = 20; var privs = this.privNums; function apply_privs(post) { if (privs && post.num && _.contains(privs, post.num.toString())) post.priv = true; } // find a run of posts that need to be fetched var end; for (end = ix; end < nums.length && (end - ix) < limit; end++) { if (cache[nums[end]]) break; } if (ix < end) { // fetch posts in the ix..end range var range = []; for (var i = ix; i < end; i++) range.push(nums[i]); var self = this; this.get_posts('post', range, opts, function (err, posts) { if (err) return self.emit('error', err); for (var i = 0; i < posts.length; i++) { var post = posts[i]; apply_privs(post); self.emit('post', post); } process.nextTick(self._get_each_reply.bind(self, end, nums, opts)); }); return; } // otherwise read posts from cache for (; ix < nums.length; ix++) { var num = nums[ix]; var post = cache[num]; if (!post) break; if (this.is_visible(post, opts)) { post.num = num; refine_post(post); apply_privs(post); this.emit('post', post); } } if (ix < nums.length) { process.nextTick(this._get_each_reply.bind(this, ix, nums, opts)); } else { this.emit('endthread'); this.emit('end'); } }; /// fetch posts in bulk. it is assumed that none of them are currently being edited Reader.prototype.get_posts = function (kind, nums, opts, cb) { if (!nums.length) return cb(null, []); var r = this.y.connect(); var self = this; var m = r.multi(); for (var i = 0; i < nums.length; i++) { var key = kind + ':' + nums[i]; m.hgetall(key); } m.exec(function (err, results) { if (err) return cb(err); var posts = []; for (var i = 0; i < results.length; i++) { var post = results[i]; var num = nums[i]; post.num = num; if (!self.is_visible(post, opts)) continue; refine_post(post); if (post.editing && !post.body) { post.body = '[a bug ate this post]'; var key = kind + ':' + num + ':body'; r.exists(key, function (err, existed) { if (err) winston.warn(err); else if (existed) winston.warn(key + " was overlooked"); }); } posts.push(post); } cb(null, posts); }); }; Reader.prototype.is_visible = function (post, opts) { if (_.isEmpty(post)) return false; if (post.hide && !opts.showDead) return false; if (!can_see_priv(post.priv, this.ident)) return false; return true; }; /// turn a fresh-from-redis post hash into our expected format function refine_post(post) { post.time = parse_number(post.time); if (typeof post.op == 'string') post.op = parse_number(post.op); if (typeof post.tags == 'string') post.tags = parse_tags(post.tags); if (typeof post.body != 'string') post.body = ''; if (post.state) post.editing = true; // extract the image-specific keys (if any) to a sub-hash extract(post); } function parse_number(n) { return parseInt(n, 10); } /* Including hidden or private. Not in-order. */ function get_all_replies_and_privs(r, op, cb) { var key = 'thread:' + op; var m = r.multi(); m.lrange(key + ':posts', 0, -1); m.smembers(key + ':privs'); m.exec(function (err, rs) { if (err) return cb(err); var nums = rs[0], privs = rs[1]; if (!privs.length) return cb(null, nums, privs); var m = r.multi(); privs.forEach(function (priv) { m.lrange(key + ':privs:' + priv, 0, -1); }); m.exec(function (err, rs) { if (err) return cb(err); rs.forEach(function (ns) { nums.push.apply(nums, ns); }); cb(null, nums, privs); }); }); }; /* AUTHORITY */ function Filter(tag) { events.EventEmitter.call(this); this.tag = tag; }; util.inherits(Filter, events.EventEmitter); exports.Filter = Filter; var F = Filter.prototype; F.connect = function () { if (!this.r) { this.r = global.redis; } return this.r; }; F.get_all = function (limit) { var self = this; var r = this.connect(); r.zrange('tag:' + tag_key(this.tag) + ':threads', 0, -1, go); function go(err, threads) { if (err) return self.failure(err); async.forEach(threads, do_thread, self.check_done.bind(self)); } function do_thread(op, cb) { var key = 'thread:' + op; r.llen(key + ':posts', function (err, len) { if (err) cb(err); len = parse_number(len); if (len > limit) return cb(null); var thumbKeys = ['thumb', 'realthumb', 'src']; r.hmget(key, thumbKeys, function (err, rs) { if (err) cb(err); var thumb = rs[0] || rs[1] || rs[2]; self.emit('thread', {num: op, thumb: thumb}); cb(null); }); }); } }; F.check_done = function (err) { if (err) this.failure(err); else this.success(); }; F.success = function () { this.emit('end'); this.cleanup(); }; F.failure = function (err) { this.emit('error', err); this.cleanup(); }; F.cleanup = function () { this.removeAllListeners('error'); this.removeAllListeners('thread'); this.removeAllListeners('end'); }; /* AMUSEMENT */ Y.get_fun = function (op, callback) { if (cache.funThread && op == cache.funThread) { /* Don't cache, for extra fun */ fs.readFile('client/fun.js', 'UTF-8', callback); } else callback(null); }; Y.set_fun_thread = function (op, callback) { if (OPs[op] != op) return callback(Muggle("Thread not found.")); var self = this; fs.readFile('client/fun.js', 'UTF-8', function (err, funJs) { if (err) return callback(err); cache.funThread = op; var m = self.connect().multi(); self._log(m, op, common.EXECUTE_JS, [funJs]); m.exec(callback); }); }; Y.get_banner = function (cb) { var key = 'tag:' + tag_key(this.tag) + ':banner'; this.connect().hgetall(key, cb); }; Y.set_banner = function (op, message, cb) { var r = this.connect(); var key = 'tag:' + tag_key(this.tag) + ':banner'; var self = this; r.hgetall(key, function (err, old) { if (err) return cb(err); var m = r.multi(); if (old && old.op != op) { // clear previous thread's banner self._log(m, old.op, common.UPDATE_BANNER, [null]); } // write new banner m.hmset(key, {op: op, msg: message}); self._log(m, op, common.UPDATE_BANNER, [message]); m.exec(cb); }); }; Y.teardown = function (board, cb) { var m = this.connect().multi(); var filter = new Filter(board); var self = this; filter.get_all(NaN); // no length limit filter.on('thread', function (thread) { self._log(m, thread.num, common.TEARDOWN, []); }); filter.on('error', cb); filter.on('end', function () { m.exec(cb); }); }; Y.get_current_body = function (num, cb) { var key = (OPs[num] == num ? 'thread:' : 'post:') + num; var m = this.connect().multi(); m.hmget(key, 'hide', 'body'); m.get(key + ':body'); m.exec(function (err, rs) { if (err) return cb(err); var hide = rs[0][0], finalBody = rs[0][1]; var liveBody = rs[1]; if (hide) return cb(null); if (finalBody) return cb(null, finalBody, true); cb(null, liveBody || '', false); }); }; /* HELPERS */ function extract(post) { hooks.trigger_sync('extractPost', post); } function with_body(r, key, post, callback) { if (post.body !== undefined) callback(null, post); else r.get(key + ':body', function (err, body) { if (err) return callback(err); if (body !== null) { post.body = body; post.editing = true; return callback(null, post); } // Race condition between finishing posts r.hget(key, 'body', function (err, body) { if (err) return callback(err); post.body = body || ''; callback(null, post); }); }); }; function subject_val(op, subject) { return subject && (op + ':' + subject); } function tag_key(tag) { return tag.length + ':' + tag; } function parse_tags(input) { if (!input) { winston.warn('Blank tag!'); return []; } var tags = []; while (input.length) { var m = input.match(/^(\d+):/); if (!m) break; var len = parse_number(m[1]); var pre = m[1].length + 1; if (input.length < pre + len) break; tags.push(input.substr(pre, len)); input = input.slice(pre + len); } return tags; } exports.parse_tags = parse_tags; function hmget_obj(r, key, keys, cb) { r.hmget(key, keys, function (err, rs) { if (err) return cb(err); var result = {}; for (var i = 0; i < keys.length; i++) result[keys[i]] = rs[i]; cb(null, result); }); } /// converts a lua bulk response to a hash function unbulk(list) { if (!list) return null; if (list.length % 2) { console.warn('bad bulk:', list); throw new Error('bulk of odd len ' + list.length); } var hash = {}; for (var i = 0; i < list.length; i += 2) { var key = list[i]; if (key in hash) throw new Error('bulk repeated key ' + key); hash[key] = list[i+1]; } return hash; }
/* eslint-disable import/no-extraneous-dependencies */ const { pathsToModuleNameMapper } = require('ts-jest/utils'); // Load the config which holds the path aliases. const { compilerOptions } = require('../../tsconfig.json'); module.exports = { ...require('../../jest.config'), collectCoverageFrom: ['src/**/*.{t,j}s?(x)'], };
const childProcess = require('child_process'); const electron = require('electron'); const webpack = require('webpack'); const config = require('./webpack.app.config'); const env = 'development'; const compiler = webpack(config(env)); let electronStarted = false; const watching = compiler.watch({}, (err, stats) => { if (!err && !stats.hasErrors() && !electronStarted) { electronStarted = true; childProcess .spawn(electron, ['.'], { stdio: 'inherit' }) .on('close', () => { watching.close(); }); } });
"use strict"; // Copyright (c) 2018, 2019 by Audere // // Use of this source code is governed by an MIT-style license that // can be found in the LICENSE file distributed with this file. exports.__esModule = true; var LocationType; (function (LocationType) { LocationType["Hospital"] = "hospital"; LocationType["CollegeCampus"] = "collegeCampus"; LocationType["HomelessShelter"] = "homelessShelter"; LocationType["ChildrensHospital"] = "childrensHospital"; LocationType["ChildrensClinic"] = "childrensClinic"; LocationType["Clinic"] = "clinic"; LocationType["Childcare"] = "childcare"; LocationType["Port"] = "port"; LocationType["FredHutch"] = "fredHutch"; LocationType["PublicSpace"] = "publicSpace"; })(LocationType = exports.LocationType || (exports.LocationType = {})); exports.Locations = { Harborview: { type: LocationType.Hospital, contactName: "Dr. Helen Y. Chu", contactPhone: "(206) 897-5318" }, HarborviewLobby: { type: LocationType.HomelessShelter, contactName: "Dr. Helen Y. Chu", contactPhone: "(206) 897-5318" }, ChildrensHospitalSeattle: { type: LocationType.ChildrensHospital, contactName: "Dr. Helen Y. Chu", contactPhone: "(206) 897-5318" }, ChildrensHospitalBellevue: { type: LocationType.ChildrensHospital, contactName: "Dr. Helen Y. Chu", contactPhone: "(206) 897-5318" }, HUB: { type: LocationType.CollegeCampus, contactName: "Dr. Helen Y. Chu", contactPhone: "(206) 897-5318" }, UWHallHealth: { type: LocationType.CollegeCampus, contactName: "Dr. Helen Y. Chu", contactPhone: "(206) 897-5318" }, HealthSciencesRotunda: { type: LocationType.CollegeCampus, contactName: "Dr. Helen Y. Chu", contactPhone: "(206) 897-5318" }, HealthSciencesLobby: { type: LocationType.CollegeCampus, contactName: "Dr. Helen Y. Chu", contactPhone: "(206) 897-5318" }, StMartins: { type: LocationType.HomelessShelter, contactName: "Dr. Helen Y. Chu", contactPhone: "(206) 897-5318" }, DESC: { type: LocationType.HomelessShelter, contactName: "Dr. Helen Y. Chu", contactPhone: "(206) 897-5318" }, PioneerSquare: { type: LocationType.HomelessShelter, contactName: "Dr. Helen Y. Chu", contactPhone: "(206) 897-5318" }, UWSeaMar: { type: LocationType.Clinic, contactName: "Dr. Helen Y. Chu", contactPhone: "(206) 897-5318" }, ChildrensSeaMar: { type: LocationType.ChildrensClinic, contactName: "Dr. Helen Y. Chu", contactPhone: "(206) 897-5318" }, HutchKids: { type: LocationType.Childcare, contactName: "Dr. Helen Y. Chu", contactPhone: "(206) 897-5318" }, UWDaycare: { type: LocationType.Childcare, contactName: "Dr. Helen Y. Chu", contactPhone: "(206) 897-5318" }, SeaTacInternational: { type: LocationType.Port, contactName: "Dr. Helen Y. Chu", contactPhone: "(206) 897-5318" }, SeaTacDomestic: { type: LocationType.Port, contactName: "Dr. Helen Y. Chu", contactPhone: "(206) 897-5318" }, Costco: { type: LocationType.Clinic, contactName: "Dr. Helen Y. Chu", contactPhone: "(206) 897-5318" }, FredHutchLobby: { type: LocationType.FredHutch, contactName: "Dr. Helen Y. Chu", contactPhone: "(206) 897-5318" }, SeattleCenter: { type: LocationType.PublicSpace, contactName: "Dr. Helen Y. Chu", contactPhone: "(206) 897-5318" }, WestlakeMall: { type: LocationType.PublicSpace, contactName: "Dr. Helen Y. Chu", contactPhone: "(206) 897-5318" } };
const config = { title: 'Layout 3 - Horizontal', defaults: { mode: 'container', scroll: 'content', navbar: { display: true }, toolbar: { display: true, position: 'above' }, footer: { display: false, style: 'fixed' }, leftSidePanel: { display: false }, rightSidePanel: { display: true } }, form: { mode: { title: 'Mode', type: 'radio', options: [ { name: 'Boxed', value: 'boxed' }, { name: 'Full Width', value: 'fullwidth' }, { name: 'Container', value: 'container' } ] }, navbar: { type: 'group', title: 'Navbar', children: { display: { title: 'Display', type: 'switch' } } }, toolbar: { type: 'group', title: 'Toolbar', children: { display: { title: 'Display', type: 'switch' }, position: { title: 'Position', type: 'radio', options: [ { name: 'Above', value: 'above' }, { name: 'Below', value: 'below' } ] } } }, footer: { type: 'group', title: 'Footer', children: { display: { title: 'Display', type: 'switch' }, style: { title: 'Style', type: 'radio', options: [ { name: 'Fixed', value: 'fixed' }, { name: 'Static', value: 'static' } ] } } } } }; export default config;
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ClientMonitoredItemImpl = void 0; /** * @module node-opcua-client-private */ // tslint:disable:unified-signatures // tslint:disable:no-empty const events_1 = require("events"); const node_opcua_assert_1 = require("node-opcua-assert"); const node_opcua_data_model_1 = require("node-opcua-data-model"); const node_opcua_data_value_1 = require("node-opcua-data-value"); const node_opcua_debug_1 = require("node-opcua-debug"); const node_opcua_service_filter_1 = require("node-opcua-service-filter"); const node_opcua_service_read_1 = require("node-opcua-service-read"); const node_opcua_service_subscription_1 = require("node-opcua-service-subscription"); const node_opcua_status_code_1 = require("node-opcua-status-code"); const client_monitored_item_1 = require("../client_monitored_item"); const client_monitored_item_toolbox_1 = require("../client_monitored_item_toolbox"); const client_subscription_impl_1 = require("./client_subscription_impl"); const debugLog = (0, node_opcua_debug_1.make_debugLog)(__filename); const doDebug = (0, node_opcua_debug_1.checkDebugFlag)(__filename); /** * ClientMonitoredItem * @class ClientMonitoredItem * @extends ClientMonitoredItemBase * * event: * "initialized" * "err" * "changed" * * note: this.monitoringMode = subscription_service.MonitoringMode.Reporting; */ class ClientMonitoredItemImpl extends events_1.EventEmitter { constructor(subscription, itemToMonitor, monitoringParameters, timestampsToReturn, monitoringMode = node_opcua_service_subscription_1.MonitoringMode.Reporting) { super(); this.statusCode = node_opcua_status_code_1.StatusCodes.BadDataUnavailable; (0, node_opcua_assert_1.assert)(subscription.constructor.name === "ClientSubscriptionImpl"); this.subscription = subscription; this.itemToMonitor = new node_opcua_service_read_1.ReadValueId(itemToMonitor); this.monitoringParameters = new node_opcua_service_subscription_1.MonitoringParameters(monitoringParameters); this.monitoringMode = monitoringMode; (0, node_opcua_assert_1.assert)(this.monitoringParameters.clientHandle === 0xffffffff, "should not have a client handle yet"); (0, node_opcua_assert_1.assert)(subscription.session, "expecting session"); timestampsToReturn = (0, node_opcua_data_value_1.coerceTimestampsToReturn)(timestampsToReturn); (0, node_opcua_assert_1.assert)(subscription.constructor.name === "ClientSubscriptionImpl"); this.timestampsToReturn = timestampsToReturn; } toString() { var _a, _b; let ret = ""; ret += "itemToMonitor: " + this.itemToMonitor.toString() + "\n"; ret += "monitoringParameters: " + this.monitoringParameters.toString() + "\n"; ret += "timestampsToReturn: " + this.timestampsToReturn.toString() + "\n"; ret += "itemToMonitor " + this.itemToMonitor.nodeId + "\n"; ret += "statusCode " + ((_a = this.statusCode) === null || _a === void 0 ? void 0 : _a.toString()) + "\n"; ret += "result =" + ((_b = this.result) === null || _b === void 0 ? void 0 : _b.toString()) + "\n"; return ret; } terminate(...args) { const done = args[0]; (0, node_opcua_assert_1.assert)(typeof done === "function"); const subscription = this.subscription; subscription._delete_monitored_items([this], (err) => { if (done) { done(err); } }); } modify(...args) { if (args.length === 2) { return this.modify(args[0], null, args[1]); } const parameters = args[0]; const timestampsToReturn = args[1]; const callback = args[2]; this.timestampsToReturn = timestampsToReturn || this.timestampsToReturn; client_monitored_item_toolbox_1.ClientMonitoredItemToolbox._toolbox_modify(this.subscription, [this], parameters, this.timestampsToReturn, (err, results) => { if (err) { return callback(err); } if (!results) { return callback(new Error("internal error")); } (0, node_opcua_assert_1.assert)(results.length === 1); callback(null, results[0]); }); } setMonitoringMode(...args) { const monitoringMode = args[0]; const callback = args[1]; client_monitored_item_toolbox_1.ClientMonitoredItemToolbox._toolbox_setMonitoringMode(this.subscription, [this], monitoringMode, (err, statusCodes) => { callback(err ? err : null, statusCodes[0]); }); } /** * @internal * @param value * @private */ _notify_value_change(value) { var _a; // it is possible that the first notification arrives before the CreateMonitoredItemsRequest is fully proceed // in this case we need to put the dataValue aside so we can send the notification changed after // the node-opcua client had time to fully install the on("changed") event handler if (((_a = this.statusCode) === null || _a === void 0 ? void 0 : _a.value) === node_opcua_status_code_1.StatusCodes.BadDataUnavailable.value) { this._pendingDataValue = this._pendingDataValue || []; this._pendingDataValue.push(value); return; } /** * Notify the observers that the MonitoredItem value has changed on the server side. * @event changed * @param value */ try { this.emit("changed", value); } catch (err) { debugLog("Exception raised inside the event handler called by ClientMonitoredItem.on('change')", err); debugLog("Please verify the application using this node-opcua client"); } } /** * @internal * @param eventFields * @private */ _notify_event(eventFields) { var _a; if (((_a = this.statusCode) === null || _a === void 0 ? void 0 : _a.value) === node_opcua_status_code_1.StatusCodes.BadDataUnavailable.value) { this._pendingEvents = this._pendingEvents || []; this._pendingEvents.push(eventFields); return; } /** * Notify the observers that the MonitoredItem value has changed on the server side. * @event changed * @param value */ try { this.emit("changed", eventFields); } catch (err) { debugLog("Exception raised inside the event handler called by ClientMonitoredItem.on('change')", err); debugLog("Please verify the application using this node-opcua client"); } } /** * @internal * @private */ _prepare_for_monitoring() { (0, node_opcua_assert_1.assert)(this.monitoringParameters.clientHandle === 4294967295, "should not have a client handle yet"); const subscription = this.subscription; this.monitoringParameters.clientHandle = subscription.nextClientHandle(); (0, node_opcua_assert_1.assert)(this.monitoringParameters.clientHandle > 0 && this.monitoringParameters.clientHandle !== 4294967295); // If attributeId is EventNotifier then monitoring parameters need a filter. // The filter must then either be DataChangeFilter, EventFilter or AggregateFilter. // todo can be done in another way? // todo implement AggregateFilter // todo support DataChangeFilter // todo support whereClause if (this.itemToMonitor.attributeId === node_opcua_data_model_1.AttributeIds.EventNotifier) { // // see OPCUA Spec 1.02 part 4 page 65 : 5.12.1.4 Filter // see part 4 page 130: 7.16.3 EventFilter // part 3 page 11 : 4.6 Event Model // To monitor for Events, the attributeId element of the ReadValueId structure is the // the id of the EventNotifierAttribute // OPC Unified Architecture 1.02, Part 4 5.12.1.2 Sampling interval page 64: // "A Client shall define a sampling interval of 0 if it subscribes for Events." // toDO // note : the EventFilter is used when monitoring Events. this.monitoringParameters.filter = this.monitoringParameters.filter || new node_opcua_service_filter_1.EventFilter({}); const filter = this.monitoringParameters.filter; // istanbul ignore next if (!filter) { return { error: "Internal Error" }; } if (filter.schema.name !== "EventFilter") { return { error: "Mismatch between attributeId and filter in monitoring parameters : " + "Got a " + filter.schema.name + " but a EventFilter object is required " + "when itemToMonitor.attributeId== AttributeIds.EventNotifier" }; } } else if (this.itemToMonitor.attributeId === node_opcua_data_model_1.AttributeIds.Value) { // the DataChangeFilter and the AggregateFilter are used when monitoring Variable Values // The Value Attribute is used when monitoring Variables. Variable values are monitored for a change // in value or a change in their status. The filters defined in this standard (see 7.16.2) and in Part 8 are // used to determine if the value change is large enough to cause a Notification to be generated for the // to do : check 'DataChangeFilter' && 'AggregateFilter' } else { if (this.monitoringParameters.filter) { return { error: "Mismatch between attributeId and filter in monitoring parameters : " + "no filter expected when attributeId is not Value or EventNotifier" }; } } return { itemToMonitor: this.itemToMonitor, monitoringMode: this.monitoringMode, requestedParameters: this.monitoringParameters }; } /** * @internal * @param monitoredItemResult * @private */ _applyResult(monitoredItemResult) { this.statusCode = monitoredItemResult.statusCode; /* istanbul ignore else */ if (monitoredItemResult.statusCode === node_opcua_status_code_1.StatusCodes.Good) { this.result = monitoredItemResult; this.monitoredItemId = monitoredItemResult.monitoredItemId; this.monitoringParameters.samplingInterval = monitoredItemResult.revisedSamplingInterval; this.monitoringParameters.queueSize = monitoredItemResult.revisedQueueSize; this.filterResult = monitoredItemResult.filterResult || undefined; } // some PublishRequest with DataNotificationChange might have been sent by the server, before the monitored // item has been fully initialized it is time to process now any pending notification that were put on hold. if (this._pendingDataValue) { const dataValues = this._pendingDataValue; this._pendingDataValue = undefined; setImmediate(() => { dataValues.map((dataValue) => this._notify_value_change(dataValue)); }); } if (this._pendingEvents) { const events = this._pendingEvents; this._pendingEvents = undefined; setImmediate(() => { events.map((event) => this._notify_event(event)); }); } } _before_create() { const subscription = this.subscription; subscription._add_monitored_item(this.monitoringParameters.clientHandle, this); } /** * @internal * @param monitoredItemResult * @private */ _after_create(monitoredItemResult) { this._applyResult(monitoredItemResult); if (this.statusCode === node_opcua_status_code_1.StatusCodes.Good) { /** * Notify the observers that the monitored item is now fully initialized. * @event initialized */ this.emit("initialized"); } else { /** * Notify the observers that the monitored item has failed to initialize. * @event err * @param statusCode {StatusCode} */ const err = new Error(monitoredItemResult.statusCode.toString()); this._terminate_and_emit(err); } } _terminate_and_emit(err) { if (this.statusCode.value === node_opcua_status_code_1.StatusCodes.Bad.value) { return; // already terminated } if (err) { this.emit("err", err.message); } (0, node_opcua_assert_1.assert)(!this._terminated); this._terminated = true; /** * Notify the observer that this monitored item has been terminated. * @event terminated */ this.emit("terminated", err); this.removeAllListeners(); this.statusCode = node_opcua_status_code_1.StatusCodes.Bad; // also remove from subscription const clientHandle = this.monitoringParameters.clientHandle; delete this.subscription.monitoredItems[clientHandle]; } } exports.ClientMonitoredItemImpl = ClientMonitoredItemImpl; // tslint:disable:no-var-requires // tslint:disable:max-line-length const thenify = require("thenify"); const opts = { multiArgs: false }; ClientMonitoredItemImpl.prototype.terminate = thenify.withCallback(ClientMonitoredItemImpl.prototype.terminate); ClientMonitoredItemImpl.prototype.setMonitoringMode = thenify.withCallback(ClientMonitoredItemImpl.prototype.setMonitoringMode); ClientMonitoredItemImpl.prototype.modify = thenify.withCallback(ClientMonitoredItemImpl.prototype.modify); client_monitored_item_1.ClientMonitoredItem.create = (subscription, itemToMonitor, monitoringParameters, timestampsToReturn, monitoringMode = node_opcua_service_subscription_1.MonitoringMode.Reporting) => { return (0, client_subscription_impl_1.ClientMonitoredItem_create)(subscription, itemToMonitor, monitoringParameters, timestampsToReturn, monitoringMode); }; //# sourceMappingURL=client_monitored_item_impl.js.map
({ key: 'value' });
/* eslint-disable prettier/prettier */ import React from 'react' import { CFooter } from '@coreui/react' const AppFooter = () => { return ( <CFooter> <div> <a href="https://coreui.io" target="_blank" rel="noopener noreferrer"> CoreUI </a> <span className="ms-1">&copy; 2021 creativeLabs.</span> </div> <div className="ms-auto"> <span className="me-1">Powered by</span> <a href="https://coreui.io/react" target="_blank" rel="noopener noreferrer"> CoreUI for React </a> </div> </CFooter> ) } export default React.memo(AppFooter)
'use strict'; class WebAudioInjectorNode extends AudioWorkletNode { constructor(context) { super(context, 'injector-processor'); this.port.onmessage = (event) => { const { type } = event.data; switch (type) { case 'ready': break; default: console.warn( `web-audio-injector:worklet] Unhandled message type: ${type}`, ); console.log('[web-audio-injector:worklet]', event.data); } }; } postMessage(msg) { this.port.postMessage(msg); } } export default WebAudioInjectorNode;
module.exports = (api, options) => { const siteDescription = api.config.siteDescription const siteName = api.config.siteName const siteUrl = api.config.siteUrl const op = Object.assign(options, { siteDescription: siteDescription, siteName: siteName, siteUrl: siteUrl, }) api.setClientOptions(op) }
/* User model */ 'use strict'; const mongoose = require('mongoose') const validator = require('validator') const bcrypt = require('bcryptjs') const {TimeIntervalSchema} = require('./timeInterval') const log = console.log const ObjectId = mongoose.ObjectId const SALT_FACTOR = 10 // ----------- Schema for message ----------- const MessageEmployeeSchema = new mongoose.Schema({ from: { //email address type: String, required: true, validate: { validator: validator.isEmail, // custom validator message: 'Not valid email' } }, to: { //email address type: String, required: true, validate: { validator: validator.isEmail, // custom validator message: 'Not valid email' } }, isTrade: { type: Boolean, required: true, default: false }, tradeTime: { type: TimeIntervalSchema }, tradeWeekDay: Number, message: { type: String }, tradeResponse: { type: String, default: 'W' //'W' = wait 'A' = accpet 'D' = 'decline' } }) // ----------- Schema for employee ----------- const EmployeeSchema = new mongoose.Schema({ name: { type: String, required: true, minlegth: 1, trim: true }, email: { type: String, required: true, minlength: 1, trim: true, unique: true, validate: { validator: validator.isEmail, // custom validator message: 'Not valid email' } }, password: { type: String, required: true, minlength: 6, maxlength: 100 }, position: { type: String, required: true }, phone:{ type: String, required: true, minlength: 10, trim: true, }, companyName:{ type: String, required: true, minlength: 1, trim: true, }, availability:[TimeIntervalSchema], shifts:[TimeIntervalSchema], messages: [MessageEmployeeSchema] }) EmployeeSchema.pre('save', function(next) { const employee = this; // binds this to employee document instance //only hash again if we modify/ its new if (employee.isModified('password')) { bcrypt.genSalt(SALT_FACTOR, (err, salt) => { bcrypt.hash(employee.password, salt, (err, hash) => { employee.password = hash next() }) }) } else { next() } }) EmployeeSchema.pre('findOneAndUpdate', function(next) { const update = this.getUpdate(); if (update.password) { bcrypt.genSalt(SALT_FACTOR, (err, salt) => { bcrypt.hash(update.password, salt, (err, hash) => { this.getUpdate().password = hash; next(); }) }) } else { next(); } }) EmployeeSchema.statics.findByEmailPassword = function(email, password) { const Employee = this return Employee.findOne({ email: email }).then((employee) => { if (!employee) { return employee //return Promise.reject("No matching email") // a rejected promise } return new Promise((resolve, reject) => { bcrypt.compare(password, employee.password, (err, result) => { if (result) { resolve(employee) } else { reject() } }) }) }) } // make a model using the User schema const Employee = mongoose.model('Employee', EmployeeSchema) const MessageEmployee = mongoose.model('MessageEmployee', MessageEmployeeSchema) module.exports = { Employee, MessageEmployee}
// 健康管理路由 import Layout from '@/layout' /** * * hidden: true 如果设置为true,则项目将不会显示在侧边栏中(默认为false) * alwaysShow: true 如果设置为true,将始终显示根菜单 * 如果不始终设置Show,则当项具有多个子路由时, * 它将成为嵌套模式,否则不显示根菜单 * redirect: noRedirect 如果设置为no redirect,则breadcrumb中不会重定向 * name:'router-name' 名称由<keep alive>使用(必须设置!!!) * meta : { roles: ['admin','editor'] 控制页面角色(可以设置多个角色) title: 'title' 侧边栏和面包屑中显示的名称(推荐集) icon: 'svg-name' 图标显示在侧栏中,支持/src/icons/svg格式和element-ui icon两种形式 breadcrumb: false 如果设置为false,则该项将隐藏在breadcrumb中(默认为true) activeMenu: '/example/list' 如果设置路径,侧边栏将突出显示您设置的路径 } */ export const healthyRouter = [ { path: '/healthy', component: Layout, redirect: '/healthy/list', name: 'Healthy', meta: { title: '健康管理', icon: 'el-icon-odometer' }, children: [ { path: 'list', name: 'HealthyList', component: () => import('../list'), meta: { title: '劳务公司列表' } }, { path: 'listDetail', name: 'HealthyListDetail', hidden: true, component: () => import('../listDetail'), meta: { title: '劳务公司列表详情', activeMenu: '/healthy/list' } }, { path: 'labour-force-list', name: 'HealthyLabourForceList', component: () => import('../labour-force-list'), meta: { title: '劳务人员列表' } }, { path: 'labour-force-details', name: 'HealthyLabourForceDetails', hidden: true, component: () => import('../labour-force-details'), meta: { title: '人员健康信息详情', activeMenu: '/healthy/labour-force-list' } }, { path: 'edit-healthy-record', name: 'EditHealthyRecord', hidden: true, component: () => import('../edit-healthy-record'), meta: { title: '编辑健康监测记录', activeMenu: '/healthy/labour-force-list' } }, { path: 'healthy-vehicle-statistics', name: 'HealthyVehicleStatistics', component: () => import('../vehicle/vehicle-statistics'), meta: { title: '各公司备案车辆统计表' } }, { path: 'healthy-vehicle-list', name: 'HealthyVehicleList', hidden: true, component: () => import('../vehicle/vehicle-list'), meta: { title: '公司车辆列表', activeMenu: '/healthy/healthy-vehicle-statistics' } }, { path: 'add-healthy-vehicle', name: 'AddHealthyVehicle', hidden: true, component: () => import('../vehicle/add-vehicle'), meta: { title: '新增车辆信息', activeMenu: '/healthy/healthy-vehicle-statistics' } }, { path: 'edit-healthy-vehicle/:id', name: 'EditHealthyVehicle', hidden: true, component: () => import('../vehicle/add-vehicle'), meta: { title: '编辑车辆信息', activeMenu: '/healthy/healthy-vehicle-statistics' } }, { path: 'healthy-vehicle-details', name: 'HealthyVehicleDetails', hidden: true, component: () => import('../vehicle/vehicle-details'), meta: { title: '车辆信息详情', activeMenu: '/healthy/healthy-vehicle-statistics' } }, { path: 'edit-vehicle-record', name: 'EditHealthyVehicleRecord', hidden: true, component: () => import('../vehicle/edit-vehicle-record'), meta: { title: '编辑车辆消毒记录', activeMenu: '/healthy/healthy-vehicle-statistics' } }, { path: 'disinfection-record-list', name: 'HealthyDisinfectionRecordList', hidden: true, component: () => import('../disinfection-record/disinfection-record-list'), meta: { title: '统一消毒记录', activeMenu: '/healthy/healthy-vehicle-statistics' } }, { path: 'add-disinfection-record', name: 'HealthyAddDisinfectionRecord', hidden: true, component: () => import('../disinfection-record/add-disinfection-record'), meta: { title: '新增消毒记录', activeMenu: '/healthy/healthy-vehicle-statistics' } }, { path: 'disinfection-record-details', name: 'HealthyDisinfectionRecordDetails', hidden: true, component: () => import('../disinfection-record/disinfection-record-details'), meta: { title: '公司车辆消毒记录', activeMenu: '/healthy/healthy-vehicle-statistics' } }, { path: 'edit-disinfection-vehicle-record', name: 'EditHealthyDisinfectionRecord', hidden: true, component: () => import('../disinfection-record/edit-disinfection-vehicle-record'), meta: { title: '编辑消毒记录', activeMenu: '/healthy/healthy-vehicle-statistics' } } ] } ]
import { format, formatTime } from "lib.js"; const FIVE_MINUTES = 5 * 60 * 1000; const DELAY_BETWEEN_PURCHASES = 10*1000; // 10 seconds /** @param {NS} ns **/ export async function main(ns) { ns.disableLog("sleep"); ns.disableLog("getServerMaxRam"); ns.disableLog("getPurchasedServerMaxRam"); var i = 1 + ns.getPurchasedServers().reduce((pv, host) => Math.max(pv, parseInt(host.replace("AUTO-", ""), 10)), 0); ns.print(`Next server will be AUTO-${i}`); if (ns.args[0] === undefined) { throw new Error("Error: Enter how much money should be retained after buying servers. (Ex, `run server-upgrader.js 1.5 T`)."); } while (!isFullyUpgraded(ns)) { var nextRam = nextServerToPurchase(ns); if (nextRam > 0) { var smallest = getSmallestServer(ns); if (smallest !== "" && ns.getPurchasedServers().length === ns.getPurchasedServerLimit()) { ns.killall(smallest); ns.deleteServer(smallest); } if (ns.getPlayer().money < ns.getPurchasedServerCost(nextRam)) { await awaitMoney(ns, ns.getPurchasedServerCost(nextRam) + getBufferFromArgs(ns)); } var newServer = ns.purchaseServer(`AUTO-${++i}`, nextRam); if (newServer === "") { throw new Error(`Unable to purchase server with RAM ${nextRam}`); } else { ns.run("deploy.js", 1, newServer, "core.js"); } } await ns.sleep(DELAY_BETWEEN_PURCHASES); } ns.tprint("Done buying servers!"); //ns.spawn("nf.js", 1); } /** * * @param {NS} ns * @param {number} n * @returns */ async function awaitMoney(ns, n) { var start = performance.now(); ns.scriptKill("money.js", "home"); ns.run("money.js", 1, n); while (ns.getPlayer().money < n) { ns.print(`Waiting for \$ ${format(n - ns.getPlayer().money)} more money... (${formatTime(performance.now() - start)} elapsed)`); await ns.sleep(15000); } return Promise.resolve(); } /** * @param {NS} ns */ function isFullyUpgraded(ns) { var servers = ns.getPurchasedServers(); return servers.length === ns.getPurchasedServerLimit() && servers.every(host => { return ns.getServerMaxRam(host) >= ns.getPurchasedServerMaxRam(); }); } /** * * @param {NS} ns */ function allServersHaveSameRam(ns) { var servers = ns.getPurchasedServers(); // If we haven't filled all server slots... if (servers.length !== ns.getPurchasedServerLimit()) { return false; } var ram = ns.getServerMaxRam(servers[0]); return servers.every(host => ns.getServerMaxRam(host) === ram); } /** * @param {NS} ns * @returns {number} The RAM size of the largest server */ function currentLargestServerRam(ns) { var servers = ns.getPurchasedServers(); return servers.reduce((pv, host) => { return Math.max(pv, ns.getServerMaxRam(host)) }, 0); } /** * @param {NS} ns * @returns {string} The name of the smallest server, or an empty string if there are no servers. */ function getSmallestServer(ns) { var servers = ns.getPurchasedServers(); if (servers.length === 0) { return ""; } return servers.reduce((pv, host) => { return ns.getServerMaxRam(host) < ns.getServerMaxRam(pv) ? host : pv; }, servers[0]); } /** * * @param {NS} ns * @returns {number} -1, if I'm too poor to buy a server. Otherwise, the RAM of the server to purchase. */ function nextServerToPurchase(ns) { if (ns.getPurchasedServers().length === 0) { return 2 ** 6; } var ramNow = allServersHaveSameRam(ns) && ns.getPurchasedServers().length === ns.getPurchasedServerLimit() ? ns.getServerMaxRam(ns.getPurchasedServers()[0]) * 4 // raise it two powers. : currentLargestServerRam(ns); var costNow = ns.getPurchasedServerCost(ramNow); var costNext = ns.getPurchasedServerCost(Math.min(ramNow * 4, 2**20)); var buffer = getBufferFromArgs(ns); var availableFunds = ns.getPlayer().money - buffer; ns.print(`Waiting for money to purchase server with ${format(ramNow)} RAM for ${format(costNow)}...`); if (availableFunds >= costNext) { return Math.min(ramNow * 4, 2**20); } if (availableFunds >= costNow) { return ramNow; } return -1; } /** * * @param {NS} ns * @returns {number} */ function getBufferFromArgs(ns) { if (typeof ns.args[0] !== "number") { throw new Error("Needs to be numeric."); } switch (ns.args[1]) { case "M": return ns.args[0] * 1_000_000; case "B": return ns.args[0] * 1_000_000_000; case "T": return ns.args[0] * 1_000_000_000_000; case "Q": return ns.args[0] * 1_000_000_000_000_000; default: return ns.args[0]; } }
/** * */ function back(){ var url = "td/AllTd"; var img = new Image(); img.src = url; // 设置相对路径给Image, 此时会发送出请求 url = img.src; // 此时相对路径已经变成绝对路径 img.src = null; // 取消请求 window.location.href = url; }; var machine = new Array(); var time = new Array(); var ele = new Array(); var vol = new Array(); var machstatus = new Array(); var work = new Array(); var wait = new Array(); var dglength; var websocketURL; var welderName; var symbol=0; var symbol1=0; var sym=0; var timerele; var timervol; var socket; var redata; var rowdex=0; var maxele=0; var minele=0; var maxvol=0; var minvol=0; var rows; var fmch; var tongdao; var sint=0; var series; var chart; var series1; var chart1; var led=["0,1,2,4,5,6","2,5","0,2,3,4,6","0,2,3,5,6","1,2,3,5","0,1,3,5,6","0,1,3,4,5,6","0,2,5","0,1,2,3,4,5,6","0,1,2,3,5,6"]; $(function(){ var width = $("#treeDiv").width(); $(".easyui-layout").layout({ onCollapse:function(){ $("#dg").datagrid({ height : $("#body").height(), width : $("#body").width() }) }, onExpand:function(){ $("#dg").datagrid({ height : $("#body").height(), width : $("#body").width() }) } }); $("#myTree").tree({ onClick : function(node){ $("#dg").datagrid('load',{ "parent" : node.id }) } }) $.ajax({ type : "post", async : false, url : "td/AllTdbf", data : {}, dataType : "json", //返回数据形式为json success : function(result) { if (result) { websocketURL = eval(result.web_socket); } }, error : function(errorMsg) { alert("数据请求失败,请联系系统管理员!"); } }); $.ajax({ type : "post", async : false, url : "td/allWeldname", data : {}, dataType : "json", //返回数据形式为json success : function(result) { if (result) { welderName=eval(result.rows); } }, error : function(errorMsg) { alert("数据请求失败,请联系系统管理员!"); } }); /* $.ajax({ type : "post", async : false, url : "wps/Spe?machine="+document.getElementById("in2")+"&chanel="+"", data : {}, dataType : "json", //返回数据形式为json success : function(result) { if (result) { tongdao = eval(result.rows); }else{ alert("未查询到相关数据,请尝试索取保存。"); } }, error : function(errorMsg) { alert("数据请求失败,请联系系统管理员!"); } });*/ websocket(); }) function websocket() { if(typeof(WebSocket) == "undefined") { alert("您的浏览器不支持WebSocket"); return; } webclient(); }; function webclient(){ try{ socket = new WebSocket(websocketURL); }catch(err){ alert("地址请求错误,请清除缓存重新连接!!!") } setTimeout(function(){ if(socket.readyState!=1){ alert("与服务器连接失败,请检查网络设置!"); } },10000); socket.onopen = function() { // datatable(); //监听加载状态改变 document.onreadystatechange = completeLoading(); //加载状态为complete时移除loading效果 function completeLoading() { var loadingMask = document.getElementById('loadingDiv'); loadingMask.parentNode.removeChild(loadingMask); } /* setTimeout(function(){ if(symbol==0){ alert("连接成功,但未接收到任何数据"); } },5000);*/ }; socket.onmessage = function(msg) { redata=msg.data; iview(); }; //关闭事件 socket.onclose = function(e) { if (e.code == 4001 || e.code == 4002 || e.code == 4003 || e.code == 4005 || e.code == 4006){ //如果断开原因为4001 , 4002 , 4003 不进行重连. return; }else{ return; } // 重试3次,每次之间间隔5秒 if (tryTime < 3) { setTimeout(function () { socket = null; tryTime++; var _PageHeight = document.documentElement.clientHeight, _PageWidth = document.documentElement.clientWidth; var _LoadingTop = _PageHeight > 61 ? (_PageHeight - 61) / 2 : 0, _LoadingLeft = _PageWidth > 215 ? (_PageWidth - 215) / 2 : 0; var _LoadingHtml = '<div id="loadingDiv" style="position:absolute;left:0;width:100%;height:' + _PageHeight + 'px;top:0;background:#f3f8ff;opacity:0.8;filter:alpha(opacity=80);z-index:10000;"><div style="position: absolute; cursor1: wait; left: ' + _LoadingLeft + 'px; top:' + _LoadingTop + 'px; width: auto; height: 57px; line-height: 57px; padding-left: 50px; padding-right: 5px; background: #fff url(resources/images/load.gif) no-repeat scroll 5px 10px; border: 2px solid #95B8E7; color: #696969;">""正在尝试第"'+tryTime+'"次重连,请稍候..."</div></div>'; document.write(_LoadingHtml); ws(); }, 5000); } else { tryTime = 0; } }; //发生了错误事件 socket.onerror = function() { aler("发生异常,正在尝试重新连接服务器!!!"); } } function elecurve(){ Highcharts.setOptions({ global: { useUTC: false } }); $('#body31').highcharts({ chart: { type: 'spline', animation: false, // don't animate in old IE marginRight: 70, events: { load: function () { // set up the updating of the chart each second series = this.series[0], chart = this, timerele = window.setInterval(function () {}, 1000); } } }, title: { text: '电压电流实时监测' }, xAxis: { type: 'datetime', tickPixelInterval: 150, lineColor:'#FFFFFF', tickWidth:0, labels:{ enabled:false } }, yAxis: [{ max:500, // 定义Y轴 最大值 min:0, // 定义最小值 minPadding: 0.2, maxPadding: 0.2, tickInterval:100, color:'#A020F0', title: { text: '电流', style: { color: '#A020F0' } } }], tooltip: { formatter: function () { return '<b>' + this.series.name + '</b><br/>' + Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', this.x) + '<br/>' + Highcharts.numberFormat(this.y, 2); } }, legend: { enabled: false }, exporting: { enabled: false }, credits:{ enabled:false // 禁用版权信息 }, series: [{ color:'#A020F0', name: '电流', data: (function () { // generate an array of random data var data = [], /*time = new Date(Date.parse("0000-00-00 00:00:00")),*/ i; for (i = -19; i <= 0; i += 1) { data.push({ x: time[0]-1000+i*1000, /*x: time + i*1000,*/ y: 0 }); } return data; }()) }] }, function(c) { activeLastPointToolip(c) }); activeLastPointToolip(chart); } function volcurve(){ Highcharts.setOptions({ global: { useUTC: false } }); $('#body32').highcharts({ chart: { type: 'spline', animation: false, // don't animate in old IE marginRight: 70, events: { load: function () { // set up the updating of the chart each second series1 = this.series[0], chart1 = this; } } }, title: { text: false }, xAxis: { type: 'datetime', tickPixelInterval: 150/*, tickWidth:0, labels:{ enabled:false }*/ }, yAxis: [{ max:50, // 定义Y轴 最大值 min:0, // 定义最小值 minPadding: 0.2, maxPadding: 0.2, tickInterval:10, color:'#87CEFA', title: { text: '电压', style: { color: '#87CEFA' } }, }], tooltip: { formatter: function () { return '<b>' + this.series.name + '</b><br/>' + Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', this.x) + '<br/>' + Highcharts.numberFormat(this.y, 2); }, }, legend: { enabled: false }, exporting: { enabled: false }, credits:{ enabled:false // 禁用版权信息 }, series: [{ name: '电压', data: (function () { // generate an array of random data var data = [], /* time = new Date(Date.parse("0000-00-00 00:00:00")),*/ i; for (i = -19; i <= 0; i += 1) { data.push({ x: time[0]-1000+i*1000, y: 0 }); } return data; }()), }] }, function(c) { activeLastPointToolip1(c) }); activeLastPointToolip1(chart1); } function iview(){ var z=0; time.length=0; vol.length=0; ele.length=0; for(var i = 0;i < redata.length;i+=69){ if(redata.substring(8+i, 12+i)!="0000"){ if(redata.substring(4+i, 8+i)==document.getElementById("in2").value){ ele.push(parseInt(redata.substring(12+i, 16+i))); vol.push(parseFloat((parseInt(redata.substring(16+i, 20+i))/10).toFixed(2))); var ttme = redata.substring(20+i, 39+i); // time.push(Date.parse(redata.substring(20+i, 39+i))); ttme=ttme.replace(/-/g, '/'); time.push(Date.parse(new Date(ttme))); machstatus.push(redata.substring(0+i, 2+i)); maxele = parseInt(redata.substring(41+i, 44+i)); minele = parseInt(redata.substring(44+i, 47+i)); maxvol = parseInt(redata.substring(47+i, 50+i)); minvol = parseInt(redata.substring(50+i, 53+i)); if(symbol==0){ elecurve(); volcurve(); symbol++; } document.getElementById("in5").value=(maxele+minele)/2; document.getElementById("in6").value=(maxvol+minvol)/2; document.getElementById("in7").value=parseInt(redata.substring(12+i, 16+i)); document.getElementById("in8").value=parseFloat((parseInt(redata.substring(16+i, 20+i))/10).toFixed(2)); for(var k=0;k<welderName.length;k++){ if(welderName[k].fwelder_no==redata.substring(8+i, 12+i)){ document.getElementById("in13").value=welderName[k].fname; } } document.getElementById("in11").value=redata.substring(53+i, 61+i); document.getElementById("in12").value=redata.substring(61+i, 69+i); if(time.length!=0&&z<time.length){ var mstatus=redata.substring(0+i, 2+i); switch (mstatus){ case "00": document.getElementById("in4").value="待机"; document.getElementById("in4").style.backgroundColor="#84baed"; // document.getElementById("td1").style.backgroundColor="#0000CD"; document.getElementById("mrjpg").src="resources/images/i_blue.png"; break; case "01": document.getElementById("in4").value="E-010 焊枪开关OFF等待"; document.getElementById("in4").style.backgroundColor="#FF0000"; // document.getElementById("td1").style.backgroundColor="#FF0000"; document.getElementById("mrjpg").src="resources/images/ROBOTdj.png"; break; case "02": document.getElementById("in4").value="E-000工作停止"; document.getElementById("in4").style.backgroundColor="#FF0000"; // document.getElementById("td1").style.backgroundColor="#FF0000"; document.getElementById("mrjpg").src="resources/images/ROBOTdj.png"; break; case "03": document.getElementById("in4").value="焊接"; document.getElementById("in4").style.backgroundColor="#00FF00"; // document.getElementById("td1").style.backgroundColor="#00FF00"; document.getElementById("mrjpg").src="resources/images/i_green.png"; break; case "04": document.getElementById("in4").value="电流过低"; document.getElementById("in4").style.backgroundColor="#FF0000"; // document.getElementById("td1").style.backgroundColor="#FF0000"; document.getElementById("mrjpg").src="resources/images/ROBOTdj.png"; break; case "05": document.getElementById("in4").value="收弧"; document.getElementById("in4").style.backgroundColor="#00FF00"; // document.getElementById("td1").style.backgroundColor="#00FF00"; document.getElementById("mrjpg").src="resources/images/i_green.png"; break; case "06": document.getElementById("in4").value="电流过高"; document.getElementById("in4").style.backgroundColor="#FF0000"; // document.getElementById("td1").style.backgroundColor="#FF0000"; document.getElementById("mrjpg").src="resources/images/ROBOTdj.png"; break; case "07": document.getElementById("in4").value="启弧"; document.getElementById("in4").style.backgroundColor="#00FF00"; // document.getElementById("td1").style.backgroundColor="#00FF00"; document.getElementById("mrjpg").src="resources/images/i_green.png"; break; case "08": document.getElementById("in4").value="电压过低"; document.getElementById("in4").style.backgroundColor="#FF0000"; // document.getElementById("td1").style.backgroundColor="#FF0000"; document.getElementById("mrjpg").src="resources/images/ROBOTdj.png"; break; case "09": document.getElementById("in4").value="电压过高"; document.getElementById("in4").style.backgroundColor="#FF0000"; // document.getElementById("td1").style.backgroundColor="#FF0000"; document.getElementById("mrjpg").src="resources/images/ROBOTdj.png"; break; case "10": document.getElementById("in4").value="E-100控制电源异常"; document.getElementById("in4").style.backgroundColor="#FF0000"; // document.getElementById("td1").style.backgroundColor="#FF0000"; document.getElementById("mrjpg").src="resources/images/ROBOTdj.png"; break; case "15": document.getElementById("in4").value="E-150一次输入电压过高"; document.getElementById("in4").style.backgroundColor="#FF0000"; // document.getElementById("td1").style.backgroundColor="#FF0000"; document.getElementById("mrjpg").src="resources/images/ROBOTdj.png"; break; case "16": document.getElementById("in4").value="E-160一次输入电压过低"; document.getElementById("in4").style.backgroundColor="#FF0000"; // document.getElementById("td1").style.backgroundColor="#FF0000"; document.getElementById("mrjpg").src="resources/images/ROBOTdj.png"; break; case "20": document.getElementById("in4").value="E-200一次二次电流检出异常"; document.getElementById("in4").style.backgroundColor="#FF0000"; // document.getElementById("td1").style.backgroundColor="#FF0000"; document.getElementById("mrjpg").src="resources/images/ROBOTdj.png"; break; case "21": document.getElementById("in4").value="E-210电压检出异常"; document.getElementById("in4").style.backgroundColor="#FF0000"; // document.getElementById("td1").style.backgroundColor="#FF0000"; document.getElementById("mrjpg").src="resources/images/ROBOTdj.png"; break; case "22": document.getElementById("in4").value="E-220逆变电路反馈异常"; document.getElementById("in4").style.backgroundColor="#FF0000"; // document.getElementById("td1").style.backgroundColor="#FF0000"; document.getElementById("mrjpg").src="resources/images/ROBOTdj.png"; break; case "30": document.getElementById("in4").value="E-300温度异常"; document.getElementById("in4").style.backgroundColor="#FF0000"; // document.getElementById("td1").style.backgroundColor="#FF0000"; document.getElementById("mrjpg").src="resources/images/ROBOTdj.png"; break; case "70": document.getElementById("in4").value="E-700输出过流异常"; document.getElementById("in4").style.backgroundColor="#FF0000"; // document.getElementById("td1").style.backgroundColor="#FF0000"; document.getElementById("mrjpg").src="resources/images/ROBOTdj.png"; break; case "71": document.getElementById("in4").value="E-710输入缺相异常"; document.getElementById("in4").style.backgroundColor="#FF0000"; // document.getElementById("td1").style.backgroundColor="#FF0000"; document.getElementById("mrjpg").src="resources/images/ROBOTdj.png"; break; } var x = time[z], y = ele[z], v = vol[z]; if(z==0){ series.addPoint([x, y], true, true); activeLastPointToolip(chart); series1.addPoint([x, v], true, true); activeLastPointToolip1(chart1); }else{ if(x>time[z-1]){ series.addPoint([x, y], true, true); activeLastPointToolip(chart); series1.addPoint([x, v], true, true); activeLastPointToolip1(chart1); } } } } } z++; }; if((time.length)%3==1){ ele[time.length] = ele[time.length-1]; ele[time.length+1] = ele[time.length-1]; vol[time.length] = vol[time.length-1]; vol[time.length+1] = vol[time.length-1]; time[time.length] = time[time.length-1]+1000; time[time.length+1] = time[time.length-1]+2000; } if(time.length%3==2){ ele[time.length] = ele[time.length-1]; vol[time.length] = vol[time.length-1]; time[time.length] = time[time.length-1]+1000; } } //监听窗口大小变化 window.onresize = function() { setTimeout(domresize, 500); } //改变表格高宽 function domresize() { $("#dg").datagrid('resize', { height : $("#body").height(), width : $("#body").width() }); } function activeLastPointToolip(chart) { var points = chart.series[0].points; chart.yAxis[0].removePlotLine('plot-line-0'); chart.yAxis[0].removePlotLine('plot-line-1'); chart.yAxis[0].removePlotLine('plot-line-2'); /* chart.tooltip.refresh(points[points.length -1]); chart.tooltip.refresh(points1[points1.length -1]);*/ chart.yAxis[0].addPlotLine({ //在y轴上增加 value:maxele, //在值为2的地方 width:2, //标示线的宽度为2px color: 'red', //标示线的颜色 dashStyle:'longdashdot', id: 'plot-line-1', //标示线的id,在删除该标示线的时候需要该id标示 }); label:{ text:'最高电流', //标签的内容 align:'center', //标签的水平位置,水平居左,默认是水平居中center x:10 //标签相对于被定位的位置水平偏移的像素,重新定位,水平居左10px } }); chart.yAxis[0].addPlotLine({ //在y轴上增加 value:minele, //在值为2的地方 width:2, //标示线的宽度为2px color: 'red', //标示线的颜色 dashStyle:'longdashdot', id: 'plot-line-2', //标示线的id,在删除该标示线的时候需要该id标示 }); label:{ text:'最低电流', //标签的内容 align:'center', //标签的水平位置,水平居左,默认是水平居中center x:10 //标签相对于被定位的位置水平偏移的像素,重新定位,水平居左10px } }) chart.yAxis[0].addPlotLine({ //在y轴上增加 value:(minele+maxele)/2, //在值为2的地方 width:2, //标示线的宽度为2px color: 'red', //标示线的颜色 dashStyle:'longdashdot', id: 'plot-line-0', //标示线的id,在删除该标示线的时候需要该id标示 }); label:{ text:'预置电流', //标签的内容 align:'center', //标签的水平位置,水平居左,默认是水平居中center x:10 //标签相对于被定位的位置水平偏移的像素,重新定位,水平居左10px } }) } function activeLastPointToolip1(chart) { var points = chart.series[0].points; chart.yAxis[0].removePlotLine('plot-line-3'); chart.yAxis[0].removePlotLine('plot-line-4'); chart.yAxis[0].removePlotLine('plot-line-5'); /* chart.tooltip.refresh(points[points.length -1]); chart.tooltip.refresh(points1[points1.length -1]);*/ chart.yAxis[0].addPlotLine({ //在y轴上增加 value:maxvol, //在值为2的地方 width:2, //标示线的宽度为2px color: 'black', //标示线的颜色 dashStyle:'longdashdot', id: 'plot-line-3', //标示线的id,在删除该标示线的时候需要该id标示 }); label:{ text:'最高电压', //标签的内容 align:'center', //标签的水平位置,水平居左,默认是水平居中center x:10 } }) chart.yAxis[0].addPlotLine({ //在y轴上增加 value:minvol, //在值为2的地方 width:2, //标示线的宽度为2px color: 'black', //标示线的颜色 dashStyle:'longdashdot', id: 'plot-line-4', //标示线的id,在删除该标示线的时候需要该id标示 }); label:{ text:'最低电压', //标签的内容 align:'center', //标签的水平位置,水平居左,默认是水平居中center x:10 //标签相对于被定位的位置水平偏移的像素,重新定位,水平居左10px } }) chart.yAxis[0].addPlotLine({ //在y轴上增加 value:(minvol+maxvol)/2, //在值为2的地方 width:2, //标示线的宽度为2px color: 'black', //标示线的颜色 dashStyle:'longdashdot', id: 'plot-line-5', //标示线的id,在删除该标示线的时候需要该id标示 }); label:{ text:'预置电压', //标签的内容 align:'center', //标签的水平位置,水平居左,默认是水平居中center x:10 //标签相对于被定位的位置水平偏移的像素,重新定位,水平居左10px } }) }
import React, { Component } from 'react' import { StyleSheet, View } from 'react-native' import * as theme from '../constants/theme'; export default class Label extends Component { render() { const { blue, green, red, yellow, teal, purple, black, white, gray, color, style, children, ...props } = this.props; const labelStyles = [ styles.label, color && { backgroundColor: color }, blue && { backgroundColor: theme.colors.blue }, green && { backgroundColor: theme.colors.green }, red && { backgroundColor: theme.colors.red }, yellow && { backgroundColor: theme.colors.yellow }, teal && { backgroundColor: theme.colors.teal }, purple && { backgroundColor: theme.colors.purple }, black && { backgroundColor: theme.colors.black }, white && { backgroundColor: theme.colors.white }, gray && { backgroundColor: theme.colors.gray }, style, ]; return ( <View style={labelStyles} {...props}> {children} </View> ) } } const styles = StyleSheet.create({ label: { margin: 4, width: 12, height: 12, borderRadius: 12, }, });
/* ============ * Actions for the account module * ============ * * The actions that are available on the * account module. */ import * as types from './mutation-types'; import {get } from '../../../helpers/api' export const loadMore = ({ commit }, data) => { if (data.infoPaginate.to < data.infoPaginate.total) { commit(types.SET_LOADING, true); return new Promise((resolve, reject) => { get(`user/${data.id}?page=${data.infoPaginate.current_page + 1}`) .then(res => { commit(types.SET_LOADING, false) resolve(res.data.data.currentPageUser) }) .catch(err => { commit(types.SET_LOADING, false); reject(err) }) }) } }; export default { loadMore };
var __extends = this.__extends || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; define(["require", "exports", 'mayhem/data/Proxy'], function (require, exports, Proxy) { var ContactProxy = (function (_super) { __extends(ContactProxy, _super); function ContactProxy() { _super.apply(this, arguments); } ContactProxy.prototype._initialize = function () { _super.prototype._initialize.call(this); this._isHighlighted = false; }; return ContactProxy; })(Proxy); var ContactProxy; (function (ContactProxy) { ; ; })(ContactProxy || (ContactProxy = {})); return ContactProxy; }); //# sourceMappingURL=MasterSearch.js.map
"use strict"; let _ = require('lodash'), chai = require('chai') ,expect = chai.expect ; let jsodvcs = require("../../") ; exports.spec = function(){ describe('Repository#reset()', function() { context("no commit_ish; no options", function() { let repo = new jsodvcs.Repository(); repo.add("foo/bar", 42).commit("").add("foo/bar", 84).add("foo/bar2", 3); let prevHEAD = repo.HEAD; let ret = repo.reset(); it('should return the repository', function () { expect(ret).to.equal(repo); }); it('should reset the index to its state before any adds (to HEAD)', function () { expect(repo.get_content("foo/bar")).to.deep.equal(42); expect(repo.get_content("foo/bar2")).to.be.undefined; }); it('should not change the HEAD', function () { expect(repo.HEAD).to.equal(prevHEAD); }); }); context("given commit hash; no options", function() { let repo = new jsodvcs.Repository(); let out = {}; repo.add("foo/bar", 42).commit("", {out:out}).add("foo/bar", 84).commit("") .add("foo/bar", 126); let ret = repo.reset(out.commitHash); it('should return the repository', function () { expect(ret).to.equal(repo); }); it('should reset the index to the commit tree', function () { expect(repo.get_content("foo/bar")).to.deep.equal(42); }); it('should set the HEAD to the commit hash', function () { expect(repo.HEAD).to.equal(out.commitHash); }); it('should bring the repository into a detached HEAD state', function () { expect(repo.isDetachedHEAD).to.be.true; }); }); context("given ref; no options", function() { let repo = new jsodvcs.Repository(); let out = {}; repo.add("foo/bar", 42).commit("", {out:out}).add("foo/bar", 84).commit("") .add("foo/bar", 126); repo.set_ref('refs/heads/beta', out.commitHash); let ret = repo.reset('refs/heads/beta'); it('should return the repository', function () { expect(ret).to.equal(repo); }); it('should reset the index to the commit tree', function () { expect(repo.get_content("foo/bar")).to.deep.equal(42); }); it('should set the HEAD to the ref', function () { expect(repo.HEAD).to.equal('refs/heads/beta'); }); it('should not bring the repository into a detached HEAD state', function () { expect(repo.isDetachedHEAD).to.be.false; }); }); context("given ref; mode:soft", function() { let repo = new jsodvcs.Repository(); let out = {}; repo.add("foo/bar", 42).commit("", {out:out}).add("foo/bar", 84).commit("") .add("foo/bar", 126); repo.set_ref('refs/heads/beta', out.commitHash); let ret = repo.reset('refs/heads/beta', {mode: jsodvcs.ResetMode.soft}); it('should return the repository', function () { expect(ret).to.equal(repo); }); it('should reset the index to the commit tree', function () { expect(repo.get_content("foo/bar")).to.deep.equal(126); }); it('should set the HEAD to the ref', function () { expect(repo.HEAD).to.equal('refs/heads/beta'); }); it('should not bring the repository into a detached HEAD state', function () { expect(repo.isDetachedHEAD).to.be.false; }); }); }); describe('Repository#reset_index()', function() { context("no tree_ish; no options", function() { let repo = new jsodvcs.Repository(); let ret = repo.add("foo/bar", 42).commit("").add("foo/bar", 84).add("foo/bar2", 3).reset_index(); it('should return the repository', function () { expect(ret).to.equal(repo); }); it('should reset the index to its state before any adds (to HEAD)', function () { expect(repo.get_content("foo/bar")).to.deep.equal(42); expect(repo.get_content("foo/bar2")).to.be.undefined; }); }); context("tree_ish: commit hash; no options", function() { let repo = new jsodvcs.Repository(); let out = {}; let ret = repo.add("foo/bar", 42).commit("").add("foo/bar", 84).commit("", {out:out}) .add("foo/bar", 126).reset_index(out.commitHash); it('should return the repository', function () { expect(ret).to.equal(repo); }); it('should reset the index to the commit tree', function () { expect(repo.get_content("foo/bar")).to.deep.equal(84); }); }); context("tree_ish: tree hash; no options", function() { let repo = new jsodvcs.Repository(); let out = {}; let ret = repo.add("foo/bar", 42).commit("").add("foo/bar", 84).commit("", {out:out}) .add("foo/bar", 126).reset_index(out.commit.tree); it('should return the repository', function () { expect(ret).to.equal(repo); }); it('should reset the index to the given tree', function () { expect(repo.get_content("foo/bar")).to.deep.equal(84); }); }); context("tree_ish: commit hash; only specific paths", function() { let repo = new jsodvcs.Repository(); let out = {}; let ret = repo.add("foo/bar", 42).add("foo/bar2", 2).commit("") .add("foo/bar", 84).add("foo/bar2", 3).commit("", {out:out}) .add("foo/bar", 126).add("foo/bar2", 7).reset_index(out.commitHash, {paths: ['foo/bar2']}); it('should return the repository', function () { expect(ret).to.equal(repo); }); it('should reset the given path to the commit tree', function () { expect(repo.get_content("foo/bar2")).to.deep.equal(3); }); it('should ´not reset the other path to the commit tree', function () { expect(repo.get_content("foo/bar")).to.not.deep.equal(84); }); }); }); };
import PropTypes from 'prop-types' import React from 'react' import { Icon, Menu } from 'semantic-ui-react' import { neverUpdate } from 'docs/app/HOC' import ComponentControlsToolTip from './ComponentControlsToolTip' const ComponentControlsMaximize = ({ anchorName }) => ( <ComponentControlsToolTip content='Full Screen'> <Menu.Item href={`/maximize/${anchorName}`} target='_blank'> <Icon color='grey' fitted name='window maximize' size='large' /> </Menu.Item> </ComponentControlsToolTip> ) ComponentControlsMaximize.propTypes = { anchorName: PropTypes.string, } export default neverUpdate(ComponentControlsMaximize)
var searchData= [ ['kickgroupusersasync_0',['KickGroupUsersAsync',['../class_nakama_1_1_client.html#ae0b1081795d5a8ce9b94ae3757effc79',1,'Nakama.Client.KickGroupUsersAsync()'],['../interface_nakama_1_1_i_client.html#a984fa00bdf9b43484e1c34d11bf4194e',1,'Nakama.IClient.KickGroupUsersAsync()']]] ];
/************************************************************* * * MathJax/fonts/HTML-CSS/TeX/png/Size4/Regular/Main.js * * Defines the image size data needed for the HTML-CSS OutputJax * to display mathematics using fallback images when the fonts * are not availble to the client browser. * * --------------------------------------------------------------------- * * Copyright (c) 2009-2013 The MathJax Consortium * * 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 * * 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. * */ MathJax.OutputJax["HTML-CSS"].defineImageData({ "MathJax_Size4": { 0x20: [ // SPACE [1,1,0],[1,1,0],[1,1,0],[1,1,0],[1,1,0],[1,1,0],[1,1,0],[1,1,0], [1,1,0],[1,1,0],[1,1,0],[1,1,0],[1,1,0],[1,1,0] ], 0x28: [ // LEFT PARENTHESIS [6,21,9],[7,25,10],[8,30,12],[9,36,15],[11,42,17],[13,50,21],[15,59,24],[18,70,29], [21,83,35],[25,99,41],[30,118,49],[36,140,58],[42,166,69],[50,198,82] ], 0x29: [ // RIGHT PARENTHESIS [4,22,9],[5,25,10],[6,30,12],[7,36,15],[8,42,17],[10,50,21],[11,59,24],[13,70,29], [16,84,35],[19,99,41],[22,118,49],[26,140,58],[31,166,69],[37,198,82] ], 0x2F: [ // SOLIDUS [9,21,9],[11,25,10],[12,30,12],[15,35,15],[17,42,17],[21,50,21],[24,59,24],[29,70,29], [34,83,35],[41,99,41],[48,118,49],[57,140,58],[68,166,69],[81,198,82] ], 0x5B: [ // LEFT SQUARE BRACKET [4,21,9],[5,25,11],[6,30,12],[7,35,15],[8,42,17],[10,51,22],[12,60,25],[14,70,29], [16,83,35],[19,99,41],[23,117,49],[27,140,58],[32,166,69],[38,197,82] ], 0x5C: [ // REVERSE SOLIDUS [9,21,9],[11,25,10],[12,30,12],[15,35,15],[17,42,17],[21,50,21],[24,59,24],[29,70,29], [34,83,35],[41,99,41],[48,118,49],[57,140,58],[68,166,69],[81,198,82] ], 0x5D: [ // RIGHT SQUARE BRACKET [3,21,9],[3,25,11],[4,30,12],[4,35,15],[5,42,17],[6,51,22],[7,60,25],[8,70,29], [9,83,35],[11,99,41],[13,117,49],[15,140,58],[18,166,69],[21,197,82] ], 0x7B: [ // LEFT CURLY BRACKET [5,21,9],[6,25,10],[7,30,12],[8,36,15],[10,42,17],[11,50,21],[13,59,24],[16,70,29], [19,83,35],[22,99,41],[26,118,49],[31,140,58],[37,166,69],[44,198,82] ], 0x7D: [ // RIGHT CURLY BRACKET [5,21,9],[6,25,10],[7,30,12],[8,36,15],[10,42,17],[11,50,21],[13,59,24],[16,70,29], [19,83,35],[22,99,41],[26,118,49],[31,140,58],[37,166,69],[44,198,82] ], 0xA0: [ // NO-BREAK SPACE [1,1,0],[1,1,0],[1,1,0],[1,1,0],[1,1,0],[1,1,0],[1,1,0],[1,1,0], [1,1,0],[1,1,0],[1,1,0],[1,1,0],[1,1,0],[1,1,0] ], 0x2C6: [ // MODIFIER LETTER CIRCUMFLEX ACCENT [15,2,-4],[17,3,-5],[20,3,-6],[24,4,-7],[28,4,-8],[33,5,-9],[39,6,-11],[46,7,-13], [54,8,-16],[64,10,-18],[76,11,-22],[90,13,-26],[107,16,-31],[127,19,-37] ], 0x2DC: [ // SMALL TILDE [14,2,-4],[17,2,-5],[20,3,-5],[24,5,-6],[28,4,-8],[33,4,-10],[38,5,-11],[45,6,-14], [54,7,-16],[63,8,-19],[75,10,-23],[89,12,-27],[106,14,-32],[125,16,-38] ], 0x302: [ // COMBINING CIRCUMFLEX ACCENT [15,2,-4],[17,3,-5],[20,3,-6],[24,4,-7],[28,4,-8],[33,5,-9],[39,6,-11],[46,7,-13], [54,8,-16],[64,10,-18],[76,11,-22],[90,13,-26],[107,16,-31],[127,19,-37] ], 0x303: [ // COMBINING TILDE [14,2,-4],[16,2,-5],[19,3,-5],[23,5,-6],[27,4,-8],[32,4,-10],[37,5,-11],[44,6,-14], [53,7,-16],[63,8,-19],[74,10,-23],[88,12,-27],[105,14,-32],[125,16,-38] ], 0x221A: [ // SQUARE ROOT [8,22,9],[9,26,11],[10,31,13],[12,36,15],[15,43,18],[17,51,21],[20,60,25],[24,71,30], [29,84,35],[34,100,42],[40,118,49],[48,141,59],[57,167,70],[67,199,83] ], 0x2308: [ // LEFT CEILING [5,21,9],[6,26,11],[7,30,13],[8,36,15],[9,43,18],[11,51,21],[13,60,25],[15,70,29], [18,84,35],[21,100,42],[25,118,49],[30,141,59],[36,166,69],[42,199,83] ], 0x2309: [ // RIGHT CEILING [3,21,9],[4,26,11],[4,30,13],[6,36,15],[6,43,18],[7,51,21],[8,60,25],[9,70,29], [11,84,35],[13,100,42],[15,118,49],[18,141,59],[21,166,69],[25,199,83] ], 0x230A: [ // LEFT FLOOR [5,22,9],[6,26,11],[7,31,13],[8,36,15],[9,43,18],[11,50,21],[13,60,25],[15,70,29], [18,84,35],[21,100,42],[25,118,49],[30,140,58],[36,167,70],[42,199,83] ], 0x230B: [ // RIGHT FLOOR [3,22,9],[4,26,11],[4,31,13],[6,36,15],[6,43,18],[7,50,21],[8,60,25],[9,70,29], [11,84,35],[13,100,42],[15,118,49],[18,140,58],[21,167,70],[25,199,83] ], 0x239B: [ // LEFT PARENTHESIS UPPER HOOK [6,13,5],[7,16,6],[9,19,7],[10,22,8],[12,26,10],[14,31,11],[17,36,13],[20,43,16], [24,51,19],[28,60,22],[33,72,26],[40,85,31],[47,101,37],[56,120,44] ], 0x239C: [ // LEFT PARENTHESIS EXTENSION [3,6,1],[4,7,1],[5,7,1],[5,9,1],[6,10,1],[7,12,1],[9,13,1],[10,16,1], [12,18,1],[14,22,1],[17,25,1],[20,31,2],[24,36,2],[28,43,2] ], 0x239D: [ // LEFT PARENTHESIS LOWER HOOK [6,14,5],[7,16,6],[9,19,7],[10,22,8],[12,26,9],[14,31,11],[17,36,13],[20,43,15], [24,51,18],[28,61,22],[33,72,26],[40,85,30],[47,101,36],[56,120,43] ], 0x239E: [ // RIGHT PARENTHESIS UPPER HOOK [5,13,5],[5,16,6],[6,19,7],[7,22,8],[9,26,10],[10,31,11],[12,36,13],[14,43,16], [17,51,19],[20,60,22],[23,72,26],[28,85,31],[33,101,37],[39,120,44] ], 0x239F: [ // RIGHT PARENTHESIS EXTENSION [5,6,1],[5,7,1],[6,7,1],[7,9,1],[9,10,1],[10,12,1],[12,13,1],[14,16,1], [17,18,1],[20,22,1],[23,25,1],[28,31,2],[33,36,2],[39,43,2] ], 0x23A0: [ // RIGHT PARENTHESIS LOWER HOOK [5,14,5],[5,16,6],[6,19,7],[7,22,8],[9,26,9],[10,31,11],[12,36,13],[14,43,15], [17,51,18],[20,61,22],[23,72,26],[28,85,30],[33,101,36],[39,120,43] ], 0x23A1: [ // LEFT SQUARE BRACKET UPPER CORNER [5,13,5],[6,16,6],[7,19,7],[8,22,8],[9,25,9],[11,31,11],[14,36,13],[16,42,15], [19,50,18],[22,60,22],[27,72,26],[32,84,30],[37,100,36],[44,119,43] ], 0x23A2: [ // LEFT SQUARE BRACKET EXTENSION [3,5,0],[4,5,0],[4,6,0],[5,8,0],[6,9,0],[7,10,0],[8,12,0],[10,14,0], [12,17,0],[14,20,0],[16,24,0],[19,28,0],[23,34,0],[27,40,0] ], 0x23A3: [ // LEFT SQUARE BRACKET LOWER CORNER [5,13,5],[6,16,6],[7,19,7],[8,22,8],[9,25,9],[11,31,11],[14,36,13],[16,42,15], [19,50,18],[22,61,22],[27,72,26],[32,84,30],[37,100,36],[44,119,43] ], 0x23A4: [ // RIGHT SQUARE BRACKET UPPER CORNER [3,13,5],[3,16,6],[5,19,7],[5,22,8],[5,25,9],[6,31,11],[8,36,13],[9,42,15], [11,50,18],[12,60,22],[15,72,26],[18,84,30],[21,100,36],[23,119,43] ], 0x23A5: [ // RIGHT SQUARE BRACKET EXTENSION [3,5,0],[3,5,0],[4,6,0],[5,8,0],[5,9,0],[6,10,0],[7,12,0],[9,14,0], [10,17,0],[12,20,0],[14,24,0],[17,28,0],[20,34,0],[23,40,0] ], 0x23A6: [ // RIGHT SQUARE BRACKET LOWER CORNER [3,13,5],[3,16,6],[5,19,7],[5,22,8],[5,25,9],[6,31,11],[8,36,13],[9,42,15], [11,50,18],[12,61,22],[15,72,26],[18,84,30],[21,100,36],[23,119,43] ], 0x23A7: [ // LEFT CURLY BRACKET UPPER HOOK [5,8,1],[6,9,1],[8,10,1],[9,12,1],[10,14,1],[12,16,1],[14,19,1],[17,22,1], [20,26,1],[24,31,1],[29,37,1],[34,44,2],[40,52,2],[48,62,2] ], 0x23A8: [ // LEFT CURLY BRACKET MIDDLE PIECE [4,14,5],[5,16,6],[5,19,7],[6,23,9],[7,27,10],[9,32,12],[10,37,14],[12,44,16], [15,52,19],[17,62,23],[20,73,27],[24,87,32],[28,103,38],[34,123,45] ], 0x23A9: [ // LEFT CURLY BRACKET LOWER HOOK [6,8,7],[6,9,8],[8,10,9],[9,12,11],[10,14,13],[12,16,15],[14,19,18],[17,22,21], [20,26,25],[24,31,30],[29,37,36],[34,43,42],[40,51,50],[48,61,60] ], 0x23AA: [ // CURLY BRACKET EXTENSION [4,4,1],[5,4,1],[5,5,1],[6,5,1],[7,6,1],[9,7,1],[10,8,1],[12,9,1], [14,10,1],[17,12,1],[20,14,1],[24,17,2],[28,19,1],[34,23,2] ], 0x23AB: [ // RIGHT CURLY BRACKET UPPER HOOK [4,8,1],[5,9,1],[5,10,1],[6,12,1],[7,14,1],[9,16,1],[10,19,1],[12,22,1], [14,26,1],[17,31,1],[20,37,1],[24,43,1],[28,52,2],[34,62,2] ], 0x23AC: [ // RIGHT CURLY BRACKET MIDDLE PIECE [6,14,5],[6,16,6],[8,19,7],[9,23,9],[10,27,10],[13,32,12],[14,37,14],[17,44,16], [20,52,19],[24,62,23],[29,73,27],[34,87,32],[40,103,38],[48,123,45] ], 0x23AD: [ // RIGHT CURLY BRACKET LOWER HOOK [4,8,7],[5,9,8],[5,10,9],[6,12,11],[7,14,13],[9,16,15],[10,19,18],[12,22,21], [14,26,25],[17,31,30],[20,37,36],[24,44,42],[28,52,50],[34,62,60] ], 0x23B7: [ // RADICAL SYMBOL BOTTOM [5,14,7],[6,16,8],[8,19,9],[9,22,11],[11,26,13],[13,31,15],[15,37,18],[18,43,21], [21,51,25],[25,61,30],[30,72,35],[35,86,42],[42,101,49],[49,121,59] ], 0x27E8: [ // MATHEMATICAL LEFT ANGLE BRACKET [5,22,9],[6,26,11],[7,31,13],[9,36,15],[10,43,18],[12,51,21],[14,60,25],[17,70,29], [20,84,35],[24,100,42],[28,118,49],[33,140,58],[39,166,69],[47,199,83] ], 0x27E9: [ // MATHEMATICAL RIGHT ANGLE BRACKET [5,22,9],[6,26,11],[7,31,13],[8,36,15],[10,43,18],[11,51,21],[13,60,25],[16,70,29], [19,84,35],[22,100,42],[26,118,49],[31,140,58],[37,167,70],[44,199,83] ], 0xE000: [ // MJ-TeX: radical symbol vertical extender [5,6,1],[6,7,1],[8,8,1],[9,9,1],[11,10,1],[13,12,1],[15,14,1],[18,16,1], [21,19,1],[25,22,1],[29,26,1],[35,30,1],[41,36,1],[49,43,1] ], 0xE001: [ // MJ-TeX: radical symbol top corner piece [8,5,0],[9,6,1],[11,7,1],[13,8,1],[15,9,0],[18,11,1],[22,13,1],[25,15,1], [30,18,1],[36,21,1],[42,25,1],[50,30,1],[60,35,1],[71,41,1] ], 0xE150: [ // MJ-TeX: horizontal brace, down left piece [5,3,2],[5,3,2],[6,5,3],[7,5,3],[8,5,3],[9,6,4],[10,8,5],[12,8,5], [14,10,6],[17,12,8],[19,14,9],[24,16,10],[28,19,12],[33,23,15] ], 0xE151: [ // MJ-TeX: horizontal brace, down right piece [5,3,2],[5,4,2],[6,5,3],[7,5,3],[8,5,3],[9,7,4],[11,8,5],[12,8,5], [15,10,6],[17,12,7],[20,14,9],[23,16,10],[28,19,12],[33,23,14] ], 0xE152: [ // MJ-TeX: horizontal brace, upper left piece [5,3,0],[5,3,0],[6,4,0],[7,4,0],[8,5,0],[9,6,0],[10,7,0],[12,8,0], [14,10,0],[17,11,0],[19,13,0],[24,16,0],[28,19,0],[33,22,0] ], 0xE153: [ // MJ-TeX: horizontal brace, upper right piece [5,3,0],[5,3,0],[6,4,0],[7,4,0],[8,5,0],[9,6,0],[11,7,0],[12,8,0], [15,10,0],[17,12,0],[20,14,0],[24,16,0],[28,19,0],[33,23,0] ], 0xE154: [ // MJ-TeX: horizontal brace, extender [4,1,0],[5,1,0],[6,2,0],[6,2,0],[7,2,0],[8,2,0],[9,3,0],[11,3,0], [13,4,0],[15,4,0],[18,5,0],[21,6,0],[24,7,0],[28,8,0] ] } }); MathJax.Ajax.loadComplete(MathJax.OutputJax["HTML-CSS"].imgDir+"/Size4/Regular"+ MathJax.OutputJax["HTML-CSS"].imgPacked+"/Main.js");
/** @module vk-controller.js @author iAmMichaelConnor @desc this acts as a layer of logic between the restapi.js, which lands the rest api calls, and the heavy-lifitng token-zkp.js and zokrates.js. It exists so that the amount of logic in restapi.js is absolutely minimised. */ const contract = require('truffle-contract'); const jsonfile = require('jsonfile'); const config = require('./config'); const utils = require('./utils'); const Web3 = require('./provider'); const logger = require('./logger'); /** Loads a verification key to the Verifier Registry * @param {String} vkDescription - Description of action that the vk represents, i.e., "mint", "simpleBatchTransfer", "bunr" * @param {String} vkJsonFile - Path to vk file in JSON form * @param {Object} blockchainOptions * @param {Object} blockchainOptions.shieldJson - Compiled JSON of relevant Shield (i.e., NFTokenShield or FTokenShield) * @param {String} blockchainOptions.shieldAddress - address of relevant Shield contract (i.e., NFTokenShield or FTokenShield) * @param {String} blockchainOptions.account - Account that will send the transactions */ async function loadVk(vkDescription, vkJsonFile, blockchainOptions) { const { shieldJson, shieldAddress, account } = blockchainOptions; // Shield contract expects a uint instead of the string we get. let vkUint; switch (vkDescription) { case 'mint': vkUint = 0; break; case 'transfer': vkUint = 1; break; case 'burn': vkUint = 2; break; case 'simpleBatchTransfer': vkUint = 3; break; case 'consolidationTransfer': vkUint = 4; break; default: // intentionally set an invalid enumUint that will fail (because currently only enums 0,1,2,3 exist in the shield contracts) in order to save users gas. vkUint = 99; break; } logger.verbose(`Loading VK for ${vkJsonFile}`); const vkRegistry = contract(shieldJson); vkRegistry.setProvider(Web3.connect()); const vkRegistryInstance = await vkRegistry.at(shieldAddress); // Get VKs from the /code/gm17 directory and convert them into Solidity uints. let vk = await new Promise((resolve, reject) => { jsonfile.readFile(vkJsonFile, (err, data) => { if (err) reject(err); else resolve(data); }); }); vk = Object.values(vk); vk = utils.flattenDeep(vk); vk = vk.map(el => utils.hexToDec(el)); // upload the vk to the smart contract logger.debug('Registering verification key'); await vkRegistryInstance.registerVerificationKey(vk, vkUint, { from: account, gas: 6500000, gasPrice: config.GASPRICE, }); } module.exports = { loadVk, };
/* Copyright 2015 Gravitational, Inc. 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. */ import { Store, toImmutable } from 'nuclear-js'; import * as AT from './actionTypes'; export default Store({ getInitialState() { return toImmutable({}); }, initialize() { this.on(AT.TLPT_REST_API_START, start); this.on(AT.TLPT_REST_API_FAIL, fail); this.on(AT.TLPT_REST_API_SUCCESS, success); this.on(AT.TLPT_REST_API_CLEAR, clear); } }) function start(state, request){ return state.set(request.type, toImmutable({isProcessing: true})); } function fail(state, request){ return state.set(request.type, toImmutable({isFailed: true, message: request.message})); } function success(state, request){ return state.set(request.type, toImmutable({isSuccess: true})); } function clear(state, request){ return state.set(request.type, toImmutable( { isProcessing: false, isFailed: false, isSuccess: false, message: undefined })); }
import { PropertyResolver } from "property-resolver"; import { EventHandler } from "event-js"; import { TypeHelper } from "../helpers/type-helper"; import { PropertyWatcher } from "./property-watcher"; import { PropertyChangedEvent } from "../events/property-changed-event"; export class ModelWatcher { constructor(propertyResolver = new PropertyResolver()) { this.propertyResolver = propertyResolver; this.watchCache = []; this.watchCacheKeys = []; this.watcherInterval = null; this.setupWatcher = (model, ruleset, scanInterval = 500) => { this.model = model; this.ruleset = ruleset; this.scanInterval = scanInterval; this.watchCache = []; this.watchCacheKeys = []; this.cacheWatchTargets("", this.ruleset); this.scanProperties(); this.startWatching(); }; this.changeWatcherTarget = (model) => { this.model = model; this.scanProperties(); }; this.startWatching = () => { this.stopWatching(); this.watcherInterval = setInterval(this.scanProperties, this.scanInterval); }; this.stopWatching = () => { if (this.watcherInterval) { clearInterval(this.watcherInterval); } }; this.updateAndNotifyDifferences = () => { const previousKeyCache = this.watchCacheKeys; const previousWatchCache = this.watchCache; this.watchCache = []; this.watchCacheKeys = []; this.cacheWatchTargets("", this.ruleset); this.watchCacheKeys.forEach((key, index) => { let previousValue; if (previousKeyCache.indexOf(key) == -1) { previousValue = this.watchCache[index].previousValue; const propertyChangedArgs = new PropertyChangedEvent(key, previousValue, null); setTimeout(() => { this.onPropertyChanged.publish(propertyChangedArgs); }, 1); } else if (previousWatchCache[index].previousValue && previousWatchCache[index].previousValue.isArray) { if (previousWatchCache[index].previousValue.length != this.watchCache[index].previousValue.length) { const newValue = this.watchCache[index].previousValue; previousValue = previousWatchCache[index].previousValue; const propertyChangedArgs = new PropertyChangedEvent(key, newValue, previousValue); setTimeout(() => { this.onPropertyChanged.publish(propertyChangedArgs); }, 1); } } }); }; this.watchProperty = (watchRoute, previousData) => { if (this.watchCacheKeys.indexOf(watchRoute) == -1) { const propertyWatcher = new PropertyWatcher(watchRoute, previousData); this.watchCache.push(propertyWatcher); this.watchCacheKeys.push(watchRoute); } }; this.cacheWatchTargets = (propertyStack, ruleset) => { let paramRoute, parameterRules; let anyRulesAreForEach, anyRulesAreSets; let hasValue, currentValue; for (const param in ruleset.rules) { paramRoute = propertyStack ? propertyStack + "." + param : param; parameterRules = ruleset.rules[param]; anyRulesAreForEach = false; anyRulesAreSets = false; parameterRules.forEach(function (rule) { if (rule.isForEach) { anyRulesAreForEach = true; } if (rule.getRulesForProperty) { anyRulesAreSets = true; } }); hasValue = false; try { currentValue = this.propertyResolver.resolveProperty(this.model, paramRoute); hasValue = true; } catch (ex) { } if (currentValue == null && (anyRulesAreForEach || anyRulesAreSets)) { if (anyRulesAreForEach) { currentValue = []; } else if (anyRulesAreSets) { currentValue = {}; } else { currentValue = null; } } parameterRules.forEach((rule) => { const isArray = TypeHelper.isArrayType(currentValue); if (isArray) { const cachedArrayInfo = { length: currentValue.length, isArray: true }; this.watchProperty(paramRoute, cachedArrayInfo); } if (rule.isForEach && hasValue) { // ruleset if (rule.internalRule.getRulesForProperty) { if (this.model[param]) { this.model[param].forEach((element, index) => { this.cacheWatchTargets(paramRoute + "[" + index + "]", rule.internalRule); }); } } else { if (this.model[param]) { this.model[param].forEach((element, index) => { this.watchProperty(paramRoute + "[" + index + "]", this.model[param][index]); }); } } } else { // ruleset if (rule.getRulesForProperty) { this.cacheWatchTargets(paramRoute, rule); } else { if (!isArray) { this.watchProperty(paramRoute, currentValue); } } } }); } }; this.scanProperties = () => { if (this.onPropertyChanged.getSubscriptionCount() == 0) { return; } if (this.watchCache.length == 0) { return; } let refreshOnNextCycle = false; this.watchCache.forEach((propertyWatcher) => { let currentValue; let hasChanged = false; try { currentValue = this.propertyResolver.resolveProperty(this.model, propertyWatcher.propertyPath); } catch (ex) { } if (typeof (currentValue) == "undefined") { currentValue = propertyWatcher.previousValue; } if (propertyWatcher.previousValue && propertyWatcher.previousValue.isArray) { const currentLength = currentValue.length || 0; if (currentLength != propertyWatcher.previousValue.length) { hasChanged = true; } } else if (currentValue !== propertyWatcher.previousValue) { const propertyChangedArgs = new PropertyChangedEvent(propertyWatcher.propertyPath, currentValue, propertyWatcher.previousValue); setTimeout(() => { this.onPropertyChanged.publish(propertyChangedArgs); }, 1); propertyWatcher.previousValue = currentValue; } if (hasChanged) { refreshOnNextCycle = true; } }); if (refreshOnNextCycle) { setTimeout(this.updateAndNotifyDifferences, 1); } }; this.onPropertyChanged = new EventHandler(this); } }
import Cartesian3 from '../Core/Cartesian3.js'; import Cartesian4 from '../Core/Cartesian4.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; import destroyObject from '../Core/destroyObject.js'; import Ellipsoid from '../Core/Ellipsoid.js'; import EllipsoidGeometry from '../Core/EllipsoidGeometry.js'; import GeometryPipeline from '../Core/GeometryPipeline.js'; import CesiumMath from '../Core/Math.js'; import VertexFormat from '../Core/VertexFormat.js'; import BufferUsage from '../Renderer/BufferUsage.js'; import DrawCommand from '../Renderer/DrawCommand.js'; import RenderState from '../Renderer/RenderState.js'; import ShaderProgram from '../Renderer/ShaderProgram.js'; import ShaderSource from '../Renderer/ShaderSource.js'; import VertexArray from '../Renderer/VertexArray.js'; import SkyAtmosphereFS from '../Shaders/SkyAtmosphereFS.js'; import SkyAtmosphereVS from '../Shaders/SkyAtmosphereVS.js'; import BlendingState from './BlendingState.js'; import CullFace from './CullFace.js'; import SceneMode from './SceneMode.js'; /** * An atmosphere drawn around the limb of the provided ellipsoid. Based on * {@link https://developer.nvidia.com/gpugems/GPUGems2/gpugems2_chapter16.html|Accurate Atmospheric Scattering} * in GPU Gems 2. * <p> * This is only supported in 3D. Atmosphere is faded out when morphing to 2D or Columbus view. * </p> * * @alias SkyAtmosphere * @constructor * * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid that the atmosphere is drawn around. * * @example * scene.skyAtmosphere = new Cesium.SkyAtmosphere(); * * @demo {@link https://sandcastle.cesium.com/index.html?src=Sky%20Atmosphere.html|Sky atmosphere demo in Sandcastle} * * @see Scene.skyAtmosphere */ function SkyAtmosphere(ellipsoid) { ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84); /** * Determines if the atmosphere is shown. * * @type {Boolean} * @default true */ this.show = true; this._ellipsoid = ellipsoid; this._command = new DrawCommand({ owner : this }); this._spSkyFromSpace = undefined; this._spSkyFromAtmosphere = undefined; this._spSkyFromSpaceColorCorrect = undefined; this._spSkyFromAtmosphereColorCorrect = undefined; /** * The hue shift to apply to the atmosphere. Defaults to 0.0 (no shift). * A hue shift of 1.0 indicates a complete rotation of the hues available. * @type {Number} * @default 0.0 */ this.hueShift = 0.0; /** * The saturation shift to apply to the atmosphere. Defaults to 0.0 (no shift). * A saturation shift of -1.0 is monochrome. * @type {Number} * @default 0.0 */ this.saturationShift = 0.0; /** * The brightness shift to apply to the atmosphere. Defaults to 0.0 (no shift). * A brightness shift of -1.0 is complete darkness, which will let space show through. * @type {Number} * @default 0.0 */ this.brightnessShift = 0.0; this._hueSaturationBrightness = new Cartesian3(); // camera height, outer radius, inner radius, dynamic atmosphere color flag var cameraAndRadiiAndDynamicAtmosphereColor = new Cartesian4(); // Toggles whether the sun position is used. 0 treats the sun as always directly overhead. cameraAndRadiiAndDynamicAtmosphereColor.w = 0; cameraAndRadiiAndDynamicAtmosphereColor.y = Cartesian3.maximumComponent(Cartesian3.multiplyByScalar(ellipsoid.radii, 1.025, new Cartesian3())); cameraAndRadiiAndDynamicAtmosphereColor.z = ellipsoid.maximumRadius; this._cameraAndRadiiAndDynamicAtmosphereColor = cameraAndRadiiAndDynamicAtmosphereColor; var that = this; this._command.uniformMap = { u_cameraAndRadiiAndDynamicAtmosphereColor : function() { return that._cameraAndRadiiAndDynamicAtmosphereColor; }, u_hsbShift : function() { that._hueSaturationBrightness.x = that.hueShift; that._hueSaturationBrightness.y = that.saturationShift; that._hueSaturationBrightness.z = that.brightnessShift; return that._hueSaturationBrightness; } }; } Object.defineProperties(SkyAtmosphere.prototype, { /** * Gets the ellipsoid the atmosphere is drawn around. * @memberof SkyAtmosphere.prototype * * @type {Ellipsoid} * @readonly */ ellipsoid : { get : function() { return this._ellipsoid; } } }); /** * @private */ SkyAtmosphere.prototype.setDynamicAtmosphereColor = function(enableLighting, useSunDirection) { this._cameraAndRadiiAndDynamicAtmosphereColor.w = enableLighting ? (useSunDirection ? 2.0 : 1.0) : 0.0; }; /** * @private */ SkyAtmosphere.prototype.update = function(frameState) { if (!this.show) { return undefined; } var mode = frameState.mode; if ((mode !== SceneMode.SCENE3D) && (mode !== SceneMode.MORPHING)) { return undefined; } // The atmosphere is only rendered during the render pass; it is not pickable, it doesn't cast shadows, etc. if (!frameState.passes.render) { return undefined; } var command = this._command; if (!defined(command.vertexArray)) { var context = frameState.context; var geometry = EllipsoidGeometry.createGeometry(new EllipsoidGeometry({ radii : Cartesian3.multiplyByScalar(this._ellipsoid.radii, 1.025, new Cartesian3()), slicePartitions : 256, stackPartitions : 256, vertexFormat : VertexFormat.POSITION_ONLY })); command.vertexArray = VertexArray.fromGeometry({ context : context, geometry : geometry, attributeLocations : GeometryPipeline.createAttributeLocations(geometry), bufferUsage : BufferUsage.STATIC_DRAW }); command.renderState = RenderState.fromCache({ cull : { enabled : true, face : CullFace.FRONT }, blending : BlendingState.ALPHA_BLEND, depthMask : false }); var vs = new ShaderSource({ defines : ['SKY_FROM_SPACE'], sources : [SkyAtmosphereVS] }); this._spSkyFromSpace = ShaderProgram.fromCache({ context : context, vertexShaderSource : vs, fragmentShaderSource : SkyAtmosphereFS }); vs = new ShaderSource({ defines : ['SKY_FROM_ATMOSPHERE'], sources : [SkyAtmosphereVS] }); this._spSkyFromAtmosphere = ShaderProgram.fromCache({ context : context, vertexShaderSource : vs, fragmentShaderSource : SkyAtmosphereFS }); } // Compile the color correcting versions of the shader on demand var useColorCorrect = colorCorrect(this); if (useColorCorrect && (!defined(this._spSkyFromSpaceColorCorrect) || !defined(this._spSkyFromAtmosphereColorCorrect))) { var contextColorCorrect = frameState.context; var vsColorCorrect = new ShaderSource({ defines : ['SKY_FROM_SPACE'], sources : [SkyAtmosphereVS] }); var fsColorCorrect = new ShaderSource({ defines : ['COLOR_CORRECT'], sources : [SkyAtmosphereFS] }); this._spSkyFromSpaceColorCorrect = ShaderProgram.fromCache({ context : contextColorCorrect, vertexShaderSource : vsColorCorrect, fragmentShaderSource : fsColorCorrect }); vsColorCorrect = new ShaderSource({ defines : ['SKY_FROM_ATMOSPHERE'], sources : [SkyAtmosphereVS] }); this._spSkyFromAtmosphereColorCorrect = ShaderProgram.fromCache({ context : contextColorCorrect, vertexShaderSource : vsColorCorrect, fragmentShaderSource : fsColorCorrect }); } var cameraPosition = frameState.camera.positionWC; var cameraHeight = Cartesian3.magnitude(cameraPosition); this._cameraAndRadiiAndDynamicAtmosphereColor.x = cameraHeight; if (cameraHeight > this._cameraAndRadiiAndDynamicAtmosphereColor.y) { // Camera in space command.shaderProgram = useColorCorrect ? this._spSkyFromSpaceColorCorrect : this._spSkyFromSpace; } else { // Camera in atmosphere command.shaderProgram = useColorCorrect ? this._spSkyFromAtmosphereColorCorrect : this._spSkyFromAtmosphere; } return command; }; function colorCorrect(skyAtmosphere) { return !(CesiumMath.equalsEpsilon(skyAtmosphere.hueShift, 0.0, CesiumMath.EPSILON7) && CesiumMath.equalsEpsilon(skyAtmosphere.saturationShift, 0.0, CesiumMath.EPSILON7) && CesiumMath.equalsEpsilon(skyAtmosphere.brightnessShift, 0.0, CesiumMath.EPSILON7)); } /** * Returns true if this object was destroyed; otherwise, false. * <br /><br /> * If this object was destroyed, it should not be used; calling any function other than * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. * * @returns {Boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>. * * @see SkyAtmosphere#destroy */ SkyAtmosphere.prototype.isDestroyed = function() { return false; }; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic * release of WebGL resources, instead of relying on the garbage collector to destroy this object. * <br /><br /> * Once an object is destroyed, it should not be used; calling any function other than * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore, * assign the return value (<code>undefined</code>) to the object as done in the example. * * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called. * * * @example * skyAtmosphere = skyAtmosphere && skyAtmosphere.destroy(); * * @see SkyAtmosphere#isDestroyed */ SkyAtmosphere.prototype.destroy = function() { var command = this._command; command.vertexArray = command.vertexArray && command.vertexArray.destroy(); this._spSkyFromSpace = this._spSkyFromSpace && this._spSkyFromSpace.destroy(); this._spSkyFromAtmosphere = this._spSkyFromAtmosphere && this._spSkyFromAtmosphere.destroy(); this._spSkyFromSpaceColorCorrect = this._spSkyFromSpaceColorCorrect && this._spSkyFromSpaceColorCorrect.destroy(); this._spSkyFromAtmosphereColorCorrect = this._spSkyFromAtmosphereColorCorrect && this._spSkyFromAtmosphereColorCorrect.destroy(); return destroyObject(this); }; export default SkyAtmosphere;
import _ from 'lodash' import _postcss from 'postcss' import processPlugins from '../src/util/processPlugins' function css(nodes) { return _postcss.root({ nodes }).toString() } function makeConfig(overrides) { return _.defaultsDeep(overrides, { prefix: '', important: false, separator: ':', }) } test('plugins can create utilities with object syntax', () => { const { components, utilities } = processPlugins( [ function({ addUtilities }) { addUtilities({ '.object-fill': { 'object-fit': 'fill', }, '.object-contain': { 'object-fit': 'contain', }, '.object-cover': { 'object-fit': 'cover', }, }) }, ], makeConfig() ) expect(components.length).toBe(0) expect(css(utilities)).toMatchCss(` @variants { .object-fill { object-fit: fill } .object-contain { object-fit: contain } .object-cover { object-fit: cover } } `) }) test('plugins can create utilities with arrays of objects', () => { const { components, utilities } = processPlugins( [ function({ addUtilities }) { addUtilities([ { '.object-fill': { 'object-fit': 'fill', }, }, { '.object-contain': { 'object-fit': 'contain', }, }, { '.object-cover': { 'object-fit': 'cover', }, }, ]) }, ], makeConfig() ) expect(components.length).toBe(0) expect(css(utilities)).toMatchCss(` @variants { .object-fill { object-fit: fill } .object-contain { object-fit: contain } .object-cover { object-fit: cover } } `) }) test('plugins can create utilities with raw PostCSS nodes', () => { const { components, utilities } = processPlugins( [ function({ addUtilities, postcss }) { addUtilities([ postcss.rule({ selector: '.object-fill' }).append([ postcss.decl({ prop: 'object-fit', value: 'fill', }), ]), postcss.rule({ selector: '.object-contain' }).append([ postcss.decl({ prop: 'object-fit', value: 'contain', }), ]), postcss.rule({ selector: '.object-cover' }).append([ postcss.decl({ prop: 'object-fit', value: 'cover', }), ]), ]) }, ], makeConfig() ) expect(components.length).toBe(0) expect(css(utilities)).toMatchCss(` @variants { .object-fill { object-fit: fill } .object-contain { object-fit: contain } .object-cover { object-fit: cover } } `) }) test('plugins can create utilities with mixed object styles and PostCSS nodes', () => { const { components, utilities } = processPlugins( [ function({ addUtilities, postcss }) { addUtilities([ { '.object-fill': { objectFit: 'fill', }, }, postcss.rule({ selector: '.object-contain' }).append([ postcss.decl({ prop: 'object-fit', value: 'contain', }), ]), postcss.rule({ selector: '.object-cover' }).append([ postcss.decl({ prop: 'object-fit', value: 'cover', }), ]), ]) }, ], makeConfig() ) expect(components.length).toBe(0) expect(css(utilities)).toMatchCss(` @variants { .object-fill { object-fit: fill } .object-contain { object-fit: contain } .object-cover { object-fit: cover } } `) }) test('plugins can create utilities with variants', () => { const { components, utilities } = processPlugins( [ function({ addUtilities }) { addUtilities( { '.object-fill': { 'object-fit': 'fill', }, '.object-contain': { 'object-fit': 'contain', }, '.object-cover': { 'object-fit': 'cover', }, }, ['responsive', 'hover', 'group-hover', 'focus'] ) }, ], makeConfig() ) expect(components.length).toBe(0) expect(css(utilities)).toMatchCss(` @variants responsive, hover, group-hover, focus { .object-fill { object-fit: fill } .object-contain { object-fit: contain } .object-cover { object-fit: cover } } `) }) test('plugins can create components with object syntax', () => { const { components, utilities } = processPlugins( [ function({ addComponents }) { addComponents({ '.btn-blue': { backgroundColor: 'blue', color: 'white', padding: '.5rem 1rem', borderRadius: '.25rem', }, '.btn-blue:hover': { backgroundColor: 'darkblue', }, }) }, ], makeConfig() ) expect(utilities.length).toBe(0) expect(css(components)).toMatchCss(` .btn-blue { background-color: blue; color: white; padding: .5rem 1rem; border-radius: .25rem } .btn-blue:hover { background-color: darkblue } `) }) test('plugins can add base styles with object syntax', () => { const { base } = processPlugins( [ function({ addBase }) { addBase({ img: { maxWidth: '100%', }, button: { fontFamily: 'inherit', }, }) }, ], makeConfig() ) expect(css(base)).toMatchCss(` img { max-width: 100% } button { font-family: inherit } `) }) test('plugins can add base styles with raw PostCSS nodes', () => { const { base } = processPlugins( [ function({ addBase, postcss }) { addBase([ postcss.rule({ selector: 'img' }).append([ postcss.decl({ prop: 'max-width', value: '100%', }), ]), postcss.rule({ selector: 'button' }).append([ postcss.decl({ prop: 'font-family', value: 'inherit', }), ]), ]) }, ], makeConfig() ) expect(css(base)).toMatchCss(` img { max-width: 100% } button { font-family: inherit } `) }) test('plugins can create components with raw PostCSS nodes', () => { const { components, utilities } = processPlugins( [ function({ addComponents, postcss }) { addComponents([ postcss.rule({ selector: '.btn-blue' }).append([ postcss.decl({ prop: 'background-color', value: 'blue', }), postcss.decl({ prop: 'color', value: 'white', }), postcss.decl({ prop: 'padding', value: '.5rem 1rem', }), postcss.decl({ prop: 'border-radius', value: '.25rem', }), ]), postcss.rule({ selector: '.btn-blue:hover' }).append([ postcss.decl({ prop: 'background-color', value: 'darkblue', }), ]), ]) }, ], makeConfig() ) expect(utilities.length).toBe(0) expect(css(components)).toMatchCss(` .btn-blue { background-color: blue; color: white; padding: .5rem 1rem; border-radius: .25rem } .btn-blue:hover { background-color: darkblue } `) }) test('plugins can create components with mixed object styles and raw PostCSS nodes', () => { const { components, utilities } = processPlugins( [ function({ addComponents, postcss }) { addComponents([ postcss.rule({ selector: '.btn-blue' }).append([ postcss.decl({ prop: 'background-color', value: 'blue', }), postcss.decl({ prop: 'color', value: 'white', }), postcss.decl({ prop: 'padding', value: '.5rem 1rem', }), postcss.decl({ prop: 'border-radius', value: '.25rem', }), ]), { '.btn-blue:hover': { backgroundColor: 'darkblue', }, }, ]) }, ], makeConfig() ) expect(utilities.length).toBe(0) expect(css(components)).toMatchCss(` .btn-blue { background-color: blue; color: white; padding: .5rem 1rem; border-radius: .25rem } .btn-blue:hover { background-color: darkblue } `) }) test('plugins can create components with media queries with object syntax', () => { const { components, utilities } = processPlugins( [ function({ addComponents }) { addComponents({ '.container': { width: '100%', }, '@media (min-width: 100px)': { '.container': { maxWidth: '100px', }, }, '@media (min-width: 200px)': { '.container': { maxWidth: '200px', }, }, '@media (min-width: 300px)': { '.container': { maxWidth: '300px', }, }, }) }, ], makeConfig() ) expect(utilities.length).toBe(0) expect(css(components)).toMatchCss(` .container { width: 100% } @media (min-width: 100px) { .container { max-width: 100px } } @media (min-width: 200px) { .container { max-width: 200px } } @media (min-width: 300px) { .container { max-width: 300px } } `) }) test('media queries can be defined multiple times using objects-in-array syntax', () => { const { components, utilities } = processPlugins( [ function({ addComponents }) { addComponents([ { '.container': { width: '100%', }, '@media (min-width: 100px)': { '.container': { maxWidth: '100px', }, }, }, { '.btn': { padding: '1rem .5rem', display: 'block', }, '@media (min-width: 100px)': { '.btn': { display: 'inline-block', }, }, }, ]) }, ], makeConfig() ) expect(utilities.length).toBe(0) expect(css(components)).toMatchCss(` .container { width: 100% } @media (min-width: 100px) { .container { max-width: 100px } } .btn { padding: 1rem .5rem; display: block } @media (min-width: 100px) { .btn { display: inline-block } } `) }) test('plugins can create nested rules', () => { const { components, utilities } = processPlugins( [ function({ addComponents }) { addComponents({ '.btn-blue': { backgroundColor: 'blue', color: 'white', padding: '.5rem 1rem', borderRadius: '.25rem', '&:hover': { backgroundColor: 'darkblue', }, '@media (min-width: 500px)': { '&:hover': { backgroundColor: 'orange', }, }, '> a': { color: 'red', }, 'h1 &': { color: 'purple', }, }, }) }, ], makeConfig() ) expect(utilities.length).toBe(0) expect(css(components)).toMatchCss(` .btn-blue { background-color: blue; color: white; padding: .5rem 1rem; border-radius: .25rem; } .btn-blue:hover { background-color: darkblue; } @media (min-width: 500px) { .btn-blue:hover { background-color: orange; } } .btn-blue > a { color: red; } h1 .btn-blue { color: purple; } `) }) test('plugins can create rules with escaped selectors', () => { const { components, utilities } = processPlugins( [ function({ e, addUtilities }) { addUtilities({ [`.${e('top-1/4')}`]: { top: '25%', }, }) }, ], makeConfig() ) expect(components.length).toBe(0) expect(css(utilities)).toMatchCss(` @variants { .top-1\\/4 { top: 25% } } `) }) test('plugins can access the current config', () => { const { components, utilities } = processPlugins( [ function({ addComponents, config }) { const containerClasses = [ { '.container': { width: '100%', }, }, ] _.forEach(config('screens'), breakpoint => { containerClasses.push({ [`@media (min-width: ${breakpoint})`]: { '.container': { maxWidth: breakpoint }, }, }) }) addComponents(containerClasses) }, ], makeConfig({ screens: { sm: '576px', md: '768px', lg: '992px', xl: '1200px', }, }) ) expect(utilities.length).toBe(0) expect(css(components)).toMatchCss(` .container { width: 100% } @media (min-width: 576px) { .container { max-width: 576px } } @media (min-width: 768px) { .container { max-width: 768px } } @media (min-width: 992px) { .container { max-width: 992px } } @media (min-width: 1200px) { .container { max-width: 1200px } } `) }) test('plugins can access the variants config directly', () => { const { components, utilities } = processPlugins( [ function({ addUtilities, variants }) { addUtilities( { '.object-fill': { 'object-fit': 'fill', }, '.object-contain': { 'object-fit': 'contain', }, '.object-cover': { 'object-fit': 'cover', }, }, variants('objectFit') ) }, ], makeConfig({ variants: { objectFit: ['responsive', 'focus', 'hover'], }, }) ) expect(components.length).toBe(0) expect(css(utilities)).toMatchCss(` @variants responsive, focus, hover { .object-fill { object-fit: fill } .object-contain { object-fit: contain } .object-cover { object-fit: cover } } `) }) test('plugins apply all global variants when variants are configured globally', () => { const { components, utilities } = processPlugins( [ function({ addUtilities, variants }) { addUtilities( { '.object-fill': { 'object-fit': 'fill', }, }, variants('objectFit') ) addUtilities( { '.rotate-90deg': { transform: 'rotate(90deg)', }, }, variants('rotate') ) }, ], makeConfig({ variants: ['responsive', 'focus', 'hover'], }) ) expect(components.length).toBe(0) expect(css(utilities)).toMatchCss(` @variants responsive, focus, hover { .object-fill { object-fit: fill } } @variants responsive, focus, hover { .rotate-90deg { transform: rotate(90deg) } } `) }) test('plugins can provide fallbacks to keys missing from the config', () => { const { components, utilities } = processPlugins( [ function({ addComponents, config }) { addComponents({ '.btn': { borderRadius: config('borderRadius.default', '.25rem'), }, }) }, ], makeConfig({ borderRadius: { '1': '1px', '2': '2px', '4': '4px', '8': '8px', }, }) ) expect(utilities.length).toBe(0) expect(css(components)).toMatchCss(` .btn { border-radius: .25rem } `) }) test('variants are optional when adding utilities', () => { const { utilities } = processPlugins( [ function({ addUtilities }) { addUtilities({ '.border-collapse': { 'border-collapse': 'collapse', }, }) }, ], makeConfig() ) expect(css(utilities)).toMatchCss(` @variants { .border-collapse { border-collapse: collapse } }`) }) test('plugins can add multiple sets of utilities and components', () => { const { components, utilities } = processPlugins( [ function({ addUtilities, addComponents }) { addComponents({ '.card': { padding: '1rem', borderRadius: '.25rem', }, }) addUtilities({ '.skew-12deg': { transform: 'skewY(-12deg)', }, }) addComponents({ '.btn': { padding: '1rem .5rem', display: 'inline-block', }, }) addUtilities({ '.border-collapse': { borderCollapse: 'collapse', }, }) }, ], makeConfig() ) expect(css(utilities)).toMatchCss(` @variants { .skew-12deg { transform: skewY(-12deg) } } @variants { .border-collapse { border-collapse: collapse } } `) expect(css(components)).toMatchCss(` .card { padding: 1rem; border-radius: .25rem } .btn { padding: 1rem .5rem; display: inline-block } `) }) test('plugins respect prefix and important options by default when adding utilities', () => { const { utilities } = processPlugins( [ function({ addUtilities }) { addUtilities({ '.rotate-90': { transform: 'rotate(90deg)', }, }) }, ], makeConfig({ prefix: 'tw-', important: true, }) ) expect(css(utilities)).toMatchCss(` @variants { .tw-rotate-90 { transform: rotate(90deg) !important } } `) }) test('when important is a selector it is used to scope utilities instead of adding !important', () => { const { utilities } = processPlugins( [ function({ addUtilities }) { addUtilities({ '.rotate-90': { transform: 'rotate(90deg)', }, }) }, ], makeConfig({ important: '#app', }) ) expect(css(utilities)).toMatchCss(` @variants { #app .rotate-90 { transform: rotate(90deg) } } `) }) test('when important is a selector it scopes all selectors in a rule, even though defining utilities like this is stupid', () => { const { utilities } = processPlugins( [ function({ addUtilities }) { addUtilities({ '.rotate-90, .rotate-1\\/4': { transform: 'rotate(90deg)', }, }) }, ], makeConfig({ important: '#app', }) ) expect(css(utilities)).toMatchCss(` @variants { #app .rotate-90, #app .rotate-1\\/4 { transform: rotate(90deg) } } `) }) test('important utilities are not made double important when important option is used', () => { const { utilities } = processPlugins( [ function({ addUtilities }) { addUtilities({ '.rotate-90': { transform: 'rotate(90deg) !important', }, }) }, ], makeConfig({ important: true, }) ) expect(css(utilities)).toMatchCss(` @variants { .rotate-90 { transform: rotate(90deg) !important } } `) }) test("component declarations respect the 'prefix' option by default", () => { const { components } = processPlugins( [ function({ addComponents }) { addComponents({ '.btn-blue': { backgroundColor: 'blue', }, }) }, ], makeConfig({ prefix: 'tw-', }) ) expect(css(components)).toMatchCss(` .tw-btn-blue { background-color: blue } `) }) test('all selectors in a rule are prefixed', () => { const { utilities, components } = processPlugins( [ function({ addUtilities, addComponents }) { addUtilities({ '.rotate-90, .rotate-1\\/4': { transform: 'rotate(90deg)', }, }) addComponents({ '.btn-blue, .btn-red': { padding: '10px', }, }) }, ], makeConfig({ prefix: 'tw-', }) ) expect(css(utilities)).toMatchCss(` @variants { .tw-rotate-90, .tw-rotate-1\\/4 { transform: rotate(90deg) } } `) expect(css(components)).toMatchCss(` .tw-btn-blue, .tw-btn-red { padding: 10px } `) }) test("component declarations can optionally ignore 'prefix' option", () => { const { components } = processPlugins( [ function({ addComponents }) { addComponents( { '.btn-blue': { backgroundColor: 'blue', }, }, { respectPrefix: false } ) }, ], makeConfig({ prefix: 'tw-', }) ) expect(css(components)).toMatchCss(` .btn-blue { background-color: blue } `) }) test("component declarations are not affected by the 'important' option", () => { const { components } = processPlugins( [ function({ addComponents }) { addComponents({ '.btn-blue': { backgroundColor: 'blue', }, }) }, ], makeConfig({ important: true, }) ) expect(css(components)).toMatchCss(` .btn-blue { background-color: blue } `) }) test("plugins can apply the user's chosen prefix to components manually", () => { const { components } = processPlugins( [ function({ addComponents, prefix }) { addComponents( { [prefix('.btn-blue')]: { backgroundColor: 'blue', }, }, { respectPrefix: false } ) }, ], makeConfig({ prefix: 'tw-', }) ) expect(css(components)).toMatchCss(` .tw-btn-blue { background-color: blue } `) }) test('prefix can optionally be ignored for utilities', () => { const { utilities } = processPlugins( [ function({ addUtilities }) { addUtilities( { '.rotate-90': { transform: 'rotate(90deg)', }, }, { respectPrefix: false, } ) }, ], makeConfig({ prefix: 'tw-', important: true, }) ) expect(css(utilities)).toMatchCss(` @variants { .rotate-90 { transform: rotate(90deg) !important } } `) }) test('important can optionally be ignored for utilities', () => { const { utilities } = processPlugins( [ function({ addUtilities }) { addUtilities( { '.rotate-90': { transform: 'rotate(90deg)', }, }, { respectImportant: false, } ) }, ], makeConfig({ prefix: 'tw-', important: true, }) ) expect(css(utilities)).toMatchCss(` @variants { .tw-rotate-90 { transform: rotate(90deg) } } `) }) test('variants can still be specified when ignoring prefix and important options', () => { const { utilities } = processPlugins( [ function({ addUtilities }) { addUtilities( { '.rotate-90': { transform: 'rotate(90deg)', }, }, { variants: ['responsive', 'hover', 'focus'], respectImportant: false, respectPrefix: false, } ) }, ], makeConfig({ prefix: 'tw-', important: true, }) ) expect(css(utilities)).toMatchCss(` @variants responsive, hover, focus { .rotate-90 { transform: rotate(90deg) } } `) }) test('prefix will prefix all classes in a selector', () => { const { components } = processPlugins( [ function({ addComponents, prefix }) { addComponents( { [prefix('.btn-blue .w-1\\/4 > h1.text-xl + a .bar')]: { backgroundColor: 'blue', }, }, { respectPrefix: false } ) }, ], makeConfig({ prefix: 'tw-', }) ) expect(css(components)).toMatchCss(` .tw-btn-blue .tw-w-1\\/4 > h1.tw-text-xl + a .tw-bar { background-color: blue } `) }) test('plugins can be provided as an object with a handler function', () => { const { components, utilities } = processPlugins( [ { handler({ addUtilities }) { addUtilities({ '.object-fill': { 'object-fit': 'fill', }, '.object-contain': { 'object-fit': 'contain', }, '.object-cover': { 'object-fit': 'cover', }, }) }, }, ], makeConfig() ) expect(components.length).toBe(0) expect(css(utilities)).toMatchCss(` @variants { .object-fill { object-fit: fill } .object-contain { object-fit: contain } .object-cover { object-fit: cover } } `) }) test('plugins can provide a config but no handler', () => { const { components, utilities } = processPlugins( [ { config: { prefix: 'tw-', }, }, { handler({ addUtilities }) { addUtilities({ '.object-fill': { 'object-fit': 'fill', }, '.object-contain': { 'object-fit': 'contain', }, '.object-cover': { 'object-fit': 'cover', }, }) }, }, ], makeConfig() ) expect(components.length).toBe(0) expect(css(utilities)).toMatchCss(` @variants { .object-fill { object-fit: fill } .object-contain { object-fit: contain } .object-cover { object-fit: cover } } `) })
import React from 'react'; import PropTypes from 'prop-types'; import {connect} from 'react-redux'; import {View, StyleSheet, Image} from 'react-native'; import {Text, Card} from 'react-native-elements'; import {useFocusEffect} from '@react-navigation/native'; import {globalStyles} from '../../styles/Global'; import {primary_color} from '../../styles/color'; import Icon from 'react-native-vector-icons/Fontisto'; import * as actions from '../../store/actions'; import AppButton from '../../components/AppButton'; import axios from 'axios'; import {API_URL} from '../../utils/config'; import {retrieveData} from '../../services/persistentStorage'; // const styles = StyleSheet.create({ // container: { // flex: 1, // backgroundColor: '#fff', // }, // text: { // marginBottom: 10, // }, // buttonStyle: { // borderRadius: 0, // marginLeft: 0, // marginRight: 0, // marginBottom: 0, // }, // }); const ProfileScreen = ({navigation, logout}) => { const onLogoutPress = () => { logout(); }; const [user, set_user] = React.useState(0); useFocusEffect( React.useCallback(() => { let isActive = true; const fetchCategories = async () => { const user_id = await retrieveData('user'); console.log(user_id.id); try { const res = await axios.get(`${API_URL}user/${user_id.id}`); if (res.status === 200) { console.log(res.data); } if (isActive) { set_user(res.data); } } catch (e) { console.log(e); } }; fetchCategories(); return () => { isActive = false; }; }, []), ); return ( <View style={styles.container}> <View style={styles.header}> <Image style={styles.avatar} source={require('../../assets/doctor3.png')} /> <View style={{marginTop: 20}}> <Text style={{fontSize: 16}}>{`Dr. ${user.firstName} ${user.lastName}`}</Text> </View> </View> <View /> <View style={{marginBottom: 10}}> <Icon name="email" color={primary_color} size={25} /> </View> <View> <Text style={{fontSize: 16}}>{user.email}</Text> </View> <View style={{marginTop: 10}}> <Icon name="phone" color={primary_color} size={25} /> </View> <View> <Text style={{fontSize: 16}}> +256 {user.phoneNumber}</Text> </View> <View style={{marginTop: 10}}> <Icon name="home" color={primary_color} size={25} /> </View> <View> <Text style={{fontSize: 16}}>{user.hospital}</Text> </View> <AppButton onPress={() => { onLogoutPress(); }} icon={{name: 'exit-to-app', color: '#fff'}} buttonStyle={styles.buttonStyle} title="Logout" /> <View /> </View> ); }; ProfileScreen.propTypes = { logout: PropTypes.func.isRequired, }; export default connect(null, actions)(ProfileScreen); const styles = StyleSheet.create({ container: { flex: 1, padding: 10, }, header: { alignItems: 'center', margin: 20, }, avatar: { width: 130, height: 130, borderRadius: 63, borderWidth: 1, borderColor: primary_color, }, name: { fontSize: 30, color: primary_color, fontWeight: 'bold', textTransform: 'capitalize', }, buttonStyle: { borderRadius: 0, marginLeft: 0, marginRight: 0, marginBottom: 0, marginTop: 20, height: 45, backgroundColor: primary_color, }, });
(function(d){d['gu']=Object.assign(d['gu']||{},{a:"ફાઇલ અપલોડ ન થઇ શકી",b:"ઘાટુ - બોલ્ડ્",c:"ત્રાંસુ - ઇટલિક્",d:" વિચાર ટાંકો",e:"Insert image or file",f:"Choose heading",g:"Heading",h:"image widget",i:"Full size image",j:"Side image",k:"Left aligned image",l:"Centered image",m:"Right aligned image",n:"Insert image",o:"Numbered List",p:"Bulleted List",q:"Insert table",r:"Header column",s:"Insert column left",t:"Insert column right",u:"Delete column",v:"Column",w:"Header row",x:"Insert row below",y:"Insert row above",z:"Delete row",aa:"Row",ab:"Merge cell up",ac:"Merge cell right",ad:"Merge cell down",ae:"Merge cell left",af:"Split cell vertically",ag:"Split cell horizontally",ah:"Merge cells",ai:"Enter image caption",aj:"Upload failed",ak:"media widget",al:"Insert media",am:"The URL must not be empty.",an:"This media URL is not supported.",ao:"Link",ap:"Could not obtain resized image URL.",aq:"Selecting resized image failed",ar:"Could not insert image at the current position.",as:"Inserting image failed",at:"Upload in progress",au:"Open in a new tab",av:"Downloadable",aw:"Unlink",ax:"Edit link",ay:"Open link in new tab",az:"This link has no URL",ba:"Save",bb:"Cancel",bc:"Link URL",bd:"Paste the media URL in the input.",be:"Tip: Paste the URL into the content to embed faster.",bf:"Media URL",bg:"Undo",bh:"Redo",bi:"Rich Text Editor, %0",bj:"Rich Text Editor",bk:"%0 of %1",bl:"Previous",bm:"Next",bn:"Change image text alternative",bo:"Paragraph",bp:"Heading 1",bq:"Heading 2",br:"Heading 3",bs:"Heading 4",bt:"Heading 5",bu:"Heading 6",bv:"Text alternative"})})(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
/* global module */ 'use strict'; function FakeNotificationApp(client, origin) { this.client = client; this.origin = origin || ('app://' + FakeNotificationApp.DEFAULT_ORIGIN); } module.exports = FakeNotificationApp; FakeNotificationApp.DEFAULT_ORIGIN = 'fakenotificationapp.gaiamobile.org'; FakeNotificationApp.Selector = Object.freeze({ title : '#title' }); FakeNotificationApp.prototype = { client: null, get title() { return this.client.findElement(FakeNotificationApp.Selector.title); }, launch: function() { this.client.switchToFrame(); this.client.apps.launch(this.origin); this.client.apps.switchToApp(this.origin); }, waitForTitleShown: function(shouldBeShown) { this.client.waitFor(function() { var shown = this.title.displayed(); return shown === shouldBeShown; }.bind(this)); }, close: function() { this.client.apps.close(this.origin); } };
;(function() { "use strict" analyticsHooks.on("save:sign-up", function(data) { analytics.track("Triggered sign up form via save button") }) analyticsHooks.on("save:save-artwork", function(data) { analytics.track("Saved Artwork", { entity_slug: data.entity_slug, entity_id: data.entity_id, context_page: data.context_page, context_module: data.context_module, }) }) analyticsHooks.on("save:remove-artwork", function(data) { analytics.track("Removed Artwork", { entity_slug: data.entity_slug, entity_id: data.entity_id, context_page: data.context_page, context_module: data.context_module, }) }) })()
/************************************************************* * * MathJax/fonts/HTML-CSS/TeX/png/SansSerif/Regular/Other.js * * Defines the image size data needed for the HTML-CSS OutputJax * to display mathematics using fallback images when the fonts * are not availble to the client browser. * * --------------------------------------------------------------------- * * Copyright (c) 2009-2010 Design Science, Inc. * * 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 * * 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. * */ MathJax.OutputJax["HTML-CSS"].defineImageData({ "MathJax_SansSerif": { 0xA0: [ // NO-BREAK SPACE [1,1,0],[1,1,0],[1,1,0],[1,1,0],[1,1,0],[1,1,0],[1,1,0],[1,1,0], [1,1,0],[1,1,0],[1,1,0],[1,1,0],[1,1,0],[1,1,0] ], 0x131: [ // LATIN SMALL LETTER DOTLESS I [2,3,0],[2,4,0],[2,5,0],[2,6,0],[3,6,0],[3,8,0],[4,9,0],[4,11,0], [5,13,0],[6,15,0],[7,17,0],[8,20,0],[10,26,0],[11,30,0] ], 0x237: [ // LATIN SMALL LETTER DOTLESS J [3,4,1],[3,6,2],[3,7,2],[4,9,3],[4,9,3],[5,11,3],[6,13,4],[7,16,5], [8,18,5],[9,21,6],[11,25,8],[12,30,10],[15,38,12],[17,43,14] ], 0x300: [ // COMBINING GRAVE ACCENT [2,1,-4],[3,2,-4],[4,2,-6],[3,2,-7],[4,2,-7],[4,3,-9],[6,4,-10],[6,4,-13], [7,5,-15],[8,6,-17],[10,7,-20],[11,8,-24],[13,10,-29],[15,11,-34] ], 0x301: [ // COMBINING ACUTE ACCENT [3,1,-4],[3,2,-4],[3,2,-6],[4,2,-7],[4,2,-7],[5,3,-9],[5,4,-10],[7,4,-13], [7,5,-15],[8,6,-17],[9,7,-20],[12,8,-24],[13,10,-29],[15,11,-34] ], 0x302: [ // COMBINING CIRCUMFLEX ACCENT [3,1,-4],[4,2,-4],[5,2,-6],[5,2,-7],[5,2,-7],[6,3,-9],[8,4,-10],[9,4,-13], [10,5,-15],[12,6,-17],[14,7,-20],[17,8,-24],[20,10,-29],[23,11,-34] ], 0x303: [ // COMBINING TILDE [3,1,-4],[4,1,-5],[5,2,-6],[5,3,-6],[5,2,-7],[6,3,-9],[8,3,-11],[9,3,-14], [10,4,-16],[12,5,-18],[14,6,-21],[17,6,-25],[20,8,-31],[23,9,-35] ], 0x304: [ // COMBINING MACRON [3,1,-3],[4,1,-5],[5,1,-6],[6,2,-6],[6,2,-6],[7,3,-9],[8,2,-11],[9,2,-13], [11,3,-16],[13,3,-18],[15,4,-22],[18,4,-25],[21,5,-31],[25,6,-36] ], 0x306: [ // COMBINING BREVE [3,1,-4],[4,2,-4],[5,2,-6],[6,3,-6],[5,3,-6],[7,4,-8],[8,4,-10],[9,4,-13], [10,6,-14],[13,6,-17],[15,8,-19],[17,9,-23],[20,11,-28],[25,12,-33] ], 0x307: [ // COMBINING DOT ABOVE [2,1,-4],[2,1,-5],[2,2,-6],[2,2,-7],[3,2,-7],[3,2,-10],[3,3,-11],[4,3,-14], [4,3,-17],[4,4,-19],[5,5,-23],[6,5,-26],[7,6,-33],[7,7,-38] ], 0x308: [ // COMBINING DIAERESIS [3,1,-4],[4,1,-5],[3,2,-6],[4,2,-7],[5,2,-7],[6,2,-10],[6,2,-12],[8,3,-14], [9,3,-17],[11,4,-19],[12,4,-23],[15,5,-27],[17,6,-33],[21,7,-38] ], 0x30A: [ // COMBINING RING ABOVE [3,1,-4],[3,2,-4],[4,2,-6],[3,2,-7],[4,2,-7],[5,3,-9],[6,3,-11],[6,5,-12], [7,6,-14],[8,6,-17],[10,7,-20],[11,8,-24],[13,10,-29],[15,11,-34] ], 0x30B: [ // COMBINING DOUBLE ACUTE ACCENT [3,2,-3],[4,2,-4],[4,2,-6],[5,3,-6],[5,3,-6],[6,3,-9],[7,4,-10],[9,5,-12], [10,5,-15],[12,6,-17],[13,7,-20],[16,8,-24],[19,10,-29],[22,11,-34] ], 0x30C: [ // COMBINING CARON [3,1,-3],[4,2,-4],[5,2,-5],[5,2,-6],[5,2,-6],[6,3,-9],[8,4,-10],[9,4,-12], [10,5,-14],[12,6,-16],[14,7,-19],[17,8,-22],[20,10,-28],[23,11,-32] ], 0x393: [ // GREEK CAPITAL LETTER GAMMA [4,5,0],[5,6,0],[5,8,0],[6,9,0],[7,9,0],[9,12,0],[10,14,0],[12,17,0], [14,20,0],[17,23,0],[20,27,0],[24,32,0],[28,39,0],[33,45,0] ], 0x394: [ // GREEK CAPITAL LETTER DELTA [6,5,0],[7,6,0],[8,8,0],[10,9,0],[11,9,0],[14,12,0],[16,14,0],[19,17,0], [22,20,0],[26,23,0],[31,27,0],[37,32,0],[44,39,0],[52,45,0] ], 0x398: [ // GREEK CAPITAL LETTER THETA [5,5,0],[6,6,0],[8,8,0],[9,9,0],[10,9,0],[12,12,0],[15,14,0],[17,19,1], [20,22,1],[24,25,1],[29,27,0],[34,34,1],[40,42,1],[48,49,1] ], 0x39B: [ // GREEK CAPITAL LETTER LAMDA [5,5,0],[5,6,0],[6,8,0],[7,9,0],[9,9,0],[10,12,0],[12,14,0],[14,17,0], [17,20,0],[20,23,0],[23,27,0],[28,32,0],[33,39,0],[39,45,0] ], 0x39E: [ // GREEK CAPITAL LETTER XI [5,5,0],[6,6,0],[7,8,0],[8,9,0],[9,9,0],[11,12,0],[13,14,0],[15,17,0], [18,20,0],[21,23,0],[25,27,0],[29,32,0],[35,39,0],[42,45,0] ], 0x3A0: [ // GREEK CAPITAL LETTER PI [5,5,0],[6,6,0],[7,8,0],[8,9,0],[9,9,0],[11,12,0],[13,14,0],[15,17,0], [18,20,0],[21,23,0],[25,27,0],[29,32,0],[35,39,0],[41,45,0] ], 0x3A3: [ // GREEK CAPITAL LETTER SIGMA [5,5,0],[6,6,0],[7,8,0],[8,9,0],[10,9,0],[12,12,0],[13,14,0],[16,17,0], [19,20,0],[22,23,0],[27,27,0],[31,32,0],[37,39,0],[44,45,0] ], 0x3A5: [ // GREEK CAPITAL LETTER UPSILON [5,5,0],[6,6,0],[8,8,0],[9,9,0],[10,9,0],[12,12,0],[15,14,0],[17,18,0], [20,21,0],[24,24,0],[29,27,0],[34,33,0],[40,41,0],[48,47,0] ], 0x3A6: [ // GREEK CAPITAL LETTER PHI [5,5,0],[6,6,0],[7,8,0],[8,9,0],[10,9,0],[12,12,0],[13,14,0],[16,17,0], [19,20,0],[22,23,0],[27,27,0],[31,32,0],[37,39,0],[44,45,0] ], 0x3A8: [ // GREEK CAPITAL LETTER PSI [5,5,0],[6,6,0],[8,8,0],[9,9,0],[10,9,0],[12,12,0],[15,14,0],[17,17,0], [20,20,0],[24,23,0],[29,27,0],[34,32,0],[40,39,0],[48,45,0] ], 0x3A9: [ // GREEK CAPITAL LETTER OMEGA [5,5,0],[6,6,0],[7,8,0],[8,9,0],[10,9,0],[12,12,0],[14,14,0],[16,18,0], [19,21,0],[23,24,0],[27,27,0],[32,33,0],[38,41,0],[45,47,0] ], 0x2013: [ // EN DASH [4,1,-1],[5,1,-2],[5,1,-2],[6,1,-3],[7,1,-3],[9,3,-3],[10,2,-5],[12,2,-6], [14,3,-7],[17,3,-8],[20,3,-9],[24,4,-11],[28,5,-13],[33,5,-15] ], 0x2014: [ // EM DASH [7,1,-1],[9,1,-2],[10,1,-2],[12,1,-3],[14,1,-3],[17,3,-3],[20,2,-5],[24,2,-6], [28,3,-7],[33,3,-8],[40,3,-9],[47,4,-11],[56,5,-13],[66,5,-15] ], 0x2018: [ // LEFT SINGLE QUOTATION MARK [2,2,-3],[2,2,-4],[2,3,-5],[3,4,-5],[3,4,-5],[4,4,-8],[4,4,-10],[5,6,-11], [6,6,-14],[7,8,-15],[8,9,-18],[9,10,-22],[11,13,-26],[13,15,-30] ], 0x2019: [ // RIGHT SINGLE QUOTATION MARK [2,2,-3],[2,2,-4],[2,3,-5],[3,3,-6],[3,3,-6],[4,4,-8],[4,5,-9],[5,6,-11], [6,7,-13],[7,8,-15],[8,9,-18],[9,10,-22],[11,13,-26],[13,15,-30] ], 0x201C: [ // LEFT DOUBLE QUOTATION MARK [4,2,-3],[4,2,-4],[5,3,-5],[6,4,-5],[7,4,-5],[8,4,-8],[10,4,-10],[11,6,-11], [13,6,-14],[16,8,-15],[19,9,-18],[22,10,-22],[26,13,-26],[31,15,-30] ], 0x201D: [ // RIGHT DOUBLE QUOTATION MARK [3,2,-3],[3,2,-4],[4,3,-5],[4,3,-6],[5,3,-6],[6,4,-8],[7,5,-9],[8,6,-11], [9,7,-13],[11,8,-15],[13,9,-18],[16,10,-22],[18,13,-26],[22,15,-30] ] } }); MathJax.Ajax.loadComplete(MathJax.OutputJax["HTML-CSS"].imgDir+"/SansSerif/Regular"+ MathJax.OutputJax["HTML-CSS"].imgPacked+"/Other.js");
(function(a,b){if('function'==typeof define&&define.amd)define(['exports','react'],b);else if('undefined'!=typeof exports)b(exports,require('react'));else{var c={exports:{}};b(c.exports,a.react),a.wifiStrengthAlertOutline=c.exports}})(this,function(a,b){'use strict';Object.defineProperty(a,'__esModule',{value:!0});var e=function(h){return h&&h.__esModule?h:{default:h}}(b),f=Object.assign||function(h){for(var k,j=1;j<arguments.length;j++)for(var l in k=arguments[j],k)Object.prototype.hasOwnProperty.call(k,l)&&(h[l]=k[l]);return h};a.default=function(h){var j=/^\<svg [^>]+\>(.*)<\/svg>/ig.exec('<svg xmlns="http://www.w3.org/2000/svg" baseProfile="full" viewBox="0 0 24 24"><path d="M12.002 2.998A18.986 18.986 0 0 0 .377 7.003H.361c3.883 4.828 7.764 9.657 11.65 14.486 2.33-2.9 4.659-5.805 6.988-8.705V9.585l-6.996 8.716L3.27 7.436A16.972 16.972 0 0 1 12.003 5c3.07.015 6.083.859 8.71 2.451l-.44.546h2.564l.805-.994h.006a18.98 18.98 0 0 0-11.646-4.005zm9 7.002v7.997h1.995V10m-1.996 10v2.003h1.996V20"/></svg>')[1];return e.default.createElement('svg',f({},h,{xmlns:'http://www.w3.org/2000/svg',baseProfile:'full',viewBox:'0 0 24 24',className:'react-pretty-icons react-pretty-icons__wifi-strength-alert-outline '+h.className,dangerouslySetInnerHTML:{__html:j}}))},module.exports=a.default});
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = void 0; var _react = _interopRequireDefault(require("react")); var LeftArrow = function LeftArrow(props) { return /*#__PURE__*/_react["default"].createElement("svg", props, /*#__PURE__*/_react["default"].createElement("path", { d: "M336 275L126 485h806c13 0 23 10 23 23s-10 23-23 23H126l210 210c11 11 11 21 0 32-5 5-10 7-16 7s-11-2-16-7L55 524c-11-11-11-21 0-32l249-249c21-22 53 10 32 32z" })); }; LeftArrow.defaultProps = { focusable: "false", viewBox: "0 0 1000 1000" }; var _default = LeftArrow; exports["default"] = _default;
import React from 'react'; import PropTypes from 'prop-types'; import PDFViewer from 'mgr-pdf-viewer-react'; import CustomNavigation from './CustomNavigation'; const PdfViewer = props => { const { file, scale } = props; return ( <div className={`panel-heading`}> <PDFViewer document={{ file: file, }} navigation={CustomNavigation} scale={scale} /> </div> ); }; PDFViewer.defaultProps = { file: '', scale: 1, }; PDFViewer.propTypes = { file: PropTypes.string, scale: PropTypes.number, }; export default PdfViewer;
zipdata({"7070057":[33,"美作市","則平"],"7078502":[33,"美作市","栄町","187番4"],"7070431":[33,"美作市","田井"],"7070502":[33,"英田郡西粟倉村","坂根"],"7070421":[33,"美作市","川上"],"7070024":[33,"美作市","楢原下"],"7070014":[33,"美作市","北山"],"7070122":[33,"美作市","馬形"],"7070034":[33,"美作市","猪臥"],"7070124":[33,"美作市","大町"],"7070416":[33,"美作市","今岡"],"7070407":[33,"美作市","川東"],"7070031":[33,"美作市","山口"],"7070204":[33,"美作市","右手"],"7070132":[33,"美作市","小畑"],"7070112":[33,"美作市","余野"],"7070023":[33,"美作市","平福"],"7070013":[33,"美作市","吉"],"7070053":[33,"美作市","安蘇"],"7070406":[33,"美作市","東吉田"],"7070003":[33,"美作市","明見"],"7070413":[33,"美作市","中町"],"7070123":[33,"美作市","宗掛"],"7070134":[33,"美作市","矢田"],"7070433":[33,"美作市","立石"],"7070414":[33,"美作市","西町"],"7070401":[33,"美作市","後山"],"7070000":[33,"美作市",""],"7070131":[33,"美作市","河内"],"7070504":[33,"英田郡西粟倉村","長尾"],"7070011":[33,"美作市","和田"],"7070422":[33,"美作市","笹岡"],"7070201":[33,"美作市","梶並"],"7070500":[33,"英田郡西粟倉村",""],"7070111":[33,"美作市","久賀"],"7070052":[33,"美作市","位田"],"7070505":[33,"英田郡西粟倉村","筏津"],"7070062":[33,"美作市","湯郷"],"7070426":[33,"美作市","桂坪"],"7070427":[33,"美作市","滝"],"7070412":[33,"美作市","古町"],"7070061":[33,"美作市","中山"],"7070016":[33,"美作市","下香山"],"7070015":[33,"美作市","豊国原"],"7070045":[33,"美作市","巨勢"],"7070064":[33,"美作市","殿所"],"7070405":[33,"美作市","野原"],"7070037":[33,"美作市","友野"],"7070002":[33,"美作市","中尾"],"7078585":[33,"美作市","入田","291-1"],"7070055":[33,"美作市","金原"],"7070032":[33,"美作市","山外野"],"7070423":[33,"美作市","小原田"],"7070501":[33,"英田郡西粟倉村","大茅"],"7070503":[33,"英田郡西粟倉村","影石"],"7070437":[33,"美作市","粟野"],"7070001":[33,"美作市","上相"],"7078501":[33,"美作市","栄町","38-2"],"7070056":[33,"美作市","長内"],"7070403":[33,"美作市","東青野"],"7070065":[33,"美作市","青木"],"7070044":[33,"美作市","海田"],"7070121":[33,"美作市","長谷内"],"7070042":[33,"美作市","朽木"],"7070046":[33,"美作市","三倉田"],"7070415":[33,"美作市","宮本"],"7070402":[33,"美作市","中谷"],"7070417":[33,"美作市","下町"],"7070004":[33,"美作市","入田"],"7070043":[33,"美作市","海内"],"7070054":[33,"美作市","岩見田"],"7070113":[33,"美作市","真加部"],"7070066":[33,"美作市","下大谷"],"7070436":[33,"美作市","川戸"],"7070041":[33,"美作市","林野"],"7070205":[33,"美作市","東谷上"],"7070063":[33,"美作市","北坂"],"7070133":[33,"美作市","杉原"],"7070033":[33,"美作市","大原"],"7070432":[33,"美作市","赤田"],"7070021":[33,"美作市","楢原中"],"7070051":[33,"美作市","稲穂"],"7070203":[33,"美作市","真殿"],"7070506":[33,"英田郡西粟倉村","知社"],"7070202":[33,"美作市","楮"],"7070067":[33,"美作市","奥大谷"],"7070206":[33,"美作市","東谷下"],"7070012":[33,"美作市","田殿"],"7070411":[33,"美作市","江ノ原"],"7070005":[33,"美作市","大井が丘"],"7070435":[33,"美作市","沢田"],"7070025":[33,"美作市","栄町"],"7070022":[33,"美作市","楢原上"],"7070424":[33,"美作市","野形"],"7070035":[33,"美作市","平田"],"7070425":[33,"美作市","下庄町"],"7070434":[33,"美作市","壬生"],"7070036":[33,"美作市","北原"],"7070404":[33,"美作市","太田"]} );
(window.webpackJsonp=window.webpackJsonp||[]).push([[5],{"./node_modules/typings-for-css-modules-loader/lib/index.js??ref--4-1!./node_modules/sass-loader/lib/loader.js!./src/components/ImageLoader/ImageLoader.scss":function(e,t,o){(t=e.exports=o("./node_modules/css-loader/lib/css-base.js")(!1)).push([e.i,".VRv0e{position:relative;display:inline-block;font-size:0;overflow:hidden;-webkit-user-drag:none}.VRv0e._1MlOY,.VRv0e._1MlOY img{border-radius:50%}.VRv0e img{width:100%;opacity:0;transition:opacity .4s ease-out}.VRv0e img._3X_EN{opacity:1}.VRv0e ._2SOxR{opacity:1;transition:opacity .2s ease-out}.VRv0e ._2SOxR._2R9Vy{opacity:0}",""]),t.locals={ImageLoader:"VRv0e",circle:"_1MlOY",loaded:"_3X_EN",Loader:"_2SOxR",hideLoader:"_2R9Vy"}},"./node_modules/typings-for-css-modules-loader/lib/index.js??ref--4-1!./node_modules/sass-loader/lib/loader.js!./src/pages/NoticePage/NoticePage.scss":function(e,t,o){(t=e.exports=o("./node_modules/css-loader/lib/css-base.js")(!1)).push([e.i,"._34h4O{position:relative}._34h4O ._1KZjW{font-size:17px;color:#000}._34h4O ._2khiC{position:absolute;top:50px;height:1px;left:0;box-shadow:0 5px 20px 0 rgba(0,0,0,.1);right:0;z-index:1}",""]),t.locals={NoticePage:"_34h4O",HeaderTitle:"_1KZjW",Shadow:"_2khiC"}},"./node_modules/typings-for-css-modules-loader/lib/index.js??ref--4-1!./node_modules/sass-loader/lib/loader.js!./src/pages/NoticePage/components/NoticeListItem.scss":function(e,t,o){(t=e.exports=o("./node_modules/css-loader/lib/css-base.js")(!1)).push([e.i,"._2nimO{position:relative}._2nimO ._2Gjmq{display:flex;justify-content:space-between;height:50px;padding:0 15px 0 12px;border-bottom:1px solid rgba(0,0,0,.05);background:#fff;box-sizing:border-box}._2nimO ._2Gjmq ._14y9l{display:flex;flex-flow:column;padding-top:9px}._2nimO ._2Gjmq ._14y9l ._1nyNm{font-size:15px;color:#000}._2nimO ._2Gjmq ._14y9l ._3BOho{font-size:12px;color:#727272;margin-top:1px}._2nimO ._2Gjmq .nE2_5{display:flex;align-items:center;justify-content:flex-end;width:50px}._2nimO ._24W-T{position:relative;padding:12px 15px;background:#f2f2f2}",""]),t.locals={NoticeListItem:"_2nimO",TitleLine:"_2Gjmq",Text:"_14y9l",Title:"_1nyNm",Date:"_3BOho",ToggleButton:"nE2_5",ContentLine:"_24W-T"}},"./src/components/ImageLoader/ImageLoader.scss":function(e,t,o){var s=o("./node_modules/typings-for-css-modules-loader/lib/index.js??ref--4-1!./node_modules/sass-loader/lib/loader.js!./src/components/ImageLoader/ImageLoader.scss");"string"==typeof s&&(s=[[e.i,s,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};o("./node_modules/style-loader/lib/addStyles.js")(s,i);s.locals&&(e.exports=s.locals)},"./src/components/ImageLoader/ImageLoader.tsx":function(e,t,o){"use strict";o.d(t,"a",function(){return u});var s=o("./node_modules/tslib/tslib.es6.js"),i=o("./node_modules/react/index.js"),n=o.n(i),a=o("./src/components/ImageLoader/ImageLoader.scss"),r=o.n(a),c=o("./node_modules/react-content-loader/dist/react-content-loader.es.js"),l=o("./node_modules/classcat/src/index.js"),d=o("./node_modules/mobx-react/index.module.js"),p=o("./src/core/utils/time.ts"),m=o("./src/core/utils/dom.ts"),u=function(e){function t(t){var o=e.call(this,t)||this;return o.mounted=!1,o.onScroll=Object(p.c)(o.onScroll.bind(o),t.throttleDuration||150),o.state={imageLoaded:!1,shouldFetch:!t.lazy},o}return s.d(t,e),t.prototype.componentDidMount=function(){this.mounted=!0,this.props.lazy&&(window.addEventListener("scroll",this.onScroll),this.onScroll())},t.prototype.shouldComponentUpdate=function(e,t){return this.props.src!==e.src||this.props.alt!==e.alt||this.props.width!==e.width||this.props.height!==e.height||this.state.imageLoaded!==t.imageLoaded||this.state.shouldFetch!==t.shouldFetch},t.prototype.componentWillUnmount=function(){window.removeEventListener("scroll",this.onScroll),this.mounted=!1},t.prototype.onScroll=function(){if(this.detectVisibility()&&!this.state.shouldFetch)return this.setState({shouldFetch:!0})},t.prototype.detectVisibility=function(){if(!this.el)return!1;var e=Object(m.a)(this.el);return e.top>window.scrollY||e.top<window.scrollY+window.innerHeight},t.prototype.onImageLoaded=function(e){return s.b(this,void 0,void 0,function(){var t;return s.e(this,function(o){return this.mounted&&(t=this.props.onLoad,this.setState({imageLoaded:!0}),t&&t(e)),[2]})})},t.prototype.render=function(){var e,t,o,s=this,i=this.props,a=i.appStore,d=i.src,p=i.alt,m=i.width,u=i.height,h=i.circle,g=i.lazy,f=void 0!==g&&g,_=a.appWidth,b=this.state,v=b.imageLoaded,y=b.shouldFetch,x=m>_?_:m,N=m>_?u/m*m:u;return n.a.createElement("div",{ref:function(e){return s.el=e},className:Object(l.a)((e={},e[r.a.ImageLoader]=!0,e[r.a.circle]=h,e)),style:{width:x,height:N}},f&&!y?null:n.a.createElement("img",{className:Object(l.a)((t={stretch:!0},t[r.a.loaded]=v,t)),src:d,alt:p,onLoad:function(e){return s.onImageLoaded(e)}}),n.a.createElement("div",{className:Object(l.a)((o={stretch:!0},o[r.a.Loader]=v,o[r.a.hideLoader]=v,o))},n.a.createElement(c.a,{width:100,height:100,speed:1},n.a.createElement("rect",{x:"0",y:"0",rx:"0",ry:"0",width:"100",height:"100"}))))},t.defaultProps={circle:!1},t=s.c([Object(d.b)("appStore"),s.g("design:paramtypes",[Object])],t)}(n.a.Component)},"./src/core/utils/dom.ts":function(e,t,o){"use strict";o.d(t,"a",function(){return s});var s=function(e){if(!e)return{top:0,bottom:0,left:0,right:0,width:0,height:0};var t=e.getBoundingClientRect();return{top:t.top||0,bottom:t.bottom||0,left:t.left||0,right:t.right||0,width:t.width?t.width:t.right-t.left,height:t.height?t.height:t.bottom-t.top}}},"./src/pages/NoticePage/NoticePage.scss":function(e,t,o){var s=o("./node_modules/typings-for-css-modules-loader/lib/index.js??ref--4-1!./node_modules/sass-loader/lib/loader.js!./src/pages/NoticePage/NoticePage.scss");"string"==typeof s&&(s=[[e.i,s,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};o("./node_modules/style-loader/lib/addStyles.js")(s,i);s.locals&&(e.exports=s.locals)},"./src/pages/NoticePage/NoticePage.tsx":function(e,t,o){"use strict";o.r(t);var s,i=o("./node_modules/tslib/tslib.es6.js"),n=o("./node_modules/react/index.js"),a=o.n(n),r=o("./src/pages/NoticePage/NoticePage.scss"),c=o.n(r),l=o("./node_modules/mobx-react/index.module.js"),d=function(){return function(e){e&&Object.assign(this,e)}}(),p=o("./src/core/utils/array.ts"),m=(new d({notice_no:1,title:"This is Title",content:"<p>hahaha</p>",upd_dt:Date.now()}),Object(p.a)(10).map(function(e){return new d({notice_no:e+=1,title:"This is Title "+e,content:"\n <p>h ahaha asd asd </p>\n <p>h ahaha asd asd </p>\n <p>h ahaha asd asd </p>\n ",upd_dt:Date.now()})})),u=o("./src/pages/NoticePage/components/NoticeListItem.scss"),h=o.n(u),g=o("./src/core/values/prefix.ts"),f=o("./src/components/ImageLoader/ImageLoader.tsx"),_=function(e){function t(t){var o=e.call(this,t)||this;return o.toggleImage=Object(g.a)(s||(s=i.f(["general/list-icon-toggle@2x.png"],["general/list-icon-toggle@2x.png"]))),o}return i.d(t,e),t.prototype.onClick=function(e){this.props.setActiveNotice(e?e.notice_no:null)},t.prototype.render=function(){var e=this,t=this.props,o=t.notice,s=t.active;return a.a.createElement("div",{className:h.a.NoticeListItem},a.a.createElement("div",{className:h.a.TitleLine,onClick:function(){return e.onClick(s?null:o)}},a.a.createElement("div",{className:h.a.Text},a.a.createElement("div",{className:h.a.Title},o.title),a.a.createElement("div",{className:h.a.Date},o.upd_dt)),a.a.createElement("div",{className:h.a.ToggleButton},a.a.createElement(f.a,{width:11,height:6,src:this.toggleImage,alt:"Toggle Image"}))),s?a.a.createElement("div",{className:h.a.ContentLine},o.content):null)},t}(a.a.Component),b=o("./src/components/Header/Header.tsx");o.d(t,"NoticePage",function(){return v});var v=function(e){function t(t){var o=e.call(this,t)||this;return o.setActiveNotice=o.setActiveNotice.bind(o),o.state={activeNotice:null},o}return i.d(t,e),t.prototype.componentDidMount=function(){this.props.appStore.updateHeaderTitle(a.a.createElement("span",{className:c.a.HeaderTitle},"__UI__.PAGE.NOTICE.TITLE"))},t.prototype.componentWillUnmount=function(){this.props.appStore.updateHeaderTitle()},t.prototype.setActiveNotice=function(e){this.setState({activeNotice:e})},t.prototype.render=function(){var e=this,t=this.state.activeNotice;return a.a.createElement("div",{className:c.a.NoticePage},a.a.createElement(b.a,{storyPage:!1}),a.a.createElement("div",{className:c.a.Shadow}),m.map(function(o){return a.a.createElement(_,{key:o.notice_no,notice:o,active:t===o.notice_no,setActiveNotice:e.setActiveNotice})}))},t=i.c([Object(l.b)("appStore"),Object(l.b)("apiSvc"),i.g("design:paramtypes",[Object])],t)}(a.a.Component)},"./src/pages/NoticePage/components/NoticeListItem.scss":function(e,t,o){var s=o("./node_modules/typings-for-css-modules-loader/lib/index.js??ref--4-1!./node_modules/sass-loader/lib/loader.js!./src/pages/NoticePage/components/NoticeListItem.scss");"string"==typeof s&&(s=[[e.i,s,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};o("./node_modules/style-loader/lib/addStyles.js")(s,i);s.locals&&(e.exports=s.locals)}}]);
/* global noframe */ import Component from '@ember/component'; import layout from '../templates/components/koenig-card-embed'; import {NO_CURSOR_MOVEMENT} from './koenig-editor'; import {computed} from '@ember/object'; import {countTextLength} from '../lib/dnd/utils'; import {isBlank} from '@ember/utils'; import {run} from '@ember/runloop'; import {inject as service} from '@ember/service'; import {set} from '@ember/object'; import {task} from 'ember-concurrency'; export default Component.extend({ ajax: service(), ghostPaths: service(), layout, // attrs payload: null, isSelected: false, isEditing: false, // internal properties hasError: false, // closure actions selectCard() {}, deselectCard() {}, editCard() {}, saveCard() {}, deleteCard() {}, moveCursorToNextSection() {}, moveCursorToPrevSection() {}, addParagraphAfterCard() {}, registerComponent() {}, counts: computed('payload.{html,caption}', function () { return { imageCount: this.payload.html ? 1 : 0, wordCount: countTextLength(this.payload.caption) }; }), init() { this._super(...arguments); if (this.payload.url && !this.payload.html) { this.convertUrl.perform(this.payload.url); } this.registerComponent(this); }, didInsertElement() { this._super(...arguments); this._populateIframe(); this._focusInput(); }, willDestroyElement() { this._super(...arguments); run.cancel(this._resizeDebounce); if (this._iframeMutationObserver) { this._iframeMutationObserver.disconnect(); } window.removeEventListener('resize', this._windowResizeHandler); }, actions: { onDeselect() { if (this.payload.url && !this.payload.html && !this.hasError) { this.convertUrl.perform(this.payload.url); } else { this._deleteIfEmpty(); } }, updateUrl(event) { let url = event.target.value; set(this.payload, 'url', url); }, urlKeydown(event) { if (event.key === 'Enter') { event.preventDefault(); this.convertUrl.perform(this.payload.url); } if (event.key === 'Escape') { event.target.blur(); this.deleteCard(); } }, updateCaption(caption) { set(this.payload, 'caption', caption); this.saveCard(this.payload, false); }, retry() { this.set('hasError', false); }, insertAsLink(options = {linkOnError: false}) { let {range} = this.editor; this.editor.run((postEditor) => { let {builder} = postEditor; let cardSection = this.env.postModel; let p = builder.createMarkupSection('p'); let link = builder.createMarkup('a', {href: this.payload.url}); postEditor.replaceSection(cardSection, p); postEditor.insertTextWithMarkup(p.toRange().head, this.payload.url, [link]); // if a user is typing further on in the doc (possible if embed // was created automatically via paste of URL) then return the // cursor so the card->link change doesn't cause a cursor jump if (range.headSection !== cardSection) { postEditor.setRange(range); } // avoid adding an extra undo step when automatically creating // link after an error so that an Undo after pasting a URL // doesn't get stuck in a loop going through link->embed->link if (options.linkOnError) { postEditor.cancelSnapshot(); } }); }, insertAsBookmark(payload) { let {range} = this.editor; this.editor.run((postEditor) => { let cardSection = this.env.postModel; let bookmarkCard = postEditor.builder.createCardSection('bookmark', payload); postEditor.replaceSection(cardSection, bookmarkCard); // if a user is typing further on in the doc (possible if embed // was created automatically via paste of URL) then return the // cursor so the card->link change doesn't cause a cursor jump if (range.headSection !== cardSection) { postEditor.setRange(range); } }); } }, convertUrl: task(function* (url) { if (isBlank(url)) { this.deleteCard(); return; } try { let oembedEndpoint = this.ghostPaths.url.api('oembed'); let requestData = { url }; if (!this.payload.isDirectUrl) { requestData.type = 'embed'; } let response = yield this.ajax.request(oembedEndpoint, { data: requestData }); if (response.type === 'bookmark') { this.send('insertAsBookmark', response); return; } if (!response.html) { throw 'No HTML returned'; } set(this.payload, 'linkOnError', undefined); set(this.payload, 'isDirectUrl', undefined); set(this.payload, 'html', response.html); set(this.payload, 'type', response.type); this.saveCard(this.payload, false); run.schedule('afterRender', this, this._populateIframe); } catch (err) { if (this.payload.linkOnError) { this.send('insertAsLink', {linkOnError: true}); return; } this.set('hasError', true); } }), _focusInput() { let urlInput = this.element.querySelector('[name="url"]'); if (urlInput) { urlInput.focus(); } }, _populateIframe() { let iframe = this.element.querySelector('iframe'); if (iframe) { iframe.contentWindow.document.open(); iframe.contentWindow.document.write(this.payload.html); iframe.contentWindow.document.close(); iframe.contentDocument.body.style.display = 'flex'; iframe.contentDocument.body.style.margin = '0'; iframe.contentDocument.body.style.justifyContent = 'center'; let nestedIframe = iframe.contentDocument.body.firstChild; if (nestedIframe.nodeName === 'IFRAME') { noframe(nestedIframe, '[data-kg-embed]'); this._resizeIframe(iframe); } this._iframeResizeHandler = run.bind(this, this._resizeIframe, iframe); this._iframeMutationObserver = this._createMutationObserver( iframe.contentWindow.document, this._iframeResizeHandler ); this._setupWindowResizeHandler(iframe); } }, _createMutationObserver(target, callback) { function addImageLoadListeners(mutation) { function addImageLoadListener(element) { if (element.complete === false) { element.addEventListener('load', imageEventTriggered, false); element.addEventListener('error', imageEventTriggered, false); imageElements.push(element); } } if (mutation.type === 'attributes' && mutation.attributeName === 'src') { addImageLoadListener(mutation.target); } else if (mutation.type === 'childList') { Array.prototype.forEach.call( mutation.target.querySelectorAll('img'), addImageLoadListener ); } } function removeFromElements(element) { imageElements.splice(imageElements.indexOf(element), 1); } function removeImageLoadListener(element) { element.removeEventListener('load', imageEventTriggered, false); element.removeEventListener('error', imageEventTriggered, false); removeFromElements(element); } function imageEventTriggered(event) { removeImageLoadListener(event.target); callback(); } function mutationObserved(mutations) { callback(); // deal with async image loads when tags are injected into the page mutations.forEach(addImageLoadListeners); } function createMutationObserver(target) { let config = { attributes: true, attributeOldValue: false, characterData: true, characterDataOldValue: false, childList: true, subtree: true }; let observer = new MutationObserver(mutationObserved); observer.observe(target, config); // eslint-disable-line ghost/ember/no-observers return observer; } let imageElements = []; let observer = createMutationObserver(target); return { disconnect() { if ('disconnect' in observer) { observer.disconnect(); // eslint-disable-line ghost/ember/no-observers imageElements.forEach(removeImageLoadListener); } } }; }, _resizeIframe(iframe) { this._resizeDebounce = run.debounce(this, this.__debouncedResizeIframe, iframe, 66); }, __debouncedResizeIframe(iframe) { iframe.style.height = null; let height = iframe.contentDocument.scrollingElement.scrollHeight; iframe.style.height = `${height}px`; }, _setupWindowResizeHandler(iframe) { this._windowResizeHandler = run.bind(this, this._resizeIframe, iframe); window.addEventListener('resize', this._windowResizeHandler, {passive: true}); }, _deleteIfEmpty() { if (isBlank(this.payload.html) && !this.convertUrl.isRunning && !this.hasError) { this.deleteCard(NO_CURSOR_MOVEMENT); } } });
const mongoose = require('mongoose'); const Schema = mongoose.Schema; const bcrypt = require('bcryptjs'); let UserSchema = new Schema({ purchase_id: { type: String, required: true, unique: true }, fname: { type: String }, lname: { type: String }, email: { type: String, required: true }, subscribed: { type: Boolean, default: false }, signdate: { type: Date, default: () => { return new Date(); } }, sitekey: { type: String, required: true } }); // Prior to saving user, encrypt site key UserSchema.pre('save', function(next) { if(!this.isModified('sitekey')) return next(); this.sitekey = this.encryptKey(this.sitekey); next(); }) UserSchema.methods = { authenticate: function(plainKey) { return bcrypt.compareSync(plainKey, this.sitekey); }, encryptKey: function(plainKey) { if(!plainKey) { return ''; } else { const salt = bcrypt.genSaltSync(10); return bcrypt.hashSync(plainKey, salt); } } }; module.exports = mongoose.model('user', UserSchema);
// various tests for range errors in ctor calls var buf = new ArrayBuffer(24); var darray = new Float64Array(buf); var farray = new Float32Array(buf); var iarray = new Int32Array(buf); var sarray = new Int16Array(buf); var barray = new Uint8Array(buf); darray[0] = 3.1415926535; console.log (darray[0]); console.log (farray[0]); console.log (iarray[0]); console.log (sarray[0]); console.log (barray[0]);
/** * Copyright (c) 2014-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ import { wrapIndex } from './TrieUtils'; import { Collection } from './Collection'; import { isImmutable, isCollection, isKeyed, isAssociative, isRecord, IS_ORDERED_SENTINEL, } from './Predicates'; import { Iterator, iteratorValue, iteratorDone, hasIterator, isIterator, getIterator, } from './Iterator'; import hasOwnProperty from './utils/hasOwnProperty'; import isArrayLike from './utils/isArrayLike'; export class Seq extends Collection { constructor(value) { return value === null || value === undefined ? emptySequence() : isImmutable(value) ? value.toSeq() : seqFromValue(value); } toSeq() { return this; } toString() { return this.__toString('Seq {', '}'); } cacheResult() { if (!this._cache && this.__iterateUncached) { this._cache = this.entrySeq().toArray(); this.size = this._cache.length; } return this; } // abstract __iterateUncached(fn, reverse) __iterate(fn, reverse) { const cache = this._cache; if (cache) { const size = cache.length; let i = 0; while (i !== size) { const entry = cache[reverse ? size - ++i : i++]; if (fn(entry[1], entry[0], this) === false) { break; } } return i; } return this.__iterateUncached(fn, reverse); } // abstract __iteratorUncached(type, reverse) __iterator(type, reverse) { const cache = this._cache; if (cache) { const size = cache.length; let i = 0; return new Iterator(() => { if (i === size) { return iteratorDone(); } const entry = cache[reverse ? size - ++i : i++]; return iteratorValue(type, entry[0], entry[1]); }); } return this.__iteratorUncached(type, reverse); } } export class KeyedSeq extends Seq { constructor(value) { return value === null || value === undefined ? emptySequence().toKeyedSeq() : isCollection(value) ? isKeyed(value) ? value.toSeq() : value.fromEntrySeq() : isRecord(value) ? value.toSeq() : keyedSeqFromValue(value); } toKeyedSeq() { return this; } } export class IndexedSeq extends Seq { constructor(value) { return value === null || value === undefined ? emptySequence() : isCollection(value) ? isKeyed(value) ? value.entrySeq() : value.toIndexedSeq() : isRecord(value) ? value.toSeq().entrySeq() : indexedSeqFromValue(value); } static of(/*...values*/) { return IndexedSeq(arguments); } toIndexedSeq() { return this; } toString() { return this.__toString('Seq [', ']'); } } export class SetSeq extends Seq { constructor(value) { return (isCollection(value) && !isAssociative(value) ? value : IndexedSeq(value) ).toSetSeq(); } static of(/*...values*/) { return SetSeq(arguments); } toSetSeq() { return this; } } Seq.isSeq = isSeq; Seq.Keyed = KeyedSeq; Seq.Set = SetSeq; Seq.Indexed = IndexedSeq; const IS_SEQ_SENTINEL = '@@__IMMUTABLE_SEQ__@@'; Seq.prototype[IS_SEQ_SENTINEL] = true; // #pragma Root Sequences export class ArraySeq extends IndexedSeq { constructor(array) { this._array = array; this.size = array.length; } get(index, notSetValue) { return this.has(index) ? this._array[wrapIndex(this, index)] : notSetValue; } __iterate(fn, reverse) { const array = this._array; const size = array.length; let i = 0; while (i !== size) { const ii = reverse ? size - ++i : i++; if (fn(array[ii], ii, this) === false) { break; } } return i; } __iterator(type, reverse) { const array = this._array; const size = array.length; let i = 0; return new Iterator(() => { if (i === size) { return iteratorDone(); } const ii = reverse ? size - ++i : i++; return iteratorValue(type, ii, array[ii]); }); } } class ObjectSeq extends KeyedSeq { constructor(object) { const keys = Object.keys(object); this._object = object; this._keys = keys; this.size = keys.length; } get(key, notSetValue) { if (notSetValue !== undefined && !this.has(key)) { return notSetValue; } return this._object[key]; } has(key) { return hasOwnProperty.call(this._object, key); } __iterate(fn, reverse) { const object = this._object; const keys = this._keys; const size = keys.length; let i = 0; while (i !== size) { const key = keys[reverse ? size - ++i : i++]; if (fn(object[key], key, this) === false) { break; } } return i; } __iterator(type, reverse) { const object = this._object; const keys = this._keys; const size = keys.length; let i = 0; return new Iterator(() => { if (i === size) { return iteratorDone(); } const key = keys[reverse ? size - ++i : i++]; return iteratorValue(type, key, object[key]); }); } } ObjectSeq.prototype[IS_ORDERED_SENTINEL] = true; class CollectionSeq extends IndexedSeq { constructor(collection) { this._collection = collection; this.size = collection.length || collection.size; } __iterateUncached(fn, reverse) { if (reverse) { return this.cacheResult().__iterate(fn, reverse); } const collection = this._collection; const iterator = getIterator(collection); let iterations = 0; if (isIterator(iterator)) { let step; while (!(step = iterator.next()).done) { if (fn(step.value, iterations++, this) === false) { break; } } } return iterations; } __iteratorUncached(type, reverse) { if (reverse) { return this.cacheResult().__iterator(type, reverse); } const collection = this._collection; const iterator = getIterator(collection); if (!isIterator(iterator)) { return new Iterator(iteratorDone); } let iterations = 0; return new Iterator(() => { const step = iterator.next(); return step.done ? step : iteratorValue(type, iterations++, step.value); }); } } class IteratorSeq extends IndexedSeq { constructor(iterator) { this._iterator = iterator; this._iteratorCache = []; } __iterateUncached(fn, reverse) { if (reverse) { return this.cacheResult().__iterate(fn, reverse); } const iterator = this._iterator; const cache = this._iteratorCache; let iterations = 0; while (iterations < cache.length) { if (fn(cache[iterations], iterations++, this) === false) { return iterations; } } let step; while (!(step = iterator.next()).done) { const val = step.value; cache[iterations] = val; if (fn(val, iterations++, this) === false) { break; } } return iterations; } __iteratorUncached(type, reverse) { if (reverse) { return this.cacheResult().__iterator(type, reverse); } const iterator = this._iterator; const cache = this._iteratorCache; let iterations = 0; return new Iterator(() => { if (iterations >= cache.length) { const step = iterator.next(); if (step.done) { return step; } cache[iterations] = step.value; } return iteratorValue(type, iterations, cache[iterations++]); }); } } // # pragma Helper functions export function isSeq(maybeSeq) { return !!(maybeSeq && maybeSeq[IS_SEQ_SENTINEL]); } let EMPTY_SEQ; function emptySequence() { return EMPTY_SEQ || (EMPTY_SEQ = new ArraySeq([])); } export function keyedSeqFromValue(value) { const seq = Array.isArray(value) ? new ArraySeq(value) : isIterator(value) ? new IteratorSeq(value) : hasIterator(value) ? new CollectionSeq(value) : undefined; if (seq) { return seq.fromEntrySeq(); } if (typeof value === 'object') { return new ObjectSeq(value); } throw new TypeError( 'Expected Array or collection object of [k, v] entries, or keyed object: ' + value ); } export function indexedSeqFromValue(value) { const seq = maybeIndexedSeqFromValue(value); if (seq) { return seq; } throw new TypeError( 'Expected Array or collection object of values: ' + value ); } function seqFromValue(value) { const seq = maybeIndexedSeqFromValue(value); if (seq) { return seq; } if (typeof value === 'object') { return new ObjectSeq(value); } throw new TypeError( 'Expected Array or collection object of values, or keyed object: ' + value ); } function maybeIndexedSeqFromValue(value) { return isArrayLike(value) ? new ArraySeq(value) : isIterator(value) ? new IteratorSeq(value) : hasIterator(value) ? new CollectionSeq(value) : undefined; }
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.isHorizontal = isHorizontal; exports.getAnchor = getAnchor; exports.default = void 0; var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose")); var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")); var React = _interopRequireWildcard(require("react")); var _propTypes = _interopRequireDefault(require("prop-types")); var _clsx = _interopRequireDefault(require("clsx")); var _utils = require("@mui/utils"); var _core = require("@mui/core"); var _Modal = _interopRequireDefault(require("../Modal")); var _Slide = _interopRequireDefault(require("../Slide")); var _Paper = _interopRequireDefault(require("../Paper")); var _capitalize = _interopRequireDefault(require("../utils/capitalize")); var _createTransitions = require("../styles/createTransitions"); var _useTheme = _interopRequireDefault(require("../styles/useTheme")); var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps")); var _styled = _interopRequireWildcard(require("../styles/styled")); var _drawerClasses = require("./drawerClasses"); var _jsxRuntime = require("react/jsx-runtime"); const _excluded = ["BackdropProps"], _excluded2 = ["anchor", "BackdropProps", "children", "className", "elevation", "hideBackdrop", "ModalProps", "onClose", "open", "PaperProps", "SlideProps", "TransitionComponent", "transitionDuration", "variant"]; function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } const overridesResolver = (props, styles) => { const { ownerState } = props; return [styles.root, (ownerState.variant === 'permanent' || ownerState.variant === 'persistent') && styles.docked, styles.modal]; }; const useUtilityClasses = ownerState => { const { classes, anchor, variant } = ownerState; const slots = { root: ['root'], docked: [(variant === 'permanent' || variant === 'persistent') && 'docked'], modal: ['modal'], paper: ['paper', `paperAnchor${(0, _capitalize.default)(anchor)}`, variant !== 'temporary' && `paperAnchorDocked${(0, _capitalize.default)(anchor)}`] }; return (0, _core.unstable_composeClasses)(slots, _drawerClasses.getDrawerUtilityClass, classes); }; const DrawerRoot = (0, _styled.default)(_Modal.default, { name: 'MuiDrawer', slot: 'Root', overridesResolver })(({ theme }) => ({ zIndex: theme.zIndex.drawer })); const DrawerDockedRoot = (0, _styled.default)('div', { shouldForwardProp: _styled.rootShouldForwardProp, name: 'MuiDrawer', slot: 'Docked', skipVariantsResolver: false, overridesResolver })({ flex: '0 0 auto' }); const DrawerPaper = (0, _styled.default)(_Paper.default, { name: 'MuiDrawer', slot: 'Paper', overridesResolver: (props, styles) => { const { ownerState } = props; return [styles.paper, styles[`paperAnchor${(0, _capitalize.default)(ownerState.anchor)}`], ownerState.variant !== 'temporary' && styles[`paperAnchorDocked${(0, _capitalize.default)(ownerState.anchor)}`]]; } })(({ theme, ownerState }) => (0, _extends2.default)({ overflowY: 'auto', display: 'flex', flexDirection: 'column', height: '100%', flex: '1 0 auto', zIndex: theme.zIndex.drawer, // Add iOS momentum scrolling for iOS < 13.0 WebkitOverflowScrolling: 'touch', // temporary style position: 'fixed', top: 0, // We disable the focus ring for mouse, touch and keyboard users. // At some point, it would be better to keep it for keyboard users. // :focus-ring CSS pseudo-class will help. outline: 0 }, ownerState.anchor === 'left' && { left: 0 }, ownerState.anchor === 'top' && { top: 0, left: 0, right: 0, height: 'auto', maxHeight: '100%' }, ownerState.anchor === 'right' && { right: 0 }, ownerState.anchor === 'bottom' && { top: 'auto', left: 0, bottom: 0, right: 0, height: 'auto', maxHeight: '100%' }, ownerState.anchor === 'left' && ownerState.variant !== 'temporary' && { borderRight: `1px solid ${theme.palette.divider}` }, ownerState.anchor === 'top' && ownerState.variant !== 'temporary' && { borderBottom: `1px solid ${theme.palette.divider}` }, ownerState.anchor === 'right' && ownerState.variant !== 'temporary' && { borderLeft: `1px solid ${theme.palette.divider}` }, ownerState.anchor === 'bottom' && ownerState.variant !== 'temporary' && { borderTop: `1px solid ${theme.palette.divider}` })); const oppositeDirection = { left: 'right', right: 'left', top: 'down', bottom: 'up' }; function isHorizontal(anchor) { return ['left', 'right'].indexOf(anchor) !== -1; } function getAnchor(theme, anchor) { return theme.direction === 'rtl' && isHorizontal(anchor) ? oppositeDirection[anchor] : anchor; } const defaultTransitionDuration = { enter: _createTransitions.duration.enteringScreen, exit: _createTransitions.duration.leavingScreen }; /** * The props of the [Modal](/api/modal/) component are available * when `variant="temporary"` is set. */ const Drawer = /*#__PURE__*/React.forwardRef(function Drawer(inProps, ref) { const props = (0, _useThemeProps.default)({ props: inProps, name: 'MuiDrawer' }); const { anchor: anchorProp = 'left', BackdropProps, children, className, elevation = 16, hideBackdrop = false, ModalProps: { BackdropProps: BackdropPropsProp } = {}, onClose, open = false, PaperProps = {}, SlideProps, // eslint-disable-next-line react/prop-types TransitionComponent = _Slide.default, transitionDuration = defaultTransitionDuration, variant = 'temporary' } = props, ModalProps = (0, _objectWithoutPropertiesLoose2.default)(props.ModalProps, _excluded), other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded2); const theme = (0, _useTheme.default)(); // Let's assume that the Drawer will always be rendered on user space. // We use this state is order to skip the appear transition during the // initial mount of the component. const mounted = React.useRef(false); React.useEffect(() => { mounted.current = true; }, []); const anchorInvariant = getAnchor(theme, anchorProp); const anchor = anchorProp; const ownerState = (0, _extends2.default)({}, props, { anchor, elevation, open, variant }, other); const classes = useUtilityClasses(ownerState); const drawer = /*#__PURE__*/(0, _jsxRuntime.jsx)(DrawerPaper, (0, _extends2.default)({ elevation: variant === 'temporary' ? elevation : 0, square: true }, PaperProps, { className: (0, _clsx.default)(classes.paper, PaperProps.className), ownerState: ownerState, children: children })); if (variant === 'permanent') { return /*#__PURE__*/(0, _jsxRuntime.jsx)(DrawerDockedRoot, (0, _extends2.default)({ className: (0, _clsx.default)(classes.root, classes.docked, className), ownerState: ownerState, ref: ref }, other, { children: drawer })); } const slidingDrawer = /*#__PURE__*/(0, _jsxRuntime.jsx)(TransitionComponent, (0, _extends2.default)({ in: open, direction: oppositeDirection[anchorInvariant], timeout: transitionDuration, appear: mounted.current }, SlideProps, { children: drawer })); if (variant === 'persistent') { return /*#__PURE__*/(0, _jsxRuntime.jsx)(DrawerDockedRoot, (0, _extends2.default)({ className: (0, _clsx.default)(classes.root, classes.docked, className), ownerState: ownerState, ref: ref }, other, { children: slidingDrawer })); } // variant === temporary return /*#__PURE__*/(0, _jsxRuntime.jsx)(DrawerRoot, (0, _extends2.default)({ BackdropProps: (0, _extends2.default)({}, BackdropProps, BackdropPropsProp, { transitionDuration }), className: (0, _clsx.default)(classes.root, classes.modal, className), open: open, ownerState: ownerState, onClose: onClose, hideBackdrop: hideBackdrop, ref: ref }, other, ModalProps, { children: slidingDrawer })); }); process.env.NODE_ENV !== "production" ? Drawer.propTypes /* remove-proptypes */ = { // ----------------------------- Warning -------------------------------- // | These PropTypes are generated from the TypeScript type definitions | // | To update them edit the d.ts file and run "yarn proptypes" | // ---------------------------------------------------------------------- /** * Side from which the drawer will appear. * @default 'left' */ anchor: _propTypes.default.oneOf(['bottom', 'left', 'right', 'top']), /** * @ignore */ BackdropProps: _propTypes.default.object, /** * The content of the component. */ children: _propTypes.default.node, /** * Override or extend the styles applied to the component. */ classes: _propTypes.default.object, /** * @ignore */ className: _propTypes.default.string, /** * The elevation of the drawer. * @default 16 */ elevation: _utils.integerPropType, /** * If `true`, the backdrop is not rendered. * @default false */ hideBackdrop: _propTypes.default.bool, /** * Props applied to the [`Modal`](/api/modal/) element. * @default {} */ ModalProps: _propTypes.default.object, /** * Callback fired when the component requests to be closed. * * @param {object} event The event source of the callback. */ onClose: _propTypes.default.func, /** * If `true`, the component is shown. * @default false */ open: _propTypes.default.bool, /** * Props applied to the [`Paper`](/api/paper/) element. * @default {} */ PaperProps: _propTypes.default.object, /** * Props applied to the [`Slide`](/api/slide/) element. */ SlideProps: _propTypes.default.object, /** * The system prop that allows defining system overrides as well as additional CSS styles. */ sx: _propTypes.default.object, /** * The duration for the transition, in milliseconds. * You may specify a single timeout for all transitions, or individually with an object. * @default { enter: duration.enteringScreen, exit: duration.leavingScreen } */ transitionDuration: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.shape({ appear: _propTypes.default.number, enter: _propTypes.default.number, exit: _propTypes.default.number })]), /** * The variant to use. * @default 'temporary' */ variant: _propTypes.default.oneOf(['permanent', 'persistent', 'temporary']) } : void 0; var _default = Drawer; exports.default = _default;
(function(root, factory) { if (typeof define === 'function' && define.amd) { define([], factory); } else if (typeof exports === 'object') { module.exports = factory(); } else { root.DHDevice = factory(); } }(this, function() { var utils = (function () { 'use strict'; var utils = { isArray: Array.isArray || function (obj) { return Object.prototype.toString.call(obj) === '[object Array]'; }, isString: function (obj) { return Object.prototype.toString.call(obj) === '[object String]'; }, inArray: function (val, arr, ind) { if (arr) { if (Array.prototype.indexOf) { return arr.indexOf(val, ind); } else { var len = arr.length, i = +ind || 0; if (!len || (i >= len)) { return -1; } i = i < 0 ? Math.max(0, len + i) : i; for (; i < len; i++) { if (i in arr && arr[i] === val) { return i; } } } return -1; } }, forEach: function (obj, callback) { var i; if (this.isArray(obj)) { var len = obj.length; for (i = 0; i < len; i++) { if (callback.call(obj[i], i, obj[i]) === false) { break; } } } else { for (i in obj) { if (obj.hasOwnProperty(i)) { if (callback.call(obj[i], i, obj[i]) === false) { break; } } } } return obj; }, // used for kinoma because it doesn't support Array.prototype.slice.call(arguments) toArray: function (args) { if (!args) { return null; } var mass = []; for (var i = 0, l = args.length; i < l; i++) { mass.push(args[i]); } return mass; }, parseDate: function (date) { return new Date(date.substring(0, 4), parseInt(date.substring(5, 7), 10) - 1, date.substring(8, 10), date.substring(11, 13), date.substring(14, 16), date.substring(17, 19), date.substring(20, 23)); }, formatDate: function (date) { if (utils.isString(date)) return date; // already formatted string - do not modify if (Object.prototype.toString.call(date) !== '[object Date]') throw new Error('Invalid object type'); var pad = function (value, length) { value = String(value); length = length || 2; while (value.length < length) value = "0" + value; return value; }; return date.getUTCFullYear() + "-" + pad(date.getUTCMonth() + 1) + "-" + pad(date.getUTCDate()) + "T" + pad(date.getUTCHours()) + ":" + pad(date.getUTCMinutes()) + ":" + pad(date.getUTCSeconds()) + "." + pad(date.getUTCMilliseconds(), 3); }, encodeBase64: function (data) { var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; var o1, o2, o3, h1, h2, h3, h4, bits, i = 0, ac = 0, enc = "", tmp_arr = []; if (!data) { return data; } do { // pack three octets into four hexets o1 = data.charCodeAt(i++); o2 = data.charCodeAt(i++); o3 = data.charCodeAt(i++); bits = o1 << 16 | o2 << 8 | o3; h1 = bits >> 18 & 0x3f; h2 = bits >> 12 & 0x3f; h3 = bits >> 6 & 0x3f; h4 = bits & 0x3f; // use hexets to index into b64, and append result to encoded string tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4); } while (i < data.length); enc = tmp_arr.join(''); var r = data.length % 3; return (r ? enc.slice(0, r - 3) : enc) + '==='.slice(r || 3); }, noop: function () { }, createCallback: function (cb) { return cb && Object.prototype.toString.call(cb) === '[object Function]' ? cb : this.noop; }, isGuid: function (val) { return val && /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(val); }, serializeQuery: function (obj) { var str = '', key, val; for (key in obj) { if (obj.hasOwnProperty(key)) { if (str != '') { str += '&'; } val = obj[key]; val = val == null ? '' : val; str += encodeURIComponent(key) + '=' + encodeURIComponent(val); } } return str; }, makeUrl: function (params) { var method = params.method, url = params.url, data = params.data; if (method === 'GET') { if (data) { data = utils.serializeQuery(data); data && (url += (url.indexOf('?') != -1 ? '&' : '?') + data); } } return url; }, serverErrorMessage: function (http) { var errMsg = 'DeviceHive server error'; if (http.responseText) { try { errMsg += ' - ' + JSON.parse(http.responseText).message; } catch (e) { errMsg += ' - ' + http.responseText; } } return {error: errMsg}; }, errorMessage: function (msg) { return {error: 'DeviceHive error: ' + msg}; }, setTimeout: function (cb, delay) { return setTimeout(cb, delay); }, clearTimeout: function (timeoutID) { clearTimeout(timeoutID); } }; return utils; }()); var Events = (function () { 'use strict'; var Events = function () { }; Events.prototype = { bind: function (name, callback, context) { this._handlers || (this._handlers = {}); var events = this._handlers[name] || (this._handlers[name] = []); events.push({callback: callback, context: context || this}); return this; }, unbind: function (name, callback) { if (!name && !callback) { this._handlers = null; return this; } var events = this._handlers[name]; if (!events) { return this; } if (!callback) { delete this._handlers[name]; return this; } var remaining = []; utils.forEach(events, function (ind, ev) { if (callback && callback !== ev.callback) { remaining.push(ev); } }); if (remaining.length) { this._handlers[name] = remaining; } else { delete this._handlers[name]; } return this; }, trigger: function (name) { if (!this._handlers) { return this; } var args = utils.toArray(arguments).slice(1), events = this._handlers[name]; events && this._triggerEvents(events, args); return this; }, _triggerEvents: function (events, args) { utils.forEach(events, function (ind, ev) { ev.callback.apply(ev.context, args); }); } }; return Events; }()); var http = (function () { 'use strict'; var getXhr = utils.noop(); if (typeof XMLHttpRequest !== 'undefined') { getXhr = function () { return new XMLHttpRequest(); }; } else { getXhr = function () { try { return new ActiveXObject('Microsoft.XMLHTTP'); } catch (e) { var XMLHttpRequest = require('xhr2'); return new XMLHttpRequest; } }; } if (!getXhr()) { throw new Error('DeviceHive: XMLHttpRequest is not available'); } return { send: function (params, cb) { params.method = params.method || 'GET'; cb = utils.createCallback(cb); var xhr = getXhr(), headers = params.headers, url = utils.makeUrl(params), method = params.method; xhr.open(method, url, true); if (method == 'POST' || method == 'PUT') { xhr.setRequestHeader('Content-Type', 'application/json'); params.data = JSON.stringify(params.data); } xhr.onreadystatechange = function () { var isSuccess, err; if (xhr.readyState === 4) { isSuccess = xhr.status && xhr.status >= 200 && xhr.status < 300 || xhr.status === 304; if (!isSuccess) { err = utils.serverErrorMessage(xhr); } var result = xhr.responseText ? JSON.parse(xhr.responseText) : null; return cb(err, result); } }; if (headers) { for (var key in headers) { if (headers[key] !== void 0) { xhr.setRequestHeader(key, headers[key]); } } } xhr.send(params.data || void 0); return { abort: function () { xhr.abort(); } } } } }()); var restApi = (function () { 'use strict'; var authTypes = { USER: 1, KEY: 2, DEVICE: 4 }; var isFlagSet = function (variable, flag) { return (variable & flag) == flag; }; var applyAuth = function (request, params) { var authType = params.authTypes; var auth = params.auth; request.headers = params.headers || {}; if (!authType) return; if (!auth) { // library bug throw new Error('Authentication parameters must be specified for this endpoint. Endpoint auth code: ' + authType) } if (isFlagSet(authType, authTypes.KEY) && auth.accessKey) { // Set bearer token authorization request.headers['Authorization'] = 'Bearer ' + auth.accessKey; } else if (isFlagSet(authType, authTypes.DEVICE) && utils.isGuid(auth.deviceId) && utils.isGuid(auth.deviceKey)) { // Set Device authorization request.headers['Auth-DeviceID'] = auth.deviceId; request.headers['Auth-DeviceKey'] = auth.deviceKey; } else if (isFlagSet(authType, authTypes.USER)) { // Set User authorization request.headers['Authorization'] = 'Basic ' + utils.encodeBase64(auth.login + ':' + auth.password); } else { // library bug, therefore crash is necessary throw new Error('Invalid authentication parameters. Endpoint auth code: ' + authType); } }; var send = function (params, cb) { var req = { method: params.method, url: params.base + params.relative, data: params.data }; applyAuth(req, params, cb); return http.send(req, cb); }; return { /* API INFO */ info: function (serviceUrl, cb) { return send({ base: serviceUrl, relative: '/info', method: 'GET' }, cb); }, /* ACCESS KEYS */ getAccessKeys: function (serviceUrl, auth, userId, cb) { return send({ base: serviceUrl, relative: '/user/' + userId + '/accesskey', method: 'GET', authTypes: authTypes.USER, auth: auth }, cb); }, getAccessKey: function (serviceUrl, auth, userId, keyId, cb) { return send({ base: serviceUrl, relative: '/user/' + userId + '/accesskey/' + userId, method: 'GET', authTypes: authTypes.USER, auth: auth }, cb); }, insertAccessKey: function (serviceUrl, auth, userId, key, cb) { return send({ base: serviceUrl, relative: '/user/' + userId + '/accesskey', data: key, method: 'POST', authTypes: authTypes.USER, auth: auth }, cb); }, updateAccessKey: function (serviceUrl, auth, userId, keyId, key, cb) { return send({ base: serviceUrl, relative: '/user/' + userId + '/accesskey/' + keyId, data: key, method: 'PUT', authTypes: authTypes.USER, auth: auth }, cb); }, deleteAccessKey: function (serviceUrl, auth, userId, keyId, cb) { return send({ base: serviceUrl, relative: '/user/' + userId + '/accesskey/' + keyId, method: 'DELETE', authTypes: authTypes.USER, auth: auth }, cb); }, /* DEVICE */ getDevices: function (serviceUrl, auth, filter, cb) { return send({ base: serviceUrl, relative: '/device', method: 'GET', data: filter, authTypes: authTypes.USER | authTypes.KEY, auth: auth }, cb); }, getDevice: function (serviceUrl, auth, deviceId, cb) { return send({ base: serviceUrl, relative: '/device/' + deviceId, method: 'GET', authTypes: authTypes.USER | authTypes.KEY | authTypes.DEVICE, auth: auth }, cb); }, getEquipmentState: function (serviceUrl, auth, deviceId, cb) { return send({ base: serviceUrl, relative: '/device/' + deviceId + '/equipment', method: 'GET', authTypes: authTypes.USER | authTypes.KEY, auth: auth }, cb); }, registerDevice: function (serviceUrl, auth, deviceId, device, cb) { return send({ base: serviceUrl, relative: '/device/' + deviceId, method: 'PUT', data: device, authTypes: authTypes.USER | authTypes.KEY | authTypes.DEVICE, auth: auth }, cb); }, /* DEVICE CLASS */ getDeviceClass: function (serviceUrl, auth, deviceClassId, cb) { return send({ base: serviceUrl, relative: '/device/class/' + deviceClassId, method: 'GET', authTypes: authTypes.USER, auth: auth }, cb); }, /* COMMAND */ getCommands: function (serviceUrl, auth, deviceId, filter, cb) { if (filter && filter.start) { filter.start = utils.formatDate(filter.start); } if (filter && filter.end) { filter.end = utils.formatDate(filter.end); } return send({ base: serviceUrl, relative: '/device/' + deviceId + '/command', method: 'GET', data: filter, authTypes: authTypes.USER | authTypes.KEY | authTypes.DEVICE, auth: auth }, cb); }, getCommand: function (serviceUrl, auth, deviceId, cmdId, cb) { return send({ base: serviceUrl, relative: '/device/' + deviceId + '/command/' + cmdId, method: 'GET', authTypes: authTypes.USER | authTypes.KEY | authTypes.DEVICE, auth: auth }, cb); }, insertCommand: function (serviceUrl, auth, deviceId, cmd, cb) { return send({ base: serviceUrl, relative: '/device/' + deviceId + '/command', method: 'POST', data: cmd, authTypes: authTypes.USER | authTypes.KEY, auth: auth }, cb); }, updateCommand: function (serviceUrl, auth, deviceId, cmdId, cmd, cb) { return send({ base: serviceUrl, relative: '/device/' + deviceId + '/command/' + cmdId, method: 'PUT', data: cmd, authTypes: authTypes.USER | authTypes.KEY | authTypes.DEVICE, auth: auth }, cb); }, pollCommands: function (serviceUrl, auth, deviceId, params, cb) { return send({ base: serviceUrl, relative: '/device/' + deviceId + '/command/poll', method: 'GET', data: params, authTypes: authTypes.USER | authTypes.KEY | authTypes.DEVICE, auth: auth }, cb); }, pollManyCommands: function (serviceUrl, auth, params, cb) { return send({ base: serviceUrl, relative: '/device/command/poll', method: 'GET', data: params, authTypes: authTypes.USER | authTypes.KEY, auth: auth }, cb); }, waitCommandResult: function (serviceUrl, auth, deviceId, cmdId, params, cb) { return send({ base: serviceUrl, relative: '/device/' + deviceId + '/command/' + cmdId + '/poll', method: 'GET', data: params, authTypes: authTypes.USER | authTypes.KEY, auth: auth }, cb); }, /* NOTIFICATION */ getNotifications: function (serviceUrl, auth, deviceId, filter, cb) { if (filter && filter.start) { filter.start = utils.formatDate(filter.start); } if (filter && filter.end) { filter.end = utils.formatDate(filter.end); } return send({ base: serviceUrl, relative: '/device/' + deviceId + '/notification', method: 'GET', data: filter, authTypes: authTypes.USER | authTypes.KEY, auth: auth }, cb); }, getNotification: function (serviceUrl, auth, deviceId, notificationId, cb) { return send({ base: serviceUrl, relative: '/device/' + deviceId + '/notification/' + notificationId, method: 'GET', authTypes: authTypes.USER | authTypes.KEY, auth: auth }, cb); }, insertNotification: function (serviceUrl, auth, deviceId, notification, cb) { return send({ base: serviceUrl, relative: '/device/' + deviceId + '/notification', method: 'POST', data: notification, authTypes: authTypes.USER | authTypes.KEY | authTypes.DEVICE, auth: auth }, cb); }, pollNotifications: function (serviceUrl, auth, deviceId, params, cb) { return send({ base: serviceUrl, relative: '/device/' + deviceId + '/notification/poll', method: 'GET', data: params, authTypes: authTypes.USER | authTypes.KEY, auth: auth }, cb); }, pollManyNotifications: function (serviceUrl, auth, params, cb) { return send({ base: serviceUrl, relative: '/device/notification/poll', method: 'GET', data: params, authTypes: authTypes.USER | authTypes.KEY, auth: auth }, cb); }, /* NETWORK */ getNetworks: function (serviceUrl, auth, filter, cb) { return send({ base: serviceUrl, relative: '/network', method: 'GET', data: filter, authTypes: authTypes.USER | authTypes.KEY, auth: auth }, cb); }, getNetwork: function (serviceUrl, auth, networkId, cb) { return send({ base: serviceUrl, relative: '/network/' + networkId, method: 'GET', authTypes: authTypes.USER | authTypes.KEY, auth: auth }, cb); }, insertNetwork: function (serviceUrl, auth, network, cb) { return send({ base: serviceUrl, relative: '/network', method: 'POST', data: network, authTypes: authTypes.USER, auth: auth }, cb); }, updateNetwork: function (serviceUrl, auth, networkId, network, cb) { return send({ base: serviceUrl, relative: '/network/' + networkId, method: 'PUT', data: network, authTypes: authTypes.USER, auth: auth }, cb); }, deleteNetwork: function (serviceUrl, auth, networkId, cb) { return send({ base: serviceUrl, relative: '/network/' + networkId, method: 'DELETE', authTypes: authTypes.USER, auth: auth }, cb); }, /* OAUTH CLIENT */ /* OAUTH GRANT */ /* USER */ getCurrentUser: function (serviceUrl, auth, cb) { return send({ base: serviceUrl, relative: '/user/current', method: 'GET', authTypes: authTypes.USER, auth: auth }, cb); }, updateCurrentUser: function (serviceUrl, auth, user, cb) { return send({ base: serviceUrl, relative: '/user/current', method: 'PUT', data: user, authTypes: authTypes.USER, auth: auth }, cb); } }; }()); var DeviceHive = (function () { 'use strict'; var changeChannelState = function (self, newState, oldState) { oldState = oldState || self.channelState; if (oldState === self.channelState) { self.channelState = newState; self._events = self._events || new Events(); self._events.trigger('onChannelStateChanged', { oldState: oldState, newState: newState }); return true; } return false; }; // DeviceHive channel states var channelStates = { disconnected: 0, // channel is not connected connecting: 1, // channel is being connected connected: 2 // channel is connected }; DeviceHive = { channelStates: channelStates, channelState: channelStates.disconnected, // opens a communication channel to the server // supported channels: webSockets, longPolling // callback (cb) must be a function with the following arguments: // - errors: an error object if any errors occurred // - channel: a name of the opened channel openChannel: function (cb, channels) { cb = utils.createCallback(cb); if (!changeChannelState(this, this.channelStates.connecting, this.channelStates.disconnected)) { cb(null); return; } var self = this; function manageInfo(info) { self.serverInfo = info; if (!channels) { channels = []; utils.forEach(self._channels, function (t) { channels.push(t); }); } else if (!utils.isArray(channels)) { channels = [channels]; } var emptyChannel = true; (function checkChannel(channels) { utils.forEach(channels, function (ind) { // enumerate all channels in order var channel = this; if (self._channels[channel]) { self._channel = new self._channels[channel](self); self._channel.open(function (err) { if (err) { var channelsToCheck = channels.slice(++ind); if (!channelsToCheck.length) return cb(utils.errorMessage('Cannot open any of the specified channels')); checkChannel(channelsToCheck); } else { changeChannelState(self, self.channelStates.connected); cb(null, channel); } }); return emptyChannel = false; } }); })(channels); emptyChannel && cb(utils.errorMessage('None of the specified channels are supported')); } if (this.serverInfo) { manageInfo(this.serverInfo); } else { restApi.info(this.serviceUrl, function (err, res) { if (!err) { manageInfo(res); } else { changeChannelState(self, self.channelStates.disconnected); cb(err, res); } }); } }, // closes the communications channel to the server // callback (cb) must be a function which will be executed when channel is closed closeChannel: function (cb) { cb = utils.createCallback(cb); if (this.channelState === this.channelStates.disconnected) return cb(null); var self = this; if (this._channel) { this._channel.close(function (err, res) { if (err) { return cb(err, res); } self._channel = null; changeChannelState(self, self.channelStates.disconnected); return cb(null); }); } }, // adds a callback that will be invoked when the communication channel state is changed // callback (cb) must be a function with the following arguments: // - channelState: channel state object with the following fields: // - oldState: previous channel state // - newState: current channel state channelStateChanged: function (cb) { cb = utils.createCallback(cb); var self = this; this._events = this._events || new Events(); this._events.bind('onChannelStateChanged', function (data) { cb.call(self, data); }); return this; }, _ensureConnectedState: function () { if (this.channelState === this.channelStates.disconnected) { throw new Error('DeviceHive: Channel is not opened, call the .openChannel() method first'); } if (this.channelState === this.channelStates.connecting) { throw new Error('DeviceHive: Channel has not been initialized, use .openChannel().done() to run logic after the channel is initialized'); } } }; return DeviceHive; }()); var LongPolling = (function () { 'use strict'; var poll = function (self, timestamp) { var params = { timestamp: timestamp }; var continuePollingCb = function (err, res) { if (!err) { var lastTimestamp = null; if (res) { utils.forEach(res, function () { var newTimestamp = self._poller.resolveTimestamp(this); if (!lastTimestamp || newTimestamp > lastTimestamp) { lastTimestamp = newTimestamp; } self._poller.onData(this); }); } poll(self, lastTimestamp || timestamp); } else { if (self._polling) { utils.setTimeout(function () { poll(self, timestamp); }, 1000); } } }; self.pollRequest = self._polling && self._poller.executePoll(params, continuePollingCb); }; var LongPolling = function (serviceUrl, poller) { this.serviceUrl = serviceUrl; this._poller = poller }; LongPolling.prototype = { startPolling: function (cb) { cb = utils.createCallback(cb); this.stopPolling(); var self = this; return restApi.info(this.serviceUrl, function (err, res) { if (err) return cb(err); self._polling = true; poll(self, res.serverTimestamp); return cb(null); }); }, stopPolling: function () { this._polling = false; this.pollRequest && this.pollRequest.abort(); } }; return LongPolling; }()); var WebSocketTransport = (function () { 'use strict'; var WebSocketTransport = utils.noop; WebSocketTransport.requestTimeout = 10000; WebSocketTransport.prototype = { _handler: utils.noop, open: function (url, cb) { cb = utils.createCallback(cb); if (!WebSocket) { return cb(utils.errorMessage('WebSockets are not supported')); } var self = this; var opened = false; this._native = new WebSocket(url); this._native.onopen = function (e) { opened = true; cb(null, e); }; this._native.onmessage = function (e) { var response = JSON.parse(e.data); if (self._requests && response.requestId) { var request = self._requests[response.requestId]; if (request) { utils.clearTimeout(request.timeout); if (response.status && response.status == 'success') { request.cb(null, response); } else { request.cb({error: response.error}); } delete self._requests[response.requestId]; } } else { self._handler(response); } }; this._native.onclose = function (e) { if (!opened) { var err = utils.errorMessage('WebSocket connection has failed to open'); err.data = e; return cb(err); } }; }, close: function (cb) { cb = utils.createCallback(cb); this._native.onclose = function (e) { return cb(null, e); }; this._native.close(); }, message: function (cb) { this._handler = cb; }, send: function (action, data, cb) { cb = utils.createCallback(cb); var self = this, request = {}; this._requestId = this._requestId || 0; request.id = ++this._requestId; //callback for request request.cb = cb; request.timeout = utils.setTimeout(function () { request.cb(utils.errorMessage('Operation timeout')); delete self._requests[request.id]; }, WebSocketTransport.requestTimeout); this._requests = this._requests || {}; this._requests[request.id] = request; data = data || {}; data.requestId = request.id; data.action = action; this._native.send(JSON.stringify(data)); return request; } }; return WebSocketTransport; }()); var WebSocketClientApi = (function () { 'use strict'; var WebSocketClientApi = function (events) { this._transport = new WebSocketTransport(); this._transport.message(function (response) { if (response.action == 'command/insert' && response.command && response.command.id) { events.trigger('onCommandInsert', response.deviceGuid, response.command); } if (response.action == 'command/update') { events.trigger('onCommandUpdate', response.command); } if (response.action == 'notification/insert' && response.deviceGuid && response.notification) { events.trigger('onNotification', response.deviceGuid, response.notification); } }); }; WebSocketClientApi.prototype = { open: function (baseUrl, cb) { this._transport.open(baseUrl + '/client', cb); }, close: function (cb) { this._transport.close(cb); }, getInfo: function (cb) { this._transport.send('server/info', null, cb); }, authenticate: function (username, password, key, cb) { this._transport.send('authenticate', { login: username, password: password, accessKey: key }, cb); }, sendCommand: function (params, cb) { this._transport.send('command/insert', params, cb); }, updateCommand: function (params, cb) { this._transport.send('command/update', params, cb); }, commandSubscribe: function (params, cb) { this._transport.send('command/subscribe', params, cb); }, commandUnSubscribe: function (params, cb) { this._transport.send('command/unsubscribe', params, cb); }, sendNotification: function (params, cb) { this._transport.send('notification/insert', params, cb); }, notificationSubscribe: function (params, cb) { this._transport.send('notification/subscribe', params, cb); }, notificationUnSubscribe: function (params, cb) { this._transport.send('notification/unsubscribe', params, cb); } }; return WebSocketClientApi; }()); var WebSocketDeviceApi = (function () { 'use strict'; var WebSocketDeviceApi = function (events) { this._transport = new WebSocketTransport(); this._transport.message(function (response) { if (response.action == 'command/insert' && response.command && response.command.id) { events.trigger('onCommandInsert', response.deviceGuid, response.command); } }); }; WebSocketDeviceApi.prototype = { open: function (baseUrl, cb) { return this._transport.open(baseUrl + '/device', cb); }, close: function (cb) { return this._transport.close(cb); }, getInfo: function (cb) { this._transport.send('server/info', null, cb); }, authenticate: function (deviceId, deviceKey, cb) { this._transport.send('authenticate', { deviceId: deviceId, deviceKey: deviceKey }, cb); }, updateCommand: function (params, cb) { this._transport.send('command/update', params, cb); }, commandSubscribe: function (params, cb) { this._transport.send('command/subscribe', params, cb); }, commandUnSubscribe: function (params, cb) { this._transport.send('command/unsubscribe', params, cb); }, sendNotification: function (params, cb) { this._transport.send('notification/insert', params, cb); } }; return WebSocketDeviceApi; }()); var LongPollingDeviceChannel = (function () { 'use strict'; LongPollingDeviceChannel = function (hive) { this._hive = hive; this._handler = utils.noop; this._events = new Events(); this.deviceIds = []; var self = this; this._lp = new LongPolling(this._hive.serviceUrl, { executePoll: function (params, continuePollingCb) { return self._hive._executeApi(restApi.pollCommands, [params, continuePollingCb]); }, resolveTimestamp: function (data) { return data.timestamp; }, onData: function (command) { self._events.trigger('onCommandInsert', self._hive.deviceId, command); } }); }; LongPollingDeviceChannel.prototype = { open: function (cb) { cb = utils.createCallback(cb); return cb(null); }, close: function (cb) { cb = utils.createCallback(cb); this._lp.stopPolling(); return cb(null); }, subscribe: function (cb) { cb = utils.createCallback(cb); return this._lp.startPolling(cb); }, unsubscribe: function (cb) { cb = utils.createCallback(cb); this._lp.stopPolling(); return cb(null); }, sendNotification: function (params, cb) { cb = utils.createCallback(cb); return this._hive._executeApi(restApi.insertNotification, [params.notification, cb]); }, updateCommand: function (cmd, cb) { cb = utils.createCallback(cb); return this._hive._executeApi(restApi.updateCommand, [cmd.commandId, cmd.command, cb]); } }; return LongPollingDeviceChannel; }()); var WebSocketDeviceChannel = (function () { 'use strict'; var WebSocketDeviceChannel = function (hive) { this._hive = hive; this._events = new Events(); }; WebSocketDeviceChannel.prototype = { open: function (cb) { cb = utils.createCallback(cb); var webSocketUrl = this._hive.serverInfo.webSocketServerUrl; if (!webSocketUrl) { cb(utils.errorMessage('Open channel failed. Cannot get web socket server url')); return; } var self = this; function onOpen(err) { if (err) return cb(err); if (self._hive.auth.accessKey) { self._wsApi.authenticate(null, null, self._hive.auth.accessKey, cb); } else { self._wsApi.authenticate(self._hive.auth.deviceId, self._hive.auth.deviceKey, cb); } } this._wsApi = self._hive.auth.accessKey ? new WebSocketClientApi(self._events) : new WebSocketDeviceApi(self._events); this._wsApi.open(webSocketUrl, onOpen); }, close: function (cb) { cb = utils.createCallback(cb); this._wsApi.close(cb); }, subscribe: function (cb) { cb = utils.createCallback(cb); var self = this; this._wsApi.commandSubscribe({ deviceGuids: [this._hive.deviceId]}, function (err, res) { if (!err) { self._sub = res.subscriptionId; } return cb(err); }); }, unsubscribe: function (cb) { cb = utils.createCallback(cb); this._wsApi.commandUnSubscribe({ subscriptionId: this._sub }, function (err, res) { if (!err) { self._sub = null; } return cb(err); }); }, sendNotification: function (params, cb) { cb = utils.createCallback(cb); this._wsApi.sendNotification(params, cb); }, updateCommand: function (cmd, cb) { cb = utils.createCallback(cb); this._wsApi.updateCommand(cmd, cb); } }; return WebSocketDeviceChannel; }()); var DHDevice = (function () { 'use strict'; // DHDevice object constructor // specify device key or access key as an authentication/authorization parameters // authentication with device key is deprecated and will be removed in future var DHDevice = function (serviceUrl, deviceId, deviceKeyOrAccessKey) { this.serviceUrl = serviceUrl; this.deviceId = deviceId; // save auth information this.auth = {}; if (utils.isGuid(deviceKeyOrAccessKey)) { this.auth.deviceId = deviceId; this.auth.deviceKey = deviceKeyOrAccessKey; } else { this.auth.accessKey = deviceKeyOrAccessKey; } }; DHDevice.prototype = DeviceHive; DHDevice.constructor = DHDevice; // gets information about the current device // callback (cb) must be a function with the following arguments: // - errors: an error object if any errors occurred // - device: current device information DHDevice.prototype.getDevice = function (cb) { cb = utils.createCallback(cb); return this._executeApi(restApi.getDevice, [cb]); }; // registers a device in the DeviceHive network with the current device id // device key will be implicitly added if specified as an authentication parameter // callback (cb) must be a function with the following arguments: // - errors: an error object if any errors occurred DHDevice.prototype.registerDevice = function (device, cb) { cb = utils.createCallback(cb); device.key = this.auth.deviceKey; return this._executeApi(restApi.registerDevice, [device, cb]); }; // updates a device in the DeviceHive network // callback (cb) must be a function with the following arguments: // - errors: an error object if any errors occurred DHDevice.prototype.updateDevice = function (device, cb) { cb = utils.createCallback(cb); return this._executeApi(restApi.registerDevice, [device, cb]); }; // opens a communication channel to the server // check DeviceHive.prototype.openChannel for more information var openChannelBase = DHDevice.prototype.openChannel; DHDevice.prototype.openChannel = function (cb, channels) { cb = utils.createCallback(cb); var self = this; openChannelBase.call(this, function (err, res) { if (err) return cb(err, res); self._channel._events.bind('onCommandInsert', function (deviceId, cmd) { cmd.update = function (params, onUpdated) { if (!params || !params.status) { return onUpdated(utils.errorMessage('Command status must be specified')); } var updateParams = {}; updateParams.commandId = cmd.id; updateParams.command = params || {}; updateParams.deviceGuid = self.deviceId; return self._channel.updateCommand(updateParams, onUpdated); }; self._events.trigger('onCommand', cmd); }); return cb(err, res); }, channels); }; // subscribes to device commands // callback (cb) must be a function with the following arguments: // - errors: an error object if any errors occurred DHDevice.prototype.subscribe = function (cb) { cb = utils.createCallback(cb); this._ensureConnectedState(); return this._channel.subscribe(cb); }; // unsubscribes from device commands // callback (cb) must be a function with the following arguments: // - errors: an error object if any errors occurred DHDevice.prototype.unsubscribe = function (cb) { cb = utils.createCallback(cb); this._ensureConnectedState(); return this._channel.unsubscribe(cb); }; // sends new notification to the client // callback (cb) must be a function with the following arguments: // - errors: an error object if any errors occurred DHDevice.prototype.sendNotification = function (notification, params, cb) { cb = utils.createCallback(cb); this._ensureConnectedState(); return this._channel.sendNotification({ notification: {notification: notification, parameters: params}, deviceGuid: this.deviceId }, cb); }; // adds a callback that will be invoked when a command from client is received // callback (cb) must be a function with the following arguments: // - command: received command DHDevice.prototype.command = function (cb) { cb = utils.createCallback(cb); var self = this; this._events.bind('onCommand', function (command) { cb.call(self, command); }); return this; }; DHDevice.prototype._executeApi = function (endpoint, args) { var endpointParams = [this.serviceUrl, this.auth, this.deviceId].concat(args); return endpoint.apply(null, endpointParams); }; DHDevice.prototype._channels = {}; DHDevice.prototype._channels.websocket = WebSocketDeviceChannel; DHDevice.prototype._channels.longpolling = LongPollingDeviceChannel; return DHDevice; }()); return DHDevice; }));
/* global anchors: false, ClipboardJS: false, Holder: false */ (function ($) { 'use strict' $(function () { // Anchor anchors.options = { icon: '#' } anchors.add('.bd-content > h2, .bd-content > h3, .bd-content > h4, .bd-content > h5') $('.bd-content > h2, .bd-content > h3, .bd-content > h4, .bd-content > h5').wrapInner('<div></div>') // Clipboard $('div.highlight, figure.highlight').each(function () { var btnHtml = '<div class="bd-clipboard"><button class="btn-clipboard" title="Copy to clipboard">Copy</button></div>' $(this).before(btnHtml) $('.btn-clipboard').on('mouseleave', function () { $(this).tooltip('hide') }).tooltip() }) var clipboard = new ClipboardJS('.btn-clipboard', { target: function (trigger) { return trigger.parentNode.nextElementSibling } }) clipboard.on('error', function (e) { var key = /Mac/i.test(navigator.userAgent) ? '\u2318' : 'Ctrl-' var msg = 'Press ' + key + 'C to copy' $(e.trigger) .attr('title', msg) .tooltip('_fixTitle') .tooltip('show') .attr('title', 'Copy to clipboard') .tooltip('_fixTitle') }) clipboard.on('success', function (e) { $(e.trigger) .attr('title', 'Copied!') .tooltip('_fixTitle') .tooltip('show') .attr('title', 'Copy to clipboard') .tooltip('_fixTitle') e.clearSelection() }) // Disable empty links in docs examples $('.bd-content [href="#"]').on('click', function (e) { e.preventDefault() }) // Docsearch /* docsearch({ algoliaOptions: { facetFilters: ['version: 4.6'] }, apiKey: 'c1af50add5aa791153ec947a3035b0c4', debug: false, handleSelected: function (input, event, suggestion) { var url = suggestion.url url = suggestion.isLvl1 ? url.split('#')[0] : url window.location.href = url }, indexName: 'daemonite_material', inputSelector: '#doc-search', transformData: function (hits) { return hits.map(function (hit) { var siteurl = document.getElementById('doc-search').getAttribute('data-siteurl') var urlRE = /^https?:\/\/djibe\.github\.io/ hit.url = siteurl.match(urlRE) ? hit.url : hit.url.replace(urlRE, '') return hit }) } }) */ // Floating labels $('.floating-label .custom-select, .floating-label .form-control').floatinglabel() // Holder Holder.addTheme('gray', { bg: '#424242', fg: 'rgba(255, 255, 255, .7)', fontweight: 'normal' }) // Indeterminate checkbox example $('.bd-example-indeterminate [type="checkbox"]').prop('indeterminate', true) // Modal $('#exampleModal').on('show.bs.modal', function (event) { var $button = $(event.relatedTarget) var $modal = $(this) var recipient = $button.data('whatever') $modal.find('.modal-body input').val(recipient) $modal.find('.modal-title').text('New message to ' + recipient) }) // Navbar examples $('.navbar-brand img[src="/material/assets/brand/bootstrap-solid.svg"]') .addClass('mr-2 rounded') .attr({ height : 36, src : '/material/apple-touch-icon.png', width : 36 }) // Pickers $('#exampleInputDatePicker1').pickdate() $('#exampleInputDatePicker2').pickdate({ cancel : 'Clear', closeOnCancel : false, closeOnSelect : true, container : 'body', containerHidden : 'body', firstDay : 1, format : 'You selecte!d: dddd, d mm, yy', formatSubmit : 'dd/mmmm/yyyy', hiddenPrefix : 'prefix_', hiddenSuffix : '_suffix', labelMonthNext : 'Go to the next month', labelMonthPrev : 'Go to the previous month', labelMonthSelect : 'Choose a month from the dropdown menu', labelYearSelect : 'Choose a year from the dropdown menu', ok : 'Close', onClose : function () { console.log('Datepicker closes') // eslint-disable-line no-console }, onOpen : function () { console.log('Datepicker opens') // eslint-disable-line no-console }, selectMonths : true, selectYears : 10, today : 'Today' }) $('#exampleInputDatePicker3').pickdate({ max : true, min : -10 }) $('#exampleInputDatePicker4').pickdate({ max : new Date(2016, 1, 13), min : new Date(2016, 0, 3) }) $('#exampleInputDatePicker5').pickdate({ max : [2016, 1, 13], min : [2016, 0, 3] }) $('#exampleInputDatePicker6').pickdate({ disable: [ new Date(2016, 0, 16), new Date(2016, 0, 20), [2016, 0, 24] ] }) $('#exampleInputDatePicker7').pickdate({ disable: [ 1, 2, 3 ] }) $('#exampleInputDatePicker8').pickdate({ disable: [ { from: new Date(2016, 0, 16), to: [2016, 0, 24] } ] }) $('#exampleInputDatePicker9').pickdate({ disable: [ { from: -10, to: true } ] }) $('#exampleInputDatePicker10').pickdate({ disable: [ { from: [2016, 0, 16], to: 10 } ] }) // Progress bar $('.bd-toggle-animated-progress').on('click', function () { $(this).siblings('.progress').find('.progress-bar-striped').toggleClass('progress-bar-animated') }) // Snackbar $('#toast-demo1-btn').on('click', function () { $('#toast-demo1').toast('show') }) $('#toast-demo2-btn').on('click', function () { $('#toast-demo2').toast('show') }) $('#toast-demo3-btn').on('click', function () { $('#toast-demo3').toast('show') }) $('#toast-demo4-btn').on('click', function () { $('#toast-demo4').toast('show') }) $('#toast-demo5-btn').on('click', function () { $('#toast-demo5').toast('show') }) // Toolbar $(window).on('scroll', function () { if ($(window).scrollTop() > 0) { $('.toolbar-waterfall').addClass('waterfall') } else { $('.toolbar-waterfall').removeClass('waterfall') } }) // Tooltip $('[data-toggle="popover"]').popover() $('.bd-example .toast') .toast({ autohide: false }) .toast('show') // Live toast demo $('#liveToastBtn').click(function () { $('#liveToast').toast('show') }) // Demos within modals $('.tooltip-test').tooltip() $('.popover-test').popover() $('.tooltip-demo').tooltip({ container: 'body', selector: '[data-toggle="tooltip"]' }) }) }(jQuery))
import { SET_SPEED, SET_EPOCH, SET_EVOLUTION_RUNNING, } from '../constants/actionTypes'; import initialState from './initialState'; export default function gameOfLifeReducer(state = initialState.gameOfLife, action) { switch (action.type) { case SET_EPOCH: // For this example, just simulating a save by changing date modified. // In a real app using Redux, you might use redux-thunk and handle the async call in fuelSavingsActions.js return Object.assign({}, state, { epoch: action.epoch }); case SET_SPEED: // For this example, just simulating a save by changing date modified. // In a real app using Redux, you might use redux-thunk and handle the async call in fuelSavingsActions.js return Object.assign({}, state, { speed: action.speed }); case SET_EVOLUTION_RUNNING: return Object.assign({}, state, { evolutionRunning: action.evolutionRunning }); default: return state; } }
/* <![CDATA[ */ // Jquery validate form booking jQuery(document).ready(function(){ $('#availability-form').submit(function(){ var action = $(this).attr('action'); $("#message-booking").slideUp(750,function() { $('#message-booking').hide(); $('#submit-booking') .after('<img src="images/ajax-loader.gif" class="loader" >') .attr('disabled','disabled'); $.post(action, { check_in: $('#check_in').val(), check_out: $('#check_out').val(), guest: $('#guest').val(), child: $('#child').val(), rooms_type: $('#rooms_type').val(), name: $('#name').val(), last_name: $('#last_name').val(), email: $('#email').val(), phone_number: $('#phone_number').val(), verify_booking: $('#verify_booking').val() }, function(data){ document.getElementById('message-booking').innerHTML = data; $('#message-booking').slideDown('slow'); $('#availability-form .loader').fadeOut('slow',function(){$(this).remove()}); $('#submit-booking').removeAttr('disabled'); if(data.match('success') != null) $('#availability-form').slideUp('slow'); } ); }); return false; }); }); // Jquery validate form contact jQuery(document).ready(function(){ $('#contact-form').submit(function(){ var action = $(this).attr('action'); $("#message-contact").slideUp(750,function() { $('#message-contact').hide(); $('#submit_contact') .after('<img src="assets/images/ajax-loader.gif" class="loader" >') .attr('disabled','disabled'); $.post(action, { name_contact: $('#name_contact').val(), // last_name_contact: $('#last_name_contact').val(), email_contact: $('#email_contact').val(), // phone_number_contact: $('#phone_number_contact').val(), message_contact: $('#message_contact').val(), // verify_contact: $('#verify_contact').val() }, function(data){ document.getElementById('message-contact').innerHTML = data; $('#message-contact').slideDown('slow'); $('#contact-form .loader').fadeOut('slow',function(){$(this).remove()}); $('#submit_contact').removeAttr('disabled'); if(data.match('success') != null) $('#contact-form').slideUp('slow'); } ); }); return false; }); });; /* ]]> */
var expect = require("expect.js"); var nock = require("nock"); var Eventflit = require("../../../lib/eventflit"); describe("Eventflit", function() { var eventflit; beforeEach(function() { eventflit = new Eventflit({ appId: 1234, key: "f00d", secret: "beef" }); nock.disableNetConnect(); }); afterEach(function() { nock.cleanAll(); nock.enableNetConnect(); }); describe("#trigger", function() { it("should send the event when no callback is given", function(done) { var mock = nock("http://service.eventflit.com") .filteringPath(function(path) { return path .replace(/auth_timestamp=[0-9]+/, "auth_timestamp=X") .replace(/auth_signature=[0-9a-f]{64}/, "auth_signature=Y"); }) .post( "/apps/1234/events?auth_key=f00d&auth_timestamp=X&auth_version=1.0&body_md5=cf87d666b4a829a54fc44b313584b2d7&auth_signature=Y", { name: "my_event", data: "{\"some\":\"data \"}", channels: ["test_channel"] } ) .reply(200, "{}"); eventflit.trigger("test_channel", "my_event", { some: "data "}); setTimeout(function() { // we have no callback in this test, so we wait until the next tick expect(mock.isDone()).to.be(true); done(); }, 0); }); it("should send the event to a single channel", function(done) { var mock = nock("http://service.eventflit.com") .filteringPath(function(path) { return path .replace(/auth_timestamp=[0-9]+/, "auth_timestamp=X") .replace(/auth_signature=[0-9a-f]{64}/, "auth_signature=Y"); }) .post( "/apps/1234/events?auth_key=f00d&auth_timestamp=X&auth_version=1.0&body_md5=e95168baf497b2e54b2c6cadd41a6a3f&auth_signature=Y", { name: "my_event", data: "{\"some\":\"data \"}", channels: ["one"] } ) .reply(200, "{}"); eventflit.trigger("one", "my_event", { some: "data "}, done); }); it("should send the event to multiple channels", function(done) { var mock = nock("http://service.eventflit.com") .filteringPath(function(path) { return path .replace(/auth_timestamp=[0-9]+/, "auth_timestamp=X") .replace(/auth_signature=[0-9a-f]{64}/, "auth_signature=Y"); }) .post( "/apps/1234/events?auth_key=f00d&auth_timestamp=X&auth_version=1.0&body_md5=530dac0aa045e5f8e51c470aed0ce325&auth_signature=Y", { name: "my_event", data: "{\"some\":\"data \"}", channels: ["one", "two", "three"] } ) .reply(200, "{}"); eventflit.trigger(["one", "two", "three"], "my_event", { some: "data "}, done); }); it("should serialize arrays into JSON", function(done) { var mock = nock("http://service.eventflit.com") .filteringPath(function(path) { return path .replace(/auth_timestamp=[0-9]+/, "auth_timestamp=X") .replace(/auth_signature=[0-9a-f]{64}/, "auth_signature=Y"); }) .post( "/apps/1234/events?auth_key=f00d&auth_timestamp=X&auth_version=1.0&body_md5=18e64b2fed38726915d79ebb4f8feb5b&auth_signature=Y", { name: "my_event", data: "[1,2,4]", channels: ["one"] } ) .reply(200, "{}"); eventflit.trigger("one", "my_event", [1,2,4], done); }); it("should not serialize strings into JSON", function(done) { var mock = nock("http://service.eventflit.com") .filteringPath(function(path) { return path .replace(/auth_timestamp=[0-9]+/, "auth_timestamp=X") .replace(/auth_signature=[0-9a-f]{64}/, "auth_signature=Y"); }) .post( "/apps/1234/events?auth_key=f00d&auth_timestamp=X&auth_version=1.0&body_md5=f358a562d00e1bfe1859132d932cd706&auth_signature=Y", { name: "test_event", data: "test string", channels: ["test"] } ) .reply(200, "{}"); eventflit.trigger("test", "test_event", "test string", done); }); it("should add socket_id to the request body", function(done) { var mock = nock("http://service.eventflit.com") .filteringPath(function(path) { return path .replace(/auth_timestamp=[0-9]+/, "auth_timestamp=X") .replace(/auth_signature=[0-9a-f]{64}/, "auth_signature=Y"); }) .post( "/apps/1234/events?auth_key=f00d&auth_timestamp=X&auth_version=1.0&body_md5=0478e1ed73804ae1be97cfa6554cf039&auth_signature=Y", { name: "my_event", data: "{\"some\":\"data \"}", channels: ["test_channel"], socket_id: "123.567" } ) .reply(200, "{}"); eventflit.trigger("test_channel", "my_event", { some: "data "}, "123.567", done); }); it("should call back with the result", function(done) { var mock = nock("http://service.eventflit.com") .filteringPath(function(path) { return path .replace(/auth_timestamp=[0-9]+/, "auth_timestamp=X") .replace(/auth_signature=[0-9a-f]{64}/, "auth_signature=Y"); }) .post( "/apps/1234/events?auth_key=f00d&auth_timestamp=X&auth_version=1.0&body_md5=cf87d666b4a829a54fc44b313584b2d7&auth_signature=Y", { name: "my_event", data: "{\"some\":\"data \"}", channels: ["test_channel"] } ) .reply(200, "OK"); eventflit.trigger("test_channel", "my_event", { some: "data "}, function(error, request, response) { expect(error).to.be(null); expect(response.statusCode).to.equal(200); done(); }); }); it("should call back with a RequestError if Eventflit responds with 4xx", function(done) { var mock = nock("http://service.eventflit.com") .filteringPath(function(path) { return path .replace(/auth_timestamp=[0-9]+/, "auth_timestamp=X") .replace(/auth_signature=[0-9a-f]{64}/, "auth_signature=Y"); }) .post( "/apps/1234/events?auth_key=f00d&auth_timestamp=X&auth_version=1.0&body_md5=cf87d666b4a829a54fc44b313584b2d7&auth_signature=Y", { name: "my_event", data: "{\"some\":\"data \"}", channels: ["test_channel"] } ) .reply(400, "Error"); eventflit.trigger("test_channel", "my_event", { some: "data "}, function(error, request, response) { expect(error).to.be.a(Eventflit.RequestError); expect(error.message).to.equal("Unexpected status code 400"); expect(error.url).to.match( /^http:\/\/service.eventflit.com\/apps\/1234\/events\?auth_key=f00d&auth_timestamp=[0-9]+&auth_version=1\.0&body_md5=cf87d666b4a829a54fc44b313584b2d7&auth_signature=[a-f0-9]+$/ ); expect(error.statusCode).to.equal(400); expect(error.body).to.equal("Error"); done(); }); }); it("should allow channel names with special characters: _ - = @ , . ;", function(done) { var mock = nock("http://service.eventflit.com") .filteringPath(function(path) { return path .replace(/auth_timestamp=[0-9]+/, "auth_timestamp=X") .replace(/auth_signature=[0-9a-f]{64}/, "auth_signature=Y"); }) .post( "/apps/1234/events?auth_key=f00d&auth_timestamp=X&auth_version=1.0&body_md5=024f0f297e27e131c8ec2c8817d153f4&auth_signature=Y", { name: "my_event", data: "{\"some\":\"data \"}", channels: ["test_-=@,.;channel"] } ) .reply(200, "OK"); eventflit.trigger("test_-=@,.;channel", "my_event", { some: "data "}, function(error, request, response) { expect(error).to.be(null); expect(response.statusCode).to.equal(200); done(); }); }); it("should throw an error if called with more than 10 channels", function() { expect(function() { eventflit.trigger( ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11"], "x", {} ); }).to.throwError(function(e) { expect(e).to.be.an(Error); expect(e.message).to.equal( "Can't trigger a message to more than 10 channels" ); }); }); it("should throw an error if channel name is empty", function() { expect(function() { eventflit.trigger("", "test"); }).to.throwError(function(e) { expect(e).to.be.an(Error); expect(e.message).to.equal("Invalid channel name: ''"); }); }); it("should throw an error if channel name is invalid", function() { expect(function() { eventflit.trigger("abc$", "test"); }).to.throwError(function(e) { expect(e).to.be.an(Error); expect(e.message).to.equal("Invalid channel name: 'abc$'"); }); }); it("should throw an error if channel name is longer than 200 characters", function() { var channel = new Array(202).join("x"); // 201 characters expect(function() { eventflit.trigger(channel, "test"); }).to.throwError(function(e) { expect(e).to.be.an(Error); expect(e.message).to.equal("Channel name too long: '" + channel + "'"); }); }); it("should throw an error if event name is longer than 200 characters", function() { var event = new Array(202).join("x"); // 201 characters expect(function() { eventflit.trigger("test", event); }).to.throwError(function(e) { expect(e).to.be.an(Error); expect(e.message).to.equal("Too long event name: '" + event + "'"); }); }); it("should respect the encryption, host and port config", function(done) { var eventflit = new Eventflit({ appId: 1234, key: "f00d", secret: "beef", encrypted: true, host: "example.com", port: 1234 }); var mock = nock("https://example.com:1234") .filteringPath(function(path) { return path .replace(/auth_timestamp=[0-9]+/, "auth_timestamp=X") .replace(/auth_signature=[0-9a-f]{64}/, "auth_signature=Y"); }) .post( "/apps/1234/events?auth_key=f00d&auth_timestamp=X&auth_version=1.0&body_md5=0478e1ed73804ae1be97cfa6554cf039&auth_signature=Y", { name: "my_event", data: "{\"some\":\"data \"}", channels: ["test_channel"], socket_id: "123.567" } ) .reply(200, "{}"); eventflit.trigger("test_channel", "my_event", { some: "data "}, "123.567", done); }); it("should respect the timeout when specified", function(done) { var eventflit = new Eventflit({ appId: 1234, key: "f00d", secret: "beef", timeout: 200 }); var mock = nock("http://service.eventflit.com") .filteringPath(function(path) { return path .replace(/auth_timestamp=[0-9]+/, "auth_timestamp=X") .replace(/auth_signature=[0-9a-f]{64}/, "auth_signature=Y"); }) .post( "/apps/1234/events?auth_key=f00d&auth_timestamp=X&auth_version=1.0&body_md5=0478e1ed73804ae1be97cfa6554cf039&auth_signature=Y", { name: "my_event", data: "{\"some\":\"data \"}", channels: ["test_channel"], socket_id: "123.567" } ) .delayConnection(200) .reply(200); eventflit.trigger("test_channel", "my_event", { some: "data "}, "123.567", function(error, request, response) { var expectedError = new Error("ETIMEDOUT"); expectedError.code = "ETIMEDOUT"; expectedError.connect = undefined; expect(error).to.be.a(Eventflit.RequestError); expect(error.message).to.equal("Request failed with an error"); expect(error.error).to.eql(expectedError); expect(error.url).to.match( /^http:\/\/service.eventflit.com\/apps\/1234\/events\?auth_key=f00d&auth_timestamp=[0-9]+&auth_version=1\.0&body_md5=0478e1ed73804ae1be97cfa6554cf039&auth_signature=[a-f0-9]+$/ ); expect(error.statusCode).to.equal(null); expect(error.body).to.equal(null); done(); }); }); }); describe("#triggerBatch", function(){ it("should trigger multiple events in a single call", function(done) { var mock = nock("http://service.eventflit.com") .filteringPath(function(path) { return path .replace(/auth_timestamp=[0-9]+/, "auth_timestamp=X") .replace(/auth_signature=[0-9a-f]{64}/, "auth_signature=Y"); }) .post( "/apps/1234/batch_events?auth_key=f00d&auth_timestamp=X&auth_version=1.0&body_md5=fd5ab5fd40237f27555c4d2564470fdd&auth_signature=Y", JSON.stringify({"batch":[{"channel":"integration","name":"event","data":"test"},{"channel":"integration2","name":"event2","data":"test2"}]}) ) .reply(200, "{}"); eventflit.triggerBatch([{ channel: "integration", name: "event", data: "test" }, { channel: "integration2", name: "event2", data: "test2" }], done); }); it("should stringify data before posting", function(done) { var mock = nock("http://service.eventflit.com") .filteringPath(function(path) { return path .replace(/auth_timestamp=[0-9]+/, "auth_timestamp=X") .replace(/auth_signature=[0-9a-f]{64}/, "auth_signature=Y"); }) .post( "/apps/1234/batch_events?auth_key=f00d&auth_timestamp=X&auth_version=1.0&body_md5=ade2e9d64d936215c2b2d6a6f4606ef9&auth_signature=Y", JSON.stringify({"batch":[{"channel":"integration","name":"event","data":"{\"hello\":\"world\"}"},{"channel":"integration2","name":"event2","data":"{\"hello2\":\"another world\"}"}]}) ) .reply(200, "{}"); eventflit.triggerBatch([{ channel: "integration", name: "event", data: { hello: "world" } }, { channel: "integration2", name: "event2", data: { hello2: "another world" } }], done); }); }) });
import Firebase from 'firebase/app'; import 'firebase/database'; import 'firebase/storage'; const config = { apiKey: process.env.REACT_APP_API_KEY, authDomain: process.env.REACT_APP_AUTH_DOMAIN, databaseURL: process.env.REACT_APP_DATABASE_URL, projectId: process.env.REACT_APP_PROJECT_ID, storageBucket: process.env.REACT_APP_STORAGE_BUCKET, messagingSenderId: process.env.REACT_APP_MESSAGING_SENDER_ID, appId: process.env.REACT_APP_APP_ID, measurementId: process.env.REACT_APP_MEASUREMENT_ID }; const firebaseApp = Firebase.initializeApp(config); const db = firebaseApp.database(); const storage = firebaseApp.storage(); export default firebaseApp export { db as Database, storage as Storage }
const path = require('path'); const fs = require('fs'); const tempDir = path.resolve(__dirname, '../templates'); const render = employees => { const html = []; html.push(employees.filter(employee => employee.getRole() === 'Manager').map(manager => renderManager(manager)).join('')); html.push(employees.filter(employee => employee.getRole() === 'Engineer').map(engineer => renderEngineer(engineer)).join('')); html.push(employees.filter(employee => employee.getRole() === 'Intern').map(intern => renderIntern(intern)).join('')); return renderMain(html.join('')); }; const renderManager = manager => { let template = fs.readFileSync(path.resolve(tempDir, 'manager.html'), 'utf8'); template = replacePlaceholders(template, 'name', manager.getName()); template = replacePlaceholders(template, 'role', manager.getRole()); template = replacePlaceholders(template, 'email', manager.getEmail()); template = replacePlaceholders(template, 'id', manager.getID()); template = replacePlaceholders(template, 'officeNumber', manager.getOfficeNumber()); return template; } const renderEngineer = engineer => { let template = fs.readFileSync(path.resolve(tempDir, 'engineer.html'), 'utf8'); template = replacePlaceholders(template, 'name', engineer.getName()); template = replacePlaceholders(template, 'role', engineer.getRole()); template = replacePlaceholders(template, 'email', engineer.getEmail()); template = replacePlaceholders(template, 'id', engineer.getID()); template = replacePlaceholders(template, 'github', engineer.getGithub()); return template; }; const renderIntern = intern => { let template = fs.readFileSync(path.resolve(tempDir, 'intern.html'), 'utf8'); template = replacePlaceholders(template, 'name', intern.getName()); template = replacePlaceholders(template, 'role', intern.getRole()); template = replacePlaceholders(template, 'email', intern.getEmail()); template = replacePlaceholders(template, 'id', intern.getID()); template = replacePlaceholders(template, 'school', intern.getSchool()); return template; }; const renderMain = html => { const template = fs.readFileSync(path.resolve(tempDir, 'main.html'), 'utf8'); return replacePlaceholders(template, 'team', html); }; const replacePlaceholders = (template, placeholder, value) => { const pattern = new RegExp("{{ " + placeholder + " }}", 'gm'); return template.replace(pattern, value); }; module.exports = render;
// @flow import React from 'react'; // storybook import { storiesOf } from '@storybook/react'; // components import { Button } from '../source/components/Button'; // skins import { ButtonSkin } from '../source/skins/simple/ButtonSkin'; import { ButtonSpinnerSkin } from '../source/skins/simple/ButtonSpinnerSkin'; // themes import CustomButtonTheme from './theme-customizations/Button.custom.scss'; // theme overrides and identifiers import themeOverrides from './theme-overrides/customButton.scss'; // helpers import { decorateWithSimpleTheme } from './helpers/theming'; storiesOf('Button', module) .addDecorator(decorateWithSimpleTheme) // ====== Stories ====== .add('plain', () => <Button label="Button label" skin={ButtonSkin} />) .add('disabled', () => ( <Button disabled label="Button label" skin={ButtonSkin} /> )) .add('with LoadingSpinner', () => ( <Button loading label="Done Loading" skin={ButtonSpinnerSkin} /> )) .add('theme overrides', () => ( <Button label="theme overrides" themeOverrides={themeOverrides} skin={ButtonSkin} /> )) .add('custom theme', () => ( <Button label="Custom theme" theme={CustomButtonTheme} skin={ButtonSkin} /> ));
const jwt = require('jsonwebtoken'); const { User } = require("../config/dbConfig"); exports.checkUser = (req, res, next) => { const token = req.cookies.jwtCookie; // récupérer le token dans le cookie if (token) { jwt.verify(token, process.env.SECRET_KEY, async(err, decodedToken) => { if (err) { res.locals.user = null; res.cookie('jwtCookie', '', { maxAge: 1 }); console.log("bb"); next(); } else { let user = await User.findByPk(decodedToken.id); res.locals.user = user; console.log("abacres.locals.user); next(); } }); } else { // si pas de token res.locals.user = null; console.log("bbb"); next(); } };
/* eslint-env jest */ let spy; beforeEach(() => { spy = jest.spyOn(console, "error").mockImplementation((message) => { console.log(message); throw new Error(message); }); }); afterEach(() => { spy.mockRestore(); });
"use strict"; import React from "react"; import Wprr from "wprr/Wprr"; import Layout from "wprr/elements/layout/Layout"; // import HorizontalMenuItem from "./HorizontalMenuItem"; export default class HorizontalMenuItem extends Layout { /** * Constructor */ constructor() { //console.log("HorizontalMenuItem::constructor"); super(); this._layoutName = "horizontalMenuItem"; this._open = Wprr.sourceValue(false); } _stateFromOpen(aOpen) { return aOpen ? "over" : "initial"; } _toggleOpen() { this._open.setValue(!this._open.getValue()); } _setOpen(aOpen) { this._open.setValue(aOpen); } _getLayout(aSlots) { let menuItem = this.getFirstInput(Wprr.sourceProp("menuItem")); let children = menuItem.children; let link = React.createElement(Wprr.Adjust, { adjust: Wprr.adjusts.isUrlAtPath(menuItem.link, null, { "not": "not-active", "at": "active", "in": "child-active" }, "className") }, /*#__PURE__*/React.createElement(Wprr.Link, { href: menuItem.link, className: "custom-styled-link menu-link" }, Wprr.text(menuItem.title)));; if(children.length > 0) { let childItemMarkup = React.createElement("div", null, /*#__PURE__*/React.createElement(Wprr.Adjust, { adjust: Wprr.adjusts.isUrlAtPath(Wprr.sourceReference("loop/item", "link"), null, { "not": "not-active", "at": "active", "in": "not-active" }, "className") }, /*#__PURE__*/React.createElement(Wprr.Link, { href: Wprr.sourceReference("loop/item", "link"), className: "custom-styled-link menu-link" }, Wprr.text(Wprr.sourceReference("loop/item", "title")))));; return React.createElement("div", null, /*#__PURE__*/React.createElement(Wprr.EventCommands, { events: { "onMouseEnter": [Wprr.commands.callFunction(this, this._setOpen, [true])], "onMouseLeave": [Wprr.commands.callFunction(this, this._setOpen, [false])] } }, /*#__PURE__*/React.createElement("div", { className: "absolute-container" }, /*#__PURE__*/React.createElement("div", null, link, " ", /*#__PURE__*/React.createElement(Wprr.Image, { className: "background-contain display-inline-block menu-arrow-adjust", src: "chevron-medium.svg" })), /*#__PURE__*/React.createElement(Wprr.AnimationControl, { states: { "initial": { "scale": 0 }, "over": { "scale": 1 } }, state: Wprr.sourceFunction(this, this._stateFromOpen, [this._open]), sourceUpdates: this._open }, /*#__PURE__*/React.createElement(Wprr.AnimationPart, { animationFunctions: [Wprr.utils.applyAnimation.staticTranslate("-50%", "0px"), Wprr.utils.applyAnimation.uniformScale()] }, /*#__PURE__*/React.createElement("div", { className: "position-absolute center-below transform-origin-top-center" }, /*#__PURE__*/React.createElement(Wprr.OpenCloseExpandableArea, { open: this._open }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", { className: "menu-drop-down-top absolute-container" }, /*#__PURE__*/React.createElement("div", { className: "menu-drop-down-top-arrow" })), /*#__PURE__*/React.createElement("div", { className: "menu-drop-down-box menu-drop-down-box-padding" }, /*#__PURE__*/React.createElement(Wprr.Loop, { loop: Wprr.adjusts.markupLoop(children, childItemMarkup, /*#__PURE__*/React.createElement("div", { className: "spacing medium" })) }))))))))));; } return React.createElement("div", null, link); } }
import { createStore, applyMiddleware } from 'redux'; import createSagaMiddleware from 'redux-saga'; import {persistStore, persistReducer} from 'redux-persist'; import storage from 'redux-persist/lib/storage'; import pokeapi from './reducers'; import rootSaga from './sagas'; const config = { key:'poke_shop', storage, whiteList:['cart','total'] } const persistedReducer = persistReducer(config,pokeapi); const sagaMiddleware = createSagaMiddleware(); const store = createStore( persistedReducer, applyMiddleware(sagaMiddleware), ); sagaMiddleware.run(rootSaga); const persistor = persistStore(store) export {store,persistor};
import Icon from "./icon.jsx"; export default Icon;
/*! * Lightbox v2.11.2 * by Lokesh Dhakar * * More info: * * Copyright Lokesh Dhakar * Released under the MIT license * * @preserve */ // Uses Node, AMD or browser globals to create a module. (function (root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. define(['jquery'], factory); } else if (typeof exports === 'object') { // Node. Does not work with strict CommonJS, but // only CommonJS-like environments that support module.exports, // like Node. module.exports = factory(require('jquery')); } else { // Browser globals (root is window) root.lightbox = factory(root.jQuery); } }(this, function ($) { function Lightbox(options) { this.album = []; this.currentImageIndex = void 0; this.init(); // options this.options = $.extend({}, this.constructor.defaults); this.option(options); } // Descriptions of all options available on the demo site: Lightbox.defaults = { albumLabel: 'Image %1 of %2', alwaysShowNavOnTouchDevices: false, fadeDuration: 600, fitImagesInViewport: true, imageFadeDuration: 600, // maxWidth: 800, // maxHeight: 600, positionFromTop: 50, resizeDuration: 700, showImageNumberLabel: true, wrapAround: false, disableScrolling: false, /* Sanitize Title If the caption data is trusted, for example you are hardcoding it in, then leave this to false. This will free you to add html tags, such as links, in the caption. If the caption data is user submitted or from some other untrusted source, then set this to true to prevent xss and other injection attacks. */ sanitizeTitle: false }; Lightbox.prototype.option = function(options) { $.extend(this.options, options); }; Lightbox.prototype.imageCountLabel = function(currentImageNum, totalImages) { return this.options.albumLabel.replace(/%1/g, currentImageNum).replace(/%2/g, totalImages); }; Lightbox.prototype.init = function() { var self = this; // Both enable and build methods require the body tag to be in the DOM. $(document).ready(function() { self.enable(); self.build(); }); }; // Loop through anchors and areamaps looking for either data-lightbox attributes or rel attributes // that contain 'lightbox'. When these are clicked, start lightbox. Lightbox.prototype.enable = function() { var self = this; $('body').on('click', 'a[rel^=lightbox], area[rel^=lightbox], a[data-lightbox], area[data-lightbox]', function(event) { self.start($(event.currentTarget)); return false; }); }; // Build html for the lightbox and the overlay. // Attach event handlers to the new DOM elements. click click click Lightbox.prototype.build = function() { if ($('#lightbox').length > 0) { return; } var self = this; // The two root notes generated, #lightboxOverlay and #lightbox are given // tabindex attrs so they are focusable. We attach our keyboard event // listeners to these two elements, and not the document. Clicking anywhere // while Lightbox is opened will keep the focus on or inside one of these // two elements. // // We do this so we can prevent propogation of the Esc keypress when // Lightbox is open. This prevents it from intefering with other components // on the page below. // $('<div id="lightboxOverlay" tabindex="-1" class="lightboxOverlay"></div><div id="lightbox" tabindex="-1" class="lightbox"><div class="lb-outerContainer"><div class="lb-container"><img class="lb-image" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" alt=""/><div class="lb-nav"><a class="lb-prev" aria-label="Previous image" href="" ></a><a class="lb-next" aria-label="Next image" href="" ></a></div><div class="lb-loader"><a class="lb-cancel"></a></div></div></div><div class="lb-dataContainer"><div class="lb-data"><div class="lb-details"><span class="lb-caption"></span><span class="lb-number"></span></div><div class="lb-closeContainer"><a class="lb-close"></a></div></div></div></div>').appendTo($('body')); // Cache jQuery objects this.$lightbox = $('#lightbox'); this.$overlay = $('#lightboxOverlay'); this.$outerContainer = this.$lightbox.find('.lb-outerContainer'); this.$container = this.$lightbox.find('.lb-container'); this.$image = this.$lightbox.find('.lb-image'); this.$nav = this.$lightbox.find('.lb-nav'); // Store css values for future lookup this.containerPadding = { top: parseInt(this.$container.css('padding-top'), 10), right: parseInt(this.$container.css('padding-right'), 10), bottom: parseInt(this.$container.css('padding-bottom'), 10), left: parseInt(this.$container.css('padding-left'), 10) }; this.imageBorderWidth = { top: parseInt(this.$image.css('border-top-width'), 10), right: parseInt(this.$image.css('border-right-width'), 10), bottom: parseInt(this.$image.css('border-bottom-width'), 10), left: parseInt(this.$image.css('border-left-width'), 10) }; // Attach event handlers to the newly minted DOM elements this.$overlay.hide().on('click', function() { self.end(); return false; }); this.$lightbox.hide().on('click', function(event) { if ($(event.target).attr('id') === 'lightbox') { self.end(); } }); this.$outerContainer.on('click', function(event) { if ($(event.target).attr('id') === 'lightbox') { self.end(); } return false; }); this.$lightbox.find('.lb-prev').on('click', function() { if (self.currentImageIndex === 0) { self.changeImage(self.album.length - 1); } else { self.changeImage(self.currentImageIndex - 1); } return false; }); this.$lightbox.find('.lb-next').on('click', function() { if (self.currentImageIndex === self.album.length - 1) { self.changeImage(0); } else { self.changeImage(self.currentImageIndex + 1); } return false; }); /* Show context menu for image on right-click There is a div containing the navigation that spans the entire image and lives above of it. If you right-click, you are right clicking this div and not the image. This prevents users from saving the image or using other context menu actions with the image. To fix this, when we detect the right mouse button is pressed down, but not yet clicked, we set pointer-events to none on the nav div. This is so that the upcoming right-click event on the next mouseup will bubble down to the image. Once the right-click/contextmenu event occurs we set the pointer events back to auto for the nav div so it can capture hover and left-click events as usual. */ this.$nav.on('mousedown', function(event) { if (event.which === 3) { self.$nav.css('pointer-events', 'none'); self.$lightbox.one('contextmenu', function() { setTimeout(function() { this.$nav.css('pointer-events', 'auto'); }.bind(self), 0); }); } }); this.$lightbox.find('.lb-loader, .lb-close').on('click', function() { self.end(); return false; }); }; // Show overlay and lightbox. If the image is part of a set, add siblings to album array. Lightbox.prototype.start = function($link) { var self = this; var $window = $(window); $window.on('resize', $.proxy(this.sizeOverlay, this)); this.sizeOverlay(); this.album = []; var imageNumber = 0; function addToAlbum($link) { self.album.push({ alt: $link.attr('data-alt'), link: $link.attr('href'), title: $link.attr('data-title') || $link.attr('title') }); } // Support both data-lightbox attribute and rel attribute implementations var dataLightboxValue = $link.attr('data-lightbox'); var $links; if (dataLightboxValue) { $links = $($link.prop('tagName') + '[data-lightbox="' + dataLightboxValue + '"]'); for (var i = 0; i < $links.length; i = ++i) { addToAlbum($($links[i])); if ($links[i] === $link[0]) { imageNumber = i; } } } else { if ($link.attr('rel') === 'lightbox') { // If image is not part of a set addToAlbum($link); } else { // If image is part of a set $links = $($link.prop('tagName') + '[rel="' + $link.attr('rel') + '"]'); for (var j = 0; j < $links.length; j = ++j) { addToAlbum($($links[j])); if ($links[j] === $link[0]) { imageNumber = j; } } } } // Position Lightbox var top = $window.scrollTop() + this.options.positionFromTop; var left = $window.scrollLeft(); this.$lightbox.css({ top: top + 'px', left: left + 'px' }).fadeIn(this.options.fadeDuration); // Disable scrolling of the page while open if (this.options.disableScrolling) { $('body').addClass('lb-disable-scrolling'); } this.changeImage(imageNumber); }; // Hide most UI elements in preparation for the animated resizing of the lightbox. Lightbox.prototype.changeImage = function(imageNumber) { var self = this; var filename = this.album[imageNumber].link; var filetype = filename.split('.').slice(-1)[0]; var $image = this.$lightbox.find('.lb-image'); // Disable keyboard nav during transitions this.disableKeyboardNav(); // Show loading state this.$overlay.fadeIn(this.options.fadeDuration); $('.lb-loader').fadeIn('slow'); this.$lightbox.find('.lb-image, .lb-nav, .lb-prev, .lb-next, .lb-dataContainer, .lb-numbers, .lb-caption').hide(); this.$outerContainer.addClass('animating'); // When image to show is preloaded, we send the width and height to sizeContainer() var preloader = new Image(); preloader.onload = function() { var $preloader; var imageHeight; var imageWidth; var maxImageHeight; var maxImageWidth; var windowHeight; var windowWidth; $image.attr({ 'alt': self.album[imageNumber].alt, 'src': filename }); $preloader = $(preloader); $image.width(preloader.width); $image.height(preloader.height); windowWidth = $(window).width(); windowHeight = $(window).height(); // Calculate the max image dimensions for the current viewport. // Take into account the border around the image and an additional 10px gutter on each side. maxImageWidth = windowWidth - self.containerPadding.left - self.containerPadding.right - self.imageBorderWidth.left - self.imageBorderWidth.right - 20; maxImageHeight = windowHeight - self.containerPadding.top - self.containerPadding.bottom - self.imageBorderWidth.top - self.imageBorderWidth.bottom - self.options.positionFromTop - 70; /* Since many SVGs have small intrinsic dimensions, but they support scaling up without quality loss because of their vector format, max out their size. */ if (filetype === 'svg') { $image.width(maxImageWidth); $image.height(maxImageHeight); } // Fit image inside the viewport. if (self.options.fitImagesInViewport) { // Check if image size is larger then maxWidth|maxHeight in settings if (self.options.maxWidth && self.options.maxWidth < maxImageWidth) { maxImageWidth = self.options.maxWidth; } if (self.options.maxHeight && self.options.maxHeight < maxImageHeight) { maxImageHeight = self.options.maxHeight; } } else { maxImageWidth = self.options.maxWidth || preloader.width || maxImageWidth; maxImageHeight = self.options.maxHeight || preloader.height || maxImageHeight; } // Is the current image's width or height is greater than the maxImageWidth or maxImageHeight // option than we need to size down while maintaining the aspect ratio. if ((preloader.width > maxImageWidth) || (preloader.height > maxImageHeight)) { if ((preloader.width / maxImageWidth) > (preloader.height / maxImageHeight)) { imageWidth = maxImageWidth; imageHeight = parseInt(preloader.height / (preloader.width / imageWidth), 10); $image.width(imageWidth); $image.height(imageHeight); } else { imageHeight = maxImageHeight; imageWidth = parseInt(preloader.width / (preloader.height / imageHeight), 10); $image.width(imageWidth); $image.height(imageHeight); } } self.sizeContainer($image.width(), $image.height()); }; // Preload image before showing preloader.src = this.album[imageNumber].link; this.currentImageIndex = imageNumber; }; // Stretch overlay to fit the viewport Lightbox.prototype.sizeOverlay = function() { var self = this; /* We use a setTimeout 0 to pause JS execution and let the rendering catch-up. Why do this? If the `disableScrolling` option is set to true, a class is added to the body tag that disables scrolling and hides the scrollbar. We want to make sure the scrollbar is hidden before we measure the document width, as the presence of the scrollbar will affect the number. */ setTimeout(function() { self.$overlay .width($(document).width()) .height($(document).height()); }, 0); }; // Animate the size of the lightbox to fit the image we are showing // This method also shows the the image. Lightbox.prototype.sizeContainer = function(imageWidth, imageHeight) { var self = this; var oldWidth = this.$outerContainer.outerWidth(); var oldHeight = this.$outerContainer.outerHeight(); var newWidth = imageWidth + this.containerPadding.left + this.containerPadding.right + this.imageBorderWidth.left + this.imageBorderWidth.right; var newHeight = imageHeight + this.containerPadding.top + this.containerPadding.bottom + this.imageBorderWidth.top + this.imageBorderWidth.bottom; function postResize() { self.$lightbox.find('.lb-dataContainer').width(newWidth); self.$lightbox.find('.lb-prevLink').height(newHeight); self.$lightbox.find('.lb-nextLink').height(newHeight); // Set focus on one of the two root nodes so keyboard events are captured. self.$overlay.focus(); self.showImage(); } if (oldWidth !== newWidth || oldHeight !== newHeight) { this.$outerContainer.animate({ width: newWidth, height: newHeight }, this.options.resizeDuration, 'swing', function() { postResize(); }); } else { postResize(); } }; // Display the image and its details and begin preload neighboring images. Lightbox.prototype.showImage = function() { this.$lightbox.find('.lb-loader').stop(true).hide(); this.$lightbox.find('.lb-image').fadeIn(this.options.imageFadeDuration); this.updateNav(); this.updateDetails(); this.preloadNeighboringImages(); this.enableKeyboardNav(); }; // Display previous and next navigation if appropriate. Lightbox.prototype.updateNav = function() { // Check to see if the browser supports touch events. If so, we take the conservative approach // and assume that mouse hover events are not supported and always show prev/next navigation // arrows in image sets. var alwaysShowNav = false; try { document.createEvent('TouchEvent'); alwaysShowNav = (this.options.alwaysShowNavOnTouchDevices) ? true : false; } catch (e) {} this.$lightbox.find('.lb-nav').show(); if (this.album.length > 1) { if (this.options.wrapAround) { if (alwaysShowNav) { this.$lightbox.find('.lb-prev, .lb-next').css('opacity', '1'); } this.$lightbox.find('.lb-prev, .lb-next').show(); } else { if (this.currentImageIndex > 0) { this.$lightbox.find('.lb-prev').show(); if (alwaysShowNav) { this.$lightbox.find('.lb-prev').css('opacity', '1'); } } if (this.currentImageIndex < this.album.length - 1) { this.$lightbox.find('.lb-next').show(); if (alwaysShowNav) { this.$lightbox.find('.lb-next').css('opacity', '1'); } } } } }; // Display caption, image number, and closing button. Lightbox.prototype.updateDetails = function() { var self = this; // Enable anchor clicks in the injected caption html. if (typeof this.album[this.currentImageIndex].title !== 'undefined' && this.album[this.currentImageIndex].title !== '') { var $caption = this.$lightbox.find('.lb-caption'); if (this.options.sanitizeTitle) { $caption.text(this.album[this.currentImageIndex].title); } else { $caption.html(this.album[this.currentImageIndex].title); } $caption.fadeIn('fast'); } if (this.album.length > 1 && this.options.showImageNumberLabel) { var labelText = this.imageCountLabel(this.currentImageIndex + 1, this.album.length); this.$lightbox.find('.lb-number').text(labelText).fadeIn('fast'); } else { this.$lightbox.find('.lb-number').hide(); } this.$outerContainer.removeClass('animating'); this.$lightbox.find('.lb-dataContainer').fadeIn(this.options.resizeDuration, function() { return self.sizeOverlay(); }); }; // Preload previous and next images in set. Lightbox.prototype.preloadNeighboringImages = function() { if (this.album.length > this.currentImageIndex + 1) { var preloadNext = new Image(); preloadNext.src = this.album[this.currentImageIndex + 1].link; } if (this.currentImageIndex > 0) { var preloadPrev = new Image(); preloadPrev.src = this.album[this.currentImageIndex - 1].link; } }; Lightbox.prototype.enableKeyboardNav = function() { this.$lightbox.on('keyup.keyboard', $.proxy(this.keyboardAction, this)); this.$overlay.on('keyup.keyboard', $.proxy(this.keyboardAction, this)); }; Lightbox.prototype.disableKeyboardNav = function() { this.$lightbox.off('.keyboard'); this.$overlay.off('.keyboard'); }; Lightbox.prototype.keyboardAction = function(event) { var KEYCODE_ESC = 27; var KEYCODE_LEFTARROW = 37; var KEYCODE_RIGHTARROW = 39; var keycode = event.keyCode; if (keycode === KEYCODE_ESC) { // Prevent bubbling so as to not affect other components on the page. event.stopPropagation(); this.end(); } else if (keycode === KEYCODE_LEFTARROW) { if (this.currentImageIndex !== 0) { this.changeImage(this.currentImageIndex - 1); } else if (this.options.wrapAround && this.album.length > 1) { this.changeImage(this.album.length - 1); } } else if (keycode === KEYCODE_RIGHTARROW) { if (this.currentImageIndex !== this.album.length - 1) { this.changeImage(this.currentImageIndex + 1); } else if (this.options.wrapAround && this.album.length > 1) { this.changeImage(0); } } }; // Closing time. :-( Lightbox.prototype.end = function() { this.disableKeyboardNav(); $(window).off('resize', this.sizeOverlay); this.$lightbox.fadeOut(this.options.fadeDuration); this.$overlay.fadeOut(this.options.fadeDuration); if (this.options.disableScrolling) { $('body').removeClass('lb-disable-scrolling'); } }; return new Lightbox(); }));
const path = require('path') const fs = require('fs') const test = require('tape') const tempfile = require('tempfile') const writeJson5File = require('.') test('async', async t => { const tmp = path.join(tempfile(), 'foo') await writeJson5File(tmp, { foo: true }, { indent: 2 }) t.equal(fs.readFileSync(tmp, 'utf8'), '{\n foo: true,\n}\n') t.end() }) test('sync', t => { const tmp = path.join(tempfile(), 'foo') writeJson5File.sync(tmp, { foo: true }, { indent: 2 }) t.equal(fs.readFileSync(tmp, 'utf8'), '{\n foo: true,\n}\n') t.end() })
(()=>{"use strict";var deferred,inProgress,__webpack_modules__={},__webpack_module_cache__={};function __webpack_require__(moduleId){var cachedModule=__webpack_module_cache__[moduleId];if(void 0!==cachedModule)return cachedModule.exports;var module=__webpack_module_cache__[moduleId]={id:moduleId,loaded:!1,exports:{}};return __webpack_modules__[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.loaded=!0,module.exports}__webpack_require__.m=__webpack_modules__,deferred=[],__webpack_require__.O=(result,chunkIds,fn,priority)=>{if(!chunkIds){var notFulfilled=1/0;for(i=0;i<deferred.length;i++){for(var[chunkIds,fn,priority]=deferred[i],fulfilled=!0,j=0;j<chunkIds.length;j++)(!1&priority||notFulfilled>=priority)&&Object.keys(__webpack_require__.O).every((key=>__webpack_require__.O[key](chunkIds[j])))?chunkIds.splice(j--,1):(fulfilled=!1,priority<notFulfilled&&(notFulfilled=priority));fulfilled&&(deferred.splice(i--,1),result=fn())}return result}priority=priority||0;for(var i=deferred.length;i>0&&deferred[i-1][2]>priority;i--)deferred[i]=deferred[i-1];deferred[i]=[chunkIds,fn,priority]},__webpack_require__.n=module=>{var getter=module&&module.__esModule?()=>module.default:()=>module;return __webpack_require__.d(getter,{a:getter}),getter},__webpack_require__.d=(exports,definition)=>{for(var key in definition)__webpack_require__.o(definition,key)&&!__webpack_require__.o(exports,key)&&Object.defineProperty(exports,key,{enumerable:!0,get:definition[key]})},__webpack_require__.f={},__webpack_require__.e=chunkId=>Promise.all(Object.keys(__webpack_require__.f).reduce(((promises,key)=>(__webpack_require__.f[key](chunkId,promises),promises)),[])),__webpack_require__.u=chunkId=>chunkId+"."+{90:"a29094a1",331:"a4d69bca",459:"5a886fb5",881:"61c8f29e",913:"a1de9192"}[chunkId]+".iframe.bundle.js",__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.hmd=module=>((module=Object.create(module)).children||(module.children=[]),Object.defineProperty(module,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+module.id)}}),module),__webpack_require__.o=(obj,prop)=>Object.prototype.hasOwnProperty.call(obj,prop),inProgress={},__webpack_require__.l=(url,done,key,chunkId)=>{if(inProgress[url])inProgress[url].push(done);else{var script,needAttach;if(void 0!==key)for(var scripts=document.getElementsByTagName("script"),i=0;i<scripts.length;i++){var s=scripts[i];if(s.getAttribute("src")==url||s.getAttribute("data-webpack")=="cubism-react:"+key){script=s;break}}script||(needAttach=!0,(script=document.createElement("script")).charset="utf-8",script.timeout=120,__webpack_require__.nc&&script.setAttribute("nonce",__webpack_require__.nc),script.setAttribute("data-webpack","cubism-react:"+key),script.src=url),inProgress[url]=[done];var onScriptComplete=(prev,event)=>{script.onerror=script.onload=null,clearTimeout(timeout);var doneFns=inProgress[url];if(delete inProgress[url],script.parentNode&&script.parentNode.removeChild(script),doneFns&&doneFns.forEach((fn=>fn(event))),prev)return prev(event)},timeout=setTimeout(onScriptComplete.bind(null,void 0,{type:"timeout",target:script}),12e4);script.onerror=onScriptComplete.bind(null,script.onerror),script.onload=onScriptComplete.bind(null,script.onload),needAttach&&document.head.appendChild(script)}},__webpack_require__.r=exports=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(exports,"__esModule",{value:!0})},__webpack_require__.nmd=module=>(module.paths=[],module.children||(module.children=[]),module),__webpack_require__.p="",(()=>{var installedChunks={303:0};__webpack_require__.f.j=(chunkId,promises)=>{var installedChunkData=__webpack_require__.o(installedChunks,chunkId)?installedChunks[chunkId]:void 0;if(0!==installedChunkData)if(installedChunkData)promises.push(installedChunkData[2]);else if(303!=chunkId){var promise=new Promise(((resolve,reject)=>installedChunkData=installedChunks[chunkId]=[resolve,reject]));promises.push(installedChunkData[2]=promise);var url=__webpack_require__.p+__webpack_require__.u(chunkId),error=new Error;__webpack_require__.l(url,(event=>{if(__webpack_require__.o(installedChunks,chunkId)&&(0!==(installedChunkData=installedChunks[chunkId])&&(installedChunks[chunkId]=void 0),installedChunkData)){var errorType=event&&("load"===event.type?"missing":event.type),realSrc=event&&event.target&&event.target.src;error.message="Loading chunk "+chunkId+" failed.\n("+errorType+": "+realSrc+")",error.name="ChunkLoadError",error.type=errorType,error.request=realSrc,installedChunkData[1](error)}}),"chunk-"+chunkId,chunkId)}else installedChunks[chunkId]=0},__webpack_require__.O.j=chunkId=>0===installedChunks[chunkId];var webpackJsonpCallback=(parentChunkLoadingFunction,data)=>{var moduleId,chunkId,[chunkIds,moreModules,runtime]=data,i=0;for(moduleId in moreModules)__webpack_require__.o(moreModules,moduleId)&&(__webpack_require__.m[moduleId]=moreModules[moduleId]);if(runtime)var result=runtime(__webpack_require__);for(parentChunkLoadingFunction&&parentChunkLoadingFunction(data);i<chunkIds.length;i++)chunkId=chunkIds[i],__webpack_require__.o(installedChunks,chunkId)&&installedChunks[chunkId]&&installedChunks[chunkId][0](),installedChunks[chunkIds[i]]=0;return __webpack_require__.O(result)},chunkLoadingGlobal=self.webpackChunkcubism_react=self.webpackChunkcubism_react||[];chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null,0)),chunkLoadingGlobal.push=webpackJsonpCallback.bind(null,chunkLoadingGlobal.push.bind(chunkLoadingGlobal))})()})(); //# sourceMappingURL=runtime~main.0021e2e3.iframe.bundle.js.map
/* * Copyright 2015 Palantir Technologies, Inc. All rights reserved. * Licensed under the BSD-3 License as modified (the “License”); you may obtain a copy * of the license at https://github.com/palantir/blueprint/blob/master/LICENSE * and https://github.com/palantir/blueprint/blob/master/PATENTS */ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); var classNames = require("classnames"); var PureRender = require("pure-render-decorator"); var React = require("react"); var react_dom_1 = require("react-dom"); var abstractComponent_1 = require("../../common/abstractComponent"); var Classes = require("../../common/classes"); var Errors = require("../../common/errors"); var Keys = require("../../common/keys"); var Utils = require("../../common/utils"); var tab_1 = require("./tab"); var tabList_1 = require("./tabList"); var tabPanel_1 = require("./tabPanel"); var TAB_CSS_SELECTOR = "li[role=tab]"; var Tabs = (function (_super) { tslib_1.__extends(Tabs, _super); function Tabs(props, context) { var _this = _super.call(this, props, context) || this; _this.displayName = "Blueprint.Tabs"; // state is initialized in the constructor but getStateFromProps needs state defined _this.state = {}; _this.panelIds = []; _this.tabIds = []; _this.handleClick = function (e) { _this.handleTabSelectingEvent(e); }; _this.handleKeyPress = function (e) { var insideTab = e.target.closest("." + Classes.TAB) != null; if (insideTab && (e.which === Keys.SPACE || e.which === Keys.ENTER)) { e.preventDefault(); _this.handleTabSelectingEvent(e); } }; _this.handleKeyDown = function (e) { // don't want to handle keyDown events inside a tab panel var insideTabList = e.target.closest("." + Classes.TAB_LIST) != null; if (!insideTabList) { return; } var focusedTabIndex = _this.getFocusedTabIndex(); if (focusedTabIndex === -1) { return; } if (e.which === Keys.ARROW_LEFT) { e.preventDefault(); // find previous tab that isn't disabled var newTabIndex = focusedTabIndex - 1; var tabIsDisabled = _this.isTabDisabled(newTabIndex); while (tabIsDisabled && newTabIndex !== -1) { newTabIndex--; tabIsDisabled = _this.isTabDisabled(newTabIndex); } if (newTabIndex !== -1) { _this.focusTab(newTabIndex); } } else if (e.which === Keys.ARROW_RIGHT) { e.preventDefault(); // find next tab that isn't disabled var tabsCount = _this.getTabsCount(); var newTabIndex = focusedTabIndex + 1; var tabIsDisabled = _this.isTabDisabled(newTabIndex); while (tabIsDisabled && newTabIndex !== tabsCount) { newTabIndex++; tabIsDisabled = _this.isTabDisabled(newTabIndex); } if (newTabIndex !== tabsCount) { _this.focusTab(newTabIndex); } } }; _this.handleTabSelectingEvent = function (e) { var tabElement = e.target.closest(TAB_CSS_SELECTOR); // select only if Tab is one of us and is enabled if (tabElement != null && _this.tabIds.indexOf(tabElement.id) >= 0 && tabElement.getAttribute("aria-disabled") !== "true") { var index = tabElement.parentElement.queryAll(TAB_CSS_SELECTOR).indexOf(tabElement); _this.setSelectedTabIndex(index); } }; _this.state = _this.getStateFromProps(_this.props); if (!Utils.isNodeEnv("production")) { console.warn(Errors.TABS_DEPRECATED); } return _this; } Tabs.prototype.render = function () { return (React.createElement("div", { className: classNames(Classes.TABS, this.props.className), onClick: this.handleClick, onKeyPress: this.handleKeyPress, onKeyDown: this.handleKeyDown }, this.getChildren())); }; Tabs.prototype.componentWillReceiveProps = function (newProps) { var newState = this.getStateFromProps(newProps); this.setState(newState); }; Tabs.prototype.componentDidMount = function () { var _this = this; var selectedTab = react_dom_1.findDOMNode(this.refs["tabs-" + this.state.selectedTabIndex]); this.setTimeout(function () { return _this.moveIndicator(selectedTab); }); }; Tabs.prototype.componentDidUpdate = function (_, prevState) { var _this = this; var newIndex = this.state.selectedTabIndex; if (newIndex !== prevState.selectedTabIndex) { var tabElement_1 = react_dom_1.findDOMNode(this.refs["tabs-" + newIndex]); // need to measure on the next frame in case the Tab children simultaneously change this.setTimeout(function () { return _this.moveIndicator(tabElement_1); }); } }; Tabs.prototype.validateProps = function (props) { if (React.Children.count(props.children) > 0) { var child = React.Children.toArray(props.children)[0]; if (child != null && child.type !== tabList_1.TabList) { throw new Error(Errors.TABS_FIRST_CHILD); } if (this.getTabsCount() !== this.getPanelsCount()) { throw new Error(Errors.TABS_MISMATCH); } } }; /** * Calculate the new height, width, and position of the tab indicator. * Store the CSS values so the transition animation can start. */ Tabs.prototype.moveIndicator = function (_a) { var clientHeight = _a.clientHeight, clientWidth = _a.clientWidth, offsetLeft = _a.offsetLeft, offsetTop = _a.offsetTop; var indicatorWrapperStyle = { height: clientHeight, transform: "translateX(" + Math.floor(offsetLeft) + "px) translateY(" + Math.floor(offsetTop) + "px)", width: clientWidth, }; this.setState({ indicatorWrapperStyle: indicatorWrapperStyle }); }; /** * Most of the component logic lives here. We clone the children provided by the user to set up refs, * accessibility attributes, and selection props correctly. */ Tabs.prototype.getChildren = function () { var _this = this; for (var unassignedTabs = this.getTabsCount() - this.tabIds.length; unassignedTabs > 0; unassignedTabs--) { this.tabIds.push(generateTabId()); this.panelIds.push(generatePanelId()); } var childIndex = 0; return React.Children.map(this.props.children, function (child) { var result; // can be null if conditionally rendering TabList / TabPanel if (child == null) { return null; } if (childIndex === 0) { // clone TabList / Tab elements result = _this.cloneTabList(child); } else { var tabPanelIndex = childIndex - 1; var shouldRenderTabPanel = _this.state.selectedTabIndex === tabPanelIndex; result = shouldRenderTabPanel ? _this.cloneTabPanel(child, tabPanelIndex) : null; } childIndex++; return result; }); }; Tabs.prototype.cloneTabList = function (child) { var _this = this; var tabIndex = 0; var tabs = React.Children.map(child.props.children, function (tab) { // can be null if conditionally rendering Tab if (tab == null) { return null; } var clonedTab = React.cloneElement(tab, { id: _this.tabIds[tabIndex], isSelected: _this.state.selectedTabIndex === tabIndex, panelId: _this.panelIds[tabIndex], ref: "tabs-" + tabIndex, }); tabIndex++; return clonedTab; }); return React.cloneElement(child, { children: tabs, indicatorWrapperStyle: this.state.indicatorWrapperStyle, ref: "tablist", }); }; Tabs.prototype.cloneTabPanel = function (child, tabIndex) { return React.cloneElement(child, { id: this.panelIds[tabIndex], isSelected: this.state.selectedTabIndex === tabIndex, ref: "panels-" + tabIndex, tabId: this.tabIds[tabIndex], }); }; Tabs.prototype.focusTab = function (index) { var ref = "tabs-" + index; var tab = react_dom_1.findDOMNode(this.refs[ref]); tab.focus(); }; Tabs.prototype.getFocusedTabIndex = function () { var focusedElement = document.activeElement; if (focusedElement != null && focusedElement.classList.contains(Classes.TAB)) { var tabId = focusedElement.id; return this.tabIds.indexOf(tabId); } return -1; }; Tabs.prototype.getTabs = function () { if (this.props.children == null) { return []; } var tabs = []; if (React.Children.count(this.props.children) > 0) { var firstChild = React.Children.toArray(this.props.children)[0]; if (firstChild != null) { React.Children.forEach(firstChild.props.children, function (tabListChild) { if (tabListChild.type === tab_1.Tab) { tabs.push(tabListChild); } }); } } return tabs; }; Tabs.prototype.getTabsCount = function () { return this.getTabs().length; }; Tabs.prototype.getPanelsCount = function () { if (this.props.children == null) { return 0; } var index = 0; var panelCount = 0; React.Children.forEach(this.props.children, function (child) { if (child.type === tabPanel_1.TabPanel) { panelCount++; } index++; }); return panelCount; }; Tabs.prototype.getStateFromProps = function (props) { var selectedTabIndex = props.selectedTabIndex, initialSelectedTabIndex = props.initialSelectedTabIndex; if (this.isValidTabIndex(selectedTabIndex)) { return { selectedTabIndex: selectedTabIndex }; } else if (this.isValidTabIndex(initialSelectedTabIndex) && this.state.selectedTabIndex == null) { return { selectedTabIndex: initialSelectedTabIndex }; } else { return this.state; } }; Tabs.prototype.isTabDisabled = function (index) { var tab = this.getTabs()[index]; return tab != null && tab.props.isDisabled; }; Tabs.prototype.isValidTabIndex = function (index) { return index != null && index >= 0 && index < this.getTabsCount(); }; /** * Updates the component's state if uncontrolled and calls onChange. */ Tabs.prototype.setSelectedTabIndex = function (index) { if (index === this.state.selectedTabIndex || !this.isValidTabIndex(index)) { return; } var prevSelectedIndex = this.state.selectedTabIndex; if (this.props.selectedTabIndex == null) { this.setState({ selectedTabIndex: index, }); } if (Utils.isFunction(this.props.onChange)) { this.props.onChange(index, prevSelectedIndex); } }; return Tabs; }(abstractComponent_1.AbstractComponent)); Tabs.defaultProps = { initialSelectedTabIndex: 0, }; Tabs = tslib_1.__decorate([ PureRender ], Tabs); exports.Tabs = Tabs; var tabCount = 0; function generateTabId() { return "pt-tab-" + tabCount++; } var panelCount = 0; function generatePanelId() { return "pt-tab-panel-" + panelCount++; } exports.TabsFactory = React.createFactory(Tabs); //# sourceMappingURL=tabs.js.map
module.exports = ({ config, mode }) => { config.module.rules.push({ test: /\.(ts|tsx)$/, use: [ { loader: require.resolve('babel-loader'), options: { presets: [['react-app', { flow: false, typescript: true }]], }, }, require.resolve('react-docgen-typescript-loader'), ], }); config.resolve.extensions.push('.ts', '.tsx'); return config; };
/** * Copyright since 2007 PrestaShop SA and Contributors * PrestaShop is an International Registered Trademark & Property of PrestaShop SA * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) * that is bundled with this package in the file LICENSE.md. * It is also available through the world-wide-web at this URL: * https://opensource.org/licenses/OSL-3.0 * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@prestashop.com so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to https://devdocs.prestashop.com/ for more information. * * @author PrestaShop SA and Contributors <contact@prestashop.com> * @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) */ import Vue from 'vue'; import VueResource from 'vue-resource'; import * as types from '@app/pages/translations/store/mutation-types'; import {showGrowl} from '@app/utils/growl'; Vue.use(VueResource); export const getTranslations = ({commit}) => { const url = window.data.translationUrl; Vue.http.get(url).then( (response) => { commit(types.SET_TRANSLATIONS, response.body); commit(types.APP_IS_READY); }, (error) => { showGrowl('error', error.bodyText ? JSON.parse(error.bodyText).error : error.statusText); }, ); }; export const getCatalog = ({commit}, payload) => { commit(types.PRINCIPAL_LOADING, true); Vue.http .get(payload.url, { params: { page_size: payload.page_size, page_index: payload.page_index, }, }) .then( (response) => { commit(types.SET_TOTAL_PAGES, response.headers.get('Total-Pages')); commit(types.SET_CATALOG, response.body); commit(types.PRINCIPAL_LOADING, false); }, (error) => { showGrowl('error', error.bodyText ? JSON.parse(error.bodyText).error : error.statusText); }, ); }; export const getDomainsTree = ({commit}, payload) => { const url = window.data.domainsTreeUrl; const params = {}; commit(types.SIDEBAR_LOADING, true); commit(types.PRINCIPAL_LOADING, true); if (payload.store.getters.searchTags.length) { params.search = payload.store.getters.searchTags; } Vue.http .get(url, { params, }) .then( (response) => { commit(types.SET_DOMAINS_TREE, response.body); commit(types.SIDEBAR_LOADING, false); commit(types.RESET_CURRENT_DOMAIN); }, (error) => { showGrowl('error', error.bodyText ? JSON.parse(error.bodyText).error : error.statusText); }, ); }; export const refreshCounts = ({commit}, payload) => { const url = window.data.domainsTreeUrl; const params = {}; if (payload.store.getters.searchTags.length) { params.search = payload.store.getters.searchTags; } Vue.http .get(url, { params, }) .then( (response) => { commit(types.DECREASE_CURRENT_DOMAIN_TOTAL_MISSING_TRANSLATIONS, payload.successfullySaved); commit(types.SET_DOMAINS_TREE, response.body); }, (error) => { showGrowl('error', error.bodyText ? JSON.parse(error.bodyText).error : error.statusText); }, ); }; export const saveTranslations = ({commit}, payload) => { const {url} = payload; const {translations} = payload; Vue.http .post(url, { translations, }) .then( () => { payload.store.dispatch('refreshCounts', { successfullySaved: translations.length, store: payload.store, }); commit(types.RESET_MODIFIED_TRANSLATIONS); return showGrowl('success', 'Translations successfully updated'); }, (error) => { showGrowl('error', error.bodyText ? JSON.parse(error.bodyText).error : error.statusText); }, ); }; /* eslint-disable-next-line no-unused-vars */ export const resetTranslation = ({commit}, payload) => { const {url} = payload; const {translations} = payload; Vue.http .post(url, { translations, }) .then( () => { showGrowl('success', 'Translations successfully reset'); }, (error) => { showGrowl('error', error.bodyText ? JSON.parse(error.bodyText).error : error.statusText); }, ); }; export const updatePageIndex = ({commit}, pageIndex) => { commit(types.SET_PAGE_INDEX, pageIndex); }; export const updateCurrentDomain = ({commit}, currentDomain) => { commit(types.SET_CURRENT_DOMAIN, currentDomain); }; export const updatePrincipalLoading = ({commit}, principalLoading) => { commit(types.PRINCIPAL_LOADING, principalLoading); }; export const updateSearch = ({commit}, searchTags) => { commit(types.SEARCH_TAGS, searchTags); };
import { useState, useEffect, useContext } from 'react'; import { FirebaseContext } from '../context/firebase'; export default function useAuthListener() { const [user, setUser] = useState(JSON.parse(localStorage.getItem('authUser'))); const { firebase } = useContext(FirebaseContext); useEffect(() => { const listener = firebase.auth().onAuthStateChanged((authUser) => { if (authUser) { localStorage.setItem('authUser', JSON.stringify(authUser)); setUser(authUser); } else { localStorage.removeItem('authUser'); setUser(null); } }); return () => listener(); }, []); return { user }; }
"use strict"; var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result["default"] = mod; return result; }; Object.defineProperty(exports, "__esModule", { value: true }); var _ = __importStar(require("lodash")); var VCLTxProvider = (function () { function VCLTxProvider() { this.lib = require('vircle-lib'); } VCLTxProvider.prototype.selectCoins = function (recipients, utxos, fee) { utxos = utxos.sort(function (a, b) { return a.mintHeight - b.mintHeight; }); var index = 0; var utxoSum = 0; var recepientSum = recipients.reduce(function (sum, cur) { return sum + Number(cur.amount); }, fee); while (utxoSum < recepientSum) { var utxo = utxos[index]; utxoSum += Number(utxo.value); index += 1; } var filteredUtxos = utxos.slice(0, index); return filteredUtxos; }; VCLTxProvider.prototype.create = function (_a) { var _this = this; var recipients = _a.recipients, _b = _a.utxos, utxos = _b === void 0 ? [] : _b, change = _a.change, wallet = _a.wallet, feeRate = _a.feeRate, fee = _a.fee; change = change || wallet.deriveAddress(wallet.addressIndex, true); var filteredUtxos = this.selectCoins(recipients, utxos, fee); var btcUtxos = filteredUtxos.map(function (utxo) { var btcUtxo = Object.assign({}, utxo, { amount: utxo.value / 1e8, txid: utxo.mintTxid, outputIndex: utxo.mintIndex }); return new _this.lib.Transaction.UnspentOutput(btcUtxo); }); var tx = new this.lib.Transaction().from(btcUtxos); if (fee) { tx.fee(fee); } if (feeRate) { tx.feePerByte(Number(feeRate)); } if (change) { tx.change(change); } for (var _i = 0, recipients_1 = recipients; _i < recipients_1.length; _i++) { var recipient = recipients_1[_i]; tx.to(recipient.address, parseInt(recipient.amount)); } return tx.uncheckedSerialize(); }; VCLTxProvider.prototype.getSignature = function (params) { throw new Error('function getSignature not implemented for UTXO coins'); }; VCLTxProvider.prototype.applySignature = function (params) { throw new Error('function applySignature not implemented for UTXO coins'); }; VCLTxProvider.prototype.getHash = function (params) { var bitcoreTx = new this.lib.Transaction(params.tx); return bitcoreTx.hash; }; VCLTxProvider.prototype.sign = function (params) { var tx = params.tx, keys = params.keys, pubkeys = params.pubkeys, threshold = params.threshold, opts = params.opts; var utxos = params.utxos || []; var inputAddresses = this.getSigningAddresses({ tx: tx, utxos: utxos }); var bitcoreTx = new this.lib.Transaction(tx); var applicableUtxos = this.getRelatedUtxos({ outputs: bitcoreTx.inputs, utxos: utxos }); bitcoreTx.associateInputs(applicableUtxos, pubkeys, threshold, opts); var privKeys = _.uniq(keys.map(function (key) { return key.privKey.toString(); })); var signedTx = bitcoreTx.sign(privKeys).toString(); return signedTx; }; VCLTxProvider.prototype.getRelatedUtxos = function (_a) { var _this = this; var outputs = _a.outputs, utxos = _a.utxos; var txids = outputs.map(function (output) { return output.toObject().prevTxId; }); var applicableUtxos = utxos.filter(function (utxo) { return txids.includes(utxo.txid || utxo.mintTxid); }); return applicableUtxos.map(function (utxo) { var btcUtxo = Object.assign({}, utxo, { amount: utxo.value / Math.pow(10, 8), txid: utxo.mintTxid, outputIndex: utxo.mintIndex }); return new _this.lib.Transaction.UnspentOutput(btcUtxo); }); }; VCLTxProvider.prototype.getOutputsFromTx = function (_a) { var tx = _a.tx; return tx.outputs.map(function (_a) { var script = _a.script, satoshis = _a.satoshis; var address = script; return { address: address, satoshis: satoshis }; }); }; VCLTxProvider.prototype.getSigningAddresses = function (_a) { var tx = _a.tx, utxos = _a.utxos; var bitcoreTx = new this.lib.Transaction(tx); var applicableUtxos = this.getRelatedUtxos({ outputs: bitcoreTx.inputs, utxos: utxos }); return applicableUtxos.map(function (utxo) { return utxo.address; }); }; return VCLTxProvider; }()); exports.VCLTxProvider = VCLTxProvider; //# sourceMappingURL=index.js.map
window.onload = function() { var viewModel = { chartOptions: { type: "doughnut", dataSource: dataSource, palette: "Soft Pastel", title: "Olympic Medals in 2008", legend: { horizontalAlignment: "right", verticalAlignment: "top", margin: 0 }, onPointClick: function(arg) { arg.target.select(); }, "export": { enabled: true }, series: [{ argumentField: "country", valueField: "medals", hoverStyle: { color: "#ffd700" } }] } }; ko.applyBindings(viewModel, document.getElementById("chart-demo")); };
import { Controller } from 'stimulus' import dompurify from 'dompurify' import globalEventBus from '../services/event_bus_service' import ws from '../services/messagesocket_service' const conversionRate = 100000000 function makeNode (html) { var div = document.createElement('div') div.innerHTML = dompurify.sanitize(html) return div.firstChild } function makeMempoolBlock (block) { let fees = 0 if (!block.Transactions) return for (const tx of block.Transactions) { fees += tx.Fees } return makeNode(`<div class="block visible"> <div class="block-info"> <a class="color-code" href="/mempool">Mempool</a> <div class="mono" style="line-height: 1;">${Math.floor(block.Total)} DCR</div> <span class="timespan"> <span data-target="time.age" data-age="${block.Time}"></span> </span> </div> <div class="block-rows"> ${makeRewardsElement(block.Subsidy, fees, block.Votes.length, '#')} ${makeVoteElements(block.Votes)} ${makeTicketAndRevocationElements(block.Tickets, block.Revocations, '/mempool')} ${makeTransactionElements(block.Transactions, '/mempool')} </div> </div>` ) } function newBlockHtmlElement (block) { let rewardTxId for (const tx of block.Transactions) { if (tx.Coinbase) { rewardTxId = tx.TxID break } } return makeNode(`<div class="block visible"> ${makeBlockSummary(block.Height, block.Total, block.Time)} <div class="block-rows"> ${makeRewardsElement(block.Subsidy, block.MiningFee, block.Votes.length, rewardTxId)} ${makeVoteElements(block.Votes)} ${makeTicketAndRevocationElements(block.Tickets, block.Revocations, `/block/${block.Height}`)} ${makeTransactionElements(block.Transactions, `/block/${block.Height}`)} </div> </div>` ) } function makeBlockSummary (blockHeight, totalSent, time) { return `<div class="block-info"> <a class="color-code" href="/block/${blockHeight}">${blockHeight}</a> <div class="mono" style="line-height: 1;">${Math.floor(totalSent)} DCR</div> <span class="timespan"> <span data-target="time.age" data-age="${time}"></span>&nbsp;ago </span> </div>` } function makeRewardsElement (subsidy, fee, voteCount, rewardTxId) { if (!subsidy) { return `<div class="block-rewards"> <span class="pow"><span class="paint" style="width:100%;"></span></span> <span class="pos"><span class="paint" style="width:100%;"></span></span> <span class="fund"><span class="paint" style="width:100%;"></span></span> <span class="fees" title='{"object": "Tx Fees", "total": "${fee}"}'></span> </div>` } const pow = subsidy.pow / conversionRate const pos = subsidy.pos / conversionRate const fund = (subsidy.developer || subsidy.dev) / conversionRate const backgroundColorRelativeToVotes = `style="width: ${voteCount * 20}%"` // 5 blocks = 100% painting // const totalDCR = Math.round(pow + fund + fee); const totalDCR = 1 return `<div class="block-rewards" style="flex-grow: ${totalDCR}"> <span class="pow" style="flex-grow: ${pow}" title='{"object": "PoW Reward", "total": "${pow}"}'> <a class="block-element-link" href="/tx/${rewardTxId}"> <span class="paint" ${backgroundColorRelativeToVotes}></span> </a> </span> <span class="pos" style="flex-grow: ${pos}" title='{"object": "PoS Reward", "total": "${pos}"}'> <a class="block-element-link" href="/tx/${rewardTxId}"> <span class="paint" ${backgroundColorRelativeToVotes}></span> </a> </span> <span class="fund" style="flex-grow: ${fund}" title='{"object": "Project Fund", "total": "${fund}"}'> <a class="block-element-link" href="/tx/${rewardTxId}"> <span class="paint" ${backgroundColorRelativeToVotes}></span> </a> </span> <span class="fees" style="flex-grow: ${fee}" title='{"object": "Tx Fees", "total": "${fee}"}'> <a class="block-element-link" href="/tx/${rewardTxId}"></a> </span> </div>` } function makeVoteElements (votes) { let totalDCR = 0 const voteElements = (votes || []).map(vote => { totalDCR += vote.Total return `<span style="background-color: ${vote.VoteValid ? '#2971ff' : 'rgba(253, 113, 74, 0.8)'}" title='{"object": "Vote", "total": "${vote.Total}", "voteValid": "${vote.VoteValid}"}'> <a class="block-element-link" href="/tx/${vote.TxID}"></a> </span>` }) // append empty squares to votes for (var i = voteElements.length; i < 5; i++) { voteElements.push('<span title="Empty vote slot"></span>') } // totalDCR = Math.round(totalDCR); totalDCR = 1 return `<div class="block-votes" style="flex-grow: ${totalDCR}"> ${voteElements.join('\n')} </div>` } function makeTicketAndRevocationElements (tickets, revocations, blockHref) { let totalDCR = 0 const ticketElements = (tickets || []).map(ticket => { totalDCR += ticket.Total return makeTxElement(ticket, 'block-ticket', 'Ticket') }) if (ticketElements.length > 50) { const total = ticketElements.length ticketElements.splice(30) ticketElements.push(`<span class="block-ticket" style="flex-grow: 10; flex-basis: 50px;" title="Total of ${total} tickets"> <a class="block-element-link" href="${blockHref}">+ ${total - 30}</a> </span>`) } const revocationElements = (revocations || []).map(revocation => { totalDCR += revocation.Total return makeTxElement(revocation, 'block-rev', 'Revocation') }) const ticketsAndRevocationElements = ticketElements.concat(revocationElements) // append empty squares to tickets+revs for (var i = ticketsAndRevocationElements.length; i < 20; i++) { ticketsAndRevocationElements.push('<span title="Empty ticket slot"></span>') } // totalDCR = Math.round(totalDCR); totalDCR = 1 return `<div class="block-tickets" style="flex-grow: ${totalDCR}"> ${ticketsAndRevocationElements.join('\n')} </div>` } function makeTransactionElements (transactions, blockHref) { let totalDCR = 0 const transactionElements = (transactions || []).map(tx => { totalDCR += tx.Total return makeTxElement(tx, 'block-tx', 'Transaction', true) }) if (transactionElements.length > 50) { const total = transactionElements.length transactionElements.splice(30) transactionElements.push(`<span class="block-tx" style="flex-grow: 10; flex-basis: 50px;" title="Total of ${total} transactions"> <a class="block-element-link" href="${blockHref}">+ ${total - 30}</a> </span>`) } // totalDCR = Math.round(totalDCR); totalDCR = 1 return `<div class="block-transactions" style="flex-grow: ${totalDCR}"> ${transactionElements.join('\n')} </div>` } function makeTxElement (tx, className, type, appendFlexGrow) { // const style = [ `opacity: ${(tx.VinCount + tx.VoutCount) / 10}` ]; const style = [] if (appendFlexGrow) { style.push(`flex-grow: ${Math.round(tx.Total)}`) } return `<span class="${className}" style="${style.join('; ')}" title='{"object": "${type}", "total": "${tx.Total}", "vout": "${tx.VoutCount}", "vin": "${tx.VinCount}"}'> <a class="block-element-link" href="/tx/${tx.TxID}"></a> </span>` } export default class extends Controller { static get targets () { return ['box', 'title', 'showmore', 'root', 'txs', 'tooltip', 'block'] } connect () { this.handleNextHomeBlockUpdate = this._handleNextHomeBlockUpdate.bind(this) globalEventBus.on('BLOCK_RECEIVED', this.handleNextHomeBlockUpdate) ws.registerEvtHandler('getmempooltrimmedResp', (event) => { console.log('received mempooltx response', event) this.handleMempoolUpdate(event) }) ws.registerEvtHandler('mempool', (event) => { ws.send('getmempooltrimmed', '') }) this.refreshBlocksDisplay = this._refreshBlocksDisplay.bind(this) // on load (js file is loaded after loading html content) window.addEventListener('resize', this.refreshBlocksDisplay) // allow some ms for page to properly render blocks before refreshing display setTimeout(this.refreshBlocksDisplay, 500) } disconnect () { ws.deregisterEvtHandlers('getmempooltrimmedResp') ws.deregisterEvtHandlers('mempool') globalEventBus.off('BLOCK_RECEIVED', this.handleNextHomeBlockUpdate) window.removeEventListener('resize', this.refreshBlocksDisplay) } _handleNextHomeBlockUpdate (newBlock) { let block = newBlock.block // show only regular tx in block.Transactions, exclude coinbase (reward) transactions const transactions = block.Tx.filter(tx => !tx.Coinbase) // trim unwanted data in this block const trimmedBlockInfo = { Time: block.time, Height: block.height, Total: block.TotalSent, MiningFee: block.MiningFee, Subsidy: block.Subsidy, Votes: block.Votes, Tickets: block.Tickets, Revocations: block.Revs, Transactions: transactions } var box = this.boxTarget box.insertBefore(newBlockHtmlElement(trimmedBlockInfo), box.firstChild.nextSibling) // hide last visible block as 1 more block is now visible var vis = this.visibleBlocks() vis[vis.length - 1].classList.remove('visible') // remove last block from dom to maintain max of 30 blocks (hidden or visible) in dom at any time box.removeChild(box.lastChild) this.setupTooltips() } handleMempoolUpdate (evt) { const mempool = JSON.parse(evt) mempool.Time = Math.round((new Date()).getTime() / 1000) this.boxTarget.replaceChild(makeMempoolBlock(mempool), this.boxTarget.firstChild) this.setupTooltips() } _refreshBlocksDisplay () { const visibleBlockElements = this.visibleBlocks() const currentlyDisplayedBlockCount = visibleBlockElements.length const maxBlockElements = this.calculateMaximumNumberOfBlocksToDisplay(visibleBlockElements[0]) if (currentlyDisplayedBlockCount > maxBlockElements) { // remove the last x blocks for (let i = currentlyDisplayedBlockCount; i >= maxBlockElements; i--) { visibleBlockElements[i - 1].classList.remove('visible') } } else { const allBlockElements = this.blockTargets // add more blocks to fill display for (let i = currentlyDisplayedBlockCount; i < maxBlockElements; i++) { allBlockElements[i].classList.add('visible') } } this.setupTooltips() } calculateMaximumNumberOfBlocksToDisplay (blockElement) { const blocksSection = this.rootTarget.getBoundingClientRect() const margin = 20 const blocksSectionFirstChildHeight = this.titleTarget.offsetHeight + margin const blocksSectionLastChildHeight = this.showmoreTarget.offsetHeight + margin // make blocks section fill available window height const extraSpace = window.innerHeight - document.getElementById('mainContainer').offsetHeight let blocksSectionHeight = blocksSection.height + extraSpace const totalAvailableWidth = blocksSection.width let totalAvailableHeight = blocksSectionHeight - blocksSectionFirstChildHeight - blocksSectionLastChildHeight const rect = blockElement.getBoundingClientRect() const blockWidth = rect.width const blockHeight = rect.height + margin // for spacing between rows const maxBlocksPerRow = Math.floor(totalAvailableWidth / blockWidth) let maxBlockRows = Math.floor(totalAvailableHeight / blockHeight) let maxBlockElements = maxBlocksPerRow * maxBlockRows const totalBlocksDisplayable = this.boxTarget.childElementCount while (maxBlockElements > totalBlocksDisplayable) { maxBlockRows-- maxBlockElements = maxBlocksPerRow * maxBlockRows } return maxBlockElements } setupTooltips () { // check for emtpy tx rows and set custom tooltip this.txsTargets.forEach((div) => { if (div.childeElementCount === 0) { div.title = 'No regular transaction in block' } }) this.tooltipTargets.forEach((tooltipElement) => { try { // parse the content var data = JSON.parse(tooltipElement.title) var newContent if (data.object === 'Vote') { newContent = `<b>${data.object} (${data.voteValid ? 'Yes' : 'No'})</b>` } else { newContent = `<b>${data.object}</b><br>${data.total} DCR` } if (data.vin && data.vout) { newContent += `<br>${data.vin} Inputs, ${data.vout} Outputs` } tooltipElement.title = newContent } catch (error) {} }) import(/* webpackChunkName: "tippy" */ '../vendor/tippy.all').then(module => { var tippy = module.default tippy('.block-rows [title]', { allowTitleHTML: true, animation: 'shift-away', arrow: true, createPopperInstanceOnInit: true, dynamicTitle: true, performance: true, placement: 'top', size: 'small', sticky: true, theme: 'light' }) }) } visibleBlocks () { return this.boxTarget.querySelectorAll('.visible') } }
import React, {useEffect, useState, useRef} from 'react'; import {useWindowDimensions, View, StatusBar} from 'react-native'; import SplashScreen from 'react-native-splash-screen'; import auth from '@react-native-firebase/auth'; import {theme} from 'App/theme'; import strings from '../../constants/strings'; import {showShortSnackBar} from '../../components/snackBar'; import screenNames from 'App/constants/screenNames'; import {LogoContainer, LoginInputContainer} from '../../styles/wrappers'; import {LogoImage} from '../../styles/images'; import {LogoText} from '../../styles/texts'; import {LoginInput} from '../../styles/inputs'; import {LoginButton} from '../../styles/buttons'; import firestore from '@react-native-firebase/firestore'; import {useDispatch} from 'react-redux'; import actionTypes from 'App/constants/actionTypes'; // eslint-disable-next-line react/prop-types function Login({navigation}) { const dispatch = useDispatch(); const {height, width} = useWindowDimensions(); const [noUser, setNoUser] = useState(false); const [userName, setUserName] = useState(''); const [password, setPassword] = useState(''); const [loadingIndicator, setLoadingIndicator] = useState(false); const userNameInputRef = useRef(); const passwordInputRef = useRef(); const focusUserInput = () => userNameInputRef.current.focus(); const focusPasswordInput = () => passwordInputRef.current.focus(); useEffect(() => { SplashScreen.hide(); focusUserInput(); }, []); const loginUser = async (userName, password) => { try { const user = await auth().signInWithEmailAndPassword(userName, password); const userDetail = {email: user.user.email, uid: user.user.uid}; // setUserDetails(userDetail); dispatch({type: actionTypes.SET_USER, payload: userDetail}); navigation.push(screenNames.homeNavigator, { screen: screenNames.home, }); setLoadingIndicator(false); } catch (error) { setLoadingIndicator(false); if (error.code === 'auth/user-not-found') { setNoUser(true); showShortSnackBar('Signup to continue'); } else { showShortSnackBar(strings.WRONG_ALERT); } } }; const newUser = async (userName, password) => { try { const user = await auth().createUserWithEmailAndPassword( userName, password, ); const currentDate = firestore.Timestamp.fromDate(new Date()); firestore().collection('Users').add({ email: user.user.email, uid: user.user.uid, date: currentDate, }); const userDetail = {email: user.user.email, uid: user.user.uid}; // setUserDetails(userDetail); dispatch({type: actionTypes.SET_USER, payload: userDetail}); navigation.push(screenNames.homeNavigator, { screen: screenNames.home, }); setLoadingIndicator(false); } catch (error) { setLoadingIndicator(false); if (error.code === 'auth/email-already-in-use') { showShortSnackBar(strings.EMAIL_IN_USE); setNoUser(false); } if (error.code === 'auth/invalid-email') { showShortSnackBar(strings.EMAIL_INVALID); } if (error.code === 'auth/weak-password') { showShortSnackBar(strings.WEAK_PASSWORD); } } }; return ( <View> <StatusBar barStyle="light-content" /> <LogoContainer landscapeMode={height > width ? false : true}> <LogoImage landscapeMode={height > width ? false : true} resizeMode="contain" source={require('../../assets/images/picaday.png')} /> <LogoText>{strings.TAG_LINE}</LogoText> </LogoContainer> <LoginInputContainer landscapeMode={height > width ? false : true}> <LoginInput autoCapitalize="none" ref={userNameInputRef} autoCorrect={false} value={userName} onChangeText={newText => setUserName(newText)} placeholder="email" placeholderTextColor="gray" returnKeyType="next" landscapeMode={height > width ? false : true} onSubmitEditing={focusPasswordInput} /> <LoginInput autoCapitalize="none" ref={passwordInputRef} autoCorrect={false} value={password} onChangeText={newText => setPassword(newText)} textContentType="password" placeholder="password" placeholderTextColor="gray" returnKeyType="done" password landscapeMode={height > width ? false : true} /> <LoginButton onPress={() => { if (userName !== '' && password !== '') { setLoadingIndicator(true); if (noUser) newUser(userName, password); else loginUser(userName, password); } else { showShortSnackBar('Please enter email/password'); } }} landscapeMode={height > width ? false : true} loadingIndicator={loadingIndicator} size="small" color={theme.colors.white} text={noUser ? strings.SIGN_UP : strings.SIGN_IN} /> </LoginInputContainer> </View> ); } // export default connect(null, actions)(Login); export default Login;
import express from 'express'; import path from 'path'; import kraken from 'kraken-js'; import braintree from 'braintree'; import paypal from 'paypal-rest-sdk'; import PayPal from 'paypal-classic-api'; let app = express(); let krakenOpts = { onconfig: (config, callback) => { let btConfig = config.get('braintreeConfig'); btConfig.environment = btConfig.enviroment === 'Production' ? braintree.Environment.Production : braintree.Environment.Sandbox; let btGateway = braintree.connect(btConfig); config.set('btGateway', btGateway); let restConfig = config.get('paypalRestConfig'); paypal.configure(restConfig); config.set('paypalRest', paypal); let classicConfig = config.get('paypalClassicConfig'); let paypalClassic = new PayPal(classicConfig); config.set('paypalClassic', paypalClassic); let c9config = config.get('cloud9'); console.log('Visit https://' + c9config.workspace + '-' + c9config.username + '.c9users.io/'); callback(null, config); } }; app.use(kraken(krakenOpts)); app.use(express.static(path.resolve(__dirname, '../client'))); let port = process.env.PORT || 8080; let ip = process.env.IP || '0.0.0.0'; let server = app.listen(port, ip); server.on('listening', () => { console.log('Server running on ' + server.address().address + ' on port ' + server.address().port + '!'); });
module.exports = { verbose: true, setupTestFrameworkScriptFile: '<rootDir>/setupTests.js', moduleFileExtensions: ['js', 'jsx'], testPathIgnorePatterns: [ '<rootDir>/node_modules/', '<rootDir>/__tests__/__mocks__/' ], moduleNameMapper: { '^api(.*)$': '<rootDir>/src/api$1', '^assets(.*)$': '<rootDir>/src/assets$1', '^components(.*)$': '<rootDir>/src/components$1', '^contexts(.*)$': '<rootDir>/src/contexts$1', '^helpers(.*)$': '<rootDir>/src/helpers$1' }, transform: { '^.+\\.(js|jsx)$': 'babel-jest', '\\.(css|scss)$': '<rootDir>/config/jest/mediaFileTransformer.js', '\\.(bmp|gif|jpg|jpeg|png|psd|svg|webp)$': '<rootDir>/config/jest/mediaFileTransformer.js' } };
import { Form, Button } from 'antd'; import BaseInfo from './BaseInfo.js'; import ReportInfo from './ReportInfo'; import DiagnoseInfo from './DiagnoseInfo.js'; import styles from './index.less'; class CustomerDetail extends React.Component { constructor(props) { super(props); this.state = {}; this.handleSave = this.handleSave.bind(this); } handleSave() { const { form } = this.props; const { validateFieldsAndScroll } = form; validateFieldsAndScroll((err, values) => { if (!err) { console.log(values); } }); } render() { const { form, toList } = this.props; const baseInfoProps = { form, }; return ( <div className={styles.caseDetail}> <BaseInfo {...baseInfoProps} /> <ReportInfo {...baseInfoProps} /> <DiagnoseInfo {...baseInfoProps} /> <div className="btnGroup part"> <Button type="primary" onClick={this.handleSave}>保存</Button> <Button onClick={toList}>取消</Button> </div> </div > ); } } export default Form.create()(CustomerDetail);
import React, { Component } from 'react'; import { Row, Col } from 'antd'; import { connect } from 'dva'; import PropTypes from 'prop-types'; /** */ class UserLayout extends Component { /** 预挂载 */ componentDidMount() { } /** 组件挂载 */ render() { const { children } = this.props; return ( <Row> <div style={{ position: 'absolute', zIndex: -10 }}> <img src="./bg.svg" alt="" style={{ height: '100vh', width: '100%' }} /> </div> <Col span={6} offset={9} style={{ overflow: 'hidden', height: '100vh', paddingTop: 50 }} > {children} </Col> </Row> ); } } UserLayout.defaultProps = { children: '' }; UserLayout.propTypes = { children: PropTypes.any }; export default connect(({ menu: menuModel }) => ({ menuData: menuModel.menuData, breadcrumbNameMap: menuModel.breadcrumbNameMap, }))(UserLayout);
'use strict' module.exports = { 'Local login test': function (browser) { browser .url(browser.launchUrl + '/login') .waitForElementVisible('body', 1000) .assert.title('nuxt-e2e-tests') .assert.containsText('h1', 'Please login to see the secret content') .assert.visible('input[type=text][name=username]') .assert.visible('input[type=password][name=password]') .setValue('input[type=text][name=username]', 'demo') .setValue('input[type=password][name=password]', '123123') .click('button[type=submit]') .pause(1000) .assert.containsText('h2', 'Hello Alexandre!') .end() }, }
import { Menu } from "antd"; import Link from "next/link"; const { SubMenu } = Menu; const getBase64 = file => { return new Promise((resolve, reject) => { const reader = new FileReader(); reader.readAsDataURL(file); reader.onload = () => resolve(reader.result); reader.onerror = error => reject(error); }); }; const getUrlWithTransforms = publicId => { return `https://res.cloudinary.com/dbvfkfj4d/image/upload/c_scale,w_150/v1570726181/${publicId}`; }; const combine = arg => { var r = [], max = arg.length - 1; function helper(arr, i) { for (var j = 0, l = arg[i].length; j < l; j++) { var a = arr.slice(0); // clone arr a.push(arg[i][j]); if (i == max) r.push(a); else helper(a, i + 1); } } helper([], 0); return r; }; const tagColors = ["geekblue", "blue", "cyan"]; const subMenus = menuConfig => { return menuConfig.subMenus.map(submenu => { return ( <SubMenu key={submenu.key} title={ <span> {submenu.icon} <span>{submenu.title}</span> </span> } > {menuConfig.menuItems.map(item => { if (item.parentKey === submenu.key && !item.hideInMenu) { return ( <Menu.Item key={item.key}> <Link href={item.path}> <a> {item.icon} <span>{item.title}</span> </a> </Link> </Menu.Item> ); } })} </SubMenu> ); }); }; const menuItems = items => { return items.map(item => { if (!item.parentKey && !item.hideInMenu && item.key !== "0") { return ( <Menu.Item key={item.key}> <Link href={item.path}> <a> {item.icon} <span>{item.title}</span> </a> </Link> </Menu.Item> ); } }); }; const firstMenuItem = menuItems => { const firstItem = menuItems.find(item => item.key === "0"); return ( <Menu.Item key={firstItem.key}> <Link href={firstItem.path}> <a> {firstItem.icon} <span>{firstItem.title}</span> </a> </Link> </Menu.Item> ); }; const createMenu = menuConfig => { const menu = []; menu.push( firstMenuItem(menuConfig.menuItems), subMenus(menuConfig), menuItems(menuConfig.menuItems) ); return menu; }; export { getBase64, getUrlWithTransforms, combine, tagColors, createMenu };
import React from "react" import styles from "./user.module.css" const User = props => ( <div className={styles.user}> {/* <img src={props.avatar} className={styles.avatar} alt="Written by" /> */} <span>Written by</span> <div className={styles.description}> <a href={props.handle} target="_blank" rel="noopener noreferrer"> <h2 className={styles.user}>{props.writer}</h2> </a> <p className={styles.excerpt}>{props.excerpt}</p> </div> </div> ) export default User
/*! SmartAdmin - v1.5.2 - 2015-04-23 */var TableTools;!function(a,b,c){var d=function(d,e){"use strict";var f={"version":"1.0.4-TableTools2","clients":{},"moviePath":"","nextId":1,"$":function(a){return"string"==typeof a&&(a=b.getElementById(a)),a.addClass||(a.hide=function(){this.style.display="none"},a.show=function(){this.style.display=""},a.addClass=function(a){this.removeClass(a),this.className+=" "+a},a.removeClass=function(a){this.className=this.className.replace(new RegExp("\\s*"+a+"\\s*")," ").replace(/^\s+/,"").replace(/\s+$/,"")},a.hasClass=function(a){return!!this.className.match(new RegExp("\\s*"+a+"\\s*"))}),a},"setMoviePath":function(a){this.moviePath=a},"dispatch":function(a,b,c){var d=this.clients[a];d&&d.receiveEvent(b,c)},"register":function(a,b){this.clients[a]=b},"getDOMObjectPosition":function(a){var b={"left":0,"top":0,"width":a.width?a.width:a.offsetWidth,"height":a.height?a.height:a.offsetHeight};for(""!==a.style.width&&(b.width=a.style.width.replace("px","")),""!==a.style.height&&(b.height=a.style.height.replace("px",""));a;)b.left+=a.offsetLeft,b.top+=a.offsetTop,a=a.offsetParent;return b},"Client":function(a){this.handlers={},this.id=f.nextId++,this.movieId="ZeroClipboard_TableToolsMovie_"+this.id,f.register(this.id,this),a&&this.glue(a)}};return f.Client.prototype={"id":0,"ready":!1,"movie":null,"clipText":"","fileName":"","action":"copy","handCursorEnabled":!0,"cssEffects":!0,"handlers":null,"sized":!1,"glue":function(a,c){this.domElement=f.$(a);var d=99;this.domElement.style.zIndex&&(d=parseInt(this.domElement.style.zIndex,10)+1);var e=f.getDOMObjectPosition(this.domElement);this.div=b.createElement("div");var g=this.div.style;g.position="absolute",g.left="0px",g.top="0px",g.width=e.width+"px",g.height=e.height+"px",g.zIndex=d,"undefined"!=typeof c&&""!==c&&(this.div.title=c),0!==e.width&&0!==e.height&&(this.sized=!0),this.domElement&&(this.domElement.appendChild(this.div),this.div.innerHTML=this.getHTML(e.width,e.height).replace(/&/g,"&amp;"))},"positionElement":function(){var a=f.getDOMObjectPosition(this.domElement),b=this.div.style;if(b.position="absolute",b.width=a.width+"px",b.height=a.height+"px",0!==a.width&&0!==a.height){this.sized=!0;var c=this.div.childNodes[0];c.width=a.width,c.height=a.height}},"getHTML":function(a,b){var c="",d="id="+this.id+"&width="+a+"&height="+b;if(navigator.userAgent.match(/MSIE/)){var e=location.href.match(/^https/i)?"https://":"http://";c+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="'+e+'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="'+a+'" height="'+b+'" id="'+this.movieId+'" align="middle"><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="false" /><param name="movie" value="'+f.moviePath+'" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="quality" value="best" /><param name="bgcolor" value="#ffffff" /><param name="flashvars" value="'+d+'"/><param name="wmode" value="transparent"/></object>'}else c+='<embed id="'+this.movieId+'" src="'+f.moviePath+'" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="'+a+'" height="'+b+'" name="'+this.movieId+'" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="'+d+'" wmode="transparent" />';return c},"hide":function(){this.div&&(this.div.style.left="-2000px")},"show":function(){this.reposition()},"destroy":function(){if(this.domElement&&this.div){this.hide(),this.div.innerHTML="";var a=b.getElementsByTagName("body")[0];try{a.removeChild(this.div)}catch(c){}this.domElement=null,this.div=null}},"reposition":function(a){if(a&&(this.domElement=f.$(a),this.domElement||this.hide()),this.domElement&&this.div){var b=f.getDOMObjectPosition(this.domElement),c=this.div.style;c.left=""+b.left+"px",c.top=""+b.top+"px"}},"clearText":function(){this.clipText="",this.ready&&this.movie.clearText()},"appendText":function(a){this.clipText+=a,this.ready&&this.movie.appendText(a)},"setText":function(a){this.clipText=a,this.ready&&this.movie.setText(a)},"setCharSet":function(a){this.charSet=a,this.ready&&this.movie.setCharSet(a)},"setBomInc":function(a){this.incBom=a,this.ready&&this.movie.setBomInc(a)},"setFileName":function(a){this.fileName=a,this.ready&&this.movie.setFileName(a)},"setAction":function(a){this.action=a,this.ready&&this.movie.setAction(a)},"addEventListener":function(a,b){a=a.toString().toLowerCase().replace(/^on/,""),this.handlers[a]||(this.handlers[a]=[]),this.handlers[a].push(b)},"setHandCursor":function(a){this.handCursorEnabled=a,this.ready&&this.movie.setHandCursor(a)},"setCSSEffects":function(a){this.cssEffects=!!a},"receiveEvent":function(c,d){var e;switch(c=c.toString().toLowerCase().replace(/^on/,"")){case"load":if(this.movie=b.getElementById(this.movieId),!this.movie)return e=this,void setTimeout(function(){e.receiveEvent("load",null)},1);if(!this.ready&&navigator.userAgent.match(/Firefox/)&&navigator.userAgent.match(/Windows/))return e=this,setTimeout(function(){e.receiveEvent("load",null)},100),void(this.ready=!0);this.ready=!0,this.movie.clearText(),this.movie.appendText(this.clipText),this.movie.setFileName(this.fileName),this.movie.setAction(this.action),this.movie.setCharSet(this.charSet),this.movie.setBomInc(this.incBom),this.movie.setHandCursor(this.handCursorEnabled);break;case"mouseover":this.domElement&&this.cssEffects&&this.recoverActive&&this.domElement.addClass("active");break;case"mouseout":this.domElement&&this.cssEffects&&(this.recoverActive=!1,this.domElement.hasClass("active")&&(this.domElement.removeClass("active"),this.recoverActive=!0));break;case"mousedown":this.domElement&&this.cssEffects&&this.domElement.addClass("active");break;case"mouseup":this.domElement&&this.cssEffects&&(this.domElement.removeClass("active"),this.recoverActive=!1)}if(this.handlers[c])for(var f=0,g=this.handlers[c].length;g>f;f++){var h=this.handlers[c][f];"function"==typeof h?h(this,d):"object"==typeof h&&2==h.length?h[0][h[1]](this,d):"string"==typeof h&&a[h](this,d)}}},a.ZeroClipboard_TableTools=f,function(a,b,d){TableTools=function(b,c){!this instanceof TableTools&&alert("Warning: TableTools must be initialised with the keyword 'new'");var d=a.fn.dataTable.Api?new a.fn.dataTable.Api(b).settings()[0]:b.fnSettings();return this.s={"that":this,"dt":d,"print":{"saveStart":-1,"saveLength":-1,"saveScroll":-1,"funcEnd":function(){}},"buttonCounter":0,"select":{"type":"","selected":[],"preRowSelect":null,"postSelected":null,"postDeselected":null,"all":!1,"selectedClass":""},"custom":{},"swfPath":"","buttonSet":[],"master":!1,"tags":{}},this.dom={"container":null,"table":null,"print":{"hidden":[],"message":null},"collection":{"collection":null,"background":null}},this.classes=a.extend(!0,{},TableTools.classes),this.s.dt.bJUI&&a.extend(!0,this.classes,TableTools.classes_themeroller),this.fnSettings=function(){return this.s},"undefined"==typeof c&&(c={}),TableTools._aInstances.push(this),this._fnConstruct(c),this},TableTools.prototype={"fnGetSelected":function(a){var b,c,d=[],e=this.s.dt.aoData,f=this.s.dt.aiDisplay;if(a)for(b=0,c=f.length;c>b;b++)e[f[b]]._DTTT_selected&&d.push(e[f[b]].nTr);else for(b=0,c=e.length;c>b;b++)e[b]._DTTT_selected&&d.push(e[b].nTr);return d},"fnGetSelectedData":function(){var a,b,c=[],d=this.s.dt.aoData;for(a=0,b=d.length;b>a;a++)d[a]._DTTT_selected&&c.push(this.s.dt.oInstance.fnGetData(a));return c},"fnGetSelectedIndexes":function(a){var b,c,d=[],e=this.s.dt.aoData,f=this.s.dt.aiDisplay;if(a)for(b=0,c=f.length;c>b;b++)e[f[b]]._DTTT_selected&&d.push(f[b]);else for(b=0,c=e.length;c>b;b++)e[b]._DTTT_selected&&d.push(b);return d},"fnIsSelected":function(a){var b=this.s.dt.oInstance.fnGetPosition(a);return this.s.dt.aoData[b]._DTTT_selected===!0?!0:!1},"fnSelectAll":function(a){this._fnRowSelect(a?this.s.dt.aiDisplay:this.s.dt.aoData)},"fnSelectNone":function(a){this._fnRowDeselect(this.fnGetSelectedIndexes(a))},"fnSelect":function(a){"single"==this.s.select.type?(this.fnSelectNone(),this._fnRowSelect(a)):this._fnRowSelect(a)},"fnDeselect":function(a){this._fnRowDeselect(a)},"fnGetTitle":function(a){var b="";if("undefined"!=typeof a.sTitle&&""!==a.sTitle)b=a.sTitle;else{var c=d.getElementsByTagName("title");c.length>0&&(b=c[0].innerHTML)}return"\xa1".toString().length<4?b.replace(/[^a-zA-Z0-9_\u00A1-\uFFFF\.,\-_ !\(\)]/g,""):b.replace(/[^a-zA-Z0-9_\.,\-_ !\(\)]/g,"")},"fnCalcColRatios":function(a){var b,c,d=this.s.dt.aoColumns,e=this._fnColumnTargets(a.mColumns),f=[],g=0,h=0;for(b=0,c=e.length;c>b;b++)e[b]&&(g=d[b].nTh.offsetWidth,h+=g,f.push(g));for(b=0,c=f.length;c>b;b++)f[b]=f[b]/h;return f.join(" ")},"fnGetTableData":function(a){return this.s.dt?this._fnGetDataTablesData(a):void 0},"fnSetText":function(a,b){this._fnFlashSetText(a,b)},"fnResizeButtons":function(){for(var a in f.clients)if(a){var b=f.clients[a];"undefined"!=typeof b.domElement&&b.domElement.parentNode&&b.positionElement()}},"fnResizeRequired":function(){for(var a in f.clients)if(a){var b=f.clients[a];if("undefined"!=typeof b.domElement&&b.domElement.parentNode==this.dom.container&&b.sized===!1)return!0}return!1},"fnPrint":function(a,b){b===c&&(b={}),a===c||a?this._fnPrintStart(b):this._fnPrintEnd()},"fnInfo":function(b,c){var d=a("<div/>").addClass(this.classes.print.info).html(b).appendTo("body");setTimeout(function(){d.fadeOut("normal",function(){d.remove()})},c)},"fnContainer":function(){return this.dom.container},"_fnConstruct":function(b){var c=this;this._fnCustomiseSettings(b),this.dom.container=d.createElement(this.s.tags.container),this.dom.container.className=this.classes.container,"none"!=this.s.select.type&&this._fnRowSelectConfig(),this._fnButtonDefinations(this.s.buttonSet,this.dom.container),this.s.dt.aoDestroyCallback.push({"sName":"TableTools","fn":function(){a(c.s.dt.nTBody).off("click.DTTT_Select",c.s.custom.sRowSelector).off("mousedown.DTTT_Select","tr").off("mouseup.DTTT_Select","tr"),a(c.dom.container).empty();var b=a.inArray(c,TableTools._aInstances);-1!==b&&TableTools._aInstances.splice(b,1)}})},"_fnCustomiseSettings":function(b){"undefined"==typeof this.s.dt._TableToolsInit&&(this.s.master=!0,this.s.dt._TableToolsInit=!0),this.dom.table=this.s.dt.nTable,this.s.custom=a.extend({},TableTools.DEFAULTS,b),this.s.swfPath=this.s.custom.sSwfPath,"undefined"!=typeof f&&(f.moviePath=this.s.swfPath),this.s.select.type=this.s.custom.sRowSelect,this.s.select.preRowSelect=this.s.custom.fnPreRowSelect,this.s.select.postSelected=this.s.custom.fnRowSelected,this.s.select.postDeselected=this.s.custom.fnRowDeselected,this.s.custom.sSelectedClass&&(this.classes.select.row=this.s.custom.sSelectedClass),this.s.tags=this.s.custom.oTags,this.s.buttonSet=this.s.custom.aButtons},"_fnButtonDefinations":function(b,c){for(var d,e=0,f=b.length;f>e;e++){if("string"==typeof b[e]){if("undefined"==typeof TableTools.BUTTONS[b[e]]){alert("TableTools: Warning - unknown button type: "+b[e]);continue}d=a.extend({},TableTools.BUTTONS[b[e]],!0)}else{if("undefined"==typeof TableTools.BUTTONS[b[e].sExtends]){alert("TableTools: Warning - unknown button type: "+b[e].sExtends);continue}var g=a.extend({},TableTools.BUTTONS[b[e].sExtends],!0);d=a.extend(g,b[e],!0)}var h=this._fnCreateButton(d,a(c).hasClass(this.classes.collection.container));h&&c.appendChild(h)}},"_fnCreateButton":function(b,c){var d=this._fnButtonBase(b,c);if(b.sAction.match(/flash/)){if(!this._fnHasFlash())return!1;this._fnFlashConfig(d,b)}else"text"==b.sAction?this._fnTextConfig(d,b):"div"==b.sAction?this._fnTextConfig(d,b):"collection"==b.sAction&&(this._fnTextConfig(d,b),this._fnCollectionConfig(d,b));return-1!==this.s.dt.iTabIndex&&a(d).attr("tabindex",this.s.dt.iTabIndex).attr("aria-controls",this.s.dt.sTableId).on("keyup.DTTT",function(b){13===b.keyCode&&(b.stopPropagation(),a(this).trigger("click"))}).on("mousedown.DTTT",function(a){b.sAction.match(/flash/)||a.preventDefault()}),d},"_fnButtonBase":function(a,b){var c,e,f;b?(c=a.sTag&&"default"!==a.sTag?a.sTag:this.s.tags.collection.button,e=a.sLinerTag&&"default"!==a.sLinerTag?a.sLiner:this.s.tags.collection.liner,f=this.classes.collection.buttons.normal):(c=a.sTag&&"default"!==a.sTag?a.sTag:this.s.tags.button,e=a.sLinerTag&&"default"!==a.sLinerTag?a.sLiner:this.s.tags.liner,f=this.classes.buttons.normal);var g=d.createElement(c),h=d.createElement(e),i=this._fnGetMasterSettings();return g.className=f+" "+a.sButtonClass,g.setAttribute("id","ToolTables_"+this.s.dt.sInstance+"_"+i.buttonCounter),g.appendChild(h),h.innerHTML=a.sButtonText,i.buttonCounter++,g},"_fnGetMasterSettings":function(){if(this.s.master)return this.s;for(var a=TableTools._aInstances,b=0,c=a.length;c>b;b++)if(this.dom.table==a[b].s.dt.nTable)return a[b].s},"_fnCollectionConfig":function(a,b){var c=d.createElement(this.s.tags.collection.container);c.style.display="none",c.className=this.classes.collection.container,b._collection=c,d.body.appendChild(c),this._fnButtonDefinations(b.aButtons,c)},"_fnCollectionShow":function(c,e){var f=this,g=a(c).offset(),h=e._collection,i=g.left,j=g.top+a(c).outerHeight(),k=a(b).height(),l=a(d).height(),m=a(b).width(),n=a(d).width();h.style.position="absolute",h.style.left=i+"px",h.style.top=j+"px",h.style.display="block",a(h).css("opacity",0);var o=d.createElement("div");o.style.position="absolute",o.style.left="0px",o.style.top="0px",o.style.height=(k>l?k:l)+"px",o.style.width=(m>n?m:n)+"px",o.className=this.classes.collection.background,a(o).css("opacity",0),d.body.appendChild(o),d.body.appendChild(h);var p=a(h).outerWidth(),q=a(h).outerHeight();i+p>n&&(h.style.left=n-p+"px"),j+q>l&&(h.style.top=j-q-a(c).outerHeight()+"px"),this.dom.collection.collection=h,this.dom.collection.background=o,setTimeout(function(){a(h).animate({"opacity":1},500),a(o).animate({"opacity":.25},500)},10),this.fnResizeButtons(),a(o).click(function(){f._fnCollectionHide.call(f,null,null)})},"_fnCollectionHide":function(b,c){(null===c||"collection"!=c.sExtends)&&null!==this.dom.collection.collection&&(a(this.dom.collection.collection).animate({"opacity":0},500,function(){this.style.display="none"}),a(this.dom.collection.background).animate({"opacity":0},500,function(){this.parentNode.removeChild(this)}),this.dom.collection.collection=null,this.dom.collection.background=null)},"_fnRowSelectConfig":function(){if(this.s.master){{var b=this,c=this.s.dt;this.s.dt.aoOpenRows}a(c.nTable).addClass(this.classes.select.table),"os"===this.s.select.type&&(a(c.nTBody).on("mousedown.DTTT_Select","tr",function(b){b.shiftKey&&a(c.nTBody).css("-moz-user-select","none").one("selectstart.DTTT_Select","tr",function(){return!1})}),a(c.nTBody).on("mouseup.DTTT_Select","tr",function(){a(c.nTBody).css("-moz-user-select","")})),a(c.nTBody).on("click.DTTT_Select",this.s.custom.sRowSelector,function(d){var e="tr"===this.nodeName.toLowerCase()?this:a(this).parents("tr")[0],f=b.s.select,g=b.s.dt.oInstance.fnGetPosition(e);if(e.parentNode==c.nTBody&&null!==c.oInstance.fnGetData(e)){if("os"==f.type)if(d.ctrlKey||d.metaKey)b.fnIsSelected(e)?b._fnRowDeselect(e,d):b._fnRowSelect(e,d);else if(d.shiftKey){var h=b.s.dt.aiDisplay.slice(),i=a.inArray(f.lastRow,h),j=a.inArray(g,h);if(0===b.fnGetSelected().length||-1===i)h.splice(a.inArray(g,h)+1,h.length);else{if(i>j){var k=j;j=i,i=k}h.splice(j+1,h.length),h.splice(0,i)}b.fnIsSelected(e)?(h.splice(a.inArray(g,h),1),b._fnRowDeselect(h,d)):b._fnRowSelect(h,d)}else b.fnIsSelected(e)&&1===b.fnGetSelected().length?b._fnRowDeselect(e,d):(b.fnSelectNone(),b._fnRowSelect(e,d));else b.fnIsSelected(e)?b._fnRowDeselect(e,d):"single"==f.type?(b.fnSelectNone(),b._fnRowSelect(e,d)):"multi"==f.type&&b._fnRowSelect(e,d);f.lastRow=g}}),c.oApi._fnCallbackReg(c,"aoRowCreatedCallback",function(d,e,f){c.aoData[f]._DTTT_selected&&a(d).addClass(b.classes.select.row)},"TableTools-SelectAll")}},"_fnRowSelect":function(b,c){var d,e,f=this,g=this._fnSelectData(b),h=(0===g.length?null:g[0].nTr,[]);for(d=0,e=g.length;e>d;d++)g[d].nTr&&h.push(g[d].nTr);if(null===this.s.select.preRowSelect||this.s.select.preRowSelect.call(this,c,h,!0)){for(d=0,e=g.length;e>d;d++)g[d]._DTTT_selected=!0,g[d].nTr&&a(g[d].nTr).addClass(f.classes.select.row);null!==this.s.select.postSelected&&this.s.select.postSelected.call(this,h),TableTools._fnEventDispatch(this,"select",h,!0)}},"_fnRowDeselect":function(b,c){var d,e,f=this,g=this._fnSelectData(b),h=(0===g.length?null:g[0].nTr,[]);for(d=0,e=g.length;e>d;d++)g[d].nTr&&h.push(g[d].nTr);if(null===this.s.select.preRowSelect||this.s.select.preRowSelect.call(this,c,h,!1)){for(d=0,e=g.length;e>d;d++)g[d]._DTTT_selected=!1,g[d].nTr&&a(g[d].nTr).removeClass(f.classes.select.row);null!==this.s.select.postDeselected&&this.s.select.postDeselected.call(this,h),TableTools._fnEventDispatch(this,"select",h,!1)}},"_fnSelectData":function(a){var b,c,d,e=[];if(a.nodeName)b=this.s.dt.oInstance.fnGetPosition(a),e.push(this.s.dt.aoData[b]);else{if("undefined"!=typeof a.length){for(c=0,d=a.length;d>c;c++)a[c].nodeName?(b=this.s.dt.oInstance.fnGetPosition(a[c]),e.push(this.s.dt.aoData[b])):e.push("number"==typeof a[c]?this.s.dt.aoData[a[c]]:a[c]);return e}e.push("number"==typeof a?this.s.dt.aoData[a]:a)}return e},"_fnTextConfig":function(b,c){var d=this;null!==c.fnInit&&c.fnInit.call(this,b,c),""!==c.sToolTip&&(b.title=c.sToolTip),a(b).hover(function(){null!==c.fnMouseover&&c.fnMouseover.call(this,b,c,null)},function(){null!==c.fnMouseout&&c.fnMouseout.call(this,b,c,null)}),null!==c.fnSelect&&TableTools._fnEventListen(this,"select",function(a){c.fnSelect.call(d,b,c,a)}),a(b).click(function(a){null!==c.fnClick&&c.fnClick.call(d,b,c,null,a),null!==c.fnComplete&&c.fnComplete.call(d,b,c,null,null),d._fnCollectionHide(b,c)})},"_fnHasFlash":function(){try{var a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");if(a)return!0}catch(b){if(navigator.mimeTypes&&navigator.mimeTypes["application/x-shockwave-flash"]!==c&&navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin)return!0}return!1},"_fnFlashConfig":function(a,b){var c=this,d=new f.Client;null!==b.fnInit&&b.fnInit.call(this,a,b),d.setHandCursor(!0),"flash_save"==b.sAction?(d.setAction("save"),d.setCharSet("utf16le"==b.sCharSet?"UTF16LE":"UTF8"),d.setBomInc(b.bBomInc),d.setFileName(b.sFileName.replace("*",this.fnGetTitle(b)))):"flash_pdf"==b.sAction?(d.setAction("pdf"),d.setFileName(b.sFileName.replace("*",this.fnGetTitle(b)))):d.setAction("copy"),d.addEventListener("mouseOver",function(){null!==b.fnMouseover&&b.fnMouseover.call(c,a,b,d)}),d.addEventListener("mouseOut",function(){null!==b.fnMouseout&&b.fnMouseout.call(c,a,b,d)}),d.addEventListener("mouseDown",function(){null!==b.fnClick&&b.fnClick.call(c,a,b,d)}),d.addEventListener("complete",function(e,f){null!==b.fnComplete&&b.fnComplete.call(c,a,b,d,f),c._fnCollectionHide(a,b)}),null!==b.fnSelect&&TableTools._fnEventListen(this,"select",function(d){b.fnSelect.call(c,a,b,d)}),this._fnFlashGlue(d,a,b.sToolTip)},"_fnFlashGlue":function(a,b,c){var e=this,f=b.getAttribute("id");d.getElementById(f)?a.glue(b,c):setTimeout(function(){e._fnFlashGlue(a,b,c)},100)},"_fnFlashSetText":function(a,b){var c=this._fnChunkData(b,8192);a.clearText();for(var d=0,e=c.length;e>d;d++)a.appendText(c[d])},"_fnColumnTargets":function(b){var c,d,e=[],f=this.s.dt,g=f.aoColumns,h=g.length;if("function"==typeof b){var i=b.call(this,f);for(c=0,d=h;d>c;c++)e.push(-1!==a.inArray(c,i)?!0:!1)}else if("object"==typeof b){for(c=0,d=h;d>c;c++)e.push(!1);for(c=0,d=b.length;d>c;c++)e[b[c]]=!0}else if("visible"==b)for(c=0,d=h;d>c;c++)e.push(g[c].bVisible?!0:!1);else if("hidden"==b)for(c=0,d=h;d>c;c++)e.push(g[c].bVisible?!1:!0);else if("sortable"==b)for(c=0,d=h;d>c;c++)e.push(g[c].bSortable?!0:!1);else for(c=0,d=h;d>c;c++)e.push(!0);return e},"_fnNewline":function(a){return"auto"==a.sNewLine?navigator.userAgent.match(/Windows/)?"\r\n":"\n":a.sNewLine},"_fnGetDataTablesData":function(b){var c,d,f,g,h,i,j,k=[],l="",m=this.s.dt,n=new RegExp(b.sFieldBoundary,"g"),o=this._fnColumnTargets(b.mColumns),p="undefined"!=typeof b.bSelectedOnly?b.bSelectedOnly:!1;if(b.bHeader){for(h=[],c=0,d=m.aoColumns.length;d>c;c++)o[c]&&(l=m.aoColumns[c].sTitle.replace(/\n/g," ").replace(/<.*?>/g,"").replace(/^\s+|\s+$/g,""),l=this._fnHtmlDecode(l),h.push(this._fnBoundData(l,b.sFieldBoundary,n)));k.push(h.join(b.sFieldSeperator))}p=!0;var q,r=this.fnGetSelectedIndexes();for(p="none"!==this.s.select.type&&p&&0!==r.length,q=p?r:e.Api?new e.Api(m).rows(b.oSelectorOpts).indexes().flatten().toArray():m.oInstance.$("tr",b.oSelectorOpts).map(function(a,b){return m.oInstance.fnGetPosition(b)}).get(),f=0,g=q.length;g>f;f++){for(j=m.aoData[q[f]].nTr,h=[],c=0,d=m.aoColumns.length;d>c;c++)if(o[c]){var s=m.oApi._fnGetCellData(m,q[f],c,"display");b.fnCellRender?l=b.fnCellRender(s,c,j,q[f])+"":"string"==typeof s?(l=s.replace(/\n/g," "),l=l.replace(/<img.*?\s+alt\s*=\s*(?:"([^"]+)"|'([^']+)'|([^\s>]+)).*?>/gi,"$1$2$3"),l=l.replace(/<.*?>/g,"")):l=s+"",l=l.replace(/^\s+/,"").replace(/\s+$/,""),l=this._fnHtmlDecode(l),h.push(this._fnBoundData(l,b.sFieldBoundary,n))}k.push(h.join(b.sFieldSeperator)),b.bOpenRows&&(i=a.grep(m.aoOpenRows,function(a){return a.nParent===j}),1===i.length&&(l=this._fnBoundData(a("td",i[0].nTr).html(),b.sFieldBoundary,n),k.push(l)))}if(b.bFooter&&null!==m.nTFoot){for(h=[],c=0,d=m.aoColumns.length;d>c;c++)o[c]&&null!==m.aoColumns[c].nTf&&(l=m.aoColumns[c].nTf.innerHTML.replace(/\n/g," ").replace(/<.*?>/g,""),l=this._fnHtmlDecode(l),h.push(this._fnBoundData(l,b.sFieldBoundary,n)));k.push(h.join(b.sFieldSeperator))}var t=k.join(this._fnNewline(b));return t},"_fnBoundData":function(a,b,c){return""===b?a:b+a.replace(c,b+b)+b},"_fnChunkData":function(a,b){for(var c=[],d=a.length,e=0;d>e;e+=b)c.push(d>e+b?a.substring(e,e+b):a.substring(e,d));return c},"_fnHtmlDecode":function(a){if(-1===a.indexOf("&"))return a;var b=d.createElement("div");return a.replace(/&([^\s]*?);/g,function(a,c){return"#"===a.substr(1,1)?String.fromCharCode(Number(c.substr(1))):(b.innerHTML=a,b.childNodes[0].nodeValue)})},"_fnPrintStart":function(c){var e=this,f=this.s.dt;this._fnPrintHideNodes(f.nTable),this.s.print.saveStart=f._iDisplayStart,this.s.print.saveLength=f._iDisplayLength,c.bShowAll&&(f._iDisplayStart=0,f._iDisplayLength=-1,f.oApi._fnCalculateEnd&&f.oApi._fnCalculateEnd(f),f.oApi._fnDraw(f)),(""!==f.oScroll.sX||""!==f.oScroll.sY)&&(this._fnPrintScrollStart(f),a(this.s.dt.nTable).bind("draw.DTTT_Print",function(){e._fnPrintScrollStart(f)}));var g=f.aanFeatures;for(var h in g)if("i"!=h&&"t"!=h&&1==h.length)for(var i=0,j=g[h].length;j>i;i++)this.dom.print.hidden.push({"node":g[h][i],"display":"block"}),g[h][i].style.display="none";a(d.body).addClass(this.classes.print.body),""!==c.sInfo&&this.fnInfo(c.sInfo,3e3),c.sMessage&&a("<div/>").addClass(this.classes.print.message).html(c.sMessage).prependTo("body"),this.s.print.saveScroll=a(b).scrollTop(),b.scrollTo(0,0),a(d).bind("keydown.DTTT",function(a){27==a.keyCode&&(a.preventDefault(),e._fnPrintEnd.call(e,a))})},"_fnPrintEnd":function(){{var c=this.s.dt,e=this.s.print;this.dom.print}this._fnPrintShowNodes(),(""!==c.oScroll.sX||""!==c.oScroll.sY)&&(a(this.s.dt.nTable).unbind("draw.DTTT_Print"),this._fnPrintScrollEnd()),b.scrollTo(0,e.saveScroll),a("div."+this.classes.print.message).remove(),a(d.body).removeClass("DTTT_Print"),c._iDisplayStart=e.saveStart,c._iDisplayLength=e.saveLength,c.oApi._fnCalculateEnd&&c.oApi._fnCalculateEnd(c),c.oApi._fnDraw(c),a(d).unbind("keydown.DTTT")},"_fnPrintScrollStart":function(){var b,c,d=this.s.dt,e=d.nScrollHead.getElementsByTagName("div")[0],f=(e.getElementsByTagName("table")[0],d.nTable.parentNode);b=d.nTable.getElementsByTagName("thead"),b.length>0&&d.nTable.removeChild(b[0]),null!==d.nTFoot&&(c=d.nTable.getElementsByTagName("tfoot"),c.length>0&&d.nTable.removeChild(c[0])),b=d.nTHead.cloneNode(!0),d.nTable.insertBefore(b,d.nTable.childNodes[0]),null!==d.nTFoot&&(c=d.nTFoot.cloneNode(!0),d.nTable.insertBefore(c,d.nTable.childNodes[1])),""!==d.oScroll.sX&&(d.nTable.style.width=a(d.nTable).outerWidth()+"px",f.style.width=a(d.nTable).outerWidth()+"px",f.style.overflow="visible"),""!==d.oScroll.sY&&(f.style.height=a(d.nTable).outerHeight()+"px",f.style.overflow="visible")},"_fnPrintScrollEnd":function(){var a=this.s.dt,b=a.nTable.parentNode;""!==a.oScroll.sX&&(b.style.width=a.oApi._fnStringToCss(a.oScroll.sX),b.style.overflow="auto"),""!==a.oScroll.sY&&(b.style.height=a.oApi._fnStringToCss(a.oScroll.sY),b.style.overflow="auto")},"_fnPrintShowNodes":function(){for(var a=this.dom.print.hidden,b=0,c=a.length;c>b;b++)a[b].node.style.display=a[b].display;a.splice(0,a.length)},"_fnPrintHideNodes":function(b){for(var c=this.dom.print.hidden,d=b.parentNode,e=d.childNodes,f=0,g=e.length;g>f;f++)if(e[f]!=b&&1==e[f].nodeType){var h=a(e[f]).css("display");"none"!=h&&(c.push({"node":e[f],"display":h}),e[f].style.display="none")}"BODY"!=d.nodeName.toUpperCase()&&this._fnPrintHideNodes(d)}},TableTools._aInstances=[],TableTools._aListeners=[],TableTools.fnGetMasters=function(){for(var a=[],b=0,c=TableTools._aInstances.length;c>b;b++)TableTools._aInstances[b].s.master&&a.push(TableTools._aInstances[b]);return a},TableTools.fnGetInstance=function(a){"object"!=typeof a&&(a=d.getElementById(a));for(var b=0,c=TableTools._aInstances.length;c>b;b++)if(TableTools._aInstances[b].s.master&&TableTools._aInstances[b].dom.table==a)return TableTools._aInstances[b];return null},TableTools._fnEventListen=function(a,b,c){TableTools._aListeners.push({"that":a,"type":b,"fn":c})},TableTools._fnEventDispatch=function(a,b,c,d){for(var e=TableTools._aListeners,f=0,g=e.length;g>f;f++)a.dom.table==e[f].that.dom.table&&e[f].type==b&&e[f].fn(c,d)},TableTools.buttonBase={"sAction":"text","sTag":"default","sLinerTag":"default","sButtonClass":"DTTT_button_text","sButtonText":"Button text","sTitle":"","sToolTip":"","sCharSet":"utf8","bBomInc":!1,"sFileName":"*.csv","sFieldBoundary":"","sFieldSeperator":" ","sNewLine":"auto","mColumns":"all","bHeader":!0,"bFooter":!0,"bOpenRows":!1,"bSelectedOnly":!1,"oSelectorOpts":c,"fnMouseover":null,"fnMouseout":null,"fnClick":null,"fnSelect":null,"fnComplete":null,"fnInit":null,"fnCellRender":null},TableTools.BUTTONS={"csv":a.extend({},TableTools.buttonBase,{"sAction":"flash_save","sButtonClass":"DTTT_button_csv","sButtonText":"CSV","sFieldBoundary":'"',"sFieldSeperator":",","fnClick":function(a,b,c){this.fnSetText(c,this.fnGetTableData(b))}}),"xls":a.extend({},TableTools.buttonBase,{"sAction":"flash_save","sCharSet":"utf16le","bBomInc":!0,"sButtonClass":"DTTT_button_xls","sButtonText":"Excel","fnClick":function(a,b,c){this.fnSetText(c,this.fnGetTableData(b))}}),"copy":a.extend({},TableTools.buttonBase,{"sAction":"flash_copy","sButtonClass":"DTTT_button_copy","sButtonText":"Copy","fnClick":function(a,b,c){this.fnSetText(c,this.fnGetTableData(b))},"fnComplete":function(a,b,c,d){var e=d.split("\n").length;b.bHeader&&e--,null!==this.s.dt.nTFoot&&b.bFooter&&e--;var f=1==e?"":"s";this.fnInfo("<h6>Table copied</h6><p>Copied "+e+" row"+f+" to the clipboard.</p>",1500)}}),"pdf":a.extend({},TableTools.buttonBase,{"sAction":"flash_pdf","sNewLine":"\n","sFileName":"*.pdf","sButtonClass":"DTTT_button_pdf","sButtonText":"PDF","sPdfOrientation":"portrait","sPdfSize":"A4","sPdfMessage":"","fnClick":function(a,b,c){this.fnSetText(c,"title:"+this.fnGetTitle(b)+"\nmessage:"+b.sPdfMessage+"\ncolWidth:"+this.fnCalcColRatios(b)+"\norientation:"+b.sPdfOrientation+"\nsize:"+b.sPdfSize+"\n--/TableToolsOpts--\n"+this.fnGetTableData(b))}}),"print":a.extend({},TableTools.buttonBase,{"sInfo":"<h6>Print view</h6><p>Please use your browser's print function to print this table. Press escape when finished.</p>","sMessage":null,"bShowAll":!0,"sToolTip":"View print view","sButtonClass":"DTTT_button_print","sButtonText":"Print","fnClick":function(a,b){this.fnPrint(!0,b)}}),"text":a.extend({},TableTools.buttonBase),"select":a.extend({},TableTools.buttonBase,{"sButtonText":"Select button","fnSelect":function(b){0!==this.fnGetSelected().length?a(b).removeClass(this.classes.buttons.disabled):a(b).addClass(this.classes.buttons.disabled)},"fnInit":function(b){a(b).addClass(this.classes.buttons.disabled)}}),"select_single":a.extend({},TableTools.buttonBase,{"sButtonText":"Select button","fnSelect":function(b){var c=this.fnGetSelected().length;1==c?a(b).removeClass(this.classes.buttons.disabled):a(b).addClass(this.classes.buttons.disabled)},"fnInit":function(b){a(b).addClass(this.classes.buttons.disabled)}}),"select_all":a.extend({},TableTools.buttonBase,{"sButtonText":"Select all","fnClick":function(){this.fnSelectAll()},"fnSelect":function(b){this.fnGetSelected().length==this.s.dt.fnRecordsDisplay()?a(b).addClass(this.classes.buttons.disabled):a(b).removeClass(this.classes.buttons.disabled)}}),"select_none":a.extend({},TableTools.buttonBase,{"sButtonText":"Deselect all","fnClick":function(){this.fnSelectNone()},"fnSelect":function(b){0!==this.fnGetSelected().length?a(b).removeClass(this.classes.buttons.disabled):a(b).addClass(this.classes.buttons.disabled)},"fnInit":function(b){a(b).addClass(this.classes.buttons.disabled)}}),"ajax":a.extend({},TableTools.buttonBase,{"sAjaxUrl":"/xhr.php","sButtonText":"Ajax button","fnClick":function(b,c){var d=this.fnGetTableData(c);a.ajax({"url":c.sAjaxUrl,"data":[{"name":"tableData","value":d}],"success":c.fnAjaxComplete,"dataType":"json","type":"POST","cache":!1,"error":function(){alert("Error detected when sending table data to server")}})},"fnAjaxComplete":function(){alert("Ajax complete")}}),"div":a.extend({},TableTools.buttonBase,{"sAction":"div","sTag":"div","sButtonClass":"DTTT_nonbutton","sButtonText":"Text button"}),"collection":a.extend({},TableTools.buttonBase,{"sAction":"collection","sButtonClass":"DTTT_button_collection","sButtonText":"Collection","fnClick":function(a,b){this._fnCollectionShow(a,b)}})},TableTools.buttons=TableTools.BUTTONS,TableTools.classes={"container":"DTTT_container","buttons":{"normal":"DTTT_button","disabled":"DTTT_disabled"},"collection":{"container":"DTTT_collection","background":"DTTT_collection_background","buttons":{"normal":"DTTT_button","disabled":"DTTT_disabled"}},"select":{"table":"DTTT_selectable","row":"DTTT_selected selected"},"print":{"body":"DTTT_Print","info":"DTTT_print_info","message":"DTTT_PrintMessage"}},TableTools.classes_themeroller={"container":"DTTT_container ui-buttonset ui-buttonset-multi","buttons":{"normal":"DTTT_button ui-button ui-state-default"},"collection":{"container":"DTTT_collection ui-buttonset ui-buttonset-multi"}},TableTools.DEFAULTS={"sSwfPath":"../swf/copy_csv_xls_pdf.swf","sRowSelect":"none","sRowSelector":"tr","sSelectedClass":null,"fnPreRowSelect":null,"fnRowSelected":null,"fnRowDeselected":null,"aButtons":["copy","csv","xls","pdf","print"],"oTags":{"container":"div","button":"a","liner":"span","collection":{"container":"div","button":"a","liner":"span"}}},TableTools.defaults=TableTools.DEFAULTS,TableTools.prototype.CLASS="TableTools",TableTools.version="2.2.4",a.fn.dataTable.Api&&a.fn.dataTable.Api.register("tabletools()",function(){var a=null;return this.context.length>0&&(a=TableTools.fnGetInstance(this.context[0].nTable)),a}),"function"==typeof a.fn.dataTable&&"function"==typeof a.fn.dataTableExt.fnVersionCheck&&a.fn.dataTableExt.fnVersionCheck("1.9.0")?a.fn.dataTableExt.aoFeatures.push({"fnInit":function(a){var b=a.oInit,c=b?b.tableTools||b.oTableTools||{}:{};return new TableTools(a.oInstance,c).dom.container},"cFeature":"T","sFeature":"TableTools"}):alert("Warning: TableTools requires DataTables 1.9.0 or newer - www.datatables.net/download"),a.fn.DataTable.TableTools=TableTools}(jQuery,a,b),"function"==typeof d.fn.dataTable&&"function"==typeof d.fn.dataTableExt.fnVersionCheck&&d.fn.dataTableExt.fnVersionCheck("1.9.0")?d.fn.dataTableExt.aoFeatures.push({"fnInit":function(a){var b="undefined"!=typeof a.oInit.oTableTools?a.oInit.oTableTools:{},c=new TableTools(a.oInstance,b);return TableTools._aInstances.push(c),c.dom.container },"cFeature":"T","sFeature":"TableTools"}):alert("Warning: TableTools 2 requires DataTables 1.9.0 or newer - www.datatables.net/download"),d.fn.dataTable.TableTools=TableTools,d.fn.DataTable.TableTools=TableTools,TableTools};"function"==typeof define&&define.amd?define(["jquery","datatables"],d):"object"==typeof exports?d(require("jquery"),require("datatables")):jQuery&&!jQuery.fn.dataTable.TableTools&&d(jQuery,jQuery.fn.dataTable)}(window,document);
const serverlessExpress = require("@vendia/serverless-express"); const api = require("./api"); const server = serverlessExpress.createServer(api); exports.handler = (event, context) => serverlessExpress.proxy(server, event, context);
import React from 'react'; import * as helpers from './componentHelpers'; import Context from './Context'; /** * The base class for all pure (state-less) view components. * * Unlike the "regular" components, pure components do not have any external * state, and therefore are pure functions of their props and state. This * allows for some nice optimizations on react's part (see the link). * * Because of this, this class does not provide all the APIs provided by the * {@linkcode AbstractComponent} class (e.g. {@code listen}) as there is next * to none use of them with pure components. * * @abstract * @see https://facebook.github.io/react/docs/react-api.html#react.purecomponent */ export default class AbstractPureComponent extends React.PureComponent { static get contextType() { return Context; } /** * Initializes the component. * * @param {Object<string, *>} props The component properties. * @param {Object<string, *>} context The component context. */ constructor(props, context) { super(props, context); /** * The view utilities, initialized lazily upon first use from either * the context, or the component's props. * * @type {?Object<string, *>} */ this._utils = null; } /** * Returns the utilities for the view components. The returned value is the * value bound to the {@code $Utils} object container constant. * * @return {Object<string, *>} The utilities for the view components. */ get utils() { if (!this._utils) { this._utils = helpers.getUtils(this.props, this.context); } return this._utils; } /** * Returns the localized phrase identified by the specified key. The * placeholders in the localization phrase will be replaced by the provided * values. * * @param {string} key Localization key. * @param {Object<string, (number|string)>=} params Values for replacing * the placeholders in the localization phrase. * @return {string} Localized phrase. */ localize(key, params = {}) { return helpers.localize(this, key, params); } /** * Generates an absolute URL using the provided route name (see the * <code>app/config/routes.js</code> file). The provided parameters will * replace the placeholders in the route pattern, while the extraneous * parameters will be appended to the generated URL's query string. * * @param {string} name The route name. * @param {Object<string, (number|string)>=} params Router parameters and * extraneous parameters to add to the URL as a query string. * @return {string} The generated URL. */ link(name, params = {}) { return helpers.link(this, name, params); } /** * Generate a string of CSS classes from the properties of the passed-in * object that resolve to true. * * @example * this.cssClasses('my-class my-class-modificator', true); * @example * this.cssClasses({ * 'my-class': true, * 'my-class-modificator': this.props.modificator * }, true); * * @param {(string|Object<string, boolean>)} classRules CSS classes in a * string separated by whitespace, or a map of CSS class names to * boolean values. The CSS class name will be included in the result * only if the value is {@code true}. * @param {boolean} includeComponentClassName * @return {string} String of CSS classes that had their property resolved * to {@code true}. */ cssClasses(classRules, includeComponentClassName = false) { return helpers.cssClasses(this, classRules, includeComponentClassName); } /** * Creates and sends a new IMA.js DOM custom event from this component. * * @param {string} eventName The name of the event. * @param {*=} data Data to send within the event. */ fire(eventName, data = undefined) { helpers.fire(this, eventName, data); } /** * Registers the provided event listener for execution whenever an IMA.js * DOM custom event of the specified name occurs at the specified event * target. * * @param {(React.Element|EventTarget)} eventTarget The react component or * event target at which the listener should listen for the event. * @param {string} eventName The name of the event for which to listen. * @param {function(Event)} listener The listener for event to register. */ listen(eventTarget, eventName, listener) { helpers.listen(this, eventTarget, eventName, listener); } /** * Deregisters the provided event listener for an IMA.js DOM custom event * of the specified name at the specified event target. * * @param {(React.Element|EventTarget)} eventTarget The react component or * event target at which the listener should listen for the event. * @param {string} eventName The name of the event for which to listen. * @param {function(Event)} listener The listener for event to register. */ unlisten(eventTarget, eventName, listener) { helpers.unlisten(this, eventTarget, eventName, listener); } }
/** * Template component * explain what this class is doing */ export default class TemplateComponent { constructor() { /** * Template component DOM selectors * @type {{templateComponentArray: string, templateComponent: string, states: {isActive: string}}} */ this.DOM = { templateComponent: ".js-template-component", templateComponentArray: ".js-template-component-array", states: { isActive: "is-active", }, }; /** * Fetch template component DOM element * @type {Element} */ this.templateComponent = document.querySelector(this.DOM.templateComponent); /** * Fetch template component list of DOM elements * @type {NodeListOf<Element>} */ this.templateComponentArray = document.querySelectorAll(this.DOM.templateComponentArray); } /** * Init */ init() { if (this.templateComponent === null) { return; } // if (this.templateComponentArray.length < 1) { // return; // } console.log("Template component init"); this.templateMethod(); } /** * Template method * explain what this method is doing */ templateMethod() { console.log("Template method init"); } }
/* * Backpack - Skyscanner's Design System * * Copyright 2016 Skyscanner Ltd * * 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. */ import PropTypes from 'prop-types'; import React from 'react'; import { cssModules } from 'bpk-react-utils'; import STYLES from './BpkGridContainer.module.scss'; const getClassName = cssModules(STYLES); const BpkGridContainer = (props) => { const { children, className, debug, fullWidth, ...rest } = props; const classNames = [getClassName('bpk-grid__container')]; if (debug) { classNames.push(getClassName('bpk-grid__container--debug')); } if (fullWidth) { classNames.push(getClassName('bpk-grid__container--full-width')); } if (className) { classNames.push(className); } return ( <div className={classNames.join(' ')} {...rest}> {children} </div> ); }; BpkGridContainer.propTypes = { children: PropTypes.node.isRequired, debug: PropTypes.bool, fullWidth: PropTypes.bool, className: PropTypes.string, }; BpkGridContainer.defaultProps = { debug: false, fullWidth: false, className: null, }; export default BpkGridContainer;
'use strict' /* |-------------------------------------------------------------------------- | Factory |-------------------------------------------------------------------------- | | Factories are used to define blueprints for database tables or Lucid | models. Later you can use these blueprints to seed your database | with dummy data. | */ // const Factory = use('Factory') /** Factory.blueprint('App/Models/User', (faker) => { return { username: faker.username() } }) */
'use strict'; angular.module('apollo') .controller('deploymentHistoryCtrl', ['apolloApiService', '$scope', '$timeout' , '$state', 'growl', 'usSpinnerService', 'DTColumnDefBuilder', function (apolloApiService, $scope, $timeout, $state, growl, usSpinnerService, DTColumnDefBuilder) { // Kinda ugly custom sorting for datatables jQuery.extend( jQuery.fn.dataTableExt.oSort, { "date-time-pre": function ( date ) { return moment(date, 'DD/MM/YY HH:mm:ss'); }, "date-time-asc": function ( a, b ) { return (a.isBefore(b) ? -1 : (a.isAfter(b) ? 1 : 0)); }, "date-time-desc": function ( a, b ) { return (a.isBefore(b) ? 1 : (a.isAfter(b) ? -1 : 0)); } }); $scope.selectedDeployment = null; $scope.setSelectedDeployment = function(selectedDeployment) { $scope.selectedDeployment = selectedDeployment; }; $scope.getLabel = function(deploymentStatus) { return apolloApiService.matchLabelToDeploymentStatus(deploymentStatus); }; $scope.showDetails = function() { $scope.deployableVersion = undefined; usSpinnerService.spin('details-spinner'); apolloApiService.getDeployableVersion( $scope.allDeployments.filter(function(a){return a.id === $scope.selectedDeployment.id;})[0].deployableVersionId) .then(function(response) { $scope.deployableVersion = response.data; usSpinnerService.stop('details-spinner'); }, function(error){ usSpinnerService.stop('details-spinner'); growl.error("Could not fetch data from apollo! error: " + error.data); }); }; $scope.showEnvStatus = function(deployment) { if (typeof(deployment) === 'undefined') { return; } if (deployment.status !== 'DONE' && deployment.status !== 'CANCELED') { $scope.envStatus = 'The environment status is not available while the deployment status is "' + deployment.status + '".'; return; } $scope.envStatus = undefined; $scope.envStatusWithServiceNames = {}; usSpinnerService.spin('details-spinner'); apolloApiService.getDeploymentEnvStatus(deployment.id) .then(function(response) { $scope.envStatus = response.data; $scope.envStatus = JSON.parse($scope.envStatus); for (var serviceId in $scope.envStatus) { if(typeof($scope.envStatus[serviceId]) === 'object') { var groupsWithNames = {}; for (var groupId in $scope.envStatus[serviceId]) { groupsWithNames[$scope.allGroups[groupId].name] = $scope.envStatus[serviceId][groupId]; } $scope.envStatusWithServiceNames[$scope.allServices[serviceId].name] = groupsWithNames; } else { $scope.envStatusWithServiceNames[$scope.allServices[serviceId].name] = $scope.envStatus[serviceId]; } } usSpinnerService.stop('details-spinner'); }, function(error){ usSpinnerService.stop('details-spinner'); growl.error("Could not fetch environment status data! error: " + error.data); }); }; $scope.revert = function() { // Set spinner usSpinnerService.spin('revert-spinner'); // Now we can deploy apolloApiService.createNewDeployment($scope.selectedDeployment.deployableVersionId, $scope.selectedDeployment.serviceId, $scope.selectedDeployment.environmentId).then(function (response) { // Wait a bit to let the deployment be in the DB setTimeout(function () { usSpinnerService.stop('revert-spinner'); // Redirect user to ongoing deployments $state.go('deployments.ongoing', {deploymentId: response.data.id}); }, 500); }, function(error) { // End spinner usSpinnerService.stop('revert-spinner'); // 403 are handled generically on the interceptor if (error.status !== 403) { growl.error("Got from apollo API: " + error.status + " (" + error.statusText + ")", {ttl: 7000}) } }); }; $scope.clearFilters = function() { $scope.serviceSearch = ""; $scope.environmentSearch = ""; $scope.userSearch = ""; $scope.statusSearch = ""; }; $scope.dtOptions = { paginationType: 'simple_numbers', displayLength: 10, dom: '<"top"i>rt<"bottom"p>', order: [[1, "desc" ]] }; $scope.dtColumnDefs = [ DTColumnDefBuilder.newColumnDef([1]).withOption('type', 'date-time') ]; // Data fetching apolloApiService.getAllEnvironments().then(function(response) { var tempEnvironment = {}; response.data.forEach(function(environment) { tempEnvironment[environment.id] = environment; }); $scope.allEnvironments = tempEnvironment; }); apolloApiService.getAllServices().then(function(response) { var tempServices = {}; response.data.forEach(function(service) { tempServices[service.id] = service; }); $scope.allServices = tempServices; }); apolloApiService.getAllUsers().then(function(response) { var tempUsers = {}; response.data.forEach(function(user) { tempUsers[user.userEmail] = user; }); $scope.allUsers = tempUsers; }); apolloApiService.getAllDeployments().then(function(response) { $scope.allDeployments = response.data; }); apolloApiService.getAllGroups().then(function(response) { var tempGroups = {}; response.data.forEach(function(group) { tempGroups[group.id] = group; }); $scope.allGroups = tempGroups; }); }]);
export { default } from './PlantInfoPageContainer';