{"text": "/**\n * Author: Denis Zatsepin\n * Email: denis@zatsepin.spb.ru\n * Date: 05.09.13\n */\n\nconst Router  = require('koa-router');\nconst Body    = require('koa-body');\n\n/**\n * This function gets handlers and base path and associate handlers with routes.\n * @param {String} path\n * @param {Array} handlers\n */\nmodule.exports = function(handlers) {\n\tvar path = '/';\n\tvar router = new Router();\n  for (var actionName in handlers) {\n    var handler = handlers[actionName];\n    var route = '';\n\n    switch(actionName) {\n      case 'index':\n        router.get(path, handler);\n        break;\n      case 'new':\n        route = path + 'new';\n        router.get(route, handler);\n        break;\n      case 'create':\n        router.post(path, Body(), handler);\n        break;\n      case 'show':\n        route = path + ':id';\n        router.get(route, handler);\n        break;\n      case 'edit':\n        route = path + ':id/edit';\n        router.get(rotue, handler);\n        break;\n      case 'update':\n        route = path + ':id';\n        router.put(route, Body(), handler);\n        break;\n      case 'destroy':\n        route = path + ':id';\n        router.delete(route, handler);\n        break;\n      default:\n        router.get(route, Body(), handler);\n    }\n  }\n\treturn router;\n};", "domain": "javascript", "lang": "code", "char_count": 1265, "word_count": 298, "byte_count": 1265}
{"text": "const flipSign = (x) => x * -1;\nfunction getElementViewportOffset(element, offset = 0) {\n    const rect = element.getBoundingClientRect();\n    return {\n        top: rect.top - offset,\n        bottom: flipSign(rect.bottom - window.innerHeight) - offset,\n        left: rect.left - offset,\n        right: flipSign(rect.right - window.innerWidth) - offset\n    };\n}\nexport function alignWebPopoverIfRequired(style, anchorElement, popoverElement) {\n    const offsetHeight = anchorElement.offsetHeight;\n    const offset = getElementViewportOffset(anchorElement, 0);\n    const popoverOffsetWidth = popoverElement.offsetWidth;\n    const popoverOffsetHeight = popoverElement.offsetHeight;\n    const isOverflowingRight = offset.left + popoverOffsetWidth > window.innerWidth;\n    const isOverflowingLeft = offset.right + popoverOffsetWidth > window.innerWidth;\n    const isOverflowingBottom = offset.top + popoverOffsetHeight > window.innerHeight - 40;\n    const isOverflowingTop = offset.bottom + popoverOffsetHeight > window.innerHeight - 40;\n    if (isOverflowingRight) {\n        style.right = 0;\n        style.transform = undefined;\n    }\n    if (isOverflowingLeft) {\n        style.left = 0;\n        style.transform = undefined;\n    }\n    if (isOverflowingBottom) {\n        style.top = undefined;\n        style.bottom = offsetHeight;\n    }\n    if (isOverflowingTop) {\n        style.bottom = undefined;\n        style.top = offsetHeight;\n    }\n    return style;\n}\n//# sourceMappingURL=alignWebPopoverIfRequired.js.map", "domain": "javascript", "lang": "code", "char_count": 1507, "word_count": 258, "byte_count": 1507}
{"text": "'use strict';\n\ndefine([], function() {\n\n\treturn function() {\n\n\t\tfunction show(scope, element, title, lead, text, buttons) {\n\n\t\t\tvar deferred = Promise.defer();\n\n\t\t\telement.find(\".modal-title\").html(title);\n\t\t\telement.find(\".lead\").html(lead);\n\t\t\telement.find(\".modal-text\").html(text);\n\n\t\t\tvar buttonContainer = element.find(\".modal-buttons\");\n\t\t\tbuttonContainer.empty();\n\n\t\t\tfor (var i in buttons) {\n\t\t\t\tvar b = buttons[i];\n\n\t\t\t\tvar btn = $(\"<a/>\");\n\n\t\t\t\tbtn.addClass(\"button primary radius\");\n\t\t\t\tbtn.html(b.caption);\n\n\t\t\t\tif(b.target)\n\t\t\t\t\tbtn.attr(\"target\", b.target);\n\n\t\t\t\tif (b.href)\n\t\t\t\t\tbtn.attr(\"href\", b.href);\n\n\t\t\t\tbtn.on(\"click\", function(i, e) {\n\t\t\t\t\tdeferred.resolve(buttons[i].value);\t\t\t\t\t\n\t\t\t\t}.bind(null, i));\n\n\t\t\t\tbuttonContainer.append(btn);\n\t\t\t}\n\n\t\t\tscope.cancel = function() {\n\t\t\t\tdeferred.reject(\"cancel\");\n\t\t\t}\n\n\t\t\t// Deal with cancel by esc.\n\t\t\tfunction keyup(e) {\n\t\t\t\tif (e.which == 27)\n\t\t\t\t\tscope.cancel();\n\t\t\t}\n\n\t\t\tfunction hide() {\n\t\t\t\tscope.modal.foundation(\"reveal\", \"close\");\n\t\t\t\t$(\"body\").off(\"keyup\", keyup);\n\t\t\t}\n\n\t\t\tdeferred.promise.then(hide, hide);\n\n\t\t\tscope.modal.foundation(\"reveal\", \"open\");\n\t\t\t$(\"body\").one(\"click\", \".reveal-modal-bg\", scope.cancel);\n\t\t\t$(\"body\").on(\"keyup\", keyup);\n\n\t\t\treturn deferred.promise;\n\t\t}\n\n\t\treturn {\n\n\t\t\tscope: {\n\t\t\t\tctrl: \"=\",\n\t\t\t},\n\n\t\t\trestrict: 'EA',\n\n\t\t\ttemplateUrl: \"partials/directives/Modal.html\",\n\n\t\t\tlink: function(scope, element, attrs) {\n\n\t\t\t\tscope.modal = element.find(\".reveal-modal\");\n\t\t\t\t$(document).foundation();\n\n\t\t\t\tscope.ctrl.show = show.bind(this, scope, element);\n\n\t\t\t},\n\t\t};\n\t};\n});", "domain": "javascript", "lang": "code", "char_count": 1575, "word_count": 470, "byte_count": 1575}
{"text": "/*\r\nCopyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\r\nFor licensing, see LICENSE.md or http://ckeditor.com/license\r\n*/\r\nCKEDITOR.plugins.setLang( 'image2', 'zh-cn', {\r\n\talt: '\u66ff\u6362\u6587\u672c',\r\n\tbtnUpload: '\u4e0a\u4f20\u5230\u670d\u52a1\u5668',\r\n\tcaptioned: '\u5e26\u6807\u9898\u56fe\u50cf',\r\n\tcaptionPlaceholder: '\u6807\u9898',\r\n\tinfoTab: '\u56fe\u50cf\u4fe1\u606f',\r\n\tlockRatio: '\u9501\u5b9a\u6bd4\u4f8b',\r\n\tmenu: '\u56fe\u50cf\u5c5e\u6027',\r\n\tpathName: '\u56fe\u50cf',\r\n\tpathNameCaption: '\u6807\u9898',\r\n\tresetSize: '\u539f\u59cb\u5c3a\u5bf8',\r\n\tresizer: '\u70b9\u51fb\u5e76\u62d6\u62fd\u4ee5\u6539\u53d8\u5c3a\u5bf8',\r\n\ttitle: '\u56fe\u50cf\u5c5e\u6027',\r\n\tuploadTab: '\u4e0a\u4f20',\r\n\turlMissing: '\u7f3a\u5c11\u56fe\u50cf\u6e90\u6587\u4ef6\u5730\u5740',\r\n\taltMissing: '\u7f3a\u5c11\u66ff\u6362\u6587\u672c'\r\n} );", "domain": "javascript", "lang": "code", "char_count": 518, "word_count": 118, "byte_count": 654}
{"text": "/**\n * {@link http://www.focus-ui.com}\n *\n * @version 1.1\n * @namespace\n */\nvar z = {};\n\n/**\n * Releases the hold on the z shortcut identifier, so that other scripts can use it.\n *\n * @return {z}reference     - A reference to z, that you can save in a variable, for later use\n *\n * @example\n * var zx = z.noConflict();\n * console.log(zx.util.isString(\"abc\"));\n */\nz.noConflict = function () {\n};\n\n/**\n * @memberOf z\n * @namespace\n */\nz.util = {\n    /**\n     * Determines whether the passed value is an Array.\n     *\n     * @param value         - The value to be checked.\n     *\n     * @return {Boolean}    - true if the value is an Array; otherwise, false.\n     *\n     * @example\n     * z.util.isArray([1,2]);//true\n     * z.util.isArray([]);//true\n     * z.util.isArray(new Array(1,2));//true\n     */\n    isArray: function (value) {\n    },\n\n    /**\n     * Determines whether the passed value is a String.\n     *\n     * @param value         - The value to be checked.\n     *\n     * @return {Boolean}    - true if the value is a String; otherwise, false.\n     *\n     * @example\n     * z.util.isString(\"abc\");//true\n     * z.util.isString(\"\");//true\n     * z.util.isString(new String(\"abc\"));//true\n     */\n    isString: function (value) {\n    },\n\n    /**\n     * Determines whether the passed value is a Boolean\n     *\n     * @param value         - The value to be checked.\n     *\n     * @return {Boolean}    - true if the value is a Boolean; otherwise, false.\n     *\n     * @example\n     * z.util.isBoolean(true);//true\n     * z.util.isBoolean(false);//true\n     * z.util.isBoolean(new Boolean(true));//true\n     */\n    isBoolean: function (value) {\n    },\n\n    /**\n     * Determines whether the passed value is an Object\n     *\n     * @param value         - The value to be checked.\n     *\n     * @return {Boolean}    - true if the value is an Object; otherwise, false.\n     *\n     * @example\n     * z.util.isObject({name:\"focus-ui\"});//true\n     * z.util.isObject({});//true\n     * z.util.isObject(Object.create(null));//true\n     *\n     * z.util.isObject(null) == false;\n     * z.util.isObject(undefined) == false;\n     */\n    isObject: function (value) {\n    },\n\n    /**\n     * Determines whether the passed value is a Function\n     *\n     * @param value         - The value to be checked.\n     *\n     * @return {Boolean}    - true if the value is a Function; otherwise, false.\n     *\n     * @example\n     * z.util.isFunction(function(){});//true\n     * z.util.isFunction(Math.abs);//true\n     */\n    isFunction: function (value) {\n    },\n\n    /**\n     * Determines whether the passed value is a Number\n     *\n     * @param value         - The value to be checked.\n     *\n     * @return {Boolean}    - true if the value is a Number; otherwise, false.\n     *\n     * @example\n     * z.util.isNumber(0);//true\n     * z.util.isNumber(-1);//true\n     * z.util.isNumber(new Number(0));//true\n     */\n    isNumber: function (value) {\n    },\n\n    /**\n     * Merges one or more arrays to the target array\n     *\n     * @param {Array}targetArray    - The target array.\n     * @param {Array}srcArrays      - The source array(s).\n     *\n     * @return {Array}targetArray   - The target array.\n     *\n     * @example\n     * z.util.mergeArray([1,2],[3,4]);//[1,2,3,4]\n     * z.util.mergeArray([1, 2], [3], [4], [[5, 6]]);//[1, 2, 3, 4, [5, 6]]\n     */\n    mergeArray: function (targetArray, srcArrays) {\n    },\n\n    /**\n     * Executes a provided function once for each array element.\n     * <b>\u2605The callback function returns false to break the loop. If the loop will not be broken, just uses array.forEach.</b>\n     *\n     * @param {Array}array          - The array that eachArray is being applied to.\n     * @param {Function}callback    - Function to execute for each element,<b>Returns false to break the loop.</b>, taking two arguments:\n     *          <ul>\n     *              <li>currentValue</li>   - The value of the current element being processed in the array.\n     *              <li>index</li>          - The index of the current element being processed in the array.\n     *          </ul>\n     * @param {Object}[thisArg] - Value to use as this (i.e the reference Object) when executing callback.\n     *\n     * @return void\n     *\n     * @example\n     * <pre>\n     * var array = [1, 2, 3]\n     * z.util.eachArray(function (item, index) {\n     *    console.log(item);\n     * });\n     * var has2 = false;\n     * z.util.eachArray(function (item, index) {\n     *   console.log(item);\n     *   if (item === 2) {\n     *       has2 = true;\n     *       return false;//stop\n     *   }\n     * });\n     * </pre>\n     */\n    eachArray: function (array, callback, thisArg) {\n    },\n\n    /**\n     * Creates a new array with all elements that pass the test implemented by the provided function.\n     *\n     * @param {Array}array          - The array filterArray was called upon.\n     * @param {Function}callback    - Function is a predicate, to test each element of the array.\n     *                                \u2605Return <b>true</b> to keep the element, false otherwise. It accepts two arguments:\n     *                                  <ul>\n     *                                      <li>element</li> - The current element being processed in the array.\n     *                                      <li>index</li> - The index of the current element being processed in the array.\n     *                                  </ul>\n     * @param {Object}[thisArg]     - Value to use as this when executing callback.\n     *\n     * @return {Array}newArray - A new array with the elements that pass the test. If no elements pass the test, an empty array[] will be returned.\n     *\n     * @example\n     * <pre>\n     * var arr = [10,20,30];\n     * var newArr = z.util.filterArray(arr,function (item) {\n     *    return item > 10;\n     * });\n     * console.log(newArr);//[20,30]\n     *</pre>\n     */\n    filterArray: function (array, callback, thisArg) {\n    },\n\n    /**\n     * Returns the first element in the array that satisfies the provided testing function. Otherwise undefined is returned.\n     *\n     * @param {Array}array - The array findArray was called upon.\n     * @param {Function}callback - Function to execute on each value in the array, taking two arguments:\n     *          <ul>\n     *              <li>element</li>The current element being processed in the array.\n     *              <li>index</li>The index of the current element being processed in the array.\n     *          </ul>\n     * @param {Object}[thisArg] - Value to use as this when executing callback.\n     *\n     * @return {*}item - The first element in the array that satisfies the provided testing function(\u2605return true); otherwise, undefined is returned.\n     *\n     * @example\n     * <pre>\n     * var arr = [\n     *    {name:\"a\"},\n     *    {name:\"b\"},\n     *    {name:\"c\"}\n     * ];\n     * var c = z.util.findArray(arr,function (item) {\n     *    return item.name === \"c\"\n     * });\n     * console.log(c);//{name:\"c\"}\n     *</pre>\n     */\n    findArray: function (array, callback, thisArg) {\n    },\n\n    /**\n     *  Removes the first element in the array that satisfies the provided testing function.\n     *\n     * @param {Array}array          - The array removeArrayItem was called upon.\n     * @param {Function}callback    - Function to execute on each value in the array, taking two arguments:\n     *                                  <ul>\n     *                                      <li>element</li> - The current element being processed in the array.\n     *                                      <li>index</li> - The index of the current element being processed in the array.\n     *                                  </ul>\n     *                                  \u2605<b>If the callback function returns true, the item will be removed and returned</b>\n     * @param {Object}[thisArg]     - Value to use as this when executing callback.\n     *\n     * @return removedItem          - The first element in the array that satisfies the provided testing function; otherwise, undefined is returned.\n     *\n     * @example\n     * <pre>\n     * var arr = [\n     *    {name: \"a\"},\n     *    {name: \"b\"},\n     *    {name: \"c\"}\n     * ];\n     * var bItem = z.util.removeArrayItem(arr, function (item) {\n     *    return item.name === \"b\";\n     * });\n     * console.log(bItem);//{name:\"b\"}\n     * console.log(arr);//[{name: \"a\"},{name: \"c\"}]\n     * </pre>\n     */\n    removeArrayItem: function (array, callback, thisArg) {\n    },\n\n    /**\n     * Creates an object composed of keys generated from the results of running each element of array.\n     *\n     * @param {Array}array                          - The specified array to be converted\n     * @param {(String|Function)}keyOrFunction      - The specified key property or the function to generate the key.\n     * @param {Object}[thisArg]                     - Value to use as this when executing key function. If keyOrFunction is not a function, it will be ignored.\n     *\n     * @return {Object}mapObject                    - The composed aggregate object.\n     *\n     * @example\n     * <pre>\n     * var array = [\n     *      {name: \"a\", value: 10},\n     *      {name: \"b\", value: 20},\n     *      {name: \"c\", value: 30}\n     * ];\n     * var map1 = z.util.toArrayMap(array, \"name\");\n     * console.log(map1);//{a:{\"name\":\"a\",\"value\":10},b:{\"name\":\"b\",\"value\":20},c:{\"name\":\"c\",\"value\":30}}\n     * var map2 = z.util.toArrayMap(array, function (item) {\n     *      return \"_\" + item.name;\n     * });\n     * console.log(map2);//{_a:{\"name\":\"a\",\"value\":10},_b:{\"name\":\"b\",\"value\":20},_c:{\"name\":\"c\",\"value\":30}}\n     *\n     * </pre>\n     */\n    toArrayMap: function (array, keyOrFunction, thisArg) {\n    },\n\n\n    /**\n     * Merges the values of all enumerable own properties from one or more source objects to a target object. It will return the target object.\n     * *Properties in the target object will be overwritten by properties in the sources if they have the same key.\n     * *Later sources' properties will similarly overwrite earlier ones.\n     * *For deep merge, please see {@link z.util.deepMergeObject}.\n     *\n     * @param {Object}targetObject          - The target object.\n     * @param {...Object}sourceObjects      - The source object(s).\n     *\n     * @return {Object}targetObject         - The target object.\n     *\n     *\n     * @example\n     * <pre>\n     * console.log(z.util.mergeObject({a: 1, b: 2, c: {x: 100, y: 200}}, {d: 4}, {e: \"a\"}));\n     * {\n     *   a: 1,\n     *   b: 2,\n     *   c: {x: 100, y: 200},\n     *   d: 4,\n     *   e: \"a\"\n     * }\n     *\n     * console.log(z.util.mergeObject({a: 1, b: 2, c: {x: 100, y: 200}}, {c: 4}, {e: \"a\"}));\n     * {\n     *   a: 1,\n     *   b: 2,\n     *   c: 4,\n     *   e: \"a\"\n     * }\n     *\n     * console.log(z.util.mergeObject({a: 1, b: 2, c: {x: 100, y: 200}}, {c: {z: 300}}, {e: \"a\"}));\n     * {\n     *   a: 1,\n     *   b: 2,\n     *   c: {z: 300},\n     *   e: \"a\"\n     * }\n     *</pre>\n     */\n    mergeObject: function (targetObject, sourceObjects) {\n    },\n\n    /**\n     * Merges the values of all enumerable own properties from one or more source objects to a target object. It will return the target object.\n     * *The difference between {@link z.util.deepMergeObject} and {@link z.util.mergeObject} is that for the Object type property,\n     * <ul>\n     *     <li>mergeObject</li>only makes a simple assignment\n     *     <li>deepMergeObject</li>creates a new object and assigns to the targetObject\n     * </ul>\n     *\n     * @param {Object}targetObject          - The target object.\n     * @param {...Object}sourceObjects      - The source object(s).\n     *\n     * @return {Object}targetObject         - The target object.\n     *\n     *\n     * @example\n     * <pre>\n     * console.log(z.util.deepMergeObject({a: 1, b: 2, c: {x: 100, y: 200}}, {d: 4}, {e: \"a\"}));\n     * //same as mergeObject\n     * {\n     *   a: 1,\n     *   b: 2,\n     *   c: {x: 100, y: 200},\n     *   d: 4,\n     *   e: \"a\"\n     * }\n     *\n     * console.log(z.util.deepMergeObject({a: 1, b: 2, c: {x: 100, y: 200}}, {c: 4}, {e: \"a\"}));\n     * //same as mergeObject\n     * {\n     *   a: 1,\n     *   b: 2,\n     *   c: 4,\n     *   e: \"a\"\n     * }\n     *\n     * console.log(z.util.deepMergeObject({a: 1, b: 2, c: {x: 100, y: 200}}, {c: {z: 300}}, {e: \"a\"}));\n     * //Different from mergeObject\n     * {\n     *   a: 1,\n     *   b: 2,\n     *   c:{x: 100, y: 200, z: 300},\n     *   e: \"a\"\n     * }\n     *</pre>\n     */\n    deepMergeObject: function (targetObject, sourceObjects) {\n    },\n\n    /**\n     * Executes a provided function once for each object enumerable own property.\n     *\n     * @param {Object}object        - The object that eachObject is being applied to.\n     * @param {Function}callback    - Function to execute for each property, taking two arguments:\n     *          <ul>\n     *              <li>key</li>     - The key of the current property being processed in the object.\n     *              <li>value</li>   - The value of the current property being processed in the object.\n     *          </ul>\n     *          *<b>If the callback function returns false, the eachObject will stop</b>\n     * @param {Object}[thisArg] -Value to use as this when executing callback.\n     *\n     * @return void\n     *\n     * @example\n     * <pre>\n     * var obj = {name:\"focus-ui\",version:0.6};\n     * z.util.eachObject(obj,function (key, value) {\n     *    console.log(key,value);\n     * });\n     * </pre>\n     */\n    eachObject: function (object, callback, thisArg) {\n    },\n\n    /**\n     *  Creates a new object with all enumerable own properties that pass the test implemented by the provided function.\n     *\n     * @param {Object}object        - The object that filterObject is being applied to.\n     * @param {Function}callback    -  Function is a predicate, to test each enumerable own property of the object. Return true to keep the property, false otherwise. It accepts two arguments:\n     *          <ul>\n     *              <li>key</li>     - The key of the current property being processed in the object.\n     *              <li>value</li>   - The value of the current property being processed in the object.\n     *          </ul>\n     *\n     * @param {Object}[thisArg]     - Value to use as this when executing callback.\n     *\n     * @return {Object}newObject   - A new object with the enumerable own properties that pass the test. If no properties pass the test, an empty object will be returned.\n     *\n     * @example\n     * <pre>\n     * var object = {\n     *      a: 1,\n     *      b: 2,\n     *      c: {x: 100, y: 200},\n     *      d: \"abc\",\n     *      e: \"123\"\n     *  };\n     * var stringObject = z.util.filterObject(object, function (key, value) {\n     *    return z.util.isString(value);\n     * });\n     * console.log(stringObject);//{d:\"abc\",e:\"123\"}\n     * </pre>\n     *\n     */\n    filterObject: function (object, callback, thisArg) {\n    },\n\n    /**\n     *  Gets the value at path of object.\n     *  <b>Only processing object, array is not processed</b>\n     * @param {Object}object            - The object to query\n     * @param {String}deepPath          - The path of the property to get\n     *\n     * @param {String}[pathSeparator]   - Optional. Specifies the character, or the regular expression, to use for splitting the path. default \".\"\n     *\n     * @return {*}value   -  the result value.\n     *\n     * @example\n     * <pre>\n     * var object = {\n     *     c: {\n     *         x: 100,\n     *         y: 200,\n     *         z: {\n     *             a: \"abc\",\n     *             b: \"xyz\"\n     *         }\n     *     }\n     * };\n     * var czb = z.util.getObjectDeepValue(object, \"c.z.b\");//\"xyz\"\n     *</pre>\n     */\n    getObjectDeepValue: function (object, deepPath, pathSeparator) {\n    },\n\n    /**\n     *  Sets the value at path of object. If a portion of path doesn't exist, it's created\n     *  <b>Only processing object, array is not processed</b>\n     *\n     * @param {Object}object            - The object to modify\n     * @param {String}deepPath          - The path of the property to set.\n     * @param {*}value                  - The value to set.\n     * @param {String}[pathSeparator]   - Optional. Specifies the character, or the regular expression, to use for splitting the path. default \".\"\n     *\n     * @return void\n     *\n     * @example\n     * <pre>\n     * var object = {\n     *     c: {\n     *         x: 100, y: 200, z: { a: \"abc\",b: \"xyz\"}\n     *     }\n     * };\n     * z.util.setObjectDeepValue(object, \"a\", \"1\");\n     * z.util.setObjectDeepValue(object, \"b.m\", \"1000\");\n     * z.util.setObjectDeepValue(object, \"c.z.c\", 123);\n     * console.log(object)\n     * /!*{\n     *       a: \"1\",\n     *       b: {m: \"1000\" },\n     *      c: {x: 100, y: 200, z: {a: \"abc\", b: \"xyz\", c: 123}}\n     *   }*!/\n     * </pre>\n     */\n    setObjectDeepValue: function (object, deepPath, value, pathSeparator) {\n    },\n\n    /**\n     * Returns an array of a given object's own enumerable property values.\n     *\n     * @param {Object}object            - The object whose enumerable own property values are to be returned.\n     * @return {Array}valueArray        - An array containing the given object's own enumerable property values.\n     *\n     * @example\n     * <pre>\n     * var object = {\n     *    a: 'a',\n     *    b: 1,\n     *    c: false\n     * };\n     * console.log(z.util.getObjectValues(object));//[\"a\", 1, false]\n     * </pre>\n     *\n     */\n    getObjectValues: function (object) {\n    },\n\n    /*#callBatch*/\n    /**\n     *  Calls a function after a specified number of milliseconds.\n     *\n     * @param {Function}callBack        - The function that will be executed\n     * @param {Number}[delay]           - The number of milliseconds to wait before executing the code. If omitted, the value 20 is used\n     * @param {Object}[thisArg]         - Value to use as this when executing callback.\n     *\n     * @return {String} callLaterID     - A string type value, representing the ID value of the timer that is set.\n     *                                     Use this value with the cancelCallLater() method to cancel the timer.\n     *\n     * @example\n     * <pre>\n     * z.util.callLater(function () {\n     *     console.log(\"1s later\")\n     * }, 1000)\n     * </pre>\n     * @see {@link z.util.cancelCallLater}\n     */\n    callLater: function (callBack, delay, thisArg) {\n    },\n\n    /**\n     *\n     * Cancels the function set with the callLater() to execute:\n     *\n     * @param {(String|Function)}idOrFunction     - The identifier/function you want to cancel callLater.\n     *                                             <ul>\n     *                                                 <li>IF it is id</li>that should be returned by the corresponding call to callLater().\n     *                                                 <li>IF it is function</li>that should be the callBack function\n     *                                             </ul>\n     *\n     * @param {Number}[delay]       - The number of milliseconds to wait before executing the code. If omitted, the value 20 is used\n     * @param {Object}[thisArg]     - Value to use as this when executing callback.\n     *\n     * @return void\n     *\n     * @example\n     * <pre>\n     * //id\n     * var id = z.util.callLater(function () {\n     *     console.log(\"never called\")\n     * }, 1000);\n     * z.util.cancelCallLater(id);\n     *\n     * //function\n     * var callBack = function () {\n     *     console.log(\"never called\")\n     * };\n     * z.util.callLater(callBack, 1000);\n     * z.util.cancelCallLater(callBack, 1000);\n     * </pre>\n     *\n     * @see {@link z.util.callLater}\n     */\n    cancelCallLater: function (idOrFunction, delay, thisArg) {\n    },\n\n    /**\n     * Calls a function with a fixed time delay between each call\n     *\n     * @param {Function}callBack            - The function that will be executed.\n     *                                          <b>If the callback function returns false, the callInterval will stop.</b>\n     * @param {Number}[intervals]           - The intervals (in milliseconds) on how often to execute the code. If omitted, the value 20 is used.", "domain": "javascript", "lang": "code", "char_count": 20140, "word_count": 4595, "byte_count": 20148}
{"text": "import React from \"react\";\n\nconst Footer = () => {\n  return (\n    <div>\n      <footer>\n        <div className=\"row\">\n          <div className=\"col span-1-of-2\">\n            <ul className=\"footer-nav\">\n              <li>\n                <a href=\"#\">About us</a>\n              </li>\n              <li>\n                <a href=\"#\">Blog</a>\n              </li>\n              <li>\n                <a href=\"#\">Press</a>\n              </li>\n              <li>\n                <a href=\"#\">iOS App</a>\n              </li>\n              <li>\n                <a href=\"#\">Android App</a>\n              </li>\n            </ul>\n          </div>\n          <div className=\"col span-1-of-2\">\n            <ul className=\"social-links\">\n              <li>\n                <a href=\"#\">\n                  <ion-icon name=\"logo-facebook\" className=\"facebook-icon\"></ion-icon>\n                </a>\n              </li>\n\n              <li>\n                <a href=\"#\">\n                  <ion-icon name=\"logo-twitter\" className=\"twitter-icon\"></ion-icon>\n                </a>\n              </li>\n\n              <li>\n                <a href=\"#\">\n                  <ion-icon name=\"logo-googleplus\" className=\"googleplus-icon\"></ion-icon>\n                </a>\n              </li>\n\n              <li>\n                <a href=\"#\">\n                  <ion-icon name=\"logo-instagram\" className=\"instagram-icon\"></ion-icon>\n                </a>\n              </li>\n            </ul>\n          </div>\n        </div>\n        <div className=\"row\">\n          <p>Copyright &copy; 2021 | ZBlock | All rights reserved.</p>\n        </div>\n      </footer>\n    </div>\n  );\n};\n\nexport default Footer;", "domain": "javascript", "lang": "code", "char_count": 1652, "word_count": 440, "byte_count": 1652}
{"text": "\ufeff/*!\nJssor Slider (MIT license)\n*/\n/* eslint-disable */\n!function(j,h,n,g,d,k,e){new(function(){});var c={C:n.PI,k:n.max,j:n.min,I:n.ceil,P:n.floor,m:n.abs,rb:n.sin,Kb:n.cos,xd:n.tan,Af:n.atan,Mb:n.sqrt,q:n.pow,td:n.random,$Round:n.round},f=j.$Jease$={$Swing:function(a){return-c.Kb(a*c.C)/2+.5},$Linear:function(a){return a},$InQuad:function(a){return a*a},$OutQuad:function(a){return-a*(a-2)},$InOutQuad:function(a){return(a*=2)<1?1/2*a*a:-1/2*(--a*(a-2)-1)},$InCubic:function(a){return a*a*a},$OutCubic:function(a){return(a-=1)*a*a+1},$InOutCubic:function(a){return(a*=2)<1?1/2*a*a*a:1/2*((a-=2)*a*a+2)},$InQuart:function(a){return a*a*a*a},$OutQuart:function(a){return-((a-=1)*a*a*a-1)},$InOutQuart:function(a){return(a*=2)<1?1/2*a*a*a*a:-1/2*((a-=2)*a*a*a-2)},$InQuint:function(a){return a*a*a*a*a},$OutQuint:function(a){return(a-=1)*a*a*a*a+1},$InOutQuint:function(a){return(a*=2)<1?1/2*a*a*a*a*a:1/2*((a-=2)*a*a*a*a+2)},$InSine:function(a){return 1-c.Kb(c.C/2*a)},$OutSine:function(a){return c.rb(c.C/2*a)},$InOutSine:function(a){return-1/2*(c.Kb(c.C*a)-1)},$InExpo:function(a){return a==0?0:c.q(2,10*(a-1))},$OutExpo:function(a){return a==1?1:-c.q(2,-10*a)+1},$InOutExpo:function(a){return a==0||a==1?a:(a*=2)<1?1/2*c.q(2,10*(a-1)):1/2*(-c.q(2,-10*--a)+2)},$InCirc:function(a){return-(c.Mb(1-a*a)-1)},$OutCirc:function(a){return c.Mb(1-(a-=1)*a)},$InOutCirc:function(a){return(a*=2)<1?-1/2*(c.Mb(1-a*a)-1):1/2*(c.Mb(1-(a-=2)*a)+1)},$InElastic:function(a){if(!a||a==1)return a;var b=.3,d=.075;return-(c.q(2,10*(a-=1))*c.rb((a-d)*2*c.C/b))},$OutElastic:function(a){if(!a||a==1)return a;var b=.3,d=.075;return c.q(2,-10*a)*c.rb((a-d)*2*c.C/b)+1},$InOutElastic:function(a){if(!a||a==1)return a;var b=.45,d=.1125;return(a*=2)<1?-.5*c.q(2,10*(a-=1))*c.rb((a-d)*2*c.C/b):c.q(2,-10*(a-=1))*c.rb((a-d)*2*c.C/b)*.5+1},$InBack:function(a){var b=1.70158;return a*a*((b+1)*a-b)},$OutBack:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},$InOutBack:function(a){var b=1.70158;return(a*=2)<1?1/2*a*a*(((b*=1.525)+1)*a-b):1/2*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},$InBounce:function(a){return 1-f.$OutBounce(1-a)},$OutBounce:function(a){return a<1/2.75?7.5625*a*a:a<2/2.75?7.5625*(a-=1.5/2.75)*a+.75:a<2.5/2.75?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},$InOutBounce:function(a){return a<1/2?f.$InBounce(a*2)*.5:f.$OutBounce(a*2-1)*.5+.5},$GoBack:function(a){return 1-c.m(2-1)},$InWave:function(a){return 1-c.Kb(a*c.C*2)},$OutWave:function(a){return c.rb(a*c.C*2)},$OutJump:function(a){return 1-((a*=2)<1?(a=1-a)*a*a:(a-=1)*a*a)},$InJump:function(a){return(a*=2)<1?a*a*a:(a=2-a)*a*a},$Early:c.I,$Late:c.P};var b=j.$Jssor$=new function(){var i=this,Ab=/\\S+/g,N=1,jb=2,mb=3,lb=4,pb=5,O,t=0,l=0,u=0,A=0,B=0,E=navigator,ub=E.appName,o=E.userAgent,z=h.documentElement,q=parseFloat;function Ib(){if(!O){O={Mg:\"ontouchstart\"in j||\"createTouch\"in h};var a;if(E.pointerEnabled||(a=E.msPointerEnabled))O.Zd=a?\"msTouchAction\":\"touchAction\"}return O}function w(g){if(!t){t=-1;if(ub==\"Microsoft Internet Explorer\"&&!!j.attachEvent&&!!j.ActiveXObject){var e=o.indexOf(\"MSIE\");t=N;u=q(o.substring(e+5,o.indexOf(\";\",e)));/*@cc_on A=@_jscript_version@*/;l=h.documentMode||u}else if(ub==\"Netscape\"&&!!j.addEventListener){var d=o.indexOf(\"Firefox\"),b=o.indexOf(\"Safari\"),f=o.indexOf(\"Chrome\"),c=o.indexOf(\"AppleWebKit\");if(d>=0){t=jb;l=q(o.substring(d+8))}else if(b>=0){var i=o.substring(0,b).lastIndexOf(\"/\");t=f>=0?lb:mb;l=q(o.substring(i+1,b))}else{var a=/Trident\\/.*rv:([0-9]{1,}[\\.0-9]{0,})/i.exec(o);if(a){t=N;l=u=q(a[1])}}if(c>=0)B=q(o.substring(c+12))}else{var a=/(opera)(?:.*version|)[ \\/]([\\w.]+)/i.exec(o);if(a){t=pb;l=q(a[2])}}}return g==t}function r(){return w(N)}function ib(){return r()&&(l<6||h.compatMode==\"BackCompat\")}function Bb(){return w(jb)}function kb(){return w(mb)}function Eb(){return w(lb)}function ob(){return w(pb)}function eb(){return kb()&&B>534&&B<535}function I(){w();return B>537||l>42||t==N&&l>=11}function gb(){return r()&&l<9}function fb(a){var b,c;return function(g){if(!b){b=d;var f=a.substr(0,1).toUpperCase()+a.substr(1);n([a].concat([\"WebKit\",\"ms\",\"Moz\",\"O\",\"webkit\"]),function(h,d){var b=a;if(d)b=h+f;if(g.style[b]!=e)return c=b})}return c}}function db(b){var a;return function(c){a=a||fb(b)(c)||b;return a}}var P=db(\"transform\");function tb(a){return{}.toString.call(a)}var qb={};n([\"Boolean\",\"Number\",\"String\",\"Function\",\"Array\",\"Date\",\"RegExp\",\"Object\"],function(a){qb[\"[object \"+a+\"]\"]=a.toLowerCase()});function n(b,d){var a,c;if(tb(b)==\"[object Array]\"){for(a=0;a<b.length;a++)if(c=d(b[a],a,b))return c}else for(a in b)if(c=d(b[a],a,b))return c}function H(a){return a==g?String(a):qb[tb(a)]||\"object\"}function rb(a){for(var b in a)return d}function C(a){try{return H(a)==\"object\"&&!a.nodeType&&a!=a.window&&(!a.constructor||{}.hasOwnProperty.call(a.constructor.prototype,\"isPrototypeOf\"))}catch(b){}}function p(a,b){return{x:a,y:b}}function yb(b,a){setTimeout(b,a||0)}function D(b,d,c){var a=!b||b==\"inherit\"?\"\":b;n(d,function(c){var b=c.exec(a);if(b){var d=a.substr(0,b.index),e=a.substr(b.index+b[0].length+1,a.length-1);a=d+e}});a&&(c+=(!a.indexOf(\" \")?\"\":\" \")+a);return c}function U(b,a){if(l<9)b.style.filter=a}function vb(a,b){if(a===e)a=b;return a}i.$Device=Ib;i.$IsBrowserIE=r;i.$IsBrowserIeQuirks=ib;i.$IsBrowserFireFox=Bb;i.$IsBrowserSafari=kb;i.$IsBrowserChrome=Eb;i.$IsBrowserOpera=ob;i.yg=I;fb(\"transform\");i.$BrowserVersion=function(){return l};i.$BrowserEngineVersion=function(){return u||l};i.$WebKitVersion=function(){w();return B};i.$Delay=yb;i.Y=vb;i.Gg=function(a,b){b.call(a);return G({},a)};function Z(a){a.constructor===Z.caller&&a.jc&&a.jc.apply(a,Z.caller.arguments)}i.jc=Z;i.$GetElement=function(a){if(i.Fg(a))a=h.getElementById(a);return a};function v(a){return a||j.event}i.$EvtSrc=function(b){b=v(b);var a=b.target||b.srcElement||h;if(a.nodeType==3)a=i.Cc(a);return a};i.de=function(a){a=v(a);return{x:a.pageX||a.clientX||0,y:a.pageY||a.clientY||0}};i.$WindowSize=function(){var a=h.body;return{x:a.clientWidth||z.clientWidth,y:a.clientHeight||z.clientHeight}};function x(c,d,a){if(a!==e)c.style[d]=a==e?\"\":a;else{var b=c.currentStyle||c.style;a=b[d];if(a==\"\"&&j.getComputedStyle){b=c.ownerDocument.defaultView.getComputedStyle(c,g);b&&(a=b.getPropertyValue(d)||b[d])}return a}}function bb(b,c,a,d){if(a===e){a=q(x(b,c));isNaN(a)&&(a=g);return a}if(a==g)a=\"\";else d&&(a+=\"px\");x(b,c,a)}function m(c,a){var d=a?bb:x,b;if(a&4)b=db(c);return function(e,f){return d(e,b?b(e):c,f,a&2)}}function Db(b){if(r()&&u<9){var a=/opacity=([^)]*)/.exec(b.style.filter||\"\");return a?q(a[1])/100:1}else return q(b.style.opacity||\"1\")}function Fb(b,a,f){if(r()&&u<9){var h=b.style.filter||\"\",i=new RegExp(/[\\s]*alpha\\([^\\)]*\\)/g),e=c.$Round(100*a),d=\"\";if(e<100||f)d=\"alpha(opacity=\"+e+\") \";var g=D(h,[i],d);U(b,g)}else b.style.opacity=a==1?\"\":c.$Round(a*100)/100}var Q={$Rotate:[\"rotate\"],$RotateX:[\"rotateX\"],$RotateY:[\"rotateY\"],$SkewX:[\"skewX\"],$SkewY:[\"skewY\"]};if(!I())Q=G(Q,{$ScaleX:[\"scaleX\",2],$ScaleY:[\"scaleY\",2],$TranslateZ:[\"translateZ\",1]});function R(d,a){var c=\"\";if(a){if(r()&&l&&l<10){delete a.$RotateX;delete a.$RotateY;delete a.$TranslateZ}b.$Each(a,function(d,b){var a=Q[b];if(a){var e=a[1]||0;if(S[b]!=d)c+=\" \"+a[0]+\"(\"+d+([\"deg\",\"px\",\"\"])[e]+\")\"}});if(I()){if(a.$TranslateX||a.$TranslateY||a.$TranslateZ!=e)c+=\" translate3d(\"+(a.$TranslateX||0)+\"px,\"+(a.$TranslateY||0)+\"px,\"+(a.$TranslateZ||0)+\"px)\";if(a.$ScaleX==e)a.$ScaleX=1;if(a.$ScaleY==e)a.$ScaleY=1;if(a.$ScaleX!=1||a.$ScaleY!=1)c+=\" scale3d(\"+a.$ScaleX+\", \"+a.$ScaleY+\", 1)\"}}d.style[P(d)]=c}i.dg=m(\"transformOrigin\",4);i.gg=m(\"backfaceVisibility\",4);i.jg=m(\"transformStyle\",4);i.ig=m(\"perspective\",6);i.hg=m(\"perspectiveOrigin\",4);i.cg=function(b,a){if(r()&&u<9||u<10&&ib())b.style.zoom=a==1?\"\":a;else{var c=P(b),f=a==1?\"\":\"scale(\"+a+\")\",e=b.style[c],g=new RegExp(/[\\s]*scale\\(.*?\\)/g),d=D(e,[g],f);b.style[c]=d}};i.$AddEvent=function(a,c,d,b){a=i.$GetElement(a);if(a.addEventListener){c==\"mousewheel\"&&a.addEventListener(\"DOMMouseScroll\",d,b);a.addEventListener(c,d,b)}else if(a.attachEvent){a.attachEvent(\"on\"+c,d);b&&a.setCapture&&a.setCapture()}};i.fb=function(a,c,d,b){a=i.$GetElement(a);if(a.removeEventListener){c==\"mousewheel\"&&a.removeEventListener(\"DOMMouseScroll\",d,b);a.removeEventListener(c,d,b)}else if(a.detachEvent){a.detachEvent(\"on\"+c,d);b&&a.releaseCapture&&a.releaseCapture()}};i.$FireEvent=function(c,b){var a;if(h.createEvent){a=h.createEvent(\"HTMLEvents\");a.initEvent(b,k,k);c.dispatchEvent(a)}else{var d=\"on\"+b;a=h.createEventObject();c.fireEvent(d,a)}};i.$CancelEvent=function(a){a=v(a);a.preventDefault&&a.preventDefault();a.cancel=d;a.returnValue=k};i.$StopEvent=function(a){a=v(a);a.stopPropagation&&a.stopPropagation();a.cancelBubble=d};i.$CreateCallback=function(d,c){var a=[].slice.call(arguments,2),b=function(){var b=a.concat([].slice.call(arguments,0));return c.apply(d,b)};return b};i.$InnerText=function(a,b){if(b==e)return a.textContent||a.innerText;var c=h.createTextNode(b);i.Dc(a);a.appendChild(c)};i.$InnerHtml=function(a,b){if(b==e)return a.innerHTML;a.innerHTML=b};i.$ClearInnerHtml=function(a){a.innerHTML=\"\"};i.$Children=function(d,c){for(var b=[],a=d.firstChild;a;a=a.nextSibling)(c||a.nodeType==1)&&b.push(a);return b};function sb(a,c,e,b){b=b||\"u\";for(a=a?a.firstChild:g;a;a=a.nextSibling)if(a.nodeType==1){if(M(a,b)==c)return a;if(!e){var d=sb(a,c,e,b);if(d)return d}}}i.$FindChild=sb;function X(a,d,f,b){b=b||\"u\";var c=[];for(a=a?a.firstChild:g;a;a=a.nextSibling)if(a.nodeType==1){M(a,b)==d&&c.push(a);if(!f){var e=X(a,d,f,b);if(e.length)c=c.concat(e)}}return c}function nb(a,c,d){for(a=a?a.firstChild:g;a;a=a.nextSibling)if(a.nodeType==1){if(a.tagName==c)return a;if(!d){var b=nb(a,c,d);if(b)return b}}}i.sg=nb;i.ug=function(b,a){return b.getElementsByTagName(a)};i.Wb=function(a,f,d){d=d||\"u\";var e;do{if(a.nodeType==1){var c=b.$AttributeEx(a,d);if(c&&c==vb(f,c)){e=a;break}}a=b.Cc(a)}while(a&&a!=h.body);return e};function G(){var f=arguments,d,c,b,a,h=1&f[0],g=1+h;d=f[g-1]||{};for(;g<f.length;g++)if(c=f[g])for(b in c){a=c[b];if(a!==e){a=c[b];var i=d[b];d[b]=h&&(C(i)||C(a))?G(h,{},i,a):a}}return d}i.B=G;function ab(f,g){var d={},c,a,b;for(c in f){a=f[c];b=g[c];if(a!==b){var e;if(C(a)&&C(b)){a=ab(a,b);e=!rb(a)}!e&&(d[c]=a)}}return d}i.kd=function(a){return H(a)==\"function\"};i.Fg=function(a){return H(a)==\"string\"};i.mc=function(a){return!isNaN(q(a))&&isFinite(a)};i.$Each=n;i.sd=C;function V(a){return h.createElement(a)}i.$CreateElement=V;i.$CreateDiv=function(){return V(\"DIV\")};i.wg=function(){return V(\"SPAN\")};i.ed=function(){};function F(b,c,a){if(a==e)return b.getAttribute(c);b.setAttribute(c,a)}function M(a,b){return F(a,b)||F(a,\"data-\"+b)}i.$Attribute=F;i.$AttributeEx=M;i.db=function(d,b,c){var a=i.vg(M(d,b));if(isNaN(a))a=c;return a};function y(b,a){return F(b,\"class\",a)||\"\"}function xb(b){var a={};n(b,function(b){if(b!=e)a[b]=b});return a}function zb(b,a){return b.match(a||Ab)}function T(b,a){return xb(zb(b||\"\",a))}i.dd=xb;i.qg=zb;function cb(b,c){var a=\"\";n(c,function(c){a&&(a+=b);a+=c});return a}function K(a,c,b){y(a,cb(\" \",G(ab(T(y(a)),T(c)),T(b))))}i.Cc=function(a){return a.parentNode};i.eb=function(a){i.ac(a,\"none\")};i.J=function(a,b){i.ac(a,b?\"none\":\"\")};i.kg=function(b,a){b.removeAttribute(a)};i.pg=function(d,a){if(a)d.style.clip=\"rect(\"+c.$Round(a.$Top||a.F||0)+\"px \"+c.$Round(a.$Right)+\"px \"+c.$Round(a.$Bottom)+\"px \"+c.$Round(a.$Left||a.G||0)+\"px)\";else if(a!==e){var h=d.style.cssText,g=[new RegExp(/[\\s]*clip: rect\\(.*?\\)[;]?/i),new RegExp(/[\\s]*cliptop: .*?[;]?/i),new RegExp(/[\\s]*clipright: .*?[;]?/i),new RegExp(/[\\s]*clipbottom: .*?[;]?/i),new RegExp(/[\\s]*clipleft: .*?[;]?/i)],f=D(h,g,\"\");b.$CssCssText(d,f)}};i.cb=function(){return+new Date};i.$AppendChild=function(b,a){b.appendChild(a)};i.Nb=function(b,a,c){(c||a.parentNode).insertBefore(b,a)};i.fc=function(b,a){a=a||b.parentNode;a&&a.removeChild(b)};i.og=function(a,b){n(a,function(a){i.fc(a,b)})};i.Dc=function(a){i.og(i.$Children(a,d),a)};i.Bc=function(a,b){var c=i.Cc(a);b&1&&i.R(a,(i.$CssWidth(c)-i.$CssWidth(a))/2);b&2&&i.U(a,(i.$CssHeight(c)-i.$CssHeight(a))/2)};var W={$Top:g,$Right:g,$Bottom:g,$Left:g,D:g,E:g};i.ng=function(a){var b=i.$CreateDiv();s(b,{bc:\"block\",sb:i.tb(a),$Top:0,$Left:0,D:0,E:0});var d=i.nd(a,W);i.Nb(b,a);i.$AppendChild(b,a);var e=i.nd(a,W),c={};n(d,function(b,a){if(b==e[a])c[a]=b});s(b,W);s(b,c);s(a,{$Top:0,$Left:0});return c};i.vg=q;function Y(d,c,b){var a=d.cloneNode(!c);!b&&i.kg(a,\"id\");return a}i.$CloneNode=Y;i.Pb=function(e,f){var a=new Image;function b(e,d){i.fb(a,\"load\",b);i.fb(a,\"abort\",c);i.fb(a,\"error\",c);f&&f(a,d)}function c(a){b(a,d)}if(ob()&&l<11.6||!e)b(!e);else{i.$AddEvent(a,\"load\",b);i.$AddEvent(a,\"abort\",c);i.$AddEvent(a,\"error\",c);a.src=e}};i.qe=function(d,a,e){var c=d.length+1;function b(b){c--;if(a&&b&&b.src==a.src)a=b;!c&&e&&e(a)}n(d,function(a){i.Pb(a.src,b)});b()};i.Id=function(a,g,i,h){if(h)a=Y(a);var c=X(a,g);if(!c.length)c=b.ug(a,g);for(var f=c.length-1;f>-1;f--){var d=c[f],e=Y(i);y(e,y(d));b.$CssCssText(e,d.style.cssText);b.Nb(e,d);b.fc(d)}return a};function Gb(a){var d=this,p=\"\",r=[\"av\",\"pv\",\"ds\",\"dn\"],f=[],q,m=0,k=0,g=0;function l(){K(a,q,(f[g||k&2||k]||\"\")+\" \"+(f[m]||\"\"));b.$Css(a,\"pointer-events\",g?\"none\":\"\")}function c(){m=0;l();i.fb(h,\"mouseup\",c);i.fb(h,\"touchend\",c);i.fb(h,\"touchcancel\",c)}function j(a){if(g)i.$CancelEvent(a);else{m=4;l();i.$AddEvent(h,\"mouseup\",c);i.$AddEvent(h,\"touchend\",c);i.$AddEvent(h,\"touchcancel\",c)}}d.zd=function(a){if(a===e)return k;k=a&2||a&1;l()};d.$Enable=function(a){if(a===e)return!g;g=a?0:3;l()};d.$Elmt=a=i.$GetElement(a);F(a,\"data-jssor-button\",\"1\");var o=b.qg(y(a));if(o)p=o.shift();n(r,function(a){f.push(p+a)});q=cb(\" \",f);f.unshift(\"\");i.$AddEvent(a,\"mousedown\",j);i.$AddEvent(a,\"touchstart\",j)}i.lc=function(a){return new Gb(a)};i.$Css=x;i.Zb=m(\"overflow\");i.U=m(\"top\",2);i.xg=m(\"right\",2);i.Je=m(\"bottom\",2);i.R=m(\"left\",2);i.$CssWidth=m(\"width\",2);i.$CssHeight=m(\"height\",2);i.Bg=m(\"marginLeft\",2);i.Ag=m(\"marginTop\",2);i.tb=m(\"position\");i.ac=m(\"display\");i.H=m(\"zIndex\",1);i.Fc=function(b,a,c){if(a!=e)Fb(b,a,c);else return Db(b)};i.$CssCssText=function(a,b){if(b!=e)a.style.cssText=b;else return a.style.cssText};i.pe=function(b,a){if(a===e){a=x(b,\"backgroundImage\")||\"\";var c=/\\burl\\s*\\(\\s*[\"']?([^\"'\\r\\n,]+)[\"']?\\s*\\)/gi.exec(a)||[];return c[1]}x(b,\"backgroundImage\",a?\"url('\"+a+\"')\":\"\")};var L;i.ze=L={$Opacity:i.Fc,$Top:i.U,$Right:i.xg,$Bottom:i.Je,$Left:i.R,D:i.$CssWidth,E:i.$CssHeight,sb:i.tb,bc:i.ac,$ZIndex:i.H};i.nd=function(c,b){var a={};n(b,function(d,b){if(L[b])a[b]=L[b](c)});return a};function s(h,l){var f=gb(),b=I(),d=eb(),j=P(h);function k(b,d,a){var e=b.zb(p(-d/2,-a/2)),f=b.zb(p(d/2,-a/2)),g=b.zb(p(d/2,a/2)),h=b.zb(p(-d/2,a/2));b.zb(p(300,300));return p(c.j(e.x,f.x,g.x,h.x)+d/2,c.j(e.y,f.y,g.y,h.y)+a/2)}function a(d,a){a=a||{};var n=a.$TranslateZ||0,p=(a.$RotateX||0)%360,q=(a.$RotateY||0)%360,u=(a.$Rotate||0)%360,l=a.$ScaleX,m=a.$ScaleY,g=a.th;if(l==e)l=1;if(m==e)m=1;if(g==e)g=1;if(f){n=0;p=0;q=0;g=0}var c=new Cb(a.$TranslateX,a.$TranslateY,n);c.$Scale(l,m,g);c.Ne(a.$SkewX,a.$SkewY);c.$RotateX(p);c.$RotateY(q);c.Pe(u);if(b){c.$Move(a.G,a.F);d.style[j]=c.Ge()}else if(!A||A<9){var o=\"\",h={x:0,y:0};if(a.$OriginalWidth)h=k(c,a.$OriginalWidth,a.$OriginalHeight);i.Ag(d,h.y);i.Bg(d,h.x);o=c.Be();var s=d.style.filter,t=new RegExp(/[\\s]*progid:DXImageTransform\\.Microsoft\\.Matrix\\([^\\)]*\\)/g),r=D(s,[t],o);U(d,r)}}s=function(f,c){c=c||{};var j=c.G,k=c.F,h;n(L,function(a,b){h=c[b];h!==e&&a(f,h)});i.pg(f,c.$Clip);if(!b){j!=e&&i.R(f,(c.Kd||0)+j);k!=e&&i.U(f,(c.Jd||0)+k)}if(c.Oe)if(d)yb(i.$CreateCallback(g,R,f,c));else a(f,c)};i.ic=R;if(d)i.ic=s;if(f)i.ic=a;else if(!b)a=R;i.N=s;s(h,l)}i.ic=s;i.N=s;function Cb(j,k,o){var d=this,b=[1,0,0,0,0,1,0,0,0,0,1,0,j||0,k||0,o||0,1],i=c.rb,h=c.Kb,l=c.xd;function f(a){return a*c.C/180}function n(a,b){return{x:a,y:b}}function m(b,c,f,g,i,l,n,o,q,t,u,w,y,A,C,F,a,d,e,h,j,k,m,p,r,s,v,x,z,B,D,E){return[b*a+c*j+f*r+g*z,b*d+c*k+f*s+g*B,b*e+c*m+f*v+g*D,b*h+c*p+f*x+g*E,i*a+l*j+n*r+o*z,i*d+l*k+n*s+o*B,i*e+l*m+n*v+o*D,i*h+l*p+n*x+o*E,q*a+t*j+u*r+w*z,q*d+t*k+u*s+w*B,q*e+t*m+u*v+w*D,q*h+t*p+u*x+w*E,y*a+A*j+C*r+F*z,y*d+A*k+C*s+F*B,y*e+A*m+C*v+F*D,y*h+A*p+C*x+F*E]}function e(c,a){return m.apply(g,(a||b).concat(c))}d.$Scale=function(a,c,d){if(a!=1||c!=1||d!=1)b=e([a,0,0,0,0,c,0,0,0,0,d,0,0,0,0,1])};d.$Move=function(a,c,d){b[12]+=a||0;b[13]+=c||0;b[14]+=d||0};d.$RotateX=function(c){if(c){a=f(c);var d=h(a),g=i(a);b=e([1,0,0,0,0,d,g,0,0,-g,d,0,0,0,0,1])}};d.$RotateY=function(c){if(c){a=f(c);var d=h(a),g=i(a);b=e([d,0,-g,0,0,1,0,0,g,0,d,0,0,0,0,1])}};d.Pe=function(c){if(c){a=f(c);var d=h(a),g=i(a);b=e([d,g,0,0,-g,d,0,0,0,0,1,0,0,0,0,1])}};d.Ne=function(a,c){if(a||c){j=f(a);k=f(c);b=e([1,l(k),0,0,l(j),1,0,0,0,0,1,0,0,0,0,1])}};d.zb=function(c){var a=e(b,[1,0,0,0,0,1,0,0,0,0,1,0,c.x,c.y,0,1]);return n(a[12],a[13])};d.Ge=function(){return\"matrix3d(\"+b.join(\",\")+\")\"};d.Be=function(){return\"progid:DXImageTransform.Microsoft.Matrix(M11=\"+b[0]+\", M12=\"+b[4]+\", M21=\"+b[1]+\", M22=\"+b[5]+\", SizingMethod='auto expand')\"}}new(function(){var a=this;function b(d,g){for(var j=d[0].length,i=d.length,h=g[0].length,f=[],c=0;c<i;c++)for(var k=f[c]=[],b=0;b<h;b++){for(var e=0,a=0;a<j;a++)e+=d[c][a]*g[a][b];k[b]=e}return f}a.$ScaleX=function(b,c){return a.ce(b,c,0)};a.$ScaleY=function(b,c){return a.ce(b,0,c)};a.ce=function(a,c,d){return b(a,[[c,0],[0,d]])};a.zb=function(d,c){var a=b(d,[[c.x],[c.y]]);return p(a[0][0],a[1][0])}});var S={Kd:0,Jd:0,G:0,F:0,$Zoom:1,$ScaleX:1,$ScaleY:1,$Rotate:0,$RotateX:0,$RotateY:0,$TranslateX:0,$TranslateY:0,$TranslateZ:0,$SkewX:0,$SkewY:0};i.Gc=function(c,d){var a=c||{};if(c)if(b.kd(c))a={Y:a};else if(b.kd(c.$Clip))a.$Clip={Y:c.$Clip};a.Y=a.Y||d;if(a.$Clip)a.$Clip.Y=a.$Clip.Y||d;return a};function wb(c,a){var b={};n(c,function(c,d){var f=c;if(a[d]!=e)if(i.mc(c))f=c+a[d];else f=wb(c,a[d]);b[d]=f});return b}i.ve=wb;i.Rd=function(n,j,s,t,B,C,o){var a=j;if(n){a={};for(var i in j){var D=C[i]||1,z=B[i]||[0,1],h=(s-z[0])/z[1];h=c.j(c.k(h,0),1);h=h*D;var x=c.P(h);if(h!=x)h-=x;var k=t.Y||f.$Linear,m,E=n[i],q=j[i];if(b.mc(q)){k=t[i]||k;var A=k(h);m=E+q*A}else{m=b.B({hc:{}},n[i]);var y=t[i]||{};b.$Each(q.hc||q,function(d,a){k=y[a]||y.Y||k;var c=k(h),b=d*c;m.hc[a]=b;m[a]+=b})}a[i]=m}var w=b.$Each(j,function(b,a){return S[a]!=e});w&&b.$Each(S,function(c,b){if(a[b]==e&&n[b]!==e)a[b]=n[b]});if(w){if(a.$Zoom)a.$ScaleX=a.$ScaleY=a.$Zoom;a.$OriginalWidth=o.$OriginalWidth;a.$OriginalHeight=o.$OriginalHeight;if(r()&&l>=11&&(j.G||j.F)&&s!=0&&s!=1)a.$Rotate=a.$Rotate||1e-8;a.Oe=d}}if(j.$Clip&&o.$Move){var p=a.$Clip.hc,v=(p.$Top||0)+(p.$Bottom||0),u=(p.$Left||0)+(p.$Right||0);a.$Left=(a.$Left||0)+u;a.$Top=(a.$Top||0)+v;a.$Clip.$Left-=u;a.$Clip.$Right-=u;a.$Clip.$Top-=v;a.$Clip.$Bottom-=v}if(a.$Clip&&!a.$Clip.$Top&&!a.$Clip.$Left&&!a.$Clip.F&&!a.$Clip.G&&a.$Clip.$Right==o.$OriginalWidth&&a.$Clip.$Bottom==o.$OriginalHeight)a.$Clip=g;return a}};function p(){var a=this,e=[];function k(a,b){e.push({ad:a,Vc:b})}function i(a,c){b.$Each(e,function(b,d){b.ad==a&&b.Vc===c&&e.splice(d,1)})}a.$On=a.addEventListener=k;a.$Off=a.removeEventListener=i;a.l=function(a){var c=[].slice.call(arguments,1);b.$Each(e,function(b){b.ad==a&&b.Vc.apply(j,c)})}}var l=function(A,D,g,L,O,J){A=A||0;var a=this,p,m,n,t,B=0,H,I,G,C,z=0,h=0,l=0,y,i,e,f,o,x,v=[],w;function P(a){e+=a;f+=a;i+=a;h+=a;l+=a;z+=a}function s(p){var j=p;if(o)if(!x&&(j>=f||j<e)||x&&j>=e)j=((j-e)%o+o)%o+e;if(!y||t||h!=j){var k=c.j(j,f);k=c.k(k,e);if(!y||t||k!=l){if(J){var m=(k-i)/(D||1);if(g.$Reverse)m=1-m;var n=b.Rd(O,J,m,H,G,I,g);if(w)b.$Each(n,function(b,a){w[a]&&w[a](L,b)});else b.N(L,n)}a.Lc(l-i,k-i);var r=l,q=l=k;b.$Each(v,function(b,c){var a=!y&&x||j<=h?v[v.length-c-1]:b;a.L(l-z)});h=j;y=d;a.Ac(r,q)}}}function E(a,b,d){b&&a.$Shift(f);if(!d){e=c.j(e,a.pc()+z);f=c.k(f,a.yb()+z)}v.push(a)}var u=j.requestAnimationFrame||j.webkitRequestAnimationFrame||j.mozRequestAnimationFrame||j.msRequestAnimationFrame;if(b.$IsBrowserSafari()&&b.$BrowserVersion()<7||!u)u=function(a){b.$Delay(a,g.$Interval)};function K(){if(p){var", "domain": "javascript", "lang": "code", "char_count": 20002, "word_count": 11558, "byte_count": 20004}
{"text": "import Validator from '../Validator';\n\nexport const messages = {\n  title: {\n    required: 'Title is required.',\n    max: 'Title should not exceed 255 characters.'\n  },\n  description: {\n    max: 'Description should not exceed 255 characters.'\n  }\n};\n\nexport const validateTitle = value => {\n  let errors = [];\n\n  if (Validator.required(value)) {\n    errors.push(messages.title.required);\n  }\n\n  if (Validator.max(value)) {\n    errors.push(messages.title.max);\n  }\n\n  return errors;\n};\n\nexport const validateDescription = value => {\n  let errors = [];\n\n  if (Validator.max(value)) {\n    errors.push(messages.description.max);\n  }\n\n  return errors;\n};\n\nexport const allowSubmit = fields => {\n  for (let a in fields) {\n    if (!fields[a].title.value.length || fields[a].title.errors.length\n    || fields[a].description.errors.length) {\n      return false;\n    }\n  }\n\n  return true;\n};", "domain": "javascript", "lang": "code", "char_count": 880, "word_count": 216, "byte_count": 880}
{"text": "const path = require('path')\nconst PnpWebpackPlugin = require(`pnp-webpack-plugin`)\nconst WebpackUserscript = require('webpack-userscript')\nconst { isDev } = require('./utils')\nconst pkg = require('./package')\n\nconst HOST = process.env.HOST || 'localhost'\nconst PORT = process.env.PORT || 9000\n\nconst BASE_URL = `https://${HOST}:${PORT}/`\n\nconst corsHeaders = {\n  \"Access-Control-Allow-Origin\": \"*\",\n  \"Access-Control-Allow-Methods\": \"GET, POST, PUT, DELETE, PATCH, OPTIONS\",\n  \"Access-Control-Allow-Headers\": \"X-Requested-With, content-type, Authorization\"\n}\n\nmodule.exports = {\n  mode: isDev ? 'development' : 'production',\n  entry: require.resolve('./src/index.js'),\n  target: 'web',\n  output: {\n    path: path.resolve(__dirname, 'dist'),\n    filename: `${pkg.name}.user.js`,\n    globalObject: \"this\",\n    publicPath: isDev ? BASE_URL : '',\n    jsonpFunction: \"userscriptJsonpFunction\"\n  },\n  optimization: {\n    minimize: false\n  },\n  devServer: {\n    port: PORT,\n    https: true,\n    headers: corsHeaders,\n    disableHostCheck: true,\n    contentBase: path.join(__dirname, 'dist'),\n    compress: false,\n    hot: true,\n    hotOnly: true\n  },\n  resolve: {\n    plugins: [\n      PnpWebpackPlugin\n    ]\n  },\n  resolveLoader: {\n    plugins: [\n      PnpWebpackPlugin.moduleLoader(module),\n    ],\n  },\n  module: {\n    rules: [\n      {\n        test: /\\.m?js$/,\n        use: {\n          loader: require.resolve('babel-loader')\n        },\n        exclude: [\n          /node_modules\\/(?!(consola)\\/).*/,\n          /userscripts\\/packages\\/polyfills.*/\n        ]\n      }\n    ]\n  },\n  plugins: [\n    new WebpackUserscript({\n      headers: require.resolve('./header.js'),\n      proxyScript: {\n        baseUrl: BASE_URL,\n        filename: '[basename].proxy.user.js',\n        enable: isDev\n      }\n    })\n  ]\n}", "domain": "javascript", "lang": "code", "char_count": 1796, "word_count": 376, "byte_count": 1796}
{"text": "/**\n * 338. Counting Bits\nGiven a non negative integer number num. For every numbers i in the range 0 \u2264 i \u2264 num calculate the number of 1's in their binary representation and return them as an array.\n\nExample:\nFor num = 5 you should return [0,1,1,2,1,2].\n\nFollow up:\n\nIt is very easy to come up with a solution with run time O(n*sizeof(integer)). But can you do it in linear time O(n) /possibly in a single pass?\nSpace complexity should be O(n).\nCan you do it like a boss? Do it without using any builtin function like __builtin_popcount in c++ or in any other language.\n * \n * @param {number} num\n * @return {number[]}\n */\nfunction countBits1(num) {\n    let arr =[0];\n    for(let i=1;i<=num;i++){\n        let count = i.toString(2).match(/1/g).length\n        arr.push(count);\n    }\n    return arr;\n};\nfunction countBits2(num){\n\tlet arr =[0];\n    for(let i=1;i<=num;i++){\n        let count = i.toString(2).match(/1/g).length\n        arr.push(count);\n    }\n    return arr;\n}\nmodule.exports = [countBits1,countBits2];", "domain": "javascript", "lang": "code", "char_count": 1014, "word_count": 277, "byte_count": 1018}
{"text": "// Data structure that holds captions for the videos\nvar videoCaptions = [\n  [{\"text\":\"Okay, so the rest of what you said is, 'are there any words in the titles that are used a lot in spam?' So basically you wanna look at other spam messages, and [student answers, inaudible] figure out what vocabulary they might use, and hope that there is something in terms of the vocabularies of the titles, as you suggested, that is common.\",\"width\":1921},{\"text\":\"Other suggestions?\",\"width\":212},{\"text\":\"[student answers inaudibly] What do you mean by training a program?\",\"width\":886},{\"text\":\"[student explains, inaudible] So what do you mean by 'similar emails?' So the question is: in what sense are the next messages, which you've never seen, similar to what you have seen before.\",\"width\":2138},{\"text\":\"That's key here.\",\"width\":59},{\"text\":\"Yeah?\",\"width\":158},{\"text\":\"[student answers inaudibly] Okay, so here is a suggestion to formulate the problem: take an email message; map it somehow to a vector, let's say a real valued vector of dimensionality 75.\",\"width\":1887},{\"text\":\"If you can do this to all email messages, then there is a well-defined notion of a distance, maybe the cosine between these vectors.\",\"width\":653},{\"text\":\"That solves your problem, because now you have a notion of distance, and things that are similar to the spam that you've seen, we're gonna say, 'these are spam'.\",\"width\":743},{\"text\":\"Things that are not, you'll say, 'these are NOT spam'.\",\"width\":259},{\"text\":\"What is the technical difficulty here?\",\"width\":306},{\"text\":\"What is the difficult step in doing what we just said?\",\"width\":255},{\"text\":\"[student answers inaudibly] What do you mean by evaluating the similarity?\",\"width\":253},{\"text\":\"[student explains, inaudible] Even before evaluating the similarity, the difficulty.\",\"width\":723},{\"text\":\"Over there.\",\"width\":116},{\"text\":\"[student answers, inaudible] Right, so the key issue is what's in this message is important for it being spam, and what is not.\",\"width\":948},{\"text\":\"So just mapping it to a vector, just a technical thing- you can- it's already a vector, the way it's written here.\",\"width\":471},{\"text\":\"I don't necessarily need to map it to another vector, maybe I will, but the key issue is what do I look at in this message?\",\"width\":492},{\"text\":\"Do I look at the fact that some of this font is blue, and some is red?\",\"width\":238},{\"text\":\"Do I look at the size of the font?\",\"width\":142},{\"text\":\"Do I look at the characters?\",\"width\":195},{\"text\":\"Do I look at...\",\"width\":87},{\"text\":\"what do I look at?\",\"width\":110},{\"text\":\"Do I look at the sender?\",\"width\":93},{\"text\":\"Do I look at the date?\",\"width\":62},{\"text\":\"What do I look at in the message to determine that this is spam.\",\"width\":437},{\"text\":\"If I don't know what to look at in the message, if I don't tell my program what it really sees here, then we have no chance, right?\",\"width\":850},{\"text\":\"Because the key thing is that you have seen this message, for the first time I assume, nevertheless, you can say something about whether for you it's spam.\",\"width\":829},{\"text\":\"By the way, it could be that it's spam for you, and not spam for someone else.\",\"width\":410},{\"text\":\"So there is a question of developing a model, or a classifier, and this is really what we wanna do in this class.\",\"width\":684},{\"text\":\"We wanna be able to study algorithms and techniques that will allow us to lean models from past data.\",\"width\":659},{\"text\":\"Here are a few other examples that, again, I wanna kind of trigger your thinking about this because these are...\",\"width\":370},{\"text\":\"all of them have to do with stacks, or natural language, but they are very very different types of examples.\",\"width\":377},{\"text\":\"So the first one, at the top here, can I have a peace of cake?\",\"width\":295},{\"text\":\"We probably didn't mean this kind of peace, this is very similar to the poem problem that I asked before, we probably mean this kind of piece.\",\"width\":520},{\"text\":\"Again, you can ask yourself; this is a binary decision.\",\"width\":218},{\"text\":\"You see it in a word in a sentence, and you wanna decide: is this the appropriate word to use there?\",\"width\":377},{\"text\":\"Is this the appropriate word or should I use something else?\",\"width\":269},{\"text\":\"How would you decide?\",\"width\":150},{\"text\":\"How would you write a program to decide?\",\"width\":354}],\n  [{\"text\":\"Right?\",\"width\":124},{\"text\":\"So how you abstract, how you represent things is really crucial here.\",\"width\":326},{\"text\":\"Next problem, this is a sentence that says, 'this can will rust', and the task here, is simply to determine what is the part of speech tag of each word in the context of this sentence.\",\"width\":1073},{\"text\":\"'This' is an article, 'can' is a noun, 'will' is a kind of a model verb, 'rust' is a verb.\",\"width\":502},{\"text\":\"Very easy, sometime you can question, 'why do I need to know this', but it's sometimes important to know whether 'can', in the context of this sentence...\",\"width\":757},{\"text\":\"in most cases, 'can' is actually a verb, in this case, 'can' is a noun, and you know this.\",\"width\":562},{\"text\":\"Again, it's a prediction problem.\",\"width\":242},{\"text\":\"There are multiple part of speech tags, for example, in english, common vocabulary or part of speech tags would have forty five different labels, and you want to determine which one it is.\",\"width\":893},{\"text\":\"What makes this problem somewhat different than the earlier problems on the same slide?\",\"width\":1020},{\"text\":\"Again, it's a prediction.\",\"width\":66},{\"text\":\"I look at the word, 'can', or 'will', that also can have multiple part of speech tags (think about it for a second).\",\"width\":529},{\"text\":\"Here, it's a model verb, it could be a noun, it could be other things.\",\"width\":332},{\"text\":\"What makes this prediction challenge different than, say, the 'peace/piece' problem?\",\"width\":758},{\"text\":\"Yeah?\",\"width\":100},{\"text\":\"[student answers, inaudible] So the first one was binary, and this is not binary.\",\"width\":637},{\"text\":\"That's one thing.\",\"width\":92},{\"text\":\"There are more labels here.\",\"width\":160},{\"text\":\"That's one difference.\",\"width\":74},{\"text\":\"Another one?\",\"width\":57},{\"text\":\"Yeah?\",\"width\":55},{\"text\":\"[student answers, inaudible] It depends on the context, but the first sentence also, the context matters.\",\"width\":644},{\"text\":\"So, whether it's 'peace', or...\",\"width\":557},{\"text\":\"This sentence makes sense either way, and what I wanna know is some kind of property outside the sentence.\",\"width\":460},{\"text\":\"That's what I was looking for.\",\"width\":458},{\"text\":\"So there are other differences, and you are all right, but this is a key different thing.\",\"width\":355},{\"text\":\"Whether one word is a noun depends not only on the sentence it's in, but also on what is the role in the sentence of other things.\",\"width\":636},{\"text\":\"For example, in english, it's unlikely that you have two consecutive verbs.\",\"width\":294},{\"text\":\"Could happen, unlikely though.\",\"width\":128},{\"text\":\"So if I decided that this word is a verb, it's unlikely that I'll decide that the next one is a verb.\",\"width\":394},{\"text\":\"So maybe, I don't need to think about this as one prediction per word, but rather I need to think about it globally, the whole sentence together, because the decisions I'm going to make, actually are interdependent.\",\"width\":1093},{\"text\":\"So in this case it's a sequence.\",\"width\":114},{\"text\":\"In some other cases it will not be a sequence, it will be some kind of other structure, but there will be interdependencies between predictions that I'm making, and that's important.\",\"width\":791},{\"text\":\"That's a problem that we sometimes call structured prediction problem.\",\"width\":294},{\"text\":\"Finally, the last example that I have here, two sentences, 'the dog bit the kid.\",\"width\":444},{\"text\":\"He was taken to a...' vet, or he was taken to a hospital.\",\"width\":294},{\"text\":\"Hopefully you agree that what 'he' refers to is determined by which sentence I choose, a vet or a hospital, agreed?\",\"width\":1169},{\"text\":\"How do you know?\",\"width\":133},{\"text\":\"What do you have to equip your program with, in order for the program to know?\",\"width\":621},{\"text\":\"So here is an option: we need to equip the program with some knowledge of what is a vet, what is a hospital, what do the serve.\",\"width\":684},{\"text\":\"Yeah?\",\"width\":7},{\"text\":\"[student asks question, inaudible] What is a dog?\",\"width\":301},{\"text\":\"What is a kid?\",\"width\":626},{\"text\":\"[student asks question, inaudible] .\", \"width\":1027}],\n  [{\"text\":\"Say something, what do you see Objects yeah That's correct, that's the easy level of the answer but I think you can say more.\",\"width\":1109},{\"text\":\"Animals, cars Yeah the cars and the animals are in different orientations.\",\"width\":570},{\"text\":\"That is unintentional...\",\"width\":207},{\"text\":\"uhh Back So yeah, four legged animals You probably see few others, few other things that you see here.\",\"width\":1773},{\"text\":\"I know but what I am asking is what do you see, what have you recognized?\",\"width\":379},{\"text\":\"Vegetables, Ok so basically there are a lot of objects and what you have done is that you have clustered them into groups.\",\"width\":804},{\"text\":\"You said I see shoes, cars, vegetables.\",\"width\":259},{\"text\":\"Now notice that we made it difficult for you but it wasn't difficult.\",\"width\":389},{\"text\":\"The sizes are completely wrong here, right The relative size of these things on the image vs the relative sizes in life.\",\"width\":882},{\"text\":\"If you really look at it into the pixel level.\",\"width\":221},{\"text\":\"Just choose a shoe and a car for example.\",\"width\":259},{\"text\":\"Some of the shoes are a lot more similar at the pixel level to some of the cars than to other shoes and vice versa.\",\"width\":776},{\"text\":\"Nevertheless it doesn't bother you at all, you were able to cluster it and moreover much how the problem you were able to name the clusters, which by the way is still a problem today.\",\"width\":888},{\"text\":\"We can do a lot about clustering, naming clusters is actually a very difficult problem for different reasons.\",\"width\":532},{\"text\":\"So this is another aspect of machine learning, we are gonna discuss this semester.\",\"width\":337},{\"text\":\"If you think about this specific example you will see that it is extremely difficult because we have taken a lot of the natural features of these objects away for example size, orientation, colours context etc.\",\"width\":1057},{\"text\":\"but it doesn't bother you at all.\",\"width\":214},{\"text\":\"Ok, so what is machine learning?\",\"width\":319},{\"text\":\"Where do we need it?\",\"width\":94},{\"text\":\"Hopefully, the example I have given so far indicate to you you know, it is a core of a lot of things.\",\"width\":433},{\"text\":\"Most of the examples I have given are, it is a core of understanding high level cognition In general I like to think about this as knowledge intensive instances, because all the tasks I have given you, you need a lot of knowledge in order to be able to think about them, make predictions.\",\"width\":1264},{\"text\":\"It's at a core of building adaptive intelligence systems, whatever definition you want to put into this.\",\"width\":464},{\"text\":\"In general dealing with messy, real world data.\",\"width\":317},{\"text\":\"Which is really what a lot of computer science and many other applications are doing today.\",\"width\":495},{\"text\":\"We are done dealing with good clean data people have organized for class and we are trying to deal with more naturally occuring data of different sorts and this is where machine learning is going to be easy and necessary Has to do with analytics, which became some kind of code buzz word for...\",\"width\":1360},{\"text\":\"use a lot of data and tell me about this data.\",\"width\":173},{\"text\":\"So it tells a lot of goals, for knowledge acquisition to the integration of various knowledge sources, to ensure adaptations, to supportin decision making.\",\"width\":1118},{\"text\":\"In all this context you can find needs for machine learning.\",\"width\":315},{\"text\":\"So what is machine learning?\",\"width\":149},{\"text\":\"I am not gonna wait for a definition from you, cause we will have 250 definitions.\",\"width\":396},{\"text\":\"I am going to use a definition that Hebb Simon who was a computer scientist, economist given probably 50 years ago or so He said, learning denotes changes in the system that are adaptive in the sense that they enable the system to do the task or tasks drawn from the same population more efficiently and more effectively the next time.\",\"width\":2098}],\n  [{\"text\":\"which is, if you think about it, a pretty good definition of what learning is.\",\"width\":402},{\"text\":\"And I wanna emphasize one thing here, 'drawn from the sample population'.\",\"width\":277},{\"text\":\"This is actually the key.\",\"width\":124},{\"text\":\"If you haven't thought about it yet, think about it, and you will have to think about it in the course of this semester.\",\"width\":349},{\"text\":\"Because this is one key starting point for us, as computer scientists, to think about this problem, if we wanna think about machine learning in any formal way.\",\"width\":760},{\"text\":\"So that we can write programs.\",\"width\":142},{\"text\":\"So that we can analyze programs.\",\"width\":126},{\"text\":\"So that we can say something about the performance of a machine learning program.\",\"width\":297},{\"text\":\"Can we say whether it's gonna do well on previously unseen examples?\",\"width\":296},{\"text\":\"Can we say something about how well ti's gonna do?\",\"width\":223},{\"text\":\"Can we give some guarantees on performance, which is the job we have as computer scientists?\",\"width\":446},{\"text\":\"It all hinges on this part of this statement, 'drawn from the same population'.\",\"width\":372},{\"text\":\"If we don't make this kind of assumptions, or similar assumptions, there's nothing we can do.\",\"width\":430},{\"text\":\"And this is gonna be a core component of what we are gonna do in this class.\",\"width\":264},{\"text\":\"We're gonna try to think about why does it work, or when does it work, and when it doesn't.\",\"width\":393},{\"text\":\"So I wanna actually augment the definition and I wanna think about machine learning mostly as the ability to perform a task in a situation which has never been encountered before.\",\"width\":840},{\"text\":\"So to me, learning is really generalization, or abstraction if you want.\",\"width\":256},{\"text\":\"If you think about it, all the examples that I've given before were example that for vast majority of you were new.\",\"width\":535},{\"text\":\"Nevertheless, it didn't bothered you.\",\"width\":125},{\"text\":\"You could do the prediction quite easily.\",\"width\":166},{\"text\":\"In fact, almost any situation that you encounter in life at the very fine level of representation, it's new.\",\"width\":612},{\"text\":\"When you are listening to what I'm saying now, behind my fine accent, you have no problem of understanding it even though it's a new signal for you.\",\"width\":730},{\"text\":\"When you look around, every time yo see a completely different image, nevertheless, you can interpret it.\",\"width\":531},{\"text\":\"So the key question is how do you do the subtraction.\",\"width\":291},{\"text\":\"This is really what machine learning is about, so don't lose track of it even though we're gonna force you to lose track of it because it's gonna be more technical, but this is really what we are aiming at.\",\"width\":762},{\"text\":\"To figure out how to generalize.\",\"width\":248},{\"text\":\"And again, you can think about the spam filter, whenever you see a spam message, you know it's spam even though you've never seen it before.\",\"width\":775},{\"text\":\"And you won't just, in this case, do the simple thing- decide yes or no in this case.\",\"width\":432},{\"text\":\"So this learner able or at least attempts to classify items it has never seen before.\",\"width\":600},{\"text\":\"And you gave a lot of ideas on what does it mean that it is able to do it.\",\"width\":323},{\"text\":\"And what should we look at in this representation, and this is the key.\",\"width\":317},{\"text\":\"In what sense is this message similar to others and different from others that you have seen before.\",\"width\":538},{\"text\":\"And if you are able to figure out this representational issues, then you have a chance of writing a program that will predict correctly on this.\",\"width\":976},{\"text\":\"If you wanna think about learning as generalization, you can dream up a lot of examples and I'm just gonna run through this example very quickly, it happens everywhere.\",\"width\":633},{\"text\":\"Classification problem like medical diagnosis.\",\"width\":194},{\"text\":\"Credit card applications, that for years already, are using machine learning technology.\",\"width\":366},{\"text\":\"Or recognizing hand writing letters.\",\"width\":184},{\"text\":\"And many other things.\",\"width\":112},{\"text\":\"You can see it in other more involved scenarios, like planning and acting, navigation, self-driving cars, game-playing.\",\"width\":617},{\"text\":\"You can see it in skills, how to balance a ball, how to play tennis.\",\"width\":345},{\"text\":\"These are all learning activities that rely on the ability to generalize from previous situation to future unseen situations.\",\"width\":1009},{\"text\":\"And, of course, common sense reasoning, whatever that means, for example things that dictate natural language interactions, scene interpretations, and other things.\",\"width\":766},{\"text\":\"So really I wanna highlight the underlying all these abilities is really the basic ability to perform a task in a situation which has never been encountered before.\",\"width\":1024},{\"text\":\"And while this class is about algorithms, so we are gonna talk a lot about machine learning algorithms, I want you to keep thinking about this notion of representation that is as important and as crucial to the ability of machine learning programs to work as the algorithm.\",\"width\":1502},{\"text\":\"And in fact, perhaps even more important.\",\"width\":167},{\"text\":\"That does not mean that we are gonna spend more time on representation than on algorithms, the reason is that we have less to say about representation than on algorithms.\",\"width\":734},{\"text\":\"But it's really a crucial thing.\",\"width\":195},{\"text\":\"So why do we wanna study learning?\",\"width\":169},{\"text\":\"A lot of opportunities.\",\"width\":264}],\n  [{\"text\":\"Basically you can think about a quipping computer system with new capabilities, things that we cannot program conventionally.\",\"width\":621},{\"text\":\"Programs that cannot automatically adapt, customize themselves.\",\"width\":406},{\"text\":\"too many things.\",\"width\":110},{\"text\":\"And of course discovering things that are out there in the data and wanna be able to do this automatically.\",\"width\":530},{\"text\":\"So you can dream up many many applications, I ma not gonna spend a lot of time.\",\"width\":410},{\"text\":\"But there are applications in the area of you know computer systems with new capabilities, you can think about applications with respect to cognition.\",\"width\":619},{\"text\":\"Human biological learning and even think about understanding teaching better.\",\"width\":369},{\"text\":\"Different notion of the word learning perhaps, still highly related and the key thing the reason why so many of you are here because the time is right.\",\"width\":691},{\"text\":\"People have realized in the last few years that actually we can do something with machine learning.\",\"width\":491},{\"text\":\"There are initial algorithms and theory in place as you will see as this might be a little disappointing to some of you in the course of this semester, most of the algorithms, mos tof the key algorithmic ideas that we are going to cover in the class were out there in the 60's.\",\"width\":1145},{\"text\":\"Really the basic algorithmic ideas were out there.\",\"width\":211},{\"text\":\"I am going to point this out.\",\"width\":148},{\"text\":\"What has changed is that we have developed theory and we understand what they do, when they do and how they work and how they don't work pretty well now.\",\"width\":504},{\"text\":\"And the theory has been developed say in the last 20-30 years.\",\"width\":336},{\"text\":\"We have a lot more data and we have a lot more computing power.\",\"width\":589},{\"text\":\"Both CPU and other versions and memory, and this actually has made huge impact on our ability to use algorithmic ideas with a few new tricks, but minor tricks.\",\"width\":986},{\"text\":\"To get machine learning to actually do something significant.\",\"width\":312},{\"text\":\"Not to say we know everything, there is a lot of things we still don't know in machine learning, and hopefully the media hasn't convinced you yet, someone has solved all the problems, they haven't.\",\"width\":1333},{\"text\":\"We can do a lot things.\",\"width\":134},{\"text\":\"As I say it is also necessary, things that computer science and other areas are trying to do today, we realized that we cannot do them without machine learning.\",\"width\":718},{\"text\":\"To me this is going to be key.\",\"width\":154},{\"text\":\"Almost everything we are gonna do in the future, dealing with real world messy data will necessitate using machine learning techniques, influenced techniques.\",\"width\":922},{\"text\":\"So in this sense you are in the right place.\",\"width\":321},{\"text\":\"As I said many unresolved issues, so something for you to work on!\",\"width\":664},{\"text\":\"I want to move on to what is this class about and what I think you should know, before that machine learning touches a lot of areas.\",\"width\":696},{\"text\":\"Both at the application level and at the technique level, it makes use of probability, statistics, linear algebra, statistics again, theory of computation and so on.\",\"width\":930},{\"text\":\"I expect you know some of it, or been exposed to some of it before you came here.\",\"width\":605},{\"text\":\"One important thing again to that has perhaps to do something with the expectation you have from this class is that it is an extremely active field.\",\"width\":746},{\"text\":\"Hundreds of papers being written as we speak.\",\"width\":431}],", "domain": "javascript", "lang": "code", "char_count": 21939, "word_count": 6630, "byte_count": 21939}
{"text": "import { Util } from 'discord.js';\nexport default class extends Command {\n    constructor(options) {\n        super(options);\n        this.description = \"Convert common text to binary\";\n    }\n    async run(bot, message, args) {\n        if (!args[1]) return message.channel.send(\"Put some text\");\n        const input = args.slice(1).join(\" \");\n        const output = [];\n        for (let i = 0; i < input.length; i++) {\n            if(output.length >= 2000) break;\n            output.push(input[i].charCodeAt(0).toString(2));\n        }\n        await message.channel.send(`\\`Output:\\` ${Util.splitMessage(output.join(\" \"), { char: \" \", maxLength: 1900 })[0]}`);\n    }\n}", "domain": "javascript", "lang": "code", "char_count": 666, "word_count": 187, "byte_count": 666}
{"text": "import {createStore, combineReducers, applyMiddleware} from 'redux'\nimport createLogger from 'redux-logger'\nimport thunkMiddleware from 'redux-thunk'\nimport {composeWithDevTools} from 'redux-devtools-extension'\nimport user from './user'\nimport newt from './newt'\n\nconst reducer = combineReducers({user, newt})\nconst middleware = composeWithDevTools(applyMiddleware(\n  thunkMiddleware,\n  createLogger({collapsed: true})\n))\nconst store = createStore(reducer, middleware)\n\nexport default store\nexport * from './user'\nexport * from './newt'", "domain": "javascript", "lang": "code", "char_count": 536, "word_count": 90, "byte_count": 536}
{"text": "(function () {\n    'use strict';\n\n    angular\n        .module('qorDash.core')\n        .factory('eventBus', eventBus);\n\n    /**\n     *\n     */\n    function eventBus(EVENTS_URL, $rootScope) {\n        var self = {\n            initConnection: initConnection\n        };\n\n        /**\n         *\n         */\n        function initConnection() {\n            self.connection = self.connection || new EventSource(EVENTS_URL);\n\n            self.connection.addEventListener('Event', function(event){\n                var eventType = JSON.parse(event.data).type;\n\n                $rootScope.$broadcast('eventBus:all', event);\n                $rootScope.$broadcast('eventBus:' + eventType, event);\n            });\n        }\n\n        return self;\n    }\n\n})();", "domain": "javascript", "lang": "code", "char_count": 742, "word_count": 139, "byte_count": 742}
{"text": "import React, { Component } from 'react';\nimport { StyleSheet, View, TouchableOpacity, Dimensions, Alert, Text, FlatList ,Animated} from 'react-native';\nimport TabNavigator from 'react-native-tab-navigator';\nimport Search from 'react-native-search-box';\n\nimport { Card, Toast, Modal, WingBlank, WhiteSpace, List, SwipeAction, Icon } from '@ant-design/react-native';\nimport IconConfig from '../../config/IconConfig'\nimport ScreenConfig from '../../config/ScreenConfig';\nimport {HistoryArrayGroup} from '../../config/StorageModule'\nimport UserModule from '../../config/UserModule'\nimport {StyleConfig,FontStyleConfig} from '../../config/StyleConfig';\n\nconst { width, height } = Dimensions.get('window');\n\nclass ziweiHistoryPage extends React.Component {\n  constructor(props) {\n    super(props);\n    this.state = {\n      isLoading: false,\n      errorMessage: undefined,\n      popupShowed: false,\n      dataSource:[],\n    };\n  }\n  rowTranslateAnimatedValues = {};\n  animationIsRunning=false\n  static navigationOptions = ({ navigation }) => {\n    const { navigate } = navigation;\n\n    return {\n    title:RouteConfig[\"ziweiHistoryPage\"].name,\n  };\n}\n\n  /*\n  handleFingerprintShowed = () => {\n    this.setState({ popupShowed: true });\n  };\n\n  handleFingerprintDismissed = (any) => {\n    this.setState({ popupShowed: false });\n    if(false==any)\n    {\n      this.props.navigation.goBack()\n    }\n    else\n    {\n      this.timer = setTimeout(\n        () => {\n          this.refreshlist()\n        },\n        200\n      );\n    }\n    \n  };\n  */\n\n  componentDidMount() {\n    this.refreshlist()\n    /*\n    FingerprintScanner\n    .isSensorAvailable()\n    .then(\n      this.handleFingerprintShowed()\n    )\n    .catch(\n      error =>{\n        if(error.name == \"FingerprintScannerNotSupported\")\n        {this.handleFingerprintDismissed(true)}\n      }\n    );\n    */\n  }\n\n  componentWillUnmount() {\n    // \u5982\u679c\u5b58\u5728this.timer\uff0c\u5219\u4f7f\u7528clearTimeout\u6e05\u7a7a\u3002\n    // \u5982\u679c\u4f60\u4f7f\u7528\u591a\u4e2atimer\uff0c\u90a3\u4e48\u7528\u591a\u4e2a\u53d8\u91cf\uff0c\u6216\u8005\u7528\u4e2a\u6570\u7ec4\u6765\u4fdd\u5b58\u5f15\u7528\uff0c\u7136\u540e\u9010\u4e2aclear\n    //FingerprintScanner.release();\n    this.timer && clearInterval(this.timer);\n  }\n  _starRow(rowData){\n    HistoryArrayGroup.loadid( 'eightrandom',rowData.id ).then(async(ret) => {\n      var Jobj = JSON.parse(ret);\n      Jobj.star = true == Jobj.star ? false : true\n      Jobj.sync = false\n      ret = JSON.stringify(Jobj)\n      let T = await UserModule.SyncFileServer(\"eightrandom\",rowData.id,ret)\n      if(undefined!=T && 2000==T.code)\n      {\n        ret = HistoryArrayGroup.MakeJsonSync(ret)\n      }\n      await HistoryArrayGroup.saveid('eightrandom',rowData.id, ret )\n      this.refreshlist();\n    })\n  }\n  _updateRow(rowData) {\n    console.log(rowData)\n    Modal.prompt(\n      '\u516b\u5b57\u63d0\u793a',\n      '',\n      (newtips: any) => this._updateStorage(rowData, newtips),\n      'default',\n      '',\n      [rowData.tip],\n    );\n  };\n  _updateStorage(rowData, newtips) {\n    HistoryArrayGroup.loadid( 'eightrandom',rowData.id ).then(async(ret) => {\n      var Jobj = JSON.parse(ret);\n      Jobj.sync = false\n      Jobj.tip = newtips;\n      ret = JSON.stringify(Jobj)\n      let T = await UserModule.SyncFileServer(\"eightrandom\",rowData.id,ret)\n      if(undefined!=T && 2000==T.code)\n        {\n            ret = HistoryArrayGroup.MakeJsonSync(ret)\n        }\n      await HistoryArrayGroup.saveid('eightrandom', rowData.id, ret )\n      this.refreshlist();\n    })\n  }\n\n  _deleteRow(rowData) {\n    Alert.alert(\n      '\u63d0\u793a',\n      '\u5220\u9664: ' + rowData.name,\n      [\n        { text: '\u53d6\u6d88', onPress: () => console.log('Cancel Pressed'), style: 'cancel' },\n        { text: '\u5220\u9664', onPress: () => this._deletehistory(rowData) },\n      ],\n      { cancelable: false }\n    )\n\n  }\n  async _deletehistory(rowData) {\n    HistoryArrayGroup.loadid('eightrandom', rowData.id).then(async (ret) => {\n      var Jobj = JSON.parse(ret);\n      let T = await UserModule.SyncFileServer(\"eightrandom\", Jobj.id, \"\")\n      if (undefined != T && 2000 == T.code) {\n        T.data.forEach(async (element) => {\n          filename = element.File\n          if (-1 != filename.indexOf(String(rowData.id))) {\n            await HistoryArrayGroup.remove(\"eightrandom\", rowData.id);\n          }\n        });\n      }\n      else {\n        await HistoryArrayGroup.remove(\"eightrandom\", rowData.id);\n        await HistoryArrayGroup.remove(\"name\", rowData.id);\n      }\n      this.Animaterefreshlist(rowData)\n    })\n  }\n  Animaterefreshlist(rowData) {\n    if (!this.animationIsRunning) {\n      this.animationIsRunning = true;\n      Animated.timing(this.rowTranslateAnimatedValues[rowData.id], { toValue: 0, duration: 500 }).start(() => {\n        Animated.timing(this.rowTranslateAnimatedValues[rowData.id], { toValue: 1, duration: 10 }).start(() => {\n          this.animationIsRunning = false;\n          this.refreshlist();\n        })\n      });\n    }\n  }\n\n  refreshlist() {\n      HistoryArrayGroup.GetEightRandomHistory().then(ids=>{\n        if (ids.length == 0) {\n          ScreenConfig.DeviceToast(\"\u6682\u65e0\u5386\u53f2\u6570\u636e\")\n          this.props.navigation.goBack()\n          return\n        }\n        var filterArray = []\n        for (var i = 0; i < ids.length; i++) {\n          if (10==ids[i].ret.length) {\n            filterArray.push(ids[i])\n          }\n        }\n        this.setState({dataSource: filterArray})\n      })\n  }\n\n\n  onSearch = (searchText) => {\n    return new Promise((resolve, reject) => {\n        if(this.state.dataSource.length>0)\n        {\n          var filterArray = []\n          for (var i = 0, len = this.state.dataSource.length; i < len; i++) {\n            console.log(searchText,this.state.dataSource[i].name);\n            if (this.state.dataSource[i].tip.match(searchText)) {\n              filterArray.push(this.state.dataSource[i])\n            }\n          }\n          this.setState({dataSource:filterArray})\n        }\n        resolve();\n    });\n}\n  onSearchCancel= () => {\n    return new Promise((resolve, reject) => {\n      HistoryArrayGroup.GetEightRandomHistory().then(ids=>{\n          this.setState({dataSource: ids})\n          \n        })\n        resolve();\n    });\n}\nchangeViewLayout(e,data) {\n  h = e.nativeEvent.layout.height\n  /*\n  var it = this.refs[data.item.id]\n  console.log(\"changeViewLayout\",it)\n  \n  this.refs[data.item.id].setNativeProps({\n      style:{height: this.rowTranslateAnimatedValues[data.item.id].interpolate({\n            inputRange: [0, 1],\n            outputRange: [0,h],})\n    }})\n  */  \n\n}\n\n  render() {\n    this.animationIsRunning=false\n    this.rowTranslateAnimatedValues = {};\n    rowlist = this.state.dataSource\n    rowlist.forEach((element, i) => {\n        this.rowTranslateAnimatedValues[`${element.id}`] = new Animated.Value(1);\n    });\n    const { errorMessage, popupShowed } = this.state;\n    const { navigate } = this.props.navigation;\n    return(\n      <View>\n        <Search\n          ref=\"search_box\"\n          onSearch={this.onSearch}\n          onCancel={this.onSearchCancel}\n          //defaultValue=\"\u641c\u7d22\"\n          placeholder=\"\u641c\u7d22\"\n          cancelTitle=\"\u53d6\u6d88\"\n          //returnKeyType=\"\u641c\u7d22\"\n          keyboardDismissOnSubmit={true}\n          backgroundColor=\"#ffffff\"\n          titleCancelColor=\"#000000\"\n          /**\n          * There many props that can customizable\n          * Please scroll down to Props section\n          */\n        />\n        <FlatList\n          useFlatList={true}\n          //1\u6570\u636e\u7684\u83b7\u53d6\u548c\u6e32\u67d3\n          data={this.state.dataSource}\n          keyExtractor={(item, index) => index.toString()}\n          renderItem={(data,index) => {\n            var ret = data.item.ret\n            ret = ret.split(0,7)\n            return(\n            <View >\n              <SwipeAction\n              \n                autoClose\n                style={{ backgroundColor: 'transparent' }}\n                right={[\n                  {\n                    text: IconConfig.IconAddTip,\n                    onPress: () => this._updateRow(data.item),\n                  },\n                  {\n                    text: IconConfig.IconDelete,\n                    onPress: () => this._deleteRow(data.item),\n                  },\n                ]}\n                left={[{\n                  onPress: () => this._starRow(data.item),\n                  text: IconConfig.IconAddStar,\n                }]}\n                onOpen={() => console.log('open')}\n                onClose={() => console.log('close')}\n              >\n                \n                <WingBlank size=\"md\" >\n                  <View onLayout={(e)=>this.changeViewLayout(e,data)}>\n                <Animated.View style={\n                    {\n                      height: this.rowTranslateAnimatedValues[data.item.id].interpolate({\n                            inputRange: [0, 1],\n                            outputRange: [0,120 + (data.item.tip.length)/30 * 13],\n                        })\n                    }} \n                    ref={ref => { this.refs[data.item.id] = ref }}\n                     >\n                <Card style={{ width: width - 20,paddingLeft:10 } } >\n                  <TouchableOpacity onPress={() => navigate('ziweiMainPage', data.item.url)}>\n                    <Card.Header\n                      title={<Text style={{fontSize:FontStyleConfig.getFontApplySize()+14}}>{ret}</Text>}\n                      //thumbStyle={{ width: 30, height: 30 }}\n                      thumb={true == data.item.star ? IconConfig.IconStar : IconConfig.IconUStar}\n                      extra={<Text style={{fontSize:FontStyleConfig.getFontApplySize()+14}}>{data.item.time}</Text>} />\n                    <Card.Body>\n                      <View >\n                        <Text style={{fontSize:FontStyleConfig.getFontApplySize()+14, marginLeft: 16,marginRight:16}}>{data.item.name}:{data.item.tip}</Text>\n                      </View>\n                    </Card.Body>\n                    <Card.Footer content=\"\" extra={<Text style={{fontSize:FontStyleConfig.getFontApplySize()+14}}>{data.item.birth}</Text>}/>\n                  </TouchableOpacity>\n                </Card>\n                </Animated.View>\n                </View>\n                </WingBlank>\n              </SwipeAction>\n              <WhiteSpace size=\"xs\" />\n            </View>\n          )}}\n        />\n        <WhiteSpace size=\"xl\" />\n        <WhiteSpace size=\"xl\" />\n        <WhiteSpace size=\"xl\" />\n        <WhiteSpace size=\"xl\" />\n        <Text style={{fontSize:FontStyleConfig.getFontApplySize()+11,color:\"#DDDDDD\",textAlign:\"center\"}}>--end--</Text>\n        <WhiteSpace size=\"xl\" />\n      </View>\n \n    )\n  }\n\n}\n\nvar styles = StyleSheet.create({\n  container: {\n    flex: 1\n  },\n  list: {\n    height: 45,\n    //borderWidth:1,\n    marginLeft: 10,\n    paddingLeft: 10,\n    //borderColor: '#ccc',\n    borderRadius: 4,\n    justifyContent: 'center', //\u867d\u7136\u6837\u5f0f\u4e2d\u8bbe\u7f6e\u4e86 justifyContent: 'center'\uff0c\u4f46\u65e0\u6548 \n    //textAlign:'center', \n    //textDecorationLine:'underline'\n  },\n  \n  delete: {\n    color: \"#d8fffa\",\n    marginLeft: 30,\n    alignItems: 'flex-start',//\u6c34\u5e73\u9760\u53f3\n  },\n  rowFront: {\n    alignItems: 'center',\n    backgroundColor: 'white',\n    borderBottomColor: 'black',\n    borderBottomWidth: 0,\n    justifyContent: 'center',\n    height: 120,\n  },\n  rowBack: {\n    alignItems: 'center',\n    //backgroundColor: '#DDD',\n    flex: 1,\n    flexDirection: 'row',\n    justifyContent: 'space-between',\n    paddingLeft: 15,\n  },\n  backRightBtn: {\n    alignItems: 'center',\n    bottom: 0,\n    justifyContent: 'center',\n    position: 'absolute',\n    top: 0,\n    width: 75\n  },\n  backLeftBtnLeft: {\n    //backgroundColor: 'blue',\n    left: 0\n  },\n  backRightBtnLeft: {\n    //backgroundColor: 'blue',\n    right: 75\n  },\n  backRightBtnRight: {\n    //backgroundColor: 'red',\n    right: 0\n  },\n  controls: {\n    alignItems: 'center',\n    marginBottom: 30\n  },\n  switchContainer: {\n    flexDirection: 'row',\n    justifyContent: 'center',\n    marginBottom: 5\n\n  }\n});\nmodule.exports = ziweiHistoryPage;", "domain": "javascript", "lang": "code", "char_count": 11760, "word_count": 2515, "byte_count": 11946}
{"text": "import React, { Component } from \"react\";\nimport axios from \"axios\";\nimport { Link } from \"react-router-dom\";\nimport Spinner from \"../layout/Spinner\";\nexport default class Lyrics extends Component {\n  state = {\n    track: {},\n    lyrics: {},\n  };\n  componentDidMount() {\n    axios\n      .get(\n        `https://cors-anywhere.herokuapp.com/https://api.musixmatch.com/ws/1.1/track.lyrics.get?track_id=${this.props.match.params.id}&apikey=${process.env.REACT_APP_MM_KEY}`\n      )\n      .then((res) => {\n        this.setState({ lyrics: res.data.message.body.lyrics });\n        // console.log(res.data);\n        return axios\n          .get(\n            `https://cors-anywhere.herokuapp.com/https://api.musixmatch.com/ws/1.1/track.get?track_id=${this.props.match.params.id}&apikey=${process.env.REACT_APP_MM_KEY}`\n          )\n          .then((res) => {\n            //  console.log(res.data)\n            this.setState({ track: res.data.message.body.track });\n          })\n          .catch((err) => console.log(err));\n      })\n      .catch((err) => console.log(err));\n  }\n  render() {\n    const { track, lyrics } = this.state;\n\n    if (\n      track === undefined ||\n      lyrics === undefined ||\n      Object.keys(track).length === 0 ||\n      Object.keys(lyrics).length === 0\n    ) {\n      return <Spinner />;\n    } else {\n      return (\n        <React.Fragment>\n          <Link to=\"/\" className=\"btn btn-dark btn-sm mb-4\">\n            Go Back\n          </Link>\n          <div className=\"card\">\n            <h5 className=\"card-header\">\n              {track.track_name} by {\"\"}\n            </h5>\n            <span className=\"text-secondary\">{track.artist_name}</span>\n            <p className=\"card-text\">{lyrics.lyrics_body}</p>\n          </div>\n\n          <ul className=\"list-group mt-3\">\n            <li className=\"list-group-item\">\n              <strong>Album ID:</strong>\n              {track.track_id} <br />\n              <strong>Genre:</strong>\n              {\n                track.primary_genres.music_genre_list[0].music_genre\n                  .music_genre_name\n              }\n            </li>\n            <li className=\"list-group-item\">\n              <strong>Explicit:</strong>\n              {track.explicit === 0 ? \"No\" : \"Yes\"}\n            </li>\n            <li className=\"list-group-item\">\n              <strong>Release Date:</strong>\n              {track.updated_time}\n            </li>\n          </ul>\n        </React.Fragment>\n      );\n    }\n  }\n}", "domain": "javascript", "lang": "code", "char_count": 2459, "word_count": 573, "byte_count": 2459}
{"text": "import React from 'react'\nimport ReactDOM from 'react-dom'\nimport App from './App/App'\nimport './styles/index.scss'\n//import reportWebVitals from './reportWebVitals';\nimport Amplify from '@aws-amplify/core'\nimport { Auth } from 'aws-amplify'\nimport awsconfig from './aws-exports'\nimport 'react-toastify/dist/ReactToastify.css'\n\nAmplify.configure(awsconfig)\nAuth.configure(awsconfig)\nReactDOM.render(<App />, document.getElementById('root'))\n\n// If you want to start measuring performance in your app, pass a function\n// to log results (for example: reportWebVitals(console.log))\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\n// reportWebVitals();", "domain": "javascript", "lang": "code", "char_count": 675, "word_count": 122, "byte_count": 675}
{"text": "import DnaScroll from \"@/modules/dna.scroll.core.js\";\r\n\r\nclass DnaScrollDown {\r\n  constructor() {\r\n    console.log(\"scrolldown constructor\");\r\n\r\n    // Keep track of if we are scrolled down or up\r\n    this.scrolledDown = false;\r\n\r\n    // The number of pixels down to detect we have scrolled down from top\r\n    this.scrollDownDetectStart = 50;\r\n\r\n    // How many more pixels needed to scroll back up to trigger up scroll\r\n    // This prevents the browsers micro-scrolls if the header reduces in\r\n    // size and causes a few pixels of scroll to happen making a constant\r\n    // loop of adding/removing the scorll classes\r\n    this.scrollBackOverdrive = 40;\r\n\r\n    // Get any elements that want to listen to scroll down events\r\n    this.scrollDownItems = document.querySelectorAll(\"[data-scrolldown-class]\");\r\n\r\n    // Every time the page scrolls...\r\n    DnaScroll.OnScroll(() => {\r\n      // Get scroll position\r\n      var windowTop = DnaScroll.ScrollPositionY();\r\n\r\n      // If we have not scrolled down\r\n      // and we are now scrolled down...\r\n      if (!this.scrolledDown && windowTop > this.scrollDownDetectStart) {\r\n        // Flag we have scrolled down\r\n        this.scrolledDown = true;\r\n\r\n        // For each element...\r\n        ForEach(this.scrollDownItems, function(item) {\r\n          // Add the desired class\r\n          item.classList.add(item.getAttribute(\"data-scrolldown-class\"));\r\n        });\r\n      }\r\n      // Else if we scrolled back up (at least 20px )...\r\n      else if (\r\n        this.scrolledDown &&\r\n        windowTop <=\r\n          Math.max(0, this.scrollDownDetectStart - this.scrollBackOverdrive)\r\n      ) {\r\n        // Flag we are not scrolled down\r\n        this.scrolledDown = false;\r\n\r\n        // For each element...\r\n        ForEach(this.scrollDownItems, function(item) {\r\n          // Add the desired class\r\n          item.classList.remove(item.getAttribute(\"data-scrolldown-class\"));\r\n        });\r\n      }\r\n    });\r\n  }\r\n\r\n  // Hook all elements that want to monitor for scroll\r\n  // scrollDownDetectStart = position in pixels at which to start detecting a scroll\r\n  Hook(scrollDownDetectStart = 50) {\r\n    console.log(\"scroll hooked\");\r\n\r\n    this.scrollDownDetectStart = scrollDownDetectStart;\r\n\r\n    // Find any elements with a data-scrolldown-class attribute\r\n    // and adds that class to them when we scroll from the top of the the page\r\n    this.scrollDownItems = document.querySelectorAll(\"[data-scrolldown-class]\");\r\n  }\r\n\r\n  Unhook() {\r\n    console.log(\"scroll unhooked\");\r\n    this.scrollDownItems = null;\r\n  }\r\n}\r\n\r\n// Single global instance\r\nwindow.$DnaScrollDown = new DnaScrollDown();\r\n\r\nexport default window.$DnaScrollDown;", "domain": "javascript", "lang": "code", "char_count": 2671, "word_count": 475, "byte_count": 2671}
{"text": "class ArticleListCtrl {\n  constructor(Articles, $scope) {\n    'ngInject';\n\n    this._Articles = Articles;\n\n    this.setListTo(this.listConfig);\n\n\n    $scope.$on('setListTo', (ev, newList) => {\n      this.setListTo(newList);\n    });\n\n    $scope.$on('setPageTo', (ev, pageNumber) => {\n      this.setPageTo(pageNumber);\n    });\n\n  }\n\n  setListTo(newList) {\n    // Set the current list to an empty array\n    this.list = [];\n\n    // Set listConfig to the new list's config\n    this.listConfig = newList;\n\n    this.runQuery();\n  }\n\n  setPageTo(pageNumber) {\n    this.listConfig.currentPage = pageNumber;\n\n    this.runQuery();\n  }\n\n\n runQuery() {\n    // Show the loading indicator\n    this.loading = true;\n    this.listConfig = this.listConfig || {};\n\n    // Create an object for this query\n    let queryConfig = {\n      type: this.listConfig.type || undefined,\n      filters: this.listConfig.filters || {}\n    };\n\n    // Set the limit filter from the component's attribute\n    queryConfig.filters.limit = this.limit;\n\n    // If there is no page set, set page as 1\n    if (!this.listConfig.currentPage) {\n      this.listConfig.currentPage = 1;\n    }\n\n    // Add the offset filter\n    queryConfig.filters.offset = (this.limit * (this.listConfig.currentPage - 1));\n\n    // Run the query\n    this._Articles\n      .query(queryConfig)\n      .then(\n        (res) => {\n          this.loading = false;\n\n          // Update list and total pages\n          this.list = res.articles;\n\n          this.listConfig.totalPages = Math.ceil(res.articlesCount / this.limit);\n        }\n      );\n  }\n\n}\n\nlet ArticleList = {\n  bindings: {\n    limit: '=',\n    listConfig: '='\n  },\n  controller: ArticleListCtrl,\n  template: require('../../components/article-helpers/article-list.html')\n};\n\nexport default ArticleList;", "domain": "javascript", "lang": "code", "char_count": 1786, "word_count": 380, "byte_count": 1786}
{"text": "/* eslint react/prop-types: 0 */\nimport React from 'react'\nimport creteStore from '../src/index'\nimport withLoading from './withLoading'\n\nconst { Provider, connect } = creteStore(\n  {\n    loading: false,\n    posts: [],\n  },\n  {\n    onChange: subreddit => async (dispatch) => {\n      if (subreddit === '') return { posts: [], loading: false }\n      const response = await fetch(`https://www.reddit.com/r/${subreddit}.json`)\n      const json = await response.json()\n      const posts = json.data.children.map(child => child.data)\n      return dispatch({ posts, loading: false })\n    },\n    setLoading: loading => dispatch => dispatch({ loading }),\n  },\n)\n\nlet Picker = ({ value, onChange, options }) => (\n  <span>\n    <h1>{value}</h1>\n    <select\n      onChange={e => onChange(e.target.value)}\n      value={value}\n    >\n      <option value=\"\">Please Select</option>\n      {options.map(option =>\n          (\n            <option value={option} key={option}>\n              {option}\n            </option>))\n        }\n    </select>\n  </span>\n)\n\nPicker = connect(({ selectedSubreddit }, { onChange, setLoading }) => ({\n  value: selectedSubreddit,\n  onChange: (value) => {\n    setLoading(true)\n    onChange(value)\n  },\n}))(Picker)\n\nlet Posts = ({ posts }) => (\n  <ul>\n    {\n      posts.map((post, i) =>\n        <li key={i}>{post.title}</li>)\n    }\n  </ul>\n)\n\n\nPosts = connect(({ posts, loading }) => ({ posts, loading }))(withLoading(Posts))\n\nconst AsyncPosts = () => (\n  <Provider>\n    <Picker options={['reactjs', 'vuejs', 'angularjs']} />\n    <Posts />\n  </Provider>\n)\n\nexport default AsyncPosts", "domain": "javascript", "lang": "code", "char_count": 1589, "word_count": 435, "byte_count": 1589}
{"text": "import { __assign } from \"tslib\";\nimport * as React from 'react';\nimport { StyledIconBase } from '@styled-icons/styled-icon';\nexport var Vial = React.forwardRef(function (props, ref) {\n    var attrs = {\n        \"fill\": \"currentColor\",\n        \"xmlns\": \"http://www.w3.org/2000/svg\",\n    };\n    return (React.createElement(StyledIconBase, __assign({ iconAttrs: attrs, iconVerticalAlign: \"middle\", iconViewBox: \"0 0 24 24\" }, props, { ref: ref }),\n        React.createElement(\"path\", { d: \"M7 22a4.965 4.965 0 003.535-1.465l9.193-9.193.707.708 1.414-1.414-8.485-8.486-1.414 1.414.708.707-9.193 9.193C2.521 14.408 2 15.664 2 17s.521 2.592 1.465 3.535A4.965 4.965 0 007 22zM18.314 9.928L15.242 13H6.758l7.314-7.314 4.242 4.242z\", key: \"k0\" })));\n});\nVial.displayName = 'Vial';\nexport var VialDimensions = { height: 24, width: 24 };", "domain": "javascript", "lang": "code", "char_count": 826, "word_count": 178, "byte_count": 826}
{"text": "#!/usr/bin/env node\n\n// Usage: npm run scaffold <componentName>\n\n/* eslint-disable no-console */\n\nconst { readFileSync, writeFileSync, mkdirSync } = require('fs')\nconst { resolve } = require('path')\nconst { camel, kebab } = require('case')\nconst readline = require('readline')\n\nconst read = readline.createInterface({\n  input: process.stdin,\n  output: process.stdout,\n})\n\nlet componentName = process.argv[2]\n\nconst getComponentName = async () => {\n  return new Promise(res => {\n    read.question(\n      \"What is the name of your component?\\nPlease use PascalCase. (E.g. 'ToggleSwitch' will become `@tds/community-toggle-switch` when deployed to npm)\\nName: \",\n      answer => {\n        componentName = answer\n        res()\n      }\n    )\n  })\n}\n\nconst getJourney = async () => {\n  return new Promise(res => {\n    read.question(\n      'Are you building a stable component, starting at version 1.0.0?\\nEnter \"no\" to start building a beta component, starting at version 0.1.0\\n(yes/no): ',\n      answer => {\n        const a = answer.toLowerCase()\n        if (a === 'yes' || a === 'y') {\n          res(true)\n        }\n        res(false)\n      }\n    )\n  })\n}\n\nconst startScaffold = async () => {\n  if (!componentName) {\n    await getComponentName()\n  }\n\n  const isStableJourney = await getJourney()\n  const basePath = `packages/${componentName}`\n  let visibleName = ''\n  let version = ''\n  let configPath = '../../'\n\n  if (isStableJourney) {\n    version = '1.0.0'\n    configPath = '../../'\n  } else {\n    version = '0.1.0'\n    visibleName = `\\n * @visibleName ${componentName} (beta)`\n  }\n\n  const scaffold = (template, destination) => {\n    const contents = readFileSync(resolve('scripts', 'scaffolding', template), 'utf8')\n      .replace(/\\$COMPONENT\\$/g, componentName)\n      .replace(/\\$COMPONENT_CAMEL\\$/g, camel(componentName))\n      .replace(/\\$COMPONENT_KEBAB\\$/g, kebab(componentName))\n      .replace(/\\$VERSION_START\\$/g, version)\n      .replace(/\\$CONFIG_PATH\\$/g, configPath)\n      .replace(/\\$VISIBLE_NAME\\$/g, visibleName)\n\n    writeFileSync(resolve(basePath, destination), contents)\n\n    console.log(`Created ${basePath}/${destination}`)\n  }\n\n  mkdirSync(resolve(basePath), { recursive: true })\n  mkdirSync(resolve(basePath, '__tests__'), { recursive: true })\n\n  scaffold('Component.jsx', `${componentName}.jsx`)\n  scaffold('Component.md', `${componentName}.md`)\n  scaffold('Component.spec.jsx', `__tests__/${componentName}.spec.jsx`)\n  scaffold('index.cjs.js', 'index.cjs.js')\n  scaffold('index.es.js', 'index.es.js')\n  scaffold('package.json', 'package.json')\n  scaffold('README.md', 'README.md')\n  scaffold('rollup.config.js', 'rollup.config.js')\n\n  read.close()\n}\n\nstartScaffold()", "domain": "javascript", "lang": "code", "char_count": 2693, "word_count": 594, "byte_count": 2693}
{"text": "const BackboneElement = require('./BackboneElement');\nconst Reference = require('./Reference');\n\nclass MessageDefinition_AllowedResponse extends BackboneElement {\n\n\tconstructor ( opts ) {\n\t\tsuper();\n\t\tObject.assign(this, opts);\n\t}\n\n\tstatic get __resourceType () {\n\t\treturn 'MessageDefinition_AllowedResponse';\n\t}\n\n\t// A reference to the message definition that must be adhered to by this supported response.\n\tget message () {\n\t\treturn this._message;\n\t}\n\n\tset message ( new_value ) {\n\t\tthis._message = new Reference(new_value);\n\t}\n\n\t// Provides a description of the circumstances in which this response should be used (as opposed to one of the alternative responses).\n\tget situation () {\n\t\treturn this._situation;\n\t}\n\n\tset situation ( new_value ) {\n\t\tthis._situation = new_value;\n\t}\n\n\ttoJSON () {\n\t\treturn Object.assign(super.toJSON(), {\n\t\t\tmessage: this._message,\n\t\t\tsituation: this._situation\n\t\t});\n\t}\n\n}\n\nmodule.exports = MessageDefinition_AllowedResponse;", "domain": "javascript", "lang": "code", "char_count": 958, "word_count": 185, "byte_count": 958}
{"text": "/******/ (() => { // webpackBootstrap\n/******/ \tvar __webpack_modules__ = ({\n\n/***/ \"./node_modules/axios/index.js\":\n/*!*************************************!*\\\n  !*** ./node_modules/axios/index.js ***!\n  \\*************************************/\n/***/ ((module, __unused_webpack_exports, __webpack_require__) => {\n\nmodule.exports = __webpack_require__(/*! ./lib/axios */ \"./node_modules/axios/lib/axios.js\");\n\n/***/ }),\n\n/***/ \"./node_modules/axios/lib/adapters/xhr.js\":\n/*!************************************************!*\\\n  !*** ./node_modules/axios/lib/adapters/xhr.js ***!\n  \\************************************************/\n/***/ ((module, __unused_webpack_exports, __webpack_require__) => {\n\n\"use strict\";\n\n\nvar utils = __webpack_require__(/*! ./../utils */ \"./node_modules/axios/lib/utils.js\");\nvar settle = __webpack_require__(/*! ./../core/settle */ \"./node_modules/axios/lib/core/settle.js\");\nvar cookies = __webpack_require__(/*! ./../helpers/cookies */ \"./node_modules/axios/lib/helpers/cookies.js\");\nvar buildURL = __webpack_require__(/*! ./../helpers/buildURL */ \"./node_modules/axios/lib/helpers/buildURL.js\");\nvar buildFullPath = __webpack_require__(/*! ../core/buildFullPath */ \"./node_modules/axios/lib/core/buildFullPath.js\");\nvar parseHeaders = __webpack_require__(/*! ./../helpers/parseHeaders */ \"./node_modules/axios/lib/helpers/parseHeaders.js\");\nvar isURLSameOrigin = __webpack_require__(/*! ./../helpers/isURLSameOrigin */ \"./node_modules/axios/lib/helpers/isURLSameOrigin.js\");\nvar createError = __webpack_require__(/*! ../core/createError */ \"./node_modules/axios/lib/core/createError.js\");\n\nmodule.exports = function xhrAdapter(config) {\n  return new Promise(function dispatchXhrRequest(resolve, reject) {\n    var requestData = config.data;\n    var requestHeaders = config.headers;\n\n    if (utils.isFormData(requestData)) {\n      delete requestHeaders['Content-Type']; // Let the browser set it\n    }\n\n    var request = new XMLHttpRequest();\n\n    // HTTP basic authentication\n    if (config.auth) {\n      var username = config.auth.username || '';\n      var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n      requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n    }\n\n    var fullPath = buildFullPath(config.baseURL, config.url);\n    request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n    // Set the request timeout in MS\n    request.timeout = config.timeout;\n\n    // Listen for ready state\n    request.onreadystatechange = function handleLoad() {\n      if (!request || request.readyState !== 4) {\n        return;\n      }\n\n      // The request errored out and we didn't get a response, this will be\n      // handled by onerror instead\n      // With one exception: request that using file: protocol, most browsers\n      // will return status as 0 even though it's a successful request\n      if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n        return;\n      }\n\n      // Prepare the response\n      var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n      var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;\n      var response = {\n        data: responseData,\n        status: request.status,\n        statusText: request.statusText,\n        headers: responseHeaders,\n        config: config,\n        request: request\n      };\n\n      settle(resolve, reject, response);\n\n      // Clean up request\n      request = null;\n    };\n\n    // Handle browser request cancellation (as opposed to a manual cancellation)\n    request.onabort = function handleAbort() {\n      if (!request) {\n        return;\n      }\n\n      reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n      // Clean up request\n      request = null;\n    };\n\n    // Handle low level network errors\n    request.onerror = function handleError() {\n      // Real errors are hidden from us by the browser\n      // onerror should only fire if it's a network error\n      reject(createError('Network Error', config, null, request));\n\n      // Clean up request\n      request = null;\n    };\n\n    // Handle timeout\n    request.ontimeout = function handleTimeout() {\n      var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';\n      if (config.timeoutErrorMessage) {\n        timeoutErrorMessage = config.timeoutErrorMessage;\n      }\n      reject(createError(timeoutErrorMessage, config, 'ECONNABORTED',\n        request));\n\n      // Clean up request\n      request = null;\n    };\n\n    // Add xsrf header\n    // This is only done if running in a standard browser environment.\n    // Specifically not if we're in a web worker, or react-native.\n    if (utils.isStandardBrowserEnv()) {\n      // Add xsrf header\n      var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n        cookies.read(config.xsrfCookieName) :\n        undefined;\n\n      if (xsrfValue) {\n        requestHeaders[config.xsrfHeaderName] = xsrfValue;\n      }\n    }\n\n    // Add headers to the request\n    if ('setRequestHeader' in request) {\n      utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n        if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n          // Remove Content-Type if data is undefined\n          delete requestHeaders[key];\n        } else {\n          // Otherwise add header to the request\n          request.setRequestHeader(key, val);\n        }\n      });\n    }\n\n    // Add withCredentials to request if needed\n    if (!utils.isUndefined(config.withCredentials)) {\n      request.withCredentials = !!config.withCredentials;\n    }\n\n    // Add responseType to request if needed\n    if (config.responseType) {\n      try {\n        request.responseType = config.responseType;\n      } catch (e) {\n        // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.\n        // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.\n        if (config.responseType !== 'json') {\n          throw e;\n        }\n      }\n    }\n\n    // Handle progress if needed\n    if (typeof config.onDownloadProgress === 'function') {\n      request.addEventListener('progress', config.onDownloadProgress);\n    }\n\n    // Not all browsers support upload events\n    if (typeof config.onUploadProgress === 'function' && request.upload) {\n      request.upload.addEventListener('progress', config.onUploadProgress);\n    }\n\n    if (config.cancelToken) {\n      // Handle cancellation\n      config.cancelToken.promise.then(function onCanceled(cancel) {\n        if (!request) {\n          return;\n        }\n\n        request.abort();\n        reject(cancel);\n        // Clean up request\n        request = null;\n      });\n    }\n\n    if (!requestData) {\n      requestData = null;\n    }\n\n    // Send the request\n    request.send(requestData);\n  });\n};\n\n\n/***/ }),\n\n/***/ \"./node_modules/axios/lib/axios.js\":\n/*!*****************************************!*\\\n  !*** ./node_modules/axios/lib/axios.js ***!\n  \\*****************************************/\n/***/ ((module, __unused_webpack_exports, __webpack_require__) => {\n\n\"use strict\";\n\n\nvar utils = __webpack_require__(/*! ./utils */ \"./node_modules/axios/lib/utils.js\");\nvar bind = __webpack_require__(/*! ./helpers/bind */ \"./node_modules/axios/lib/helpers/bind.js\");\nvar Axios = __webpack_require__(/*! ./core/Axios */ \"./node_modules/axios/lib/core/Axios.js\");\nvar mergeConfig = __webpack_require__(/*! ./core/mergeConfig */ \"./node_modules/axios/lib/core/mergeConfig.js\");\nvar defaults = __webpack_require__(/*! ./defaults */ \"./node_modules/axios/lib/defaults.js\");\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n  var context = new Axios(defaultConfig);\n  var instance = bind(Axios.prototype.request, context);\n\n  // Copy axios.prototype to instance\n  utils.extend(instance, Axios.prototype, context);\n\n  // Copy context to instance\n  utils.extend(instance, context);\n\n  return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n  return createInstance(mergeConfig(axios.defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = __webpack_require__(/*! ./cancel/Cancel */ \"./node_modules/axios/lib/cancel/Cancel.js\");\naxios.CancelToken = __webpack_require__(/*! ./cancel/CancelToken */ \"./node_modules/axios/lib/cancel/CancelToken.js\");\naxios.isCancel = __webpack_require__(/*! ./cancel/isCancel */ \"./node_modules/axios/lib/cancel/isCancel.js\");\n\n// Expose all/spread\naxios.all = function all(promises) {\n  return Promise.all(promises);\n};\naxios.spread = __webpack_require__(/*! ./helpers/spread */ \"./node_modules/axios/lib/helpers/spread.js\");\n\n// Expose isAxiosError\naxios.isAxiosError = __webpack_require__(/*! ./helpers/isAxiosError */ \"./node_modules/axios/lib/helpers/isAxiosError.js\");\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n\n\n/***/ }),\n\n/***/ \"./node_modules/axios/lib/cancel/Cancel.js\":\n/*!*************************************************!*\\\n  !*** ./node_modules/axios/lib/cancel/Cancel.js ***!\n  \\*************************************************/\n/***/ ((module) => {\n\n\"use strict\";\n\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n  this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n  return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n\n\n/***/ }),\n\n/***/ \"./node_modules/axios/lib/cancel/CancelToken.js\":\n/*!******************************************************!*\\\n  !*** ./node_modules/axios/lib/cancel/CancelToken.js ***!\n  \\******************************************************/\n/***/ ((module, __unused_webpack_exports, __webpack_require__) => {\n\n\"use strict\";\n\n\nvar Cancel = __webpack_require__(/*! ./Cancel */ \"./node_modules/axios/lib/cancel/Cancel.js\");\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n  if (typeof executor !== 'function') {\n    throw new TypeError('executor must be a function.');\n  }\n\n  var resolvePromise;\n  this.promise = new Promise(function promiseExecutor(resolve) {\n    resolvePromise = resolve;\n  });\n\n  var token = this;\n  executor(function cancel(message) {\n    if (token.reason) {\n      // Cancellation has already been requested\n      return;\n    }\n\n    token.reason = new Cancel(message);\n    resolvePromise(token.reason);\n  });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n  if (this.reason) {\n    throw this.reason;\n  }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n  var cancel;\n  var token = new CancelToken(function executor(c) {\n    cancel = c;\n  });\n  return {\n    token: token,\n    cancel: cancel\n  };\n};\n\nmodule.exports = CancelToken;\n\n\n/***/ }),\n\n/***/ \"./node_modules/axios/lib/cancel/isCancel.js\":\n/*!***************************************************!*\\\n  !*** ./node_modules/axios/lib/cancel/isCancel.js ***!\n  \\***************************************************/\n/***/ ((module) => {\n\n\"use strict\";\n\n\nmodule.exports = function isCancel(value) {\n  return !!(value && value.__CANCEL__);\n};\n\n\n/***/ }),\n\n/***/ \"./node_modules/axios/lib/core/Axios.js\":\n/*!**********************************************!*\\\n  !*** ./node_modules/axios/lib/core/Axios.js ***!\n  \\**********************************************/\n/***/ ((module, __unused_webpack_exports, __webpack_require__) => {\n\n\"use strict\";\n\n\nvar utils = __webpack_require__(/*! ./../utils */ \"./node_modules/axios/lib/utils.js\");\nvar buildURL = __webpack_require__(/*! ../helpers/buildURL */ \"./node_modules/axios/lib/helpers/buildURL.js\");\nvar InterceptorManager = __webpack_require__(/*! ./InterceptorManager */ \"./node_modules/axios/lib/core/InterceptorManager.js\");\nvar dispatchRequest = __webpack_require__(/*! ./dispatchRequest */ \"./node_modules/axios/lib/core/dispatchRequest.js\");\nvar mergeConfig = __webpack_require__(/*! ./mergeConfig */ \"./node_modules/axios/lib/core/mergeConfig.js\");\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n  this.defaults = instanceConfig;\n  this.interceptors = {\n    request: new InterceptorManager(),\n    response: new InterceptorManager()\n  };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n  /*eslint no-param-reassign:0*/\n  // Allow for axios('example/url'[, config]) a la fetch API\n  if (typeof config === 'string') {\n    config = arguments[1] || {};\n    config.url = arguments[0];\n  } else {\n    config = config || {};\n  }\n\n  config = mergeConfig(this.defaults, config);\n\n  // Set config.method\n  if (config.method) {\n    config.method = config.method.toLowerCase();\n  } else if (this.defaults.method) {\n    config.method = this.defaults.method.toLowerCase();\n  } else {\n    config.method = 'get';\n  }\n\n  // Hook up interceptors middleware\n  var chain = [dispatchRequest, undefined];\n  var promise = Promise.resolve(config);\n\n  this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n    chain.unshift(interceptor.fulfilled, interceptor.rejected);\n  });\n\n  this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n    chain.push(interceptor.fulfilled, interceptor.rejected);\n  });\n\n  while (chain.length) {\n    promise = promise.then(chain.shift(), chain.shift());\n  }\n\n  return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n  config = mergeConfig(this.defaults, config);\n  return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n  /*eslint func-names:0*/\n  Axios.prototype[method] = function(url, config) {\n    return this.request(mergeConfig(config || {}, {\n      method: method,\n      url: url,\n      data: (config || {}).data\n    }));\n  };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n  /*eslint func-names:0*/\n  Axios.prototype[method] = function(url, data, config) {\n    return this.request(mergeConfig(config || {}, {\n      method: method,\n      url: url,\n      data: data\n    }));\n  };\n});\n\nmodule.exports = Axios;\n\n\n/***/ }),\n\n/***/ \"./node_modules/axios/lib/core/InterceptorManager.js\":\n/*!***********************************************************!*\\\n  !*** ./node_modules/axios/lib/core/InterceptorManager.js ***!\n  \\***********************************************************/\n/***/ ((module, __unused_webpack_exports, __webpack_require__) => {\n\n\"use strict\";\n\n\nvar utils = __webpack_require__(/*! ./../utils */ \"./node_modules/axios/lib/utils.js\");\n\nfunction InterceptorManager() {\n  this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected) {\n  this.handlers.push({\n    fulfilled: fulfilled,\n    rejected: rejected\n  });\n  return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n  if (this.handlers[id]) {\n    this.handlers[id] = null;\n  }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n  utils.forEach(this.handlers, function forEachHandler(h) {\n    if (h !== null) {\n      fn(h);\n    }\n  });\n};\n\nmodule.exports = InterceptorManager;\n\n\n/***/ }),\n\n/***/ \"./node_modules/axios/lib/core/buildFullPath.js\":\n/*!******************************************************!*\\\n  !*** ./node_modules/axios/lib/core/buildFullPath.js ***!\n  \\******************************************************/\n/***/ ((module, __unused_webpack_exports, __webpack_require__) => {\n\n\"use strict\";\n\n\nvar isAbsoluteURL = __webpack_require__(/*! ../helpers/isAbsoluteURL */ \"./node_modules/axios/lib/helpers/isAbsoluteURL.js\");\nvar combineURLs = __webpack_require__(/*! ../helpers/combineURLs */ \"./node_modules/axios/lib/helpers/combineURLs.js\");\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n  if (baseURL && !isAbsoluteURL(requestedURL)) {\n    return combineURLs(baseURL, requestedURL);\n  }\n  return requestedURL;\n};\n\n\n/***/ }),\n\n/***/ \"./node_modules/axios/lib/core/createError.js\":\n/*!****************************************************!*\\\n  !*** ./node_modules/axios/lib/core/createError.js ***!\n  \\****************************************************/\n/***/ ((module, __unused_webpack_exports, __webpack_require__) => {\n\n\"use strict\";\n\n\nvar enhanceError = __webpack_require__(/*! ./enhanceError */ \"./node_modules/axios/lib/core/enhanceError.js\");\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n  var error = new Error(message);\n  return enhanceError(error, config, code, request, response);\n};\n\n\n/***/ }),\n\n/***/ \"./node_modules/axios/lib/core/dispatchRequest.js\":\n/*!********************************************************!*\\\n  !*** ./node_modules/axios/lib/core/dispatchRequest.js ***!\n  \\********************************************************/\n/***/ ((module, __unused_webpack_exports, __webpack_require__) => {\n\n\"use strict\";\n\n\nvar utils = __webpack_require__(/*! ./../utils */ \"./node_modules/axios/lib/utils.js\");\nvar transformData = __webpack_require__(/*! ./transformData */ \"./node_modules/axios/lib/core/transformData.js\");\nvar isCancel = __webpack_require__(/*! ../cancel/isCancel */ \"./node_modules/axios/lib/cancel/isCancel.js\");\nvar defaults = __webpack_require__(/*! ../defaults */ \"./node_modules/axios/lib/defaults.js\");\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n  if (config.cancelToken) {", "domain": "javascript", "lang": "code", "char_count": 20007, "word_count": 5009, "byte_count": 20007}
{"text": "\"use strict\"\nconst Storage=class\n{\n\terror=null\n\tconstructor(dependencies)\n\t{\n\t\ttry\n\t\t{\n\t\t\tlet storage=dependencies.multer.diskStorage({\n\t\t\t\tdestination:(req,file,next)=>\n\t\t\t\t{\n\t\t\t\t\tconst uniqueSuffix=Date.now()+'-'+Math.round(Math.random()*1E9)\n\t\t\t\t\tconst d=(new Date()).toLocaleDateString().split('/')\n\t\t\t\t\tconst p=dependencies.path.join(__dirname,'../../',process.env.MULTER_UPLOAD||'public/upload',d[2],d[1],d[0],uniqueSuffix)\n\t\t\t\t\tfile.location=`${d[2]}/${d[1]}/${d[0]}/${uniqueSuffix}`\n\t\t\t\t\tdependencies.fs.mkdirSync(p,{recursive:true})\n\t\t\t\t\tnext(null,p)\n\t\t\t\t},\n\t\t\t\tfilename:(req,file,next)=>\n\t\t\t\t{\n\t\t\t\t\tconst type=file.originalname.split('.').reverse()[0]\n\t\t\t\t\tnext(null,`original.${type}`)\n\t\t\t\t}\n\t\t\t})\n\t\t\tthis.multer=dependencies.multer({storage:storage})\n\t\t}\n\t\tcatch(error)\n\t\t{\n\t\t\tthis.error=error\n\t\t}\n\t}\n\tgetUpload=_=>\n\t{\n\t\treturn this.multer\n\t}\n\tafter=next=>\n\t{\n\t\tif(!this.error)\n\t\t\tnext()\n\t\treturn this\n\t}\n\tcatch=next=>\n\t{\n\t\tif(this.error)\n\t\t\tnext(this.error)\n\t\treturn this\n\t}\n}\nmodule.exports=Storage", "domain": "javascript", "lang": "code", "char_count": 1012, "word_count": 311, "byte_count": 1012}
{"text": "/**\n * SignalCD\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: 0.0.0\n * \n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n *\n */\n\nimport ApiClient from '../ApiClient';\n\n/**\n * The PipelineSteps model module.\n * @module model/PipelineSteps\n * @version 0.0.0\n */\nclass PipelineSteps {\n    /**\n     * Constructs a new <code>PipelineSteps</code>.\n     * @alias module:model/PipelineSteps\n     */\n    constructor() { \n        \n        PipelineSteps.initialize(this);\n    }\n\n    /**\n     * Initializes the fields of this object.\n     * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).\n     * Only for internal use.\n     */\n    static initialize(obj) { \n    }\n\n    /**\n     * Constructs a <code>PipelineSteps</code> from a plain JavaScript object, optionally creating a new instance.\n     * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.\n     * @param {Object} data The plain JavaScript object bearing properties of interest.\n     * @param {module:model/PipelineSteps} obj Optional instance to populate.\n     * @return {module:model/PipelineSteps} The populated <code>PipelineSteps</code> instance.\n     */\n    static constructFromObject(data, obj) {\n        if (data) {\n            obj = obj || new PipelineSteps();\n\n            if (data.hasOwnProperty('name')) {\n                obj['name'] = ApiClient.convertToType(data['name'], 'String');\n            }\n            if (data.hasOwnProperty('image')) {\n                obj['image'] = ApiClient.convertToType(data['image'], 'String');\n            }\n            if (data.hasOwnProperty('imagePullSecrets')) {\n                obj['imagePullSecrets'] = ApiClient.convertToType(data['imagePullSecrets'], ['String']);\n            }\n            if (data.hasOwnProperty('commands')) {\n                obj['commands'] = ApiClient.convertToType(data['commands'], ['String']);\n            }\n        }\n        return obj;\n    }\n\n\n}\n\n/**\n * @member {String} name\n */\nPipelineSteps.prototype['name'] = undefined;\n\n/**\n * @member {String} image\n */\nPipelineSteps.prototype['image'] = undefined;\n\n/**\n * @member {Array.<String>} imagePullSecrets\n */\nPipelineSteps.prototype['imagePullSecrets'] = undefined;\n\n/**\n * @member {Array.<String>} commands\n */\nPipelineSteps.prototype['commands'] = undefined;\n\n\n\n\n\n\nexport default PipelineSteps;", "domain": "javascript", "lang": "code", "char_count": 2618, "word_count": 539, "byte_count": 2618}
{"text": "const apiService = require('../api-service');\n\nmodule.exports =\n{\n\texecute: async (config, discordConfig, service, command, args) =>\n\t{\n        try {\n            let param = \"\";\n            if (args.length > 0) {\n                param = args[0];\n            }\n            \n            // prepare the payload for API call\n            const payload = {\n                accessToken: discordConfig.accessToken,\n                salt: discordConfig.salt,\n                param: param\n            }\n            // guard for useless API calls\n            if (!payload.accessToken || !payload.salt) {\n                service.message.react('\ud83d\udc4e').catch(err => console.log(err));\n                return;\n            }\n            const endpoint = {\n                url: `${config.get('API_URL')}/${command}`,\n                authKey: config.get('API_KEY')\n            };\n            const response = await apiService.get(endpoint, payload);\n            if (service.isValid(response.text)) {\n                service.message.react('\ud83d\udc4d').catch(err => console.log(err));\n            }\n            else {\n                service.message.react('\ud83d\uded1').catch(err => console.log(err));\n            }\n        } catch (err) {\n            service.reactWithError(err);\n        }\n\t}\n};", "domain": "javascript", "lang": "code", "char_count": 1255, "word_count": 253, "byte_count": 1264}
{"text": "/*************************************************************\n *\n *  MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/SpacingModLetters.js\n *\n *  Copyright (c) 2009-2020 The MathJax Consortium\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n *  Unless required by applicable law or agreed to in writing, software\n *  distributed under the License is distributed on an \"AS IS\" BASIS,\n *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *  See the License for the specific language governing permissions and\n *  limitations under the License.\n *\n */\n\nMathJax.Hub.Insert(\n  MathJax.OutputJax['HTML-CSS'].FONTDATA.FONTS['STIXGeneral'],\n  {\n    0x2B0: [848,-336,378,7,365],       // MODIFIER LETTER SMALL H\n    0x2B1: [848,-336,378,7,365],       // MODIFIER LETTER SMALL H WITH HOOK\n    0x2B2: [852,-169,300,44,244],      // MODIFIER LETTER SMALL J\n    0x2B3: [681,-336,252,5,252],       // MODIFIER LETTER SMALL R\n    0x2B4: [680,-335,277,10,257],      // MODIFIER LETTER SMALL TURNED R\n    0x2B5: [680,-168,325,10,338],      // MODIFIER LETTER SMALL TURNED R WITH HOOK\n    0x2B6: [680,-335,390,6,379],       // MODIFIER LETTER SMALL CAPITAL INVERTED R\n    0x2B7: [680,-331,520,6,512],       // MODIFIER LETTER SMALL W\n    0x2B8: [680,-176,370,14,361],      // MODIFIER LETTER SMALL Y\n    0x2B9: [684,-421,208,90,257],      // MODIFIER LETTER PRIME\n    0x2BA: [684,-421,305,19,324],      // MODIFIER LETTER DOUBLE PRIME\n    0x2BB: [686,-443,333,79,218],      // MODIFIER LETTER TURNED COMMA\n    0x2BC: [686,-443,333,79,218],      // MODIFIER LETTER APOSTROPHE\n    0x2BD: [686,-443,333,79,218],      // MODIFIER LETTER REVERSED COMMA\n    0x2BE: [680,-485,198,35,163],      // MODIFIER LETTER RIGHT HALF RING\n    0x2BF: [680,-485,198,35,163],      // MODIFIER LETTER LEFT HALF RING\n    0x2C0: [690,-295,326,23,303],      // MODIFIER LETTER GLOTTAL STOP\n    0x2C1: [690,-295,326,23,303],      // MODIFIER LETTER REVERSED GLOTTAL STOP\n    0x2C2: [755,-419,317,33,285],      // MODIFIER LETTER LEFT ARROWHEAD\n    0x2C3: [755,-419,317,33,285],      // MODIFIER LETTER RIGHT ARROWHEAD\n    0x2C4: [713,-461,317,-9,327],      // MODIFIER LETTER UP ARROWHEAD\n    0x2C5: [713,-461,317,-9,327],      // MODIFIER LETTER DOWN ARROWHEAD\n    0x2C8: [713,-448,278,119,159],     // MODIFIER LETTER VERTICAL LINE\n    0x2CC: [70,195,278,119,159],       // MODIFIER LETTER LOW VERTICAL LINE\n    0x2CD: [-104,159,334,11,323],      // MODIFIER LETTER LOW MACRON\n    0x2CE: [-21,192,333,25,249],       // MODIFIER LETTER LOW GRAVE ACCENT\n    0x2CF: [-21,192,333,84,308],       // MODIFIER LETTER LOW ACUTE ACCENT\n    0x2D0: [460,-19,333,89,244],       // MODIFIER LETTER TRIANGULAR COLON\n    0x2D1: [460,-299,333,89,244],      // MODIFIER LETTER HALF TRIANGULAR COLON\n    0x2D2: [365,-75,333,72,262],       // MODIFIER LETTER CENTRED RIGHT HALF RING\n    0x2D3: [365,-75,333,71,261],       // MODIFIER LETTER CENTRED LEFT HALF RING\n    0x2D4: [205,-18,333,51,281],       // MODIFIER LETTER UP TACK\n    0x2D5: [205,-18,333,51,281],       // MODIFIER LETTER DOWN TACK\n    0x2D6: [218,-26,333,71,263],       // MODIFIER LETTER PLUS SIGN\n    0x2D7: [144,-100,333,71,263],      // MODIFIER LETTER MINUS SIGN\n    0x2DA: [711,-512,333,67,266],      // RING ABOVE\n    0x2DB: [0,165,333,64,249],         // OGONEK\n    0x2DD: [678,-507,333,-3,376],      // DOUBLE ACUTE ACCENT\n    0x2DE: [443,-186,298,0,263],       // MODIFIER LETTER RHOTIC HOOK\n    0x2DF: [662,-425,333,48,284],      // MODIFIER LETTER CROSS ACCENT\n    0x2E0: [684,-219,378,24,335],      // MODIFIER LETTER SMALL GAMMA\n    0x2E1: [848,-336,215,19,197],      // MODIFIER LETTER SMALL L\n    0x2E2: [681,-331,291,36,261],      // MODIFIER LETTER SMALL S\n    0x2E3: [680,-336,380,5,372],       // MODIFIER LETTER SMALL X\n    0x2E4: [850,-336,341,45,319],      // MODIFIER LETTER SMALL REVERSED GLOTTAL STOP\n    0x2E5: [662,0,413,48,373],         // MODIFIER LETTER EXTRA-HIGH TONE BAR\n    0x2E6: [662,0,405,40,365],         // MODIFIER LETTER HIGH TONE BAR\n    0x2E7: [662,0,405,40,365],         // MODIFIER LETTER MID TONE BAR\n    0x2E8: [662,0,405,40,365],         // MODIFIER LETTER LOW TONE BAR\n    0x2E9: [662,0,405,40,365],         // MODIFIER LETTER EXTRA-LOW TONE BAR\n    0x2EC: [70,147,333,21,311],        // MODIFIER LETTER VOICING\n    0x2ED: [665,-507,405,10,395],      // MODIFIER LETTER UNASPIRATED\n    0x2F7: [-113,219,333,1,331]        // ??\n  }\n);\n\nMathJax.Ajax.loadComplete(MathJax.OutputJax[\"HTML-CSS\"].fontDir + \"/General/Regular/SpacingModLetters.js\");", "domain": "javascript", "lang": "code", "char_count": 4723, "word_count": 1300, "byte_count": 4723}
{"text": "(function () {\n  const ERRORS = {\n    invalidPassword: 'Please enter a valid password.',\n    invalidEmail: 'Please enter a valid email',\n    invalidUsername: 'Username is not a valid. Specical char, upper, number is required.',\n    invalidFirstname: 'Please provide valid firstname.',\n\n    passAndConfirmShouldMatch: 'Password and Confirm password should match.',\n\n    existingEmail: 'That email is already taken.',\n    existingUsername: 'That username is not available.'\n  };\n\n  function isEmail(email) {\n    const 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,}))$/;\n\n    return re.test(String(email).toLowerCase());\n  }\n\n  function isValidUsername(name) {\n    name = String(name);\n\n    if (!name.match(/[\\$@#!&*%]/)) {\n      return false;\n    } else if (!name.match(/[A-Z]/)) {\n      return false;\n    } else if (!name.match(/[a-z]/)) {\n      return false;\n    } else if (!name.match(/[0-9]/)) {\n      return false;\n    }\n\n    return true;\n  }\n\n  function renderErrors(formElm, errors) {\n    const $errElm = $('<span class=\"error\"></span>');\n    const $formElm = $(formElm);\n\n    for (const elm in errors) {\n      const $errField = $formElm.find(`[name=${elm}]`);\n      const $fieldErr = $errElm.clone();\n\n      $fieldErr.text(ERRORS[elm]);\n\n      $fieldErr.insertAfter($errField);\n    }\n  }\n\n  function removeErrors(e) {\n    const $formElm = $(e.target).closest('form');\n\n    $formElm.children().filter('.error').remove();\n  }\n\n  function onRegSubmit(e) {\n    e.stopPropagation();\n    e.preventDefault();\n\n    removeErrors(e);\n\n    const formData = {};\n    const errors = {};\n    let hasError = false;\n\n    for (let i of e.target) {\n      if (i.type !== 'submit') {\n        formData[i.name] = i.value;\n      }\n    }\n\n    if (formData.password.length === 0) {\n      errors.password = 'invalidPassword';\n      hasError = true;\n    } else if (formData.password !== formData['confirm-password']) {\n      errors['confirm-password'] = 'passAndConfirmShouldMatch';\n      hasError = true;\n    }\n\n    if (!isEmail(formData.email)) {\n      errors.email = 'invalidEmail';\n      hasError = true;\n    }\n\n    if (!isValidUsername(formData.username)) {\n      errors.username = 'invalidUsername';\n      hasError = true;\n    }\n\n    if (formData.firstname.length < 2) {\n      errors.firstname = 'invalidFirstname'\n      hasError = true;\n    }\n\n    // users\n    if (hasError) {\n      renderErrors(e.target, errors);\n    } else {\n      ET.showSpinner();\n      console.log(\"formData =-----> \", formData);\n      ET_API.createUser(formData).then((logged) => {\n        localStorage.setItem('loggedIn', true);\n        localStorage.setItem('isAdmin', logged['is-admin'] === 'on');\n\n        ET.navigateTo && ET.navigateTo('Dashboard');\n        ET.createSiteNav();\n        ET.hideSpinner();\n      }).catch(err => {\n        renderErrors(e.target, err);\n        localStorage.setItem('loggedIn', false);\n        ET.createSiteNav();\n        ET.hideSpinner();\n      });\n    }\n  }\n\n  function isAdmin() {\n    return location.search.indexOf('isAdmin=true') > 0;\n  }\n\n  // Add event listeners\n  // Reinitialize the listeners\n  ET.removeListeners();\n  ET.addListeners();\n\n  const $regForm = $('form.user-registration');\n  $('[data-reset-error]').keydown(removeErrors);\n  $regForm.submit(onRegSubmit);\n\n  if (isAdmin()) {\n    const $passField = $regForm.find('#confirm-password');\n    const $checkBox = $(`\n      <label for=\"is-admin\">Admin:</label>\n      <input type=\"checkbox\" name=\"is-admin\" id=\"is-admin\" data-reset-error checked>\n    `);\n\n    $checkBox.insertAfter($passField);\n  }\n})();", "domain": "javascript", "lang": "code", "char_count": 3665, "word_count": 936, "byte_count": 3665}
{"text": "(function(a){const e=a[\"ca\"]=a[\"ca\"]||{};e.dictionary=Object.assign(e.dictionary||{},{\"%0 of %1\":\"\",\"Align center\":\"Alineaci\u00f3 centre\",\"Align left\":\"Alineaci\u00f3 esquerra\",\"Align right\":\"Alineaci\u00f3 dreta\",\"Block quote\":\"Cita de bloc\",Bold:\"Negreta\",Cancel:\"Cancel\u00b7lar\",\"Cannot upload file:\":\"No es pot pujar l'arxiu:\",\"Choose heading\":\"Escull cap\u00e7alera\",Heading:\"Cap\u00e7alera\",\"Heading 1\":\"Cap\u00e7alera 1\",\"Heading 2\":\"Cap\u00e7alera 2\",\"Heading 3\":\"Cap\u00e7alera 3\",\"Heading 4\":\"\",\"Heading 5\":\"\",\"Heading 6\":\"\",Italic:\"Cursiva\",Justify:\"Justificar\",Paragraph:\"P\u00e0rraf\",Save:\"Desar\",\"Show more items\":\"\",\"Text alignment\":\"Alineaci\u00f3 text\",\"Text alignment toolbar\":\"\"});e.getPluralForm=function(a){return a!=1}})(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));", "domain": "javascript", "lang": "code", "char_count": 755, "word_count": 278, "byte_count": 766}
{"text": ";(function(global, document, $, undefined) {\n\n    function initSearch() {\n        var $search = $('.dw-search');\n        var $searchInput = $search.find('[type=text]');\n        var focusClass = 'active';\n        var addFocusLabel = $search.addClass.bind($search, focusClass);\n        var requestFocusLabelRemoval = function requestFocusLabelRemoval () {\n            if (this.value === '') {\n                $search.removeClass(focusClass);\n            }\n        };\n        $searchInput.on('focus', addFocusLabel);\n        $searchInput.on('focusout', requestFocusLabelRemoval);\n    }\n\n    function addCopyToClipboard() {\n\n\n        var enableCopyBtn = function enableCopyBtn ($btn) {\n            var client = new ZeroClipboard($btn[0]);\n            client.on(\"aftercopy\", function( event ) {\n                alert('Successfully copied to clipboard!');\n                $(event.target).addClass('disabled');\n            });\n            return $btn;\n        };\n\n        var copyModule = function copyModule (code) {\n            var $module = $('<div class=\"copy-header\"></div>');\n            var $btn = $('<a href=\"#\" class=\"copy-btn\">Copy to Clipboard</a>');\n            $btn\n                .attr('data-clipboard-text', code)\n                .on('click', function (evt) {evt.preventDefault();})\n                .each(function () { enableCopyBtn($(this)); })\n                .appendTo($module);\n            return $module;\n        };\n\n        var $codeBlocks = $('div.body .highlight');\n\n        $codeBlocks.each(function () {\n            var code = $(this).find('pre').text();\n            var $copyModule = copyModule(code);\n            $(this).prepend($copyModule);\n        })\n\n    }\n\n    $(document).ready(function () {\n        initSearch();\n        addCopyToClipboard();\n    })\n\n})(window, document, jQuery);", "domain": "javascript", "lang": "code", "char_count": 1808, "word_count": 377, "byte_count": 1808}
{"text": "'use strict';\nvar should = require('should');\nvar helper = require(\"../../helper\");\nvar GarmentInventoryDocumentManager = require(\"../../../src/managers/inventory-garment/garment-inventory-document-manager\");\nvar garmentInventoryDocumentManager = null;\nvar garmentInventoryDocumentDataUtil = require(\"../../data-util/inventory-garment/garment-inventory-document-data-util\");\nvar validate = require(\"dl-models\").validator.inventory.inventoryDocument;\n\nbefore('#00. connect db', function (done) {\n    helper.getDb()\n        .then(db => {\n            garmentInventoryDocumentManager = new GarmentInventoryDocumentManager(db, {\n                username: 'unit-test'\n            });\n            done();\n        })\n        .catch(e => {\n            done(e);\n        })\n});\n\nit(\"#01. should success when create new data using status OUT\", function (done) {\n    garmentInventoryDocumentDataUtil.getNewData()\n        .then((data) => {\n            data.type = \"OUT\";\n\n            return garmentInventoryDocumentManager.create(data)\n        })\n        .then((id) => {\n            id.should.be.Object();\n            done();\n        })\n        .catch((e) => {\n            done(e);\n        });\n});\n\nit(\"#02. should success when create new data using status ADJ\", function (done) {\n    garmentInventoryDocumentDataUtil.getNewData()\n        .then((data) => {\n            data.type = \"ADJ\";\n            return garmentInventoryDocumentManager.create(data)\n        })\n        .then((id) => {\n            id.should.be.Object();\n            done();\n        })\n        .catch((e) => {\n            done(e);\n        });\n});\n\nit(\"#03. should success when read data\", function (done) {\n    garmentInventoryDocumentManager.read({ \"keyword\": \"test\" })\n        .then((data) => {\n            done();\n        })\n        .catch((e) => {\n            done(e);\n        });\n});", "domain": "javascript", "lang": "code", "char_count": 1841, "word_count": 390, "byte_count": 1841}
{"text": "import { russia } from '../index';\nimport { codes, invalid, name, valid, validOnlyByFormat } from './countries_vat_lists/russia.vat';\nimport { addCharsToString, checkInvalidVat, checkOnlyValidFormatVat, checkValidVat } from './utils';\n\ndescribe('Russia', () => {\n  it('should return \"true\" result for valid VATs', () => {\n    valid.forEach((vat) => checkValidVat(vat, [russia], codes, name));\n  });\n\n  it('should return \"true\" for \"isSupportedCountry\" and \"isValidFormat\" fields, but \"false\" for \"isValid\" for VATs that match format but still invalid', () => {\n    validOnlyByFormat.forEach((vat) => checkOnlyValidFormatVat(vat, [russia], codes, name));\n  });\n\n  it('should return \"true\" result for valid VATs with extra dash characters', () => {\n    valid.map((vat) => addCharsToString(vat, '-')).forEach((vat) => checkValidVat(vat, [russia], codes, name));\n  });\n\n  it('should return \"true\" result for valid VATs with extra space characters', () => {\n    valid.map((vat) => addCharsToString(vat, ' ')).forEach((vat) => checkValidVat(vat, [russia], codes, name));\n  });\n\n  it('should return \"false\" result for invalid VATs', () => {\n    invalid.forEach((vat) => checkInvalidVat(vat, [russia]));\n  });\n});", "domain": "javascript", "lang": "code", "char_count": 1205, "word_count": 318, "byte_count": 1205}
{"text": "import Vue from 'vue'\nimport App from './App.vue'\nimport router from \"./router\";\nimport store from './store'\nimport toast from 'components/common/toast'\nimport FastClick from 'fastclick'\nimport VueLazyLoad from 'vue-lazyload'\n\nVue.config.productionTip = false\n\n// \u6dfb\u52a0\u4e8b\u4ef6\u603b\u7ebf$bus\nVue.prototype.$bus = new Vue()\n\n// \u5b89\u88c5toast\u63d2\u4ef6\nVue.use(toast)\n\n// \u5b89\u88c5VueLazyLoad\u63d2\u4ef6\nVue.use(VueLazyLoad, {\n  loading: require('./assets/img/common/placeholder.png')\n})\n\n// \u89e3\u51b3\u79fb\u52a8\u7aef\u7684300ms\u5ef6\u8fdf\nFastClick.attach(document.body)\n\nnew Vue({\n  render: h => h(App),\n  router,\n  store,\n}).$mount('#app')", "domain": "javascript", "lang": "code", "char_count": 559, "word_count": 121, "byte_count": 603}
{"text": "import cleanURL from \"../utils/clean-url\";\n\nconst getCurrentTab = (callback) => {\n    const queryInfo = {\n      active: true,\n      currentWindow: true\n    };\n  \n    chrome.tabs.query(queryInfo, (tabs) => {\n      callback(tabs[0]);\n    });\n};\n\nconst shortenURL = (_url, done) => {\n    const url = `https://sahajr.xyz/shorten/?url=${cleanURL(_url)}`;\n    const request = new XMLHttpRequest();\n    request.open(\"GET\", url, true);\n    request.onreadystatechange = () => {\n        if (request.readyState === 4) {\n            const response = JSON.parse(request.responseText);\n            done(response.shortURL);\n        }\n    };\n    request.send();\n};\n\ndocument.addEventListener('DOMContentLoaded', () => {\n\n    const overlay = document.getElementById('overlay');\n    const shortenButton = document.getElementById('shorten-button');\n    const shortenResult = document.getElementById('shorten-result');\n    const shortenCopy = document.getElementById('shorten-copy');\n    const generateQR = document.getElementById('generate-qr');\n    const goToExtensions = document.getElementById(\"shortcut-extensions\");\n    const shortenAndQR = document.getElementById(\"generate-qr-short-url\");\n\n    shortenResult.style.display = 'none';\n    shortenCopy.style.display = 'none';\n    overlay.style.display = 'none';\n\n    shortenButton.addEventListener('click', () => {\n        getCurrentTab((tab) => {\n            try {\n                overlay.style.display = 'block';\n                shortenURL(tab.url, (shortURL) => {\n                    shortenResult.style.display = 'block';\n                    shortenResult.focus();\n                    shortenResult.value = shortURL;\n                    shortenResult.select();\n                    overlay.style.display = 'none';\n                    shortenCopy.style.display = 'block';\n                });\n            } catch (err) {\n                window.alert(err);\n            }\n        });\n    });\n\n    shortenCopy.addEventListener('click', () => {\n       try {\n           if(document.execCommand('copy')) {\n               shortenCopy.style.display = 'none';\n               shortenResult.style.display = 'none';\n           }\n       } catch (err) {\n           window.alert(err);\n       }\n    });\n\n    generateQR.addEventListener('click', () => {\n        try {\n            getCurrentTab((tab) => {\n                chrome.tabs.sendMessage(tab.id, {text: tab.url});\n                window.close();\n            });\n        } catch (err) {\n            window.alert(err);\n        }\n    });\n\n    goToExtensions.addEventListener('click', () => {\n        chrome.tabs.create({url: \"chrome://extensions\"});\n    });\n\n    shortenAndQR.addEventListener('click', () => {\n        getCurrentTab((tab) => {\n            try {\n                overlay.style.display = 'block';\n                shortenURL(tab.url, (shortURL) => {\n                    overlay.style.display = 'none';\n                    chrome.tabs.sendMessage(tab.id, {text: shortURL});\n                    window.close();\n                });\n            } catch (err) {\n                window.alert(err);\n            }\n        });\n    });\n\n});", "domain": "javascript", "lang": "code", "char_count": 3114, "word_count": 630, "byte_count": 3114}
{"text": "import solfege from \"solfegejs\";\nimport * as ControllerUtil from \"../utils/ControllerUtil\";\n\n/**\n * The access points of the Wifi configuration\n */\nexport default class Wifi\n{\n    /**\n     * Get the Wifi settings\n     *\n     * @public\n     * @param   {solfege.bundle.server.Request}     request     The request\n     * @param   {solfege.bundle.server.Response}    response    The response\n     */\n    *getWifi(request, response)\n    {\n        response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, OPTIONS\");\n        yield ControllerUtil.getMainConfigurationParameters(/^wifi\\./, request, response);\n    }\n\n    /**\n     * Get the Wifi \"enabled\" setting\n     *\n     * @public\n     * @param   {solfege.bundle.server.Request}     request     The request\n     * @param   {solfege.bundle.server.Response}    response    The response\n     */\n    *getWifiEnabled(request, response)\n    {\n        response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, PUT, OPTIONS\");\n        yield ControllerUtil.getMainConfigurationParameterValue(\"wifi.enabled\", request, response);\n    }\n\n    /**\n     * Set the Wifi \"enabled\" setting\n     *\n     * @public\n     * @param   {solfege.bundle.server.Request}     request     The request\n     * @param   {solfege.bundle.server.Response}    response    The response\n     */\n    *setWifiEnabled(request, response)\n    {\n        response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, PUT, OPTIONS\");\n        yield ControllerUtil.setMainConfigurationParameterValue(\"wifi.enabled\", request, response);\n\n        // Display the new value\n        yield this.getWifiEnabled(request, response);\n    }\n\n    /**\n     * Get the Wifi \"ssid\" setting\n     *\n     * @public\n     * @param   {solfege.bundle.server.Request}     request     The request\n     * @param   {solfege.bundle.server.Response}    response    The response\n     */\n    *getWifiSsid(request, response)\n    {\n        response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, PUT, OPTIONS\");\n        yield ControllerUtil.getMainConfigurationParameterValue(\"wifi.ssid\", request, response);\n    }\n\n    /**\n     * Set the Wifi \"ssid\" setting\n     *\n     * @public\n     * @param   {solfege.bundle.server.Request}     request     The request\n     * @param   {solfege.bundle.server.Response}    response    The response\n     */\n    *setWifiSsid(request, response)\n    {\n        response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, PUT, OPTIONS\");\n        yield ControllerUtil.setMainConfigurationParameterValue(\"wifi.ssid\", request, response);\n\n        // Display the new value\n        yield this.getWifiSsid(request, response);\n    }\n\n    /**\n     * Get the Wifi \"key\" setting\n     *\n     * @public\n     * @param   {solfege.bundle.server.Request}     request     The request\n     * @param   {solfege.bundle.server.Response}    response    The response\n     */\n    *getWifiKey(request, response)\n    {\n        response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, PUT, OPTIONS\");\n        yield ControllerUtil.getMainConfigurationParameterValue(\"wifi.key\", request, response);\n    }\n\n    /**\n     * Set the Wifi \"key\" setting\n     *\n     * @public\n     * @param   {solfege.bundle.server.Request}     request     The request\n     * @param   {solfege.bundle.server.Response}    response    The response\n     */\n    *setWifiKey(request, response)\n    {\n        response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, PUT, OPTIONS\");\n        yield ControllerUtil.setMainConfigurationParameterValue(\"wifi.key\", request, response);\n\n        // Display the new value\n        yield this.getWifiKey(request, response);\n    }\n\n}", "domain": "javascript", "lang": "code", "char_count": 3638, "word_count": 613, "byte_count": 3638}
{"text": "'use strict';\n\nvar _stringify = require('babel-runtime/core-js/json/stringify');\n\nvar _stringify2 = _interopRequireDefault(_stringify);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/* eslint-env mocha */\n\nvar assert = require('assert');\nvar Fcbuffer = require('evt-fcbuffer');\nvar schema = require('./schema');\n\ndescribe('schema', function () {\n  it('parses', function () {\n    var fcbuffer = Fcbuffer(schema);\n    var errors = (0, _stringify2.default)(fcbuffer.errors, null, 4);\n    assert.equal(errors, '[]');\n  });\n});", "domain": "javascript", "lang": "code", "char_count": 574, "word_count": 140, "byte_count": 574}
{"text": "import React from \"react\";\nimport PropTypes from  \"prop-types\";\n\nfunction LightContentA(props) {\n  return (\n    <section className=\"text-gray-600 body-font\">\n      <div className=\"container px-5 py-24 mx-auto\">\n        <div className=\"flex flex-col text-center w-full mb-20\">\n          <h2 className={`text-xs text-${props.theme}-500 tracking-widest font-medium title-font mb-1`}>\n            ROOF PARTY POLAROID\n          </h2>\n          <h1 className=\"sm:text-3xl text-2xl font-medium title-font mb-4 text-gray-900\">\n            Master Cleanse Reliac Heirloom\n          </h1>\n          <p className=\"lg:w-2/3 mx-auto leading-relaxed text-base\">\n            Whatever cardigan tote bag tumblr hexagon brooklyn asymmetrical\n            gentrify, subway tile poke farm-to-table. Franzen you probably\n            haven&apos;t heard of them man bun deep jianbing selfies heirloom\n            prism food truck ugh squid celiac humblebrag.\n          </p>\n        </div>\n        <div className=\"flex flex-wrap\">\n          <div className=\"xl:w-1/4 lg:w-1/2 md:w-full px-8 py-6 border-l-2 border-gray-200 border-opacity-60\">\n            <h2 className=\"text-lg sm:text-xl text-gray-900 font-medium title-font mb-2\">\n              Shooting Stars\n            </h2>\n            <p className=\"leading-relaxed text-base mb-4\">\n              Fingerstache flexitarian street art 8-bit waistcoat. Distillery\n              hexagon disrupt edison bulbche.\n            </p>\n            <a href className={`text-${props.theme}-500 inline-flex items-center`}>\n              Learn More\n              <svg\n                fill=\"none\"\n                stroke=\"currentColor\"\n                strokeLinecap=\"round\"\n                strokeLinejoin=\"round\"\n                strokeWidth=\"2\"\n                className=\"w-4 h-4 ml-2\"\n                viewBox=\"0 0 24 24\"\n              >\n                <path d=\"M5 12h14M12 5l7 7-7 7\" />\n              </svg>\n            </a>\n          </div>\n          <div className=\"xl:w-1/4 lg:w-1/2 md:w-full px-8 py-6 border-l-2 border-gray-200 border-opacity-60\">\n            <h2 className=\"text-lg sm:text-xl text-gray-900 font-medium title-font mb-2\">\n              The Catalyzer\n            </h2>\n            <p className=\"leading-relaxed text-base mb-4\">\n              Fingerstache flexitarian street art 8-bit waistcoat. Distillery\n              hexagon disrupt edison bulbche.\n            </p>\n            <a href className={`text-${props.theme}-500 inline-flex items-center`}>\n              Learn More\n              <svg\n                fill=\"none\"\n                stroke=\"currentColor\"\n                strokeLinecap=\"round\"\n                strokeLinejoin=\"round\"\n                strokeWidth=\"2\"\n                className=\"w-4 h-4 ml-2\"\n                viewBox=\"0 0 24 24\"\n              >\n                <path d=\"M5 12h14M12 5l7 7-7 7\" />\n              </svg>\n            </a>\n          </div>\n          <div className=\"xl:w-1/4 lg:w-1/2 md:w-full px-8 py-6 border-l-2 border-gray-200 border-opacity-60\">\n            <h2 className=\"text-lg sm:text-xl text-gray-900 font-medium title-font mb-2\">\n              Neptune\n            </h2>\n            <p className=\"leading-relaxed text-base mb-4\">\n              Fingerstache flexitarian street art 8-bit waistcoat. Distillery\n              hexagon disrupt edison bulbche.\n            </p>\n            <a href className={`text-${props.theme}-500 inline-flex items-center`}>\n              Learn More\n              <svg\n                fill=\"none\"\n                stroke=\"currentColor\"\n                strokeLinecap=\"round\"\n                strokeLinejoin=\"round\"\n                strokeWidth=\"2\"\n                className=\"w-4 h-4 ml-2\"\n                viewBox=\"0 0 24 24\"\n              >\n                <path d=\"M5 12h14M12 5l7 7-7 7\" />\n              </svg>\n            </a>\n          </div>\n          <div className=\"xl:w-1/4 lg:w-1/2 md:w-full px-8 py-6 border-l-2 border-gray-200 border-opacity-60\">\n            <h2 className=\"text-lg sm:text-xl text-gray-900 font-medium title-font mb-2\">\n              Melanchole\n            </h2>\n            <p className=\"leading-relaxed text-base mb-4\">\n              Fingerstache flexitarian street art 8-bit waistcoat. Distillery\n              hexagon disrupt edison bulbche.\n            </p>\n            <a href className={`text-${props.theme}-500 inline-flex items-center`}>\n              Learn More\n              <svg\n                fill=\"none\"\n                stroke=\"currentColor\"\n                strokeLinecap=\"round\"\n                strokeLinejoin=\"round\"\n                strokeWidth=\"2\"\n                className=\"w-4 h-4 ml-2\"\n                viewBox=\"0 0 24 24\"\n              >\n                <path d=\"M5 12h14M12 5l7 7-7 7\" />\n              </svg>\n            </a>\n          </div>\n        </div>\n        <button className={`flex mx-auto mt-16 text-white bg-${props.theme}-500 border-0 py-2 px-8 focus:outline-none hover:bg-${props.theme}-600 rounded text-lg`}>\n          Button\n        </button>\n      </div>\n    </section>\n  );\n}\n\nLightContentA.defaultProps = {\n  theme: 'indigo'\n};\n\nLightContentA.propTypes = {\n  theme: PropTypes.string.isRequired\n};\n\nexport default LightContentA;", "domain": "javascript", "lang": "code", "char_count": 5195, "word_count": 949, "byte_count": 5195}
{"text": "import { alias } from '@ember/object/computed';\nimport Controller from '@ember/controller';\nimport { computed } from '@ember/object';\n\nexport default Controller.extend({\n  network: alias('model.resources.networks.firstObject'),\n  ports: computed('network.reservedPorts.[]', 'network.dynamicPorts.[]', function() {\n    return (this.get('network.reservedPorts') || [])\n      .map(port => ({\n        name: port.Label,\n        port: port.Value,\n        isDynamic: false,\n      }))\n      .concat(\n        (this.get('network.dynamicPorts') || []).map(port => ({\n          name: port.Label,\n          port: port.Value,\n          isDynamic: true,\n        }))\n      )\n      .sortBy('name');\n  }),\n});", "domain": "javascript", "lang": "code", "char_count": 691, "word_count": 157, "byte_count": 691}
{"text": "const defaults = {\n  title: null,\n  message: '',\n  type: '',\n  iconClass: '',\n  showInput: false,\n  showClose: true,\n  modalFade: true,\n  lockScroll: true,\n  closeOnClickModal: true,\n  closeOnPressEscape: true,\n  closeOnHashChange: true,\n  inputValue: null,\n  inputPlaceholder: '',\n  inputType: 'text',\n  inputPattern: null,\n  inputValidator: null,\n  inputErrorMessage: '',\n  showConfirmButton: true,\n  showCancelButton: false,\n  confirmButtonPosition: 'right',\n  confirmButtonHighlight: false,\n  cancelButtonHighlight: false,\n  confirmButtonText: '',\n  cancelButtonText: '',\n  confirmButtonClass: '',\n  cancelButtonClass: '',\n  customClass: '',\n  beforeClose: null,\n  dangerouslyUseHTMLString: false,\n  center: false,\n  roundButton: false,\n  distinguishCancelAndClose: false\n};\n\nimport Vue from 'vue';\nimport msgboxVue from './main.vue';\nimport merge from 'element-ui/src/utils/merge';\nimport { isVNode } from 'element-ui/src/utils/vdom';\n\nconst MessageBoxConstructor = Vue.extend(msgboxVue);\n\nlet currentMsg, instance;\nlet msgQueue = [];\n\nconst defaultCallback = action => {\n  if (currentMsg) {\n    let callback = currentMsg.callback;\n    if (typeof callback === 'function') {\n      if (instance.showInput) {\n        callback(instance.inputValue, action);\n      } else {\n        callback(action);\n      }\n    }\n    if (currentMsg.resolve) {\n      if (action === 'confirm') {\n        if (instance.showInput) {\n          currentMsg.resolve({ value: instance.inputValue, action });\n        } else {\n          currentMsg.resolve(action);\n        }\n      } else if (currentMsg.reject && (action === 'cancel' || action === 'close')) {\n        currentMsg.reject(action);\n      }\n    }\n  }\n};\n\nconst initInstance = () => {\n  instance = new MessageBoxConstructor({\n    el: document.createElement('div')\n  });\n\n  instance.callback = defaultCallback;\n};\n\nconst showNextMsg = () => {\n  if (!instance) {\n    initInstance();\n  }\n  instance.action = '';\n\n  if (!instance.visible || instance.closeTimer) {\n    if (msgQueue.length > 0) {\n      currentMsg = msgQueue.shift();\n\n      let options = currentMsg.options;\n      for (let prop in options) {\n        if (options.hasOwnProperty(prop)) {\n          instance[prop] = options[prop];\n        }\n      }\n      if (options.callback === undefined) {\n        instance.callback = defaultCallback;\n      }\n\n      let oldCb = instance.callback;\n      instance.callback = (action, instance) => {\n        oldCb(action, instance);\n        showNextMsg();\n      };\n      if (isVNode(instance.message)) {\n        instance.$slots.default = [instance.message];\n        instance.message = null;\n      } else {\n        delete instance.$slots.default;\n      }\n      ['modal', 'showClose', 'closeOnClickModal', 'closeOnPressEscape', 'closeOnHashChange'].forEach(prop => {\n        if (instance[prop] === undefined) {\n          instance[prop] = true;\n        }\n      });\n      document.body.appendChild(instance.$el);\n\n      Vue.nextTick(() => {\n        instance.visible = true;\n      });\n    }\n  }\n};\n/**\nMessageBox\u4e3a\u4ec0\u4e48\u80fd\u8fd4\u56de\u4e00\u4e2apromise\uff1f\n\u8fd9\u662f\u4e00\u4e2a\u8fd4\u56depromise\u7684\u51fd\u6570\uff0c\u628areject\uff0cresolve\u4f20\u9012\u7ed9\u6784\u9020\u51fd\u6570\u7684option,\u5185\u90e8\u53bb\u5904\u7406\u8c03\u7528\n\n\u5b9e\u6d4b\uff0cMessageBox\u8ddfloading service\u4e00\u6837\u90fd\u662f\u5355\u4f8b\u7684\n */\nconst MessageBox = function(options, callback) {\n  if (Vue.prototype.$isServer) return;\n  if (typeof options === 'string' || isVNode(options)) {\n    options = {\n      message: options\n    };\n    if (typeof arguments[1] === 'string') {\n      options.title = arguments[1];\n    }\n  } else if (options.callback && !callback) {\n    callback = options.callback;\n  }\n\n  if (typeof Promise !== 'undefined') {\n    return new Promise((resolve, reject) => { // eslint-disable-line\n      msgQueue.push({\n        options: merge({}, defaults, MessageBox.defaults, options),\n        callback: callback,\n        resolve: resolve,\n        reject: reject\n      });\n\n      showNextMsg();\n    });\n  } else {\n    msgQueue.push({\n      options: merge({}, defaults, MessageBox.defaults, options),\n      callback: callback\n    });\n\n    showNextMsg();\n  }\n};\n\nMessageBox.setDefaults = defaults => {\n  MessageBox.defaults = defaults;\n};\n\nMessageBox.alert = (message, title, options) => {\n  if (typeof title === 'object') {\n    options = title;\n    title = '';\n  } else if (title === undefined) {\n    title = '';\n  }\n  return MessageBox(merge({\n    title: title,\n    message: message,\n    $type: 'alert',\n    closeOnPressEscape: false,\n    closeOnClickModal: false\n  }, options));\n};\n\nMessageBox.confirm = (message, title, options) => {\n  if (typeof title === 'object') {\n    options = title;\n    title = '';\n  } else if (title === undefined) {\n    title = '';\n  }\n  return MessageBox(merge({\n    title: title,\n    message: message,\n    $type: 'confirm',\n    showCancelButton: true\n  }, options));\n};\n\nMessageBox.prompt = (message, title, options) => {\n  if (typeof title === 'object') {\n    options = title;\n    title = '';\n  } else if (title === undefined) {\n    title = '';\n  }\n  return MessageBox(merge({\n    title: title,\n    message: message,\n    showCancelButton: true,\n    showInput: true,\n    $type: 'prompt'\n  }, options));\n};\n\nMessageBox.close = () => {\n  instance.doClose();\n  instance.visible = false;\n  msgQueue = [];\n  currentMsg = null;\n};\n\nexport default MessageBox;\nexport { MessageBox };", "domain": "javascript", "lang": "code", "char_count": 5224, "word_count": 1080, "byte_count": 5318}
{"text": "/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is DOM Range tests.\n *\n * The Initial Developer of the Original Code is\n * Alexander J. Vincent <ajvincent@gmail.com>.\n * Portions created by the Initial Developer are Copyright (C) 2007\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\nconst C_i = Components.interfaces;\nconst C_r = Components.results;\n\nconst UNORDERED_TYPE = C_i.nsIDOMXPathResult.ANY_UNORDERED_NODE_TYPE;\n\nconst INVALID_STATE_ERR = 0x8053000b;     // NS_ERROR_DOM_INVALID_STATE_ERR\nconst INDEX_SIZE_ERR = 0x80530001;        // NS_ERROR_DOM_INDEX_SIZE_ERR\nconst INVALID_NODE_TYPE_ERR = 0x805c0002; // NS_ERROR_DOM_INVALID_NODE_TYPE_ERR\nconst NOT_OBJECT_ERR = 0x805303eb;        // NS_ERROR_DOM_NOT_OBJECT_ERR\nconst SECURITY_ERR = 0x805303e8;          // NS_ERROR_DOM_SECURITY_ERR\n\n/**\n * Determine if the data node has only ignorable white-space.\n *\n * @return nsIDOMNodeFilter.FILTER_SKIP if it does.\n * @return nsIDOMNodeFilter.FILTER_ACCEPT otherwise.\n */\nfunction isWhitespace(aNode) {\n  return ((/\\S/).test(aNode.nodeValue)) ?\n         C_i.nsIDOMNodeFilter.FILTER_SKIP :\n         C_i.nsIDOMNodeFilter.FILTER_ACCEPT;\n}\n\n/**\n * Create a DocumentFragment with cloned children equaling a node's children.\n *\n * @param aNode The node to copy from.\n *\n * @return DocumentFragment node.\n */\nfunction getFragment(aNode) {\n  var frag = aNode.ownerDocument.createDocumentFragment();\n  do_check_true(frag instanceof C_i.nsIDOM3Node);\n  for (var i = 0; i < aNode.childNodes.length; i++) {\n    frag.appendChild(aNode.childNodes.item(i).cloneNode(true));\n  }\n  return frag;\n}\n\n// Goodies from head_content.js\nconst serializer = new DOMSerializer();\nconst parser = new DOMParser();\n\n/**\n * Dump the contents of a document fragment to the console.\n *\n * @param aFragment The fragment to serialize.\n */\nfunction dumpFragment(aFragment) {\n  dump(serializer.serializeToString(aFragment) + \"\\n\\n\");\n}\n\n/**\n * Translate an XPath to a DOM node. This method uses a document\n * fragment as context node.\n *\n * @param aContextNode The context node to apply the XPath to.\n * @param aPath        The XPath to use.\n *\n * @return nsIDOMNode  The target node retrieved from the XPath.\n */\nfunction evalXPathInDocumentFragment(aContextNode, aPath) {\n  do_check_true(aContextNode instanceof C_i.nsIDOMDocumentFragment);\n  do_check_true(aContextNode.childNodes.length > 0);\n  if (aPath == \".\") {\n    return aContextNode;\n  }\n\n  // Separate the fragment's xpath lookup from the rest.\n  var firstSlash = aPath.indexOf(\"/\");\n  if (firstSlash == -1) {\n    firstSlash = aPath.length;\n  }\n  var prefix = aPath.substr(0, firstSlash);\n  var realPath = aPath.substr(firstSlash + 1);\n  if (!realPath) {\n    realPath = \".\";\n  }\n\n  // Set up a special node filter to look among the fragment's child nodes.\n  var childIndex = 1;\n  var bracketIndex = prefix.indexOf(\"[\");\n  if (bracketIndex != -1) {\n    childIndex = Number(prefix.substring(bracketIndex + 1, prefix.indexOf(\"]\")));\n    do_check_true(childIndex > 0);\n    prefix = prefix.substr(0, bracketIndex);\n  }\n\n  var targetType = C_i.nsIDOMNodeFilter.SHOW_ELEMENT;\n  var targetNodeName = prefix;\n  if (prefix.indexOf(\"processing-instruction(\") == 0) {\n    targetType = C_i.nsIDOMNodeFilter.SHOW_PROCESSING_INSTRUCTION;\n    targetNodeName = prefix.substring(prefix.indexOf(\"(\") + 2, prefix.indexOf(\")\") - 1);\n  }\n  switch (prefix) {\n    case \"text()\":\n      targetType = C_i.nsIDOMNodeFilter.SHOW_TEXT |\n                   C_i.nsIDOMNodeFilter.SHOW_CDATA_SECTION;\n      targetNodeName = null;\n      break;\n    case \"comment()\":\n      targetType = C_i.nsIDOMNodeFilter.SHOW_COMMENT;\n      targetNodeName = null;\n      break;\n    case \"node()\":\n      targetType = C_i.nsIDOMNodeFilter.SHOW_ALL;\n      targetNodeName = null;\n  }\n\n  var filter = {\n    count: 0,\n\n    // nsIDOMNodeFilter\n    acceptNode: function acceptNode(aNode) {\n      if (aNode.parentNode != aContextNode) {\n        // Don't bother looking at kids either.\n        return C_i.nsIDOMNodeFilter.FILTER_REJECT;\n      }\n\n      if (targetNodeName && targetNodeName != aNode.nodeName) {\n        return C_i.nsIDOMNodeFilter.FILTER_SKIP;\n      }\n\n      this.count++;\n      if (this.count != childIndex) {\n        return C_i.nsIDOMNodeFilter.FILTER_SKIP;\n      }\n\n      return C_i.nsIDOMNodeFilter.FILTER_ACCEPT;\n    }\n  };\n\n  // Look for the node matching the step from the document fragment.\n  var walker = aContextNode.ownerDocument.createTreeWalker(\n                 aContextNode,\n                 targetType,\n                 filter,\n                 true);\n  var targetNode = walker.nextNode();\n  do_check_neq(targetNode, null);\n\n  // Apply our remaining xpath to the found node.\n  var expr = aContextNode.ownerDocument.createExpression(realPath, null);\n  var result = expr.evaluate(targetNode, UNORDERED_TYPE, null);\n  do_check_true(result instanceof C_i.nsIDOMXPathResult);\n  return result.singleNodeValue;\n}\n\n/**\n * Get a DOM range corresponding to the test's source node.\n *\n * @param aSourceNode <source/> element with range information.\n * @param aFragment   DocumentFragment generated with getFragment().\n *\n * @return Range object.\n */\nfunction getRange(aSourceNode, aFragment) {\n  do_check_true(aSourceNode instanceof C_i.nsIDOMElement);\n  do_check_true(aFragment instanceof C_i.nsIDOMDocumentFragment);\n  var doc = aSourceNode.ownerDocument;\n\n  var containerPath = aSourceNode.getAttribute(\"startContainer\");\n  var startContainer = evalXPathInDocumentFragment(aFragment, containerPath);\n  var startOffset = Number(aSourceNode.getAttribute(\"startOffset\"));\n\n  containerPath = aSourceNode.getAttribute(\"endContainer\");\n  var endContainer = evalXPathInDocumentFragment(aFragment, containerPath);\n  var endOffset = Number(aSourceNode.getAttribute(\"endOffset\"));\n\n  var range = doc.createRange();\n  range.setStart(startContainer, startOffset);\n  range.setEnd(endContainer, endOffset);\n  return range;\n}\n\n/**\n * Get the document for a given path, and clean it up for our tests.\n *\n * @param aPath The path to the local document.\n */\nfunction getParsedDocument(aPath) {\n  var doc = do_parse_document(aPath, \"application/xml\");\n  do_check_true(doc.documentElement.localName != \"parsererror\");\n  do_check_true(doc instanceof C_i.nsIDOMDocumentTraversal);\n  do_check_true(doc instanceof C_i.nsIDOMXPathEvaluator);\n  do_check_true(doc instanceof C_i.nsIDOMDocumentRange);\n\n  // Clean out whitespace.\n  var walker = doc.createTreeWalker(doc,\n                                    C_i.nsIDOMNodeFilter.SHOW_TEXT |\n                                    C_i.nsIDOMNodeFilter.SHOW_CDATA_SECTION,\n                                    isWhitespace,\n                                    false);\n  while (walker.nextNode()) {\n    var parent = walker.currentNode.parentNode;\n    parent.removeChild(walker.currentNode);\n    walker.currentNode = parent;\n  }\n\n  // Clean out mandatory splits between nodes.\n  var splits = doc.getElementsByTagName(\"split\");\n  var i;\n  for (i = splits.length - 1; i >= 0; i--) {\n    var node = splits.item(i);\n    node.parentNode.removeChild(node);\n  }\n  splits = null;\n\n  // Replace empty CDATA sections.\n  var emptyData = doc.getElementsByTagName(\"empty-cdata\");\n  for (i = emptyData.length - 1; i >= 0; i--) {\n    var node = emptyData.item(i);\n    var cdata = doc.createCDATASection(\"\");\n    node.parentNode.replaceChild(cdata, node);\n  }\n\n  return doc;\n}\n\n/**\n * Run the extraction tests.\n */\nfunction run_extract_test() {\n  var filePath = \"test_delete_range.xml\";\n  var doc = getParsedDocument(filePath);\n  var tests = doc.getElementsByTagName(\"test\");\n\n  // Run our deletion, extraction tests.\n  for (var i = 0; i < tests.length; i++) {\n    dump(\"Configuring for test \" + i + \"\\n\");\n    var currentTest = tests.item(i);\n\n    // Validate the test is properly formatted for what this harness expects.\n    var baseSource = currentTest.firstChild;\n    do_check_eq(baseSource.nodeName, \"source\");\n    var baseResult = baseSource.nextSibling;\n    do_check_eq(baseResult.nodeName, \"result\");\n    var baseExtract = baseResult.nextSibling;\n    do_check_eq(baseExtract.nodeName, \"extract\");\n    do_check_eq(baseExtract.nextSibling, null);\n\n    /* We do all our tests on DOM document fragments, derived from the test\n       element's children.  This lets us rip the various fragments to shreds,\n       while preserving the original elements so we can make more copies of\n       them.\n\n       After the range's extraction or deletion is done, we use\n       nsIDOM3Node.isEqualNode() between the altered source fragment and the\n       result fragment.  We also run isEqualNode() between the extracted\n       fragment and the fragment from the baseExtract node.  If they are not\n       equal, we have failed a test.\n\n       We also have to ensure the original nodes on the end points of the\n       range are still in the source fragment.  This is bug 332148.  The nodes\n       may not be replaced with equal but separate nodes.  The range extraction\n       may alter these nodes - in the case of text containers, they will - but\n       the nodes must stay there, to preserve references such as user data,\n       event listeners, etc.\n\n       First, an extraction test.\n     */\n\n    var resultFrag = getFragment(baseResult);\n    var extractFrag = getFragment(baseExtract);\n\n    dump(\"Extract contents test \" + i + \"\\n\\n\");\n    var baseFrag = getFragment(baseSource);\n    var baseRange = getRange(baseSource, baseFrag);\n    var startContainer = baseRange.startContainer;\n    var endContainer = baseRange.endContainer;\n\n    var cutFragment = baseRange.extractContents();\n    dump(\"cutFragment: \" + cutFragment + \"\\n\");\n    if (cutFragment) {\n      do_check_true(extractFrag.isEqualNode(cutFragment));\n    } else {\n      do_check_eq(extractFrag.firstChild, null);\n    }\n    do_check_true(baseFrag.isEqualNode(resultFrag));\n\n    dump(\"Ensure the original nodes weren't extracted - test \" + i + \"\\n\\n\");\n    var walker = doc.createTreeWalker(baseFrag,\n\t\t\t\t      C_i.nsIDOMNodeFilter.SHOW_ALL,\n\t\t\t\t      null,\n\t\t\t\t      false);\n    var foundStart = false;\n    var foundEnd = false;\n    do {\n      do_check_true(walker.currentNode instanceof C_i.nsIDOM3Node);\n\n      if (walker.currentNode.isSameNode(startContainer)) {\n        foundStart = true;\n      }\n\n      if (walker.currentNode.isSameNode(endContainer)) {\n        // An end container node should not come before the start container node.\n        do_check_true(foundStart);\n        foundEnd = true;\n        break;\n      }\n    } while (walker.nextNode())\n    do_check_true(foundEnd);\n\n    /* Now, we reset our test for the deleteContents case.  This one differs\n       from the extractContents case only in that there is no extracted document\n       fragment to compare against.  So we merely compare the starting fragment,\n       minus the extracted content, against the result fragment.\n     */\n    dump(\"Delete contents test \" + i + \"\\n\\n\");\n    baseFrag = getFragment(baseSource);\n    baseRange = getRange(baseSource, baseFrag);\n    var startContainer = baseRange.startContainer;\n    var endContainer = baseRange.endContainer;\n    baseRange.deleteContents();\n    do_check_true(baseFrag.isEqualNode(resultFrag));\n\n    dump(\"Ensure the original nodes weren't deleted - test \" + i + \"\\n\\n\");\n    walker = doc.createTreeWalker(baseFrag,\n                                  C_i.nsIDOMNodeFilter.SHOW_ALL,\n                                  null,\n                                  false);\n    foundStart = false;\n    foundEnd = false;\n    do {\n      do_check_true(walker.currentNode instanceof C_i.nsIDOM3Node);\n\n      if (walker.currentNode.isSameNode(startContainer)) {\n        foundStart = true;\n      }\n\n      if (walker.currentNode.isSameNode(endContainer)) {\n        // An end container node should not come before the start container node.\n        do_check_true(foundStart);\n        foundEnd = true;\n        break;\n      }\n    } while (walker.nextNode())\n    do_check_true(foundEnd);\n\n    // Clean up after ourselves.\n    walker = null;\n\n    /* Whenever a DOM range is detached, we cannot use any methods on\n       it - including extracting its contents or deleting its contents.  It\n       should throw a NS_ERROR_DOM_INVALID_STATE_ERR exception.\n    */\n    dump(\"Detached range test\\n\");\n    var compareFrag = getFragment(baseSource);\n    baseFrag = getFragment(baseSource);\n    baseRange = getRange(baseSource, baseFrag);\n    baseRange.detach();\n    try {\n      var cutFragment = baseRange.extractContents();\n      do_throw(\"Should have thrown INVALID_STATE_ERR!\");\n    } catch (e if (e instanceof C_i.nsIException &&\n                   e.result == INVALID_STATE_ERR)) {\n      // do nothing\n    }\n    do_check_true(compareFrag.isEqualNode(baseFrag));\n\n    try {\n      baseRange.deleteContents();\n      do_throw(\"Should have thrown INVALID_STATE_ERR!\");\n    } catch (e if (e instanceof C_i.nsIException &&\n                   e.result == INVALID_STATE_ERR)) {\n      // do nothing\n    }\n    do_check_true(compareFrag.isEqualNode(baseFrag));\n  }\n}\n\n/**\n * Miscellaneous tests not covered above.\n */\nfunction run_miscellaneous_tests() {\n  var filePath = \"test_delete_range.xml\";\n  var doc = getParsedDocument(filePath);\n  var tests = doc.getElementsByTagName(\"test\");\n\n  // Let's try some invalid inputs to our DOM range and see what happens.\n  var currentTest = tests.item(0);\n  var baseSource = currentTest.firstChild;\n  var baseResult = baseSource.nextSibling;\n  var baseExtract = baseResult.nextSibling;\n\n  var baseFrag = getFragment(baseSource);\n\n  var baseRange = getRange(baseSource, baseFrag);\n  var startContainer = baseRange.startContainer;\n  var endContainer = baseRange.endContainer;\n  var startOffset = baseRange.startOffset;\n  var endOffset = baseRange.endOffset;\n\n  // Text range manipulation.\n  if ((endOffset > startOffset) &&\n      (startContainer == endContainer) &&\n      (startContainer instanceof C_i.nsIDOMText)) {\n    // Invalid start node\n    try {\n      baseRange.setStart(null, 0);\n      do_throw(\"Should have thrown NOT_OBJECT_ERR!\");\n    } catch (e if (e instanceof C_i.nsIException &&\n                   e.result == NOT_OBJECT_ERR)) {\n      // do nothing\n    }\n\n    // Invalid start node\n    try {\n      baseRange.setStart({}, 0);\n      do_throw(\"Should have thrown SECURITY_ERR!\");\n    } catch (e if (e instanceof C_i.nsIException &&\n                   e.result == SECURITY_ERR)) {\n      // do nothing\n    }\n\n    // Invalid index\n    try {\n      baseRange.setStart(startContainer, -1);\n      do_throw(\"Should have thrown INVALID_STATE_ERR!\");\n    } catch (e if (e instanceof C_i.nsIException &&\n                   e.result == INDEX_SIZE_ERR)) {\n      // do nothing\n    }\n  \n    // Invalid index\n    var newOffset = startContainer instanceof C_i.nsIDOMText ?\n                      startContainer.nodeValue.length + 1 :\n                      startContainer.childNodes.length + 1;\n    try {\n      baseRange.setStart(startContainer, newOffset);\n      do_throw(\"Should have thrown INVALID_STATE_ERR!\");\n    } catch (e if (e instanceof C_i.nsIException &&\n                   e.result == INDEX_SIZE_ERR)) {\n      // do nothing\n    }\n  \n    newOffset--;\n    // Valid index\n    baseRange.setStart(startContainer, newOffset);\n    do_check_eq(baseRange.startContainer, baseRange.endContainer);\n    do_check_eq(baseRange.startOffset, newOffset);\n    do_check_true(baseRange.collapsed);\n\n    // Valid index\n    baseRange.setEnd(startContainer, 0);\n    do_check_eq(baseRange.startContainer, baseRange.endContainer);\n    do_check_eq(baseRange.startOffset, 0);\n    do_check_true(baseRange.collapsed);\n  } else {\n    do_throw(\"The first test should be a text-only range test.  Test is invalid.\")\n  }\n\n  /* See what happens when a range has a startContainer in one fragment, and an\n     endContainer in another.  According to the DOM spec, section 2.4, the range\n     should collapse to the new container and offset. */\n  baseRange = getRange(baseSource, baseFrag);\n  startContainer = baseRange.startContainer;\n  var startOffset = baseRange.startOffset;\n  endContainer = baseRange.endContainer;\n  var endOffset = baseRange.endOffset;\n\n  dump(\"External fragment test\\n\\n\");\n\n  var externalTest = tests.item(1);\n  var externalSource = externalTest.firstChild;\n  var externalFrag = getFragment(externalSource);\n  var externalRange = getRange(externalSource, externalFrag);\n\n  baseRange.setEnd(externalRange.endContainer, 0);\n  do_check_eq(baseRange.startContainer, externalRange.endContainer);\n  do_check_eq(baseRange.startOffset, 0);\n  do_check_true(baseRange.collapsed);\n\n  /*\n  // XXX ajvincent if rv == WRONG_DOCUMENT_ERR, return false?\n  do_check_true(baseRange instanceof C_i.nsIDOMNSRange);\n  do_check_false(baseRange.isPointInRange(startContainer, startOffset));\n  do_check_false(baseRange.isPointInRange(startContainer, startOffset + 1));\n  do_check_false(baseRange.isPointInRange(endContainer, endOffset));\n  */\n\n  // Requested by smaug:  A range involving a comment as a document child.\n  doc = parser.parseFromString(\"<!-- foo --><foo/>\", \"application/xml\");\n  do_check_true(doc instanceof C_i.nsIDOMDocumentRange);\n  do_check_eq(doc.childNodes.length, 2);\n  baseRange = doc.createRange();\n  baseRange.setStart(doc.firstChild, 1);\n  baseRange.setEnd(doc.firstChild, 2);\n  var frag = baseRange.extractContents();\n  do_check_eq(frag.childNodes.length, 1);\n  do_check_true(frag.firstChild instanceof C_i.nsIDOMComment);\n  do_check_eq(frag.firstChild.nodeValue, \"f\");\n\n  /* smaug also requested attribute tests.  Sadly, those are not yet supported\n     in ranges - see https://bugzilla.mozilla.org/show_bug.cgi?id=302775.\n   */\n}\n\nfunction run_test() {\n  run_extract_test();\n  run_miscellaneous_tests();\n}", "domain": "javascript", "lang": "code", "char_count": 19087, "word_count": 3679, "byte_count": 19087}
{"text": "const Post = require('../../models/forums/Post');\nconst ObjectId = require('mongoose').Types.ObjectId;\n\nconst { formatDate } = require('../utils');\n\nlet regexp = '\\\\[quotes=#?([a-z0-9]+)\\\\]';\n\nlet format = async(content, viewer, post) => {\n    let reg = new RegExp(regexp, 'gi');\n\n    while (true) {\n        let match = reg.exec(content);\n        if (!match) break;\n\n        let postId = match[1];\n        if (!ObjectId.isValid(postId)) {\n            content = content.replace(reg, createQuoteErrorElement('Invalid post ID'));\n            continue;\n        }\n\n        let quotePost = await Post.findById(postId);\n        if (quotePost._id.equals(post._id)) {\n            content = content.replace(reg, createQuoteErrorElement('You cannot quote your own post'));\n            continue;\n        }\n        if (!quotePost) {\n            content = content.replace(reg, createQuoteErrorElement('Post not found'));\n            continue;\n        }\n\n        content = content.replace(reg, createQuoteElement(quotePost));\n    }\n    return content;\n\n};\n\nfunction createQuoteElement(post) {\n    return `<div class=\"quote\">\n                <div class=\"quote-header\">\n                    Quote by\n                </div>\n                <div class=\"quote-content\">${post.content}</div>\n            </div>`;\n}\n\nfunction createQuoteErrorElement(message) {\n    return `<div class=\"quote\">\n                <div class=\"quote-header\">\n                    <div class=\"quote-author\">Error</div>\n                    <div class=\"quote-date\">${message}</div>\n                </div>\n            </div>`;\n}\n\nmodule.exports = { regexp, format };", "domain": "javascript", "lang": "code", "char_count": 1615, "word_count": 353, "byte_count": 1615}
{"text": "(window.webpackJsonp=window.webpackJsonp||[]).push([[14],{dUtr:function(t,o,e){\"use strict\";e.r(o),e.d(o,\"ion_action_sheet\",function(){return g});var n=e(\"2atR\"),i=e(\"GTku\"),a=(e(\"Ke8Y\"),e(\"QIf6\")),r=(e(\"y08P\"),e(\"iWo5\"),e(\"B4Jq\"),e(\"FqQB\")),s=(e(\"qULd\"),e(\"pX2f\")),c=e(\"74mu\");const d=t=>{const o=Object(a.a)(),e=Object(a.a)(),n=Object(a.a)();return e.addElement(t.querySelector(\"ion-backdrop\")).fromTo(\"opacity\",.01,\"var(--backdrop-opacity)\").beforeStyles({\"pointer-events\":\"none\"}).afterClearStyles([\"pointer-events\"]),n.addElement(t.querySelector(\".action-sheet-wrapper\")).fromTo(\"transform\",\"translateY(100%)\",\"translateY(0%)\"),o.addElement(t).easing(\"cubic-bezier(.36,.66,.04,1)\").duration(400).addAnimation([e,n])},l=t=>{const o=Object(a.a)(),e=Object(a.a)(),n=Object(a.a)();return e.addElement(t.querySelector(\"ion-backdrop\")).fromTo(\"opacity\",\"var(--backdrop-opacity)\",0),n.addElement(t.querySelector(\".action-sheet-wrapper\")).fromTo(\"transform\",\"translateY(0%)\",\"translateY(100%)\"),o.addElement(t).easing(\"cubic-bezier(.36,.66,.04,1)\").duration(450).addAnimation([e,n])},b=t=>{const o=Object(a.a)(),e=Object(a.a)(),n=Object(a.a)();return e.addElement(t.querySelector(\"ion-backdrop\")).fromTo(\"opacity\",.01,\"var(--backdrop-opacity)\").beforeStyles({\"pointer-events\":\"none\"}).afterClearStyles([\"pointer-events\"]),n.addElement(t.querySelector(\".action-sheet-wrapper\")).fromTo(\"transform\",\"translateY(100%)\",\"translateY(0%)\"),o.addElement(t).easing(\"cubic-bezier(.36,.66,.04,1)\").duration(400).addAnimation([e,n])},h=t=>{const o=Object(a.a)(),e=Object(a.a)(),n=Object(a.a)();return e.addElement(t.querySelector(\"ion-backdrop\")).fromTo(\"opacity\",\"var(--backdrop-opacity)\",0),n.addElement(t.querySelector(\".action-sheet-wrapper\")).fromTo(\"transform\",\"translateY(0%)\",\"translateY(100%)\"),o.addElement(t).easing(\"cubic-bezier(.36,.66,.04,1)\").duration(450).addAnimation([e,n])},g=class{constructor(t){Object(n.o)(this,t),this.didPresent=Object(n.g)(this,\"ionActionSheetDidPresent\",7),this.willPresent=Object(n.g)(this,\"ionActionSheetWillPresent\",7),this.willDismiss=Object(n.g)(this,\"ionActionSheetWillDismiss\",7),this.didDismiss=Object(n.g)(this,\"ionActionSheetDidDismiss\",7),this.presented=!1,this.keyboardClose=!0,this.buttons=[],this.backdropDismiss=!0,this.translucent=!1,this.animated=!0,this.onBackdropTap=()=>{this.dismiss(void 0,r.a)},this.dispatchCancelHandler=t=>{const o=t.detail.role;if(Object(r.j)(o)){const t=this.getButtons().find(t=>\"cancel\"===t.role);this.callButtonHandler(t)}}}present(){return Object(r.e)(this,\"actionSheetEnter\",d,b)}connectedCallback(){Object(r.f)(this.el)}dismiss(t,o){return Object(r.g)(this,t,o,\"actionSheetLeave\",l,h)}onDidDismiss(){return Object(r.h)(this.el,\"ionActionSheetDidDismiss\")}onWillDismiss(){return Object(r.h)(this.el,\"ionActionSheetWillDismiss\")}async buttonClick(t){const o=t.role;return Object(r.j)(o)?this.dismiss(void 0,o):await this.callButtonHandler(t)?this.dismiss(void 0,t.role):Promise.resolve()}async callButtonHandler(t){return!t||!1!==await Object(r.n)(t.handler)}getButtons(){return this.buttons.map(t=>\"string\"==typeof t?{text:t}:t)}disconnectedCallback(){this.gesture&&(this.gesture.destroy(),this.gesture=void 0)}componentDidLoad(){const{groupEl:t,wrapperEl:o}=this;!this.gesture&&\"md\"!==Object(i.b)(this)&&o&&t&&Object(n.h)(()=>{t.scrollHeight>t.clientHeight||(this.gesture=Object(s.a)(o,t=>t.classList.contains(\"action-sheet-button\")),this.gesture.enable(!0))})}render(){const t=Object(i.b)(this),o=this.getButtons(),e=o.find(t=>\"cancel\"===t.role),a=o.filter(t=>\"cancel\"!==t.role);return Object(n.j)(n.c,{role:\"dialog\",\"aria-modal\":\"true\",tabindex:\"-1\",style:{zIndex:`${2e4+this.overlayIndex}`},class:Object.assign(Object.assign({[t]:!0},Object(c.b)(this.cssClass)),{\"action-sheet-translucent\":this.translucent}),onIonActionSheetWillDismiss:this.dispatchCancelHandler,onIonBackdropTap:this.onBackdropTap},Object(n.j)(\"ion-backdrop\",{tappable:this.backdropDismiss}),Object(n.j)(\"div\",{tabindex:\"0\"}),Object(n.j)(\"div\",{class:\"action-sheet-wrapper ion-overlay-wrapper\",role:\"dialog\",ref:t=>this.wrapperEl=t},Object(n.j)(\"div\",{class:\"action-sheet-container\"},Object(n.j)(\"div\",{class:\"action-sheet-group\",ref:t=>this.groupEl=t},void 0!==this.header&&Object(n.j)(\"div\",{class:\"action-sheet-title\"},this.header,this.subHeader&&Object(n.j)(\"div\",{class:\"action-sheet-sub-title\"},this.subHeader)),a.map(o=>Object(n.j)(\"button\",{type:\"button\",class:u(o),onClick:()=>this.buttonClick(o)},Object(n.j)(\"span\",{class:\"action-sheet-button-inner\"},o.icon&&Object(n.j)(\"ion-icon\",{icon:o.icon,lazy:!1,class:\"action-sheet-icon\"}),o.text),\"md\"===t&&Object(n.j)(\"ion-ripple-effect\",null)))),e&&Object(n.j)(\"div\",{class:\"action-sheet-group action-sheet-group-cancel\"},Object(n.j)(\"button\",{type:\"button\",class:u(e),onClick:()=>this.buttonClick(e)},Object(n.j)(\"span\",{class:\"action-sheet-button-inner\"},e.icon&&Object(n.j)(\"ion-icon\",{icon:e.icon,lazy:!1,class:\"action-sheet-icon\"}),e.text),\"md\"===t&&Object(n.j)(\"ion-ripple-effect\",null))))),Object(n.j)(\"div\",{tabindex:\"0\"}))}get el(){return Object(n.k)(this)}},u=t=>Object.assign({\"action-sheet-button\":!0,\"ion-activatable\":!0,\"ion-focusable\":!0,[`action-sheet-${t.role}`]:void 0!==t.role},Object(c.b)(t.cssClass));g.style={ios:'.sc-ion-action-sheet-ios-h{--color:initial;--button-color-activated:var(--button-color);--button-color-focused:var(--button-color);--button-color-hover:var(--button-color);--button-color-selected:var(--button-color);--min-width:auto;--width:100%;--max-width:500px;--min-height:auto;--height:100%;--max-height:calc(100% - (var(--ion-safe-area-top) + var(--ion-safe-area-bottom)));-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;left:0;right:0;top:0;bottom:0;display:block;position:fixed;outline:none;font-family:var(--ion-font-family, inherit);-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:1001}.overlay-hidden.sc-ion-action-sheet-ios-h{display:none}.action-sheet-wrapper.sc-ion-action-sheet-ios{left:0;right:0;bottom:0;margin-left:auto;margin-right:auto;margin-top:auto;margin-bottom:auto;-webkit-transform:translate3d(0,  100%,  0);transform:translate3d(0,  100%,  0);display:block;position:absolute;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);z-index:10;pointer-events:none}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.action-sheet-wrapper.sc-ion-action-sheet-ios{margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}.action-sheet-button.sc-ion-action-sheet-ios{display:block;position:relative;width:100%;border:0;outline:none;background:var(--button-background);color:var(--button-color);font-family:inherit;overflow:hidden}.action-sheet-button-inner.sc-ion-action-sheet-ios{display:-ms-flexbox;display:flex;position:relative;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;pointer-events:none;width:100%;height:100%;z-index:1}.action-sheet-container.sc-ion-action-sheet-ios{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;-ms-flex-pack:end;justify-content:flex-end;height:100%;max-height:100%}.action-sheet-group.sc-ion-action-sheet-ios{-ms-flex-negative:2;flex-shrink:2;overscroll-behavior-y:contain;overflow-y:auto;-webkit-overflow-scrolling:touch;pointer-events:all;background:var(--background)}.action-sheet-group.sc-ion-action-sheet-ios::-webkit-scrollbar{display:none}.action-sheet-group-cancel.sc-ion-action-sheet-ios{-ms-flex-negative:0;flex-shrink:0;overflow:hidden}.action-sheet-button.sc-ion-action-sheet-ios::after{left:0;right:0;top:0;bottom:0;position:absolute;content:\"\";opacity:0}.action-sheet-selected.sc-ion-action-sheet-ios{color:var(--button-color-selected)}.action-sheet-selected.sc-ion-action-sheet-ios::after{background:var(--button-background-selected);opacity:var(--button-background-selected-opacity)}.action-sheet-button.ion-activated.sc-ion-action-sheet-ios{color:var(--button-color-activated)}.action-sheet-button.ion-activated.sc-ion-action-sheet-ios::after{background:var(--button-background-activated);opacity:var(--button-background-activated-opacity)}.action-sheet-button.ion-focused.sc-ion-action-sheet-ios{color:var(--button-color-focused)}.action-sheet-button.ion-focused.sc-ion-action-sheet-ios::after{background:var(--button-background-focused);opacity:var(--button-background-focused-opacity)}@media (any-hover: hover){.action-sheet-button.sc-ion-action-sheet-ios:hover{color:var(--button-color-hover)}.action-sheet-button.sc-ion-action-sheet-ios:hover::after{background:var(--button-background-hover);opacity:var(--button-background-hover-opacity)}}.sc-ion-action-sheet-ios-h{--background:var(--ion-overlay-background-color, var(--ion-color-step-100, #f9f9f9));--backdrop-opacity:var(--ion-backdrop-opacity, 0.4);--button-background:linear-gradient(0deg, rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.08), rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.08) 50%, transparent 50%) bottom/100% 1px no-repeat transparent;--button-background-activated:var(--ion-text-color, #000);--button-background-activated-opacity:.08;--button-background-hover:currentColor;--button-background-hover-opacity:.04;--button-background-focused:currentColor;--button-background-focused-opacity:.12;--button-background-selected:var(--ion-color-step-150, var(--ion-background-color, #fff));--button-background-selected-opacity:1;--button-color:var(--ion-color-primary, #3880ff);--color:var(--ion-color-step-400, #999999);text-align:center}.action-sheet-wrapper.sc-ion-action-sheet-ios{margin-left:auto;margin-right:auto;margin-top:var(--ion-safe-area-top, 0);margin-bottom:var(--ion-safe-area-bottom, 0)}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.action-sheet-wrapper.sc-ion-action-sheet-ios{margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}.action-sheet-container.sc-ion-action-sheet-ios{padding-left:8px;padding-right:8px;padding-top:0;padding-bottom:0}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.action-sheet-container.sc-ion-action-sheet-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px}}.action-sheet-group.sc-ion-action-sheet-ios{border-radius:13px;margin-bottom:8px}.action-sheet-group.sc-ion-action-sheet-ios:first-child{margin-top:10px}.action-sheet-group.sc-ion-action-sheet-ios:last-child{margin-bottom:10px}@supports ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))){.action-sheet-translucent.sc-ion-action-sheet-ios-h .action-sheet-group.sc-ion-action-sheet-ios{background-color:transparent;-webkit-backdrop-filter:saturate(280%) blur(20px);backdrop-filter:saturate(280%) blur(20px)}.action-sheet-translucent.sc-ion-action-sheet-ios-h .action-sheet-title.sc-ion-action-sheet-ios,.action-sheet-translucent.sc-ion-action-sheet-ios-h .action-sheet-button.sc-ion-action-sheet-ios{background-color:transparent;background-image:-webkit-gradient(linear, left bottom, left top, from(rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8)), to(rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8))), -webkit-gradient(linear, left bottom, left top, from(rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.4)), color-stop(50%, rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.4)), color-stop(50%, rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8)));background-image:linear-gradient(0deg, rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8), rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8) 100%), linear-gradient(0deg, rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.4), rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.4) 50%, rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8) 50%);background-repeat:no-repeat;background-position:top, bottom;background-size:100% calc(100% - 1px), 100% 1px;-webkit-backdrop-filter:saturate(120%);backdrop-filter:saturate(120%)}.action-sheet-translucent.sc-ion-action-sheet-ios-h .action-sheet-button.ion-activated.sc-ion-action-sheet-ios{background-color:rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.7);background-image:none}.action-sheet-translucent.sc-ion-action-sheet-ios-h .action-sheet-cancel.sc-ion-action-sheet-ios{background:var(--button-background-selected)}}.action-sheet-title.sc-ion-action-sheet-ios{background:-webkit-gradient(linear, left bottom, left top, from(rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.08)), color-stop(50%, rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.08)), color-stop(50%, transparent)) bottom/100% 1px no-repeat transparent;background:linear-gradient(0deg, rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.08), rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.08) 50%, transparent 50%) bottom/100% 1px no-repeat transparent}.action-sheet-title.sc-ion-action-sheet-ios{padding-left:10px;padding-right:10px;padding-top:14px;padding-bottom:13px;color:var(--color, var(--ion-color-step-400, #999999));font-size:13px;font-weight:400;text-align:center}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.action-sheet-title.sc-ion-action-sheet-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:10px;padding-inline-start:10px;-webkit-padding-end:10px;padding-inline-end:10px}}.action-sheet-sub-title.sc-ion-action-sheet-ios{padding-left:0;padding-right:0;padding-top:15px;padding-bottom:0;font-size:12px}.action-sheet-button.sc-ion-action-sheet-ios{padding-left:18px;padding-right:18px;padding-top:18px;padding-bottom:18px;height:56px;font-size:20px;contain:strict}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.action-sheet-button.sc-ion-action-sheet-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:18px;padding-inline-start:18px;-webkit-padding-end:18px;padding-inline-end:18px}}.action-sheet-button.sc-ion-action-sheet-ios .action-sheet-icon.sc-ion-action-sheet-ios{margin-right:0.1em;font-size:28px;pointer-events:none}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.action-sheet-button.sc-ion-action-sheet-ios .action-sheet-icon.sc-ion-action-sheet-ios{margin-right:unset;-webkit-margin-end:0.1em;margin-inline-end:0.1em}}.action-sheet-button.sc-ion-action-sheet-ios:last-child{background-image:none}.action-sheet-selected.sc-ion-action-sheet-ios{font-weight:bold}.action-sheet-cancel.sc-ion-action-sheet-ios{font-weight:600}.action-sheet-cancel.sc-ion-action-sheet-ios::after{background:var(--button-background-selected);opacity:var(--button-background-selected-opacity)}.action-sheet-destructive.sc-ion-action-sheet-ios,.action-sheet-destructive.ion-activated.sc-ion-action-sheet-ios,.action-sheet-destructive.ion-focused.sc-ion-action-sheet-ios{color:var(--ion-color-danger, #eb445a)}@media (any-hover: hover){.action-sheet-destructive.sc-ion-action-sheet-ios:hover{color:var(--ion-color-danger, #eb445a)}}',md:'.sc-ion-action-sheet-md-h{--color:initial;--button-color-activated:var(--button-color);--button-color-focused:var(--button-color);--button-color-hover:var(--button-color);--button-color-selected:var(--button-color);--min-width:auto;--width:100%;--max-width:500px;--min-height:auto;--height:100%;--max-height:calc(100% - (var(--ion-safe-area-top) + var(--ion-safe-area-bottom)));-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;left:0;right:0;top:0;bottom:0;display:block;position:fixed;outline:none;font-family:var(--ion-font-family, inherit);-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:1001}.overlay-hidden.sc-ion-action-sheet-md-h{display:none}.action-sheet-wrapper.sc-ion-action-sheet-md{left:0;right:0;bottom:0;margin-left:auto;margin-right:auto;margin-top:auto;margin-bottom:auto;-webkit-transform:translate3d(0,  100%,  0);transform:translate3d(0,  100%,  0);display:block;position:absolute;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);z-index:10;pointer-events:none}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.action-sheet-wrapper.sc-ion-action-sheet-md{margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}.action-sheet-button.sc-ion-action-sheet-md{display:block;position:relative;width:100%;border:0;outline:none;background:var(--button-background);color:var(--button-color);font-family:inherit;overflow:hidden}.action-sheet-button-inner.sc-ion-action-sheet-md{display:-ms-flexbox;display:flex;position:relative;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;pointer-events:none;width:100%;height:100%;z-index:1}.action-sheet-container.sc-ion-action-sheet-md{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;-ms-flex-pack:end;justify-content:flex-end;height:100%;max-height:100%}.action-sheet-group.sc-ion-action-sheet-md{-ms-flex-negative:2;flex-shrink:2;overscroll-behavior-y:contain;overflow-y:auto;-webkit-overflow-scrolling:touch;pointer-events:all;background:var(--background)}.action-sheet-group.sc-ion-action-sheet-md::-webkit-scrollbar{display:none}.action-sheet-group-cancel.sc-ion-action-sheet-md{-ms-flex-negative:0;flex-shrink:0;overflow:hidden}.action-sheet-button.sc-ion-action-sheet-md::after{left:0;right:0;top:0;bottom:0;position:absolute;content:\"\";opacity:0}.action-sheet-selected.sc-ion-action-sheet-md{color:var(--button-color-selected)}.action-sheet-selected.sc-ion-action-sheet-md::after{background:var(--button-background-selected);opacity:var(--button-background-selected-opacity)}.action-sheet-button.ion-activated.sc-ion-action-sheet-md{color:var(--button-color-activated)}.action-sheet-button.ion-activated.sc-ion-action-sheet-md::after{background:var(--button-background-activated);opacity:var(--button-background-activated-opacity)}.action-sheet-button.ion-focused.sc-ion-action-sheet-md{color:var(--button-color-focused)}.action-sheet-button.ion-focused.sc-ion-action-sheet-md::after{background:var(--button-background-focused);opacity:var(--button-background-focused-opacity)}@media (any-hover: hover){.action-sheet-button.sc-ion-action-sheet-md:hover{color:var(--button-color-hover)}.action-sheet-button.sc-ion-action-sheet-md:hover::after{background:var(--button-background-hover);opacity:var(--button-background-hover-opacity)}}.sc-ion-action-sheet-md-h{--background:var(--ion-overlay-background-color, var(--ion-background-color, #fff));--backdrop-opacity:var(--ion-backdrop-opacity, 0.32);--button-background:transparent;--button-background-selected:currentColor;--button-background-selected-opacity:0;--button-background-activated:transparent;--button-background-activated-opacity:0;--button-background-hover:currentColor;--button-background-hover-opacity:.04;--button-background-focused:currentColor;--button-background-focused-opacity:.12;--button-color:var(--ion-color-step-850, #262626);--color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.54)}.action-sheet-title.sc-ion-action-sheet-md{padding-left:16px;padding-right:16px;padding-top:20px;padding-bottom:17px;height:60px;color:var(--color, rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.54));font-size:16px;text-align:start}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.action-sheet-title.sc-ion-action-sheet-md{padding-left:unset;padding-right:unset;-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}}.action-sheet-sub-title.sc-ion-action-sheet-md{padding-left:0;padding-right:0;padding-top:16px;padding-bottom:0;font-size:14px}.action-sheet-group.sc-ion-action-sheet-md:first-child{padding-top:0}.action-sheet-group.sc-ion-action-sheet-md:last-child{padding-bottom:0}.action-sheet-button.sc-ion-action-sheet-md{padding-left:16px;padding-right:16px;padding-top:0;padding-bottom:0;position:relative;height:52px;font-size:16px;text-align:start;contain:strict;overflow:hidden}@supports", "domain": "javascript", "lang": "code", "char_count": 20633, "word_count": 5716, "byte_count": 20633}
{"text": "import React from 'react';\nimport cx from 'classnames';\nimport { connect } from 'react-redux';\n\nimport BungieImage from 'src/components/BungieImage';\n\nimport s from './styles.styl';\n\nconst NO_ICON = '/img/misc/missing_icon_d2.png';\n\nfunction Item({ item, className, instance }) {\n  const icon = (item && item.displayProperties.icon) || NO_ICON;\n\n  return (\n    <div className={cx(className, s.root)}>\n      <BungieImage className={s.icon} src={icon} />\n      <div className={s.main}>\n        <div className={s.name}>{item && item.displayProperties.name}</div>\n        <div className={s.sub}>\n          {instance.quantity === 1\n            ? item.itemTypeDisplayName\n            : instance.quantity}\n        </div>\n      </div>\n    </div>\n  );\n}\n\nconst mapStateToProps = (state, ownProps) => {\n  return {\n    item:\n      state.definitions.DestinyInventoryItemDefinition &&\n      state.definitions.DestinyInventoryItemDefinition[ownProps.hash]\n  };\n};\n\nexport default connect(mapStateToProps)(Item);", "domain": "javascript", "lang": "code", "char_count": 997, "word_count": 223, "byte_count": 997}
{"text": "\ufeff///////////////////////////////////////////////////////////////////////////\n// Copyright \u00a9 Esri. All Rights Reserved.\n//\n// Licensed under the Apache License Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//    http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n///////////////////////////////////////////////////////////////////////////\n/*global define */\n/*jslint browser:true,sloppy:true,nomen:true,unparam:true,plusplus:true,indent:4 */\ndefine([\n  \"dojo/_base/declare\",\n  \"dojo/text!./summarySetting.html\",\n  \"dijit/_WidgetBase\",\n  \"dijit/_TemplatedMixin\",\n  \"dijit/_WidgetsInTemplateMixin\",\n  \"dojo/dom-class\",\n  \"dojo/dom-construct\",\n  \"dojo/_base/lang\",\n  \"dojo/on\",\n  \"dojo/dom-attr\",\n  'dijit/Editor',\n  'dojo/_base/html',\n  \"jimu/dijit/Message\",\n  \"dijit/_editor/plugins/TextColor\"\n], function (\n  declare,\n  summarySetting,\n  _WidgetBase,\n  _TemplatedMixin,\n  _WidgetsInTemplateMixin,\n  domClass,\n  domConstruct,\n  lang,\n  on,\n  domAttr,\n  Editor,\n  html,\n  Message\n) {\n  return declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin], {\n    templateString: summarySetting,\n    _selectedOutputParameter: null, // to store selected output parameter\n    _inputOutputSelect: null, // to store input parameter control\n    _operatorSelect: null, // to store operator parameter control\n    _fieldSelect: null, // to store field parameter control\n    _inputOutputParamArray: [], // to store input output parameter Array\n    _selectedInput: null, // to store input option object evt\n    _selectedOutput: null, // to store output option object evt\n    _selectedField: null, // to store feild option object evt\n    _selectedOperator: null, // to store operator option object evt\n    _summaryExpressionEditor: null, // to store object of summary expression editor\n    _editorObj: null, // to store editor object\n    _outputLayerSettingsArr: [], // to store settings of output configuration\n    _selectedOutputGeometryType: null, // to store geometry type of selected output\n\n    postCreate: function () {\n      this._initEditor();\n      this.inherited(arguments);\n    },\n\n    startup: function () {\n      this.inherited(arguments);\n    },\n\n    /**\n     * This function is used to init dojo editor\n     * @memberOf widgets/NetworkTrace/settings/summarySettings\n     **/\n    _initEditor: function () {\n      if (!this._editorObj) {\n        this._editorObj = new Editor({\n          plugins: [\n            \"bold\", \"italic\", \"underline\", \"|\", \"foreColor\"\n          ]\n        }, this.editorContainer);\n        html.setStyle(this._editorObj.domNode, {\n          \"width\": '100%',\n          \"height\": '100%'\n        });\n        this.own(on(this._editorObj, \"focus\", lang.hitch(this,\n          function () {\n            domClass.remove(this.verifySummaryExpression,\n              \"jimu-state-disabled\");\n          })));\n        this.own(on(this._editorObj, \"blur\", lang.hitch(this,\n          function () {\n            var editorText, regExp;\n            editorText = this._editorObj.focusNode.innerHTML;\n            editorText = editorText.replace(/&nbsp;/g, '');\n            regExp = new RegExp(\"<div><br></div>\", 'g');\n            editorText = editorText.replace(regExp, \"\");\n            regExp = new RegExp(\"<p><br></p>\", 'g');\n            editorText = editorText.replace(regExp, \"\");\n            regExp = new RegExp(\"<p></p>\", 'g');\n            editorText = editorText.replace(regExp, \"\");\n            editorText = editorText.replace(/<br>/g, \"\");\n            editorText = lang.trim(editorText);\n\n            if ((editorText === null) || (editorText === \"\")) {\n              this._editorObj.set(\"value\", \"\");\n              domClass.add(this.verifySummaryExpression,\n                \"jimu-state-disabled\");\n            } else {\n              domClass.remove(this.verifySummaryExpression,\n                \"jimu-state-disabled\");\n            }\n          })));\n\n        this._editorObj.onLoadDeferred.then(lang.hitch(this, function () {\n          if ((this._editorObj) && (this._editorObj.hasOwnProperty(\n              'editNode'))) {\n            if (\"title\" in this._editorObj.editNode) {\n              if (this._editorObj.editNode.title === null ||\n                this._editorObj.editNode.title === \"\") {\n                this._editorObj.editNode.title = this.nls.summaryTab\n                  .summaryEditorText;\n              }\n            }\n          }\n        }));\n\n        this._editorObj.startup();\n      }\n    },\n\n    /**\n     * This function is used to display input & output parameter\n     * @memberOf widgets/NetworkTrace/settings/summarySettings\n     **/\n    displayInputOutputParameters: function () {\n      domConstruct.empty(this.inputOutputParameterPanel);\n      this._displayInputOutputPanelParameters();\n      this._regainExistingConfigurationData();\n    },\n\n    /**\n     * This function is used to regain existing configuration settings.\n     * @memberOf widgets/NetworkTrace/settings/summarySettings\n     **/\n    _regainExistingConfigurationData: function () {\n      if (this.config.summaryExpression) {\n        this._editorObj.focus();\n        this._editorObj.set(\"value\", this.config.summaryExpression.summaryExpressionValue);\n        if (this.config.summaryExpression.summaryExpressionValue ===\n          null || this.config.summaryExpression.summaryExpressionValue ===\n          \"\") {\n          domClass.add(this.verifySummaryExpression,\n            \"jimu-state-disabled\");\n        } else {\n          domClass.remove(this.verifySummaryExpression,\n            \"jimu-state-disabled\");\n        }\n      }\n    },\n\n    /**\n     * This function used to add parameter in input output panel\n     * @memberOf widgets/NetworkTrace/settings/summarySettings\n     */\n    _displayInputOutputPanelParameters: function () {\n      var inputOption, i;\n      this._inputOutputParamArray = [];\n      this._inputOutputSelect = domConstruct.create(\"select\", {\n        \"class\": \"esriCTPanelSelect\",\n        \"size\": 2\n      }, this.inputOutputParameterPanel);\n      for (i = 0; i < this.inputParametersArray.length; i++) {\n        inputOption = domConstruct.create(\"option\", {});\n        inputOption.innerHTML = this.inputParametersArray[i].name;\n        inputOption.value = this.inputParametersArray[i].name;\n        inputOption.title = this.inputParametersArray[i].name;\n        domAttr.set(inputOption, \"Type\", \"Input\");\n        this._inputOutputSelect.appendChild(inputOption);\n        domClass.add(inputOption, \"esriCTInputOutputOptions\");\n        this._inputOutputParamArray.push(this.inputParametersArray[i]);\n      }\n      for (i = 0; i < this.outputParametersArray.length; i++) {\n        inputOption = domConstruct.create(\"option\", {});\n        inputOption.innerHTML = this.outputParametersArray[i].name;\n        inputOption.value = this.outputParametersArray[i].name;\n        inputOption.title = this.outputParametersArray[i].name;\n        domAttr.set(inputOption, \"Type\", \"Output\");\n        if (this.outputParametersArray[i] && this.outputParametersArray[\n            i].defaultValue && this.outputParametersArray[i].defaultValue\n          .geometryType) {\n          domAttr.set(inputOption, \"GeometryType\", this.outputParametersArray[\n            i].defaultValue.geometryType);\n        } else {\n          domAttr.set(inputOption, \"GeometryType\", null);\n        }\n        this._inputOutputSelect.appendChild(inputOption);\n        domClass.add(inputOption, \"esriCTInputOutputOptions\");\n        this._inputOutputParamArray.push(this.outputParametersArray[i]);\n      }\n      domAttr.set(this._inputOutputSelect, \"size\", this._inputOutputParamArray\n        .length);\n      this._onInputOutputClick();\n      this._insertBlankSelectInFieldPanel();\n      this._insertBlankSelectInOperatorPanel();\n      this._allocateEqualSizeToPanels();\n    },\n\n    /**\n     * This function is used to insert blank options in field panel\n     * @memberOf widgets/NetworkTrace/settings/summarySettings\n     */\n    _insertBlankSelectInFieldPanel: function () {\n      var fieldOption;\n      this._fieldSelect = domConstruct.create(\"select\", {\n        \"class\": \"esriCTFieldPanelSelect\",\n        \"size\": 2\n      }, this.fieldPanel);\n      fieldOption = domConstruct.create(\"option\", {});\n      fieldOption.innerHTML = \"\";\n      domAttr.set(fieldOption, \"disabled\", true);\n      this._fieldSelect.appendChild(fieldOption);\n      domClass.add(fieldOption, \"esriCTBlankOptions\");\n    },\n\n    /**\n     * This function is used to insert blank options in field panel\n     * @memberOf widgets/NetworkTrace/settings/summarySettings\n     */\n    _insertBlankSelectInOperatorPanel: function () {\n      var operatorOption;\n      this._operatorSelect = domConstruct.create(\"select\", {\n        \"class\": \"esriCTOperatorPanelSelect\",\n        \"size\": 2\n      }, this.operatorPanel);\n      operatorOption = domConstruct.create(\"option\", {});\n      operatorOption.innerHTML = \"\";\n      domAttr.set(operatorOption, \"disabled\", true);\n      this._operatorSelect.appendChild(operatorOption);\n      domClass.add(operatorOption, \"esriCTBlankOptions\");\n    },\n\n    /**\n     * This function is used to empty field panel\n     * @memberOf widgets/NetworkTrace/settings/summarySettings\n     */\n    _emptyFieldPanel: function () {\n      domConstruct.empty(this.fieldPanel);\n      this._fieldSelect = null;\n    },\n\n    /**\n     * This function is used to empty operator panel\n     * @memberOf widgets/NetworkTrace/settings/summarySettings\n     */\n    _emptyOperatorPanel: function () {\n      domConstruct.empty(this.operatorPanel);\n      this._operatorSelect = null;\n    },\n\n    /**\n     * This function is used to display input/output operators\n     * @memberOf widgets/NetworkTrace/settings/summarySettings\n     */\n    _onInputOutputClick: function () {\n      var type;\n      this.own(on(this._inputOutputSelect, \"click\", lang.hitch(this,\n        function (evt) {\n          type = domAttr.get(evt.currentTarget[evt.currentTarget\n            .selectedIndex], \"Type\");\n          if (type === \"Input\") {\n            domClass.add(this.addSummaryExpression,\n              \"jimu-state-disabled\");\n            this._selectedInput = this._selectedOutput = this._selectedField =\n              this._selectedOperator = null;\n            this._selectedInput = evt.currentTarget[evt.currentTarget\n              .selectedIndex];\n            this._emptyFieldPanel();\n            this._emptyOperatorPanel();\n            this._insertBlankSelectInFieldPanel();\n            this._displayOperators(true, false, false, false);\n            domClass.remove(this.operatorPanel, \"esriCTHidden\");\n          } else if (type === \"Output\") {\n            this._selectedOutputGeometryType = domAttr.get(evt.currentTarget[\n              evt.currentTarget\n              .selectedIndex], \"GeometryType\");\n            this._selectedInput = this._selectedOutput = this._selectedField =\n              this._selectedOperator = null;\n            this._selectedOutput = evt.currentTarget[evt.currentTarget\n              .selectedIndex];\n            this._selectedOutputParameter = evt;\n            this._emptyFieldPanel();\n            this._emptyOperatorPanel();\n            this._displayOutputFields();\n            this._fetchAndDisplayOutputOperators();\n          }\n        })));\n    },\n\n    /**\n     * This function is used to fetch & display output operators\n     * @memberOf widgets/NetworkTrace/settings/summarySettings\n     */\n    _fetchAndDisplayOutputOperators: function () {\n      domClass.add(this.addSummaryExpression,\n        \"jimu-state-disabled\");\n      this._displayOperators(false, true, false, false);\n      this._fieldSelect.selectedIndex = \"-1\";\n    },\n\n    /**\n     * This function is used to display fields\n     * @memberOf widgets/NetworkTrace/settings/summarySettings\n     */\n    _displayOutputFields: function () {\n      var fieldOption, i, fieldOptionArray = [];\n      domConstruct.empty(this.fieldPanel);\n      fieldOptionArray = this._inputOutputParamArray[this._selectedOutputParameter\n        .currentTarget.selectedIndex].defaultValue.fields;\n      this._fieldSelect = domConstruct.create(\"select\", {\n        \"class\": \"esriCTFieldPanelSelect\"\n      }, this.fieldPanel);\n      for (i = 0; i < fieldOptionArray.length; i++) {\n        if (fieldOptionArray[i].type === \"esriFieldTypeDouble\" ||\n          fieldOptionArray[i].type === \"esriFieldTypeSmallInteger\" ||\n          fieldOptionArray[i].type === \"esriFieldTypeInteger\") {\n          fieldOption = domConstruct.create(\"option\", {});\n          fieldOption.innerHTML = fieldOptionArray[i].name;\n          fieldOption.value = fieldOptionArray[i].name;\n          fieldOption.title = fieldOptionArray[i].name;\n          this._fieldSelect.appendChild(fieldOption);\n          domClass.add(fieldOption, \"esriCTInputOutputOptions\");\n        }\n      }\n      this._onFieldClick();\n      this._allocateEqualSizeToPanels();\n    },\n\n    /**\n     * This function is used to display fields operator\n     * @memberOf widgets/NetworkTrace/settings/summarySettings\n     */\n    _onFieldClick: function () {\n      this.own(on(this._fieldSelect, \"click\", lang.hitch(this,\n        function (evt) {\n          domClass.add(this.addSummaryExpression,\n            \"jimu-state-disabled\");\n          this._selectedField = null;\n          this._selectedField = evt.currentTarget[evt.currentTarget\n            .selectedIndex];\n          this._displayOperators(false, false, true, false);\n          this._allocateEqualSizeToPanels();\n        })));\n    },\n\n    /**\n     * This function is used to display input/output/field operator\n     * @memberOf widgets/NetworkTrace/settings/summarySettings\n     */\n    _displayOperators: function (inputOperator, outputOperator,\n      fieldOperator, displayOutputSkipCountOption) {\n      var operatorOption, i, operatorParameterArray;\n      operatorParameterArray = [];\n      domConstruct.empty(this.operatorPanel);\n      if (inputOperator) {\n        operatorParameterArray.push(this.nls.summaryTab.inputOperatorCountOption);\n      } else if (outputOperator) {\n        operatorParameterArray.push(this.nls.summaryTab.outputOperatorCountOption);\n        if (displayOutputSkipCountOption) {\n          operatorParameterArray.push(this.nls.summaryTab.outputOperatorSkipCountOption);\n        }\n      } else if (fieldOperator) {\n        operatorParameterArray.push(this.nls.summaryTab.fieldOperatorSumOption);\n        operatorParameterArray.push(this.nls.summaryTab.fieldOperatorMinOption);\n        operatorParameterArray.push(this.nls.summaryTab.fieldOperatorMaxOption);\n        operatorParameterArray.push(this.nls.summaryTab.fieldOperatorMeanOption);\n      }\n      this._operatorSelect = domConstruct.create(\"select\", {\n        \"class\": \"esriCTPanelSelect\",\n        \"size\": 2\n      }, this.operatorPanel);\n      for (i = 0; i < operatorParameterArray.length; i++) {\n        operatorOption = domConstruct.create(\"option\", {});\n        operatorOption.innerHTML = operatorParameterArray[i];\n        operatorOption.value = operatorParameterArray[i];\n        operatorOption.title = operatorParameterArray[i];\n        this._operatorSelect.appendChild(operatorOption);\n        domClass.add(operatorOption, \"esriCTInputOutputOptions\");\n      }\n      this._selectOperator();\n      this._allocateEqualSizeToPanels();\n    },\n\n    /**\n     * This function is used to refresh operator list\n     * @memberOf widgets/NetworkTrace/settings/summarySettings\n     */\n    refreshOperator: function () {\n      if (!this._selectedField) {\n        if (this._selectedOutput) {\n          this._fetchAndDisplayOutputOperators();\n          if (this._selectedOperator && (this._selectedOperator.value ===\n              this.nls.summaryTab.outputOperatorCountOption)) {\n            if (this._operatorSelect) {\n              this._operatorSelect.selectedIndex = 0;\n              domClass.remove(this.addSummaryExpression,\n                \"jimu-state-disabled\");\n            }\n          }\n        }\n      }\n    },\n\n    /**\n     * This function is used to select operator\n     * @memberOf widgets/NetworkTrace/settings/summarySettings\n     */\n    _selectOperator: function () {\n      this.own(on(this._operatorSelect, \"click\", lang.hitch(this,\n        function (evt) {\n          this._selectedOperator = null;\n          this._selectedOperator = evt.currentTarget[evt.currentTarget\n            .selectedIndex];\n          if ((this._selectedInput !== null || this._selectedOutput !==\n              null) && this._selectedOperator !== null) {\n            domClass.remove(this.addSummaryExpression,\n              \"jimu-state-disabled\");\n          }\n        })));\n    },\n\n    /**\n     * This function is used to get max length of parameters of inputOutput/field/operator parameters\n     * @memberOf widgets/NetworkTrace/settings/summarySettings\n     */\n    _allocateEqualSizeToPanels: function () {\n      var inputOutputPanelLength, fieldPanelLength,\n        operatorPanelLength, selectSize;\n      inputOutputPanelLength = 0;\n      fieldPanelLength = 0;\n      operatorPanelLength = 0;\n      if (this._inputOutputSelect && this._inputOutputSelect.length >\n        0) {\n        inputOutputPanelLength = this._inputOutputSelect.length;\n      }\n      if (this._fieldSelect && this._fieldSelect.length > 0) {\n        fieldPanelLength = this._fieldSelect.length;\n      }\n      if (this._operatorSelect && this._operatorSelect.length > 0) {\n        operatorPanelLength = this._operatorSelect.length;\n      }\n      selectSize = Math.max(inputOutputPanelLength, fieldPanelLength,\n        operatorPanelLength);\n      if (this._inputOutputSelect) {\n        domAttr.set(this._inputOutputSelect, \"size\", selectSize);\n      }\n      if (this._fieldSelect) {\n        domAttr.set(this._fieldSelect, \"size\", selectSize);\n      }\n      if (this._operatorSelect) {\n        domAttr.set(this._operatorSelect, \"size\", selectSize);\n      }\n      this._removeClassFromChildNodes();\n      if (this._inputOutputSelect && (this._inputOutputSelect.length ===\n          selectSize)) {\n        domClass.add(this._inputOutputSelect.childNodes[selectSize -\n          1], \"esriCTInputOutputOptionsBorderNone\");\n      }\n      if (this._fieldSelect && (this._fieldSelect.length ===\n          selectSize)) {\n        domClass.add(this._fieldSelect.childNodes[selectSize - 1],\n          \"esriCTInputOutputOptionsBorderNone\");\n      }\n      if (this._operatorSelect && (this._operatorSelect.length ===\n          selectSize)) {\n        domClass.add(this._operatorSelect.childNodes[selectSize - 1],\n          \"esriCTInputOutputOptionsBorderNone\");\n      }\n    },\n\n    /**\n     * This function is used to remove class from childnodes.\n     * @memberOf widgets/NetworkTrace/settings/summarySettings\n     */\n    _removeClassFromChildNodes: function () {\n      var i;\n      if (this._inputOutputSelect) {\n        for (i = 0; i < this._inputOutputSelect.childNodes.length; i++) {\n          domClass.remove(this._inputOutputSelect.childNodes[i],\n            \"esriCTInputOutputOptionsBorderNone\");\n        }\n      }\n      if (this._fieldSelect) {\n        for (i = 0; i < this._fieldSelect.childNodes.length; i++) {\n          domClass.remove(this._fieldSelect.childNodes[i],\n            \"esriCTInputOutputOptionsBorderNone\");\n        }\n      }\n      if (this._operatorSelect) {\n        for (i = 0; i < this._operatorSelect.childNodes.length; i++) {\n          domClass.remove(this._operatorSelect.childNodes[i],\n            \"esriCTInputOutputOptionsBorderNone\");\n        }\n      }\n    },\n\n    /**\n     * This function is used to add expression in textarea\n     * @memberOf widgets/NetworkTrace/settings/summarySettings\n     */\n    _onClickAddExpressionBtn: function () {\n      if (!(domClass.contains(this.addSummaryExpression,", "domain": "javascript", "lang": "code", "char_count": 20049, "word_count": 3561, "byte_count": 20052}
{"text": "/*\nCopyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.\nFor licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n*/\nCKEDITOR.plugins.setLang( 'find', 'sk', {\n\tfind: 'Vyh\u013eada\u0165',\n\tfindOptions: 'Mo\u017enosti vyh\u013ead\u00e1vania',\n\tfindWhat: '\u010co h\u013eada\u0165:',\n\tmatchCase: 'Rozli\u0161ova\u0165 mal\u00e9 a ve\u013ek\u00e9 p\u00edsmen\u00e1',\n\tmatchCyclic: 'Po dosiahnut\u00ed konca pokra\u010dova\u0165 od za\u010diatku',\n\tmatchWord: 'Len cel\u00e9 slov\u00e1',\n\tnotFoundMsg: 'H\u013eadan\u00fd text nebol n\u00e1jden\u00fd.',\n\treplace: 'Nahradi\u0165',\n\treplaceAll: 'Nahradi\u0165 v\u0161etko',\n\treplaceSuccessMsg: '%1 v\u00fdskyt(ov) nahraden\u00fdch.',\n\treplaceWith: '\u010c\u00edm nahradi\u0165:',\n\ttitle: 'Vyh\u013eada\u0165 a nahradi\u0165'\n} );", "domain": "javascript", "lang": "code", "char_count": 639, "word_count": 134, "byte_count": 675}
{"text": "'use strict'\n\nmodule.exports = {\n  up: (queryInterface, Sequelize) => {\n    return queryInterface.sequelize.transaction((t) =>\n      queryInterface\n        .addColumn(\n          'case',\n          'initial_ruling_date',\n          {\n            type: Sequelize.DATE,\n            allowNull: true,\n          },\n          { transaction: t },\n        )\n        .then(() =>\n          queryInterface.sequelize.query(\n            'WITH RECURSIVE initialRuling AS(\\\n              SELECT\\\n                id AS id,\\\n                ruling_date AS ruling_date,\\\n                NULL :: uuid AS parent_case_id,\\\n                NULL :: timestamp with time zone AS initial_ruling_date\\\n              FROM \"case\"\\\n              WHERE\\\n                parent_case_id IS NULL\\\n              UNION\\\n              SELECT\\\n                c.id AS id,\\\n                c.ruling_date AS ruling_date,\\\n                c.parent_case_id AS parent_case_id,\\\n                coalesce(i.initial_ruling_date, i.ruling_date) AS initial_ruling_date\\\n              FROM \"case\" c\\\n                INNER JOIN initialRuling i ON i.id = c.parent_case_id\\\n            )\\\n            Update \"case\" u\\\n            set initial_ruling_date = initialRuling.initial_ruling_date\\\n            from initialRuling\\\n            where initialRuling.id = u.id;\\\n            ',\n            { transaction: t },\n          ),\n        ),\n    )\n  },\n\n  down: (queryInterface) => {\n    return queryInterface.sequelize.transaction((t) =>\n      queryInterface.removeColumn('case', 'initial_ruling_date', {\n        transaction: t,\n      }),\n    )\n  },\n}", "domain": "javascript", "lang": "code", "char_count": 1593, "word_count": 225, "byte_count": 1593}
{"text": "/**\n * tab\u7ec4\u4ef6\n * @module Tab\n * @author liweitao\n */\n\nPP.define('tab', function () {\n  'use strict';\n\n  /**\n   * @class\n   * @alias module:tab\n   */\n  var Tab = _.Class.extend({\n    /**\n     * tab.\n     * @constructor\n     * @param {Object} options\n     * @param {String|HTMLElement|Zepto} options.container - \u6307\u5b9atab\u5bb9\u5668\n     * @param {String|HTMLElement|Zepto} [options.head] - tab\u7684\u5934\u90e8\n     * @param {String|HTMLElement|Zepto} [options.content] - tab\u7684\u5185\u5bb9\n     * @param {Number|String} [options.startAt] - \u8d77\u59cbTab\u9875\n     * @param {Boolean} [options.hash] - \u662f\u5426\u542f\u7528hash\u6807\u8bb0tab\n     * @param {Function} [options.onBeforeSwitch] - Tab\u5207\u6362\u524d\u89e6\u53d1\u7684\u64cd\u4f5c\n     * @param {Function} [options.onAfterSwitch] - Tab\u5207\u6362\u540e\u89e6\u53d1\u7684\u64cd\u4f5c\n     * @param {Function} [opts.onFirstShow] - Tab\u9996\u6b21show\u51fa\u6765\u7684\u65f6\u5019\u89e6\u53d1\u7684\u64cd\u4f5c\n     */\n    construct: function (options) {\n      this.conf = $.extend({\n        container: null,\n        head: null,\n        content: null,\n        startAt: 0,\n        hash: false,\n        onBeforeSwitch: function () {},\n        onAfterSwitch: function () {},\n        onFirstShow: function () {}\n      }, options);\n\n      this.index = undefined;\n      var conf = this.conf;\n      this.$el = $(conf.container);\n      this.$head = conf.head ? $(conf.head) : this.$el.children('.tab_head, .j_tab_head');\n      this.$headItems = this.$head.children('.tab_head_item, .j_tab_head_item');\n      this.$content = conf.content ? $(conf.content) : this.$el.children('.tab_content, .j_tab_content');\n      this.$contentItems = this.$content.children('.tab_content_item, .j_tab_content_item');\n\n      this.tabLength = this.$headItems.length;\n\n      for (var i = 0, l = this.$headItems.length; i < l; i++) {\n        this.$headItems[i].hasShown = false;\n      }\n\n      this.init();\n    },\n\n    /**\n     * @description \u4e00\u4e9b\u521d\u59cb\u5316\u64cd\u4f5c\n     */\n    init: function () {\n      var conf = this.conf;\n      var index = -1;\n      var hash = window.location.hash;\n      // \u4f18\u5148\u901a\u8fc7hash\u6765\u5b9a\u4f4dTab\n      if (conf.hash && hash.length > 1) {\n        this.switchTo(hash);\n      } else {\n        // \u5982\u679c\u4e3astring\u5219\u8ba4\u4e3a\u662f\u4e2a\u9009\u62e9\u5668\n        if (typeof conf.startAt === 'string') {\n          this.$active = this.$headItems.filter(conf.startAt);\n          if (this.$active.length) {\n            index = this.$active.index();\n          } else {\n            index = 0;\n          }\n        } else if (typeof conf.startAt === 'number') {\n          index = conf.startAt;\n        } else {\n          index = 0;\n        }\n        this.switchTo(index);\n      }\n      this.initEvent();\n\n    },\n\n    /**\n     * @description \u521d\u59cb\u5316\u4e8b\u4ef6\u7ed1\u5b9a\n     */\n    initEvent: function () {\n      var _this = this;\n      var conf = _this.conf;\n      this.$head.on('click', '.tab_head_item, .j_tab_head_item', function () {\n        var index = $(this).index();\n        _this.switchTo(index);\n        return false;\n      });\n    },\n\n    /**\n     * @description \u5207\u6362tab\n     * @param {Number|String} index - \u53ef\u4e3atab\u7684\u7d22\u5f15\u6216\u662fhash\n     * @return {Object} this - \u5b9e\u4f8b\u672c\u8eab\uff0c\u65b9\u4fbf\u94fe\u5f0f\u8c03\u7528\n     */\n    switchTo: function (index) {\n      var conf = this.conf;\n      if (conf.hash) {\n        var hash;\n        if (typeof index === 'string') {\n          hash = index.replace('#', '');\n          this.$active = this.$headItems.filter('[data-hash$=' + hash + ']');\n          index = this.$active.index();\n        }\n        if (typeof index === 'number'){\n          hash = this.$headItems.eq(index).attr('data-hash');\n        }\n\n        if (index === -1) {\n          return -1;\n        }\n        window.location.hash = hash;\n      }\n      index = parseInt(index, 10);\n      if (index === this.index) {\n        return;\n      }\n\n      this.index = index;\n\n      if (typeof conf.onBeforeSwitch === 'function') {\n        conf.onBeforeSwitch.call(this, index, this);\n      }\n\n      this.$headItems.removeClass('active').eq(index).addClass('active');\n      this.$contentItems.hide().eq(index).show();\n\n      if (typeof conf.onAfterSwitch === 'function') {\n        conf.onAfterSwitch.call(this, index, this);\n      }\n\n      if (! this.$headItems[index].hasShown && typeof conf.onFirstShow === 'function') {\n        conf.onFirstShow.call(this, index, this);\n        this.$headItems[index].hasShown = true;\n      }\n      return this;\n    },\n\n    /**\n     * @description \u5207\u6362\u5230\u4e0b\u4e00tab\n     * @return {Object} this - \u5b9e\u4f8b\u672c\u8eab\uff0c\u65b9\u4fbf\u94fe\u5f0f\u8c03\u7528\n     */\n    switchToNext: function () {\n      var index = this.index + 1;\n      if (index >= this.tabLength) {\n        index = 0;\n      }\n      this.switchTo(index);\n      return this;\n    },\n\n    /**\n     * @description \u5207\u6362\u5230\u4e0a\u4e00tab\n     * @return {Object} this - \u5b9e\u4f8b\u672c\u8eab\uff0c\u65b9\u4fbf\u94fe\u5f0f\u8c03\u7528\n     */\n    switchToPrev: function () {\n      var index = this.index + 1;\n      if (index <= 0) {\n        index = 0;\n      }\n      this.switchTo(index);\n      return this;\n    },\n\n    /**\n     * @description \u9500\u6bc1\u7ec4\u4ef6\n     */\n    destroy: function () {\n      this.unbind();\n      this.$el.remove();\n    },\n\n    /**\n     * @description \u89e3\u7ed1\u4e8b\u4ef6\n     * @return {Object} this - \u5b9e\u4f8b\u672c\u8eab\uff0c\u65b9\u4fbf\u94fe\u5f0f\u8c03\u7528\n     */\n    unbind: function () {\n      this.$head.off();\n      return this;\n    },\n\n    /**\n     * @description \u8bbe\u7f6e\u53c2\u6570\n     * @return {Object} this - \u5b9e\u4f8b\u672c\u8eab\uff0c\u65b9\u4fbf\u94fe\u5f0f\u8c03\u7528\n     */\n    setOptions: function (options) {\n      $.extend(this.conf, options);\n      return this;\n    }\n  });\n\n  return Tab;\n});", "domain": "javascript", "lang": "code", "char_count": 5179, "word_count": 1173, "byte_count": 5513}
{"text": "//webtorrent\nvar client = new WebTorrent();\n//firebase\nfirebase.initializeApp({\n    apiKey: \"AIzaSyAFlH1OEvxWRGSwzYSEj8VL4oLqLPQtQtU\",\n    authDomain: \"groovetorrent-a937a.firebaseapp.com\",\n    databaseURL: \"https://groovetorrent-a937a.firebaseio.com\",\n    storageBucket: \"groovetorrent-a937a.appspot.com\",\n});\nvar songsRef = firebase.database().ref(\"rooms/test/songs\");\nvar player;\n\nvar vue = new Vue({\n    el: '#app',\n    data: {\n        songs: [],\n        currentSong: null,\n        isPlaying: false\n    },\n    methods: {\n        onFileSelect: function (file) {\n            var self = this;\n            var p = client.seed(file, function (torrent) {\n                var song = {\n                    name: file.name,\n                    torrent: torrent,\n                    link: torrent.magnetURI,\n                    state: \"seeding\",\n                    download: \"0\",\n                    upload: \"0\",\n                    percentage: \"0\",\n                    peers: \"0\",\n                    duration: \"0\",\n                    currentTime: \"0\"\n                }\n                self.songs.push(song);\n                songsRef.push({\n                    name: song.name,\n                    link: song.link\n                })\n            })\n        },\n        play: function (song) {\n            var self = this;\n            if (song.state !== \"seeding\") {\n                return console.error(\"The song is imcomplete, can not play.\")\n            }\n            song.torrent.files[0].getBuffer(function (err, data) {\n                if (player) {\n                    player.stop();\n                }\n                player = AV.Player.fromBuffer(data);\n                player.play();\n                self.currentSong = song;\n                self.isPlaying = true;\n            })\n        },\n        sync: function (newMeta) {\n            var self = this;\n            var meta = newMeta;\n            var dul = self.songs.filter(function (song) { return song.link === meta.link });\n            if (dul.length > 0) {\n                return;\n            }\n            var song = {\n                name: meta.name,\n                link: meta.link,\n                state: \"init\",\n                download: \"0\",\n                upload: \"0\",\n                percentage: \"0\",\n                peers: \"0\",\n                duration: \"0\",\n                currentTime: \"0\"\n            }\n            self.songs.push(song);\n            client.add(meta.link, function (torrent) {\n                var file = torrent.files[0]\n                song.torrent = torrent;\n                song.state = \"syncing\";\n                torrent.on('done', function () {\n                    song.state = \"seeding\"\n                })\n            });\n        }\n    },\n    ready: function () {\n        var self = this;\n        setInterval(function () {\n            self.songs.forEach(function (song) {\n                if (song.torrent) {\n                    song.download = prettyBytes(song.torrent.downloadSpeed);\n                    song.upload = prettyBytes(song.torrent.uploadSpeed);\n                    song.percentage = Math.round(song.torrent.progress * 100 * 100) / 100;\n                    song.peers = song.torrent.numPeers;\n                }\n            });\n\n\n\n        }, 2000);\n\n        songsRef.on('child_added', function (data) {\n            self.sync(data.val());\n        });\n\n        setInterval(function () {\n            if (player && self.currentSong) {\n                self.currentSong.currentTime = millisecondsToTime(player.currentTime);\n                self.currentSong.duration = millisecondsToTime(player.duration);\n                self.isPlaying = player.playing;\n            }\n        }, 1000);\n\n    }\n})\n\nfunction millisecondsToTime(milli) {\n    var milliseconds = milli % 1000;\n    var seconds = Math.floor((milli / 1000) % 60);\n    var minutes = Math.floor((milli / (60 * 1000)) % 60);\n    seconds = seconds > 9 ? seconds : \"0\" + seconds;\n    minutes = minutes > 9 ? minutes : \"0\" + minutes;\n\n    return minutes + \":\" + seconds;\n}\n\n\nfunction prettyBytes(num) {\n    var exponent, unit, neg = num < 0, units = ['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']\n    if (neg) num = -num\n    if (num < 1) return (neg ? '-' : '') + num + ' B'\n    exponent = Math.min(Math.floor(Math.log(num) / Math.log(1000)), units.length - 1)\n    num = Number((num / Math.pow(1000, exponent)).toFixed(2))\n    unit = units[exponent]\n    return (neg ? '-' : '') + num + ' ' + unit\n}", "domain": "javascript", "lang": "code", "char_count": 4456, "word_count": 928, "byte_count": 4456}
{"text": "/*\nCopyright \u00c2\u00a9 2001-2004 World Wide Web Consortium,\n(Massachusetts Institute of Technology, European Research Consortium\nfor Informatics and Mathematics, Keio University). All\nRights Reserved. This work is distributed under the W3C\u00c2\u00ae Software License [1] in the\nhope that it will be useful, but WITHOUT ANY WARRANTY; without even\nthe implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231\n*/\n\n   /**\n    *  Gets URI that identifies the test.\n    *  @return uri identifier of test\n    */\nfunction getTargetURI() {\n      return \"http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLFrameElement02\";\n   }\n\nvar docsLoaded = -1000000;\nvar builder = null;\n\n//\n//   This function is called by the testing framework before\n//      running the test suite.\n//\n//   If there are no configuration exceptions, asynchronous\n//        document loading is started.  Otherwise, the status\n//        is set to complete and the exception is immediately\n//        raised when entering the body of the test.\n//\nfunction setUpPage() {\n   setUpPageStatus = 'running';\n   try {\n     //\n     //   creates test document builder, may throw exception\n     //\n     builder = createConfiguredBuilder();\n\n      docsLoaded = 0;\n\n      var docRef = null;\n      if (typeof(this.doc) != 'undefined') {\n        docRef = this.doc;\n      }\n      docsLoaded += preload(docRef, \"doc\", \"frame\");\n\n       if (docsLoaded == 1) {\n          setUpPageStatus = 'complete';\n       }\n    } catch(ex) {\n        catchInitializationError(builder, ex);\n        setUpPageStatus = 'complete';\n    }\n}\n\n//\n//   This method is called on the completion of\n//      each asychronous load started in setUpTests.\n//\n//   When every synchronous loaded document has completed,\n//      the page status is changed which allows the\n//      body of the test to be executed.\nfunction loadComplete() {\n    if (++docsLoaded == 1) {\n        setUpPageStatus = 'complete';\n    }\n}\n\n/**\n*\n    The longDesc attribute specifies a URI designating a long description\n    of this image or frame.\n\n    Retrieve the longDesc attribute of the first FRAME element and examine\n    its value.\n\n* @author NIST\n* @author Rick Rivello\n* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html#ID-7836998\n*/\nfunction HTMLFrameElement02() {\n   var success;\n    if(checkInitialization(builder, \"HTMLFrameElement02\") != null) return;\n    var nodeList;\n      var testNode;\n      var vlongdesc;\n      var doc;\n\n      var docRef = null;\n      if (typeof(this.doc) != 'undefined') {\n        docRef = this.doc;\n      }\n      doc = load(docRef, \"doc\", \"frame\");\n      nodeList = doc.getElementsByTagName(\"frame\");\n      assertSize(\"Asize\",2,nodeList);\ntestNode = nodeList.item(0);\n      vlongdesc = testNode.longDesc;\n\n      assertEquals(\"longdescLink\",\"about:blank\",vlongdesc);\n\n}\n\nfunction runTest() {\n   HTMLFrameElement02();\n}", "domain": "javascript", "lang": "code", "char_count": 2939, "word_count": 545, "byte_count": 2943}
{"text": "var markerLayer,map;\n$(document).ready(function(){\n\n\tmarkerLayer =  L.markerClusterGroup();// L.featureGroup();\n\t map = L.map('map').setView([39.134172, -98.628082], 4);\n\t \tL.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {\n\t\tattribution: '&copy; <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors'\n\t}).addTo(map);\n\n\t\t\n\t\t\t//activate on open\n\t\t\t$(\"#wrapper\").toggleClass(\"toggled\");\n\t\t\t$(\"#wrapper2\").toggleClass(\"toggled\");\n\t\t\t\n\t\t\t//easybutton search\n\t\t\tL.easyButton('fa-search', function () {\n\t\t\t\t$(\"#wrapper\").toggleClass(\"toggled\");\n\t\t\t\t$(\"#wrapper2\").toggleClass(\"toggled\");\n\t\t\t\t}).addTo(map);\n\t\t\t\n\t\t\t// easybutton home\n\t\t\tL.easyButton('fa-home', function () {\n\t\t\t\tmap.setView([39.134172, -98.628082], 4.488);\n\t\t\t\tvar divs = document.getElementsByClassName('search1');\n\t\t\t\tvar divs2 = document.getElementsByClassName('search2');\n\t\t\t\t// //alert(divs[0].innerHTML.indexOf(x));\n\t\t\t\tfor (var i = 0; i < divs.length; i++) {\n\t\t\t\t\t$(\"#\" + divs[i].id).css({\n\t\t\t\t\t\t'display': 'block'\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tfor (var i = 0; i < divs2.length; i++) {\n\t\t\t\t\t$(\"#\" + divs2[i].id).css({\n\t\t\t\t\t\t'display': 'block'\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t//   \treturn false;\n\n\n\t\t\t}).addTo(map);\n\t\t\t// setup a marker group\n            markerLayer.addTo(map);\n\t\t\t\n\t\t\tmap.attributionControl.setPrefix('Licensed MIT');\t\t\n\t\t\n\tloadData(-1); // by default -1 so that it will load all data\n\t\t\n});\n\nfunction loadData(ye){\n\tmarkerLayer.clearLayers();\n\tvar uu = \"php/getData.php\";\n\tvar dd = 0;\n\tif (ye != -1){\n\t\tuu = \"php/getData.php?year=\"+ye;\n\t\tdd = ye;\n\t}\n\n\n\t$.ajax({\n\t\ttype: \"GET\",\n\t\turl: uu,\n\t\tyy : dd,\n\t\tsuccess: function(msg) {\n\t\t\t\t\n\t\t\t$('.search1').remove();\n\t\t\t$('.search2').remove();\n\t\t\tvar allData = JSON.parse(msg);\n\t\t\tvar SchData = allData;\n\t\t\t//ordered list of all colleges\n\t\t\tsortByKey(SchData, 'col_nm');\n\t\t\tvar previousdiv = document.getElementById('College-list');\n\t\t\t//produces all of markers\n\t\t\tvar markerL = [];\n\t\t\tfor (var i = 0; i <= SchData.length - 1; i++) {\n\t\t\t\tvar nextcollege = SchData[i];\n\t\t\t\tvar marker = new L.marker([nextcollege.lat,nextcollege.lng], {/*riseOnHover: true*/});\n\t\t\t\t/*\n\t\t\t\tmarker.on('mouseover', function (e) {\n\t\t\t\t\tthis.openPopup();\n\t\t\t\t});\n\t\t\t\tmarker.on('mouseout', function (e) {\n\t\t\t\t\tthis.closePopup();\n\t\t\t\t});\n\t\t\t\t*/\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tmarkerL.push(marker);\n\t\t\t\t\n\t\t\t\t//add text\n\t\t\t\tvar markertext = L.popup({\n\t\t\t\t\tcloseButton: false,\n\t\t\t\t\toffset: L.point(0, 0),\n\n\t\t\t\t})\n\t\t\t\t\t\t.setContent(\"\");\n\n\t\t\t\tvar str = \"\";\n\t\t\t\t// if (undefined == nextcollege.students){\n\t\t\t\t\t//College do not have students for the respectiveyear\n\t\t\t\t\t// continue;\n\t\t\t\t// }\n\t\t\t\t// nextcollege.students.sort();\n\t\t\t\t\n\n\t\t\t\tmarkertext.setContent(\"<p style = 'margin:0px; font-family: Lora, serif; font-size:110%; font-weight:bold;'>\" \n\t\t\t\t\t\t\t+ \"<img src='dataimgs/college/\"+nextcollege.col_lg+\"' class='imm-college'  alt='\"+nextcollege.col_nm+\"' /> <a href='\" \n\t\t\t\t\t\t\t+  nextcollege.web_url + \"' target='_blank'>\"+  nextcollege.col_nm + \"</a> </br>Enrolled (\" + nextcollege.enrolled + \")</br>Accepted (\" + nextcollege.accepted + \")</p><hr style = 'margin:3px'>\" /*+ str */);\n\t\t\t\tvar collegeIcon = L.icon({\n\t\t\t\t\ticonUrl: \"dataimgs/college/\"+nextcollege.col_lg,\n\t\t\t\t\ticonSize:     [50, 50], // size of the icon\n\t\t\t\t\tclassName : \"LIcon\"\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tmarker.setIcon(collegeIcon);\n\t\t\t\tmarker.addTo(markerLayer );\n\t\t\t\tmarker.bindPopup(markertext);\n\t\t\t\t//creates HTML div for each element in list\n\t\t\t\tvar htmlrest = document.createElement('newdiv');\n\t\t\t\thtmlrest.setAttribute(\"divid\", 0);\n\t\t\t\tpreviousdiv.appendChild(htmlrest);\n\t\t\t\thtmlrest.innerHTML = nextcollege.col_nm;\n\t\t\t\thtmlrest.setAttribute(\"markerindex\", i);\n\t\t\t\thtmlrest.setAttribute(\"class\", \"search2\");\n\t\t\t\thtmlrest.setAttribute(\"id\", i);\n\t\t\t\t//creates mouselistener from list to marker\n\t\t\t\thtmlrest.addEventListener(\"click\", function (e) {\n\n\t\t\t\t\tvar index = e.target.getAttribute(\"markerindex\");\n\t\t\t\t\tmap.setView(markerL[index].getLatLng(), 12);\n\t\t\t\t\tmarkerL[index].fire('click');\n\t\t\t\t\t//$(\"#wrapper\").toggleClass(\"toggled\");\n\t\t\t\t});\n\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t//ordered list of all students\n\t\t\tvar allstudents = [];\n\t\t\tallstudents = [2012,2013,2014,2015,2016,2017,2018];\n\t\t\tvar previousdiv2 = document.getElementById('Student-list');\n\t\t\t\n\t\t\tallstudents.sort();\n\n\t\t\t\n\t\t\t\n\t\t\tfor (var i = 0; i <= allstudents.length - 1; i++) {\n\t\t\t\tvar htmlrest = document.createElement('div');\n\t\t\t\thtmlrest.setAttribute(\"divid\", \"div_\"+allstudents[i]);\n\t\t\t\tpreviousdiv2.appendChild(htmlrest);\n\t\t\t\thtmlrest.innerHTML = allstudents[i];//allstudents[i][0].st_nm;\n\n\t\t\t\thtmlrest.setAttribute(\"yearVal\", allstudents[i]);\n\t\t\t\thtmlrest.setAttribute(\"class\", \"search1\");\n\t\t\t\thtmlrest.setAttribute(\"id\", \"div_\"+allstudents[i]);\n\t\t\t\t//create stuff\n\t\t\t\thtmlrest.addEventListener(\"click\", function (e) {\n\t\t\t\t\tvar yearVal = e.target.getAttribute(\"yearVal\");\n\t\t\t\t\tloadData(yearVal);\n\t\t\t\t});\n\t\t\t}\n\t\t\t$(\".search1\").css(\"background-color\", \"#f7f7f7\");//resetting color\n\t\t\tif (this.yy>0){\n\t\t\t\t//do nothing\n\t\t\t\t$(\"#div_\"+this.yy).css(\"background-color\", \"beige\");\n\t\t\t}else{\n\t\t\t\t//first time only\n\t\t\t\t$(\"#div_2012\").click();\n\t\t\t\t$(\"#div_2012\").css(\"background-color\", \"beige\");\n\t\t\t}\n\t\t},\n\t\terror: function(data) {\n\t\t\tconsole.log(\"Error\");\n\t\t},\n\t\tcomplete: function(data) {\n\t\t   \n\t\t\t//A function to be called when the request finishes \n\t\t\t// (after success and error callbacks are executed). \n\t\t}\n\t});\n\n}\n\n\t\n\t\t\t\nfunction sortByKey(array, key) {\n\treturn array.sort(function (a, b) {\n\t\tvar x = a[key].toLowerCase();\n\t\tvar y = b[key].toLowerCase();\n\t\treturn ((x < y) ? -1 : ((x > y) ? 1 : 0));\n\t});\n}\n\t\t\t\n//function run by form to search\nfunction find() {\n\n\n\tvar x = document.getElementById('search').value.toLowerCase();\n\t//var y = document.getElementbyId('smh').innerHTML.indexOf(x) != -1\n\tvar divs = document.getElementsByClassName('search1');\n\t//alert(divs[0].innerHTML.indexOf(x));\n\tif (x == \"\") {\n\t\tfor (var i = 0; i < divs.length; i++) {\n\t\t\t$(\"#\" + divs[i].id).css({\n\t\t\t\t'display': 'block'\n\t\t\t});\n\t\t}\n\t\treturn false;\n\t}\n\tif (x.length == 1) {\n\t\tfor (var i = 0; i < divs.length; i++) {\n\t\t\tif (divs[i].innerHTML.charAt(0).toLowerCase().indexOf(x) == -1) {\n\t\t\t\t//$(\"#\"+divs[i].id).toggleClass(\"toggled\");\n\n\t\t\t\t$(\"#\" + divs[i].id).css({\n\t\t\t\t\t'display': 'none'\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t$(\"#\" + divs[i].id).css({\n\t\t\t\t\t'display': 'block'\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\tif (x.length < 4) {\n\t\tfor (var i = 0; i < divs.length; i++) {\n\t\t\tfirstlast = divs[i].innerHTML.toString().split(\" \");\n\n\t\t\tif (firstlast[0].substring(0, x.length).toLowerCase().indexOf(x) == -1 && firstlast[1].substring(0, x.length).toLowerCase().indexOf(x) == -1) {\n\t\t\t\t//$(\"#\"+divs[i].id).toggleClass(\"toggled\");\n\n\t\t\t\t$(\"#\" + divs[i].id).css({\n\t\t\t\t\t'display': 'none'\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t$(\"#\" + divs[i].id).css({\n\t\t\t\t\t'display': 'block'\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\tfor (var i = 0; i < divs.length; i++) {\n\t\t//str = divs[i].innerHTML.toLowerCase();\n\n\t\tif (divs[i].innerHTML.toLowerCase().indexOf(x) == -1) {\n\t\t\t//$(\"#\"+divs[i].id).toggleClass(\"toggled\");\n\n\t\t\t$(\"#\" + divs[i].id).css({\n\t\t\t\t'display': 'none'\n\t\t\t});\n\t\t} else {\n\t\t\t$(\"#\" + divs[i].id).css({\n\t\t\t\t'display': 'block'\n\t\t\t});\n\t\t}\n\t}\n\n\treturn false;\n}\n\nfunction find2() {\n\n\n\tvar x = document.getElementById('searchB').value.toLowerCase();\n\t//var y = document.getElementbyId('smh').innerHTML.indexOf(x) != -1\n\tvar divs = document.getElementsByClassName('search2');\n\t//alert(divs[0].innerHTML.indexOf(x));\n\tif (x == \"\") {\n\t\tfor (var i = 0; i < divs.length; i++) {\n\t\t\t$(\"#\" + divs[i].id).css({\n\t\t\t\t'display': 'block'\n\t\t\t});\n\t\t}\n\t\treturn false;\n\t}\n\tif (x.length == 1) {\n\t\tfor (var i = 0; i < divs.length; i++) {\n\t\t\tif (divs[i].innerHTML.charAt(0).toLowerCase().indexOf(x) == -1) {\n\t\t\t\t//$(\"#\"+divs[i].id).toggleClass(\"toggled\");\n\n\t\t\t\t$(\"#\" + divs[i].id).css({\n\t\t\t\t\t'display': 'none'\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t$(\"#\" + divs[i].id).css({\n\t\t\t\t\t'display': 'block'\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\tfor (var i = 0; i < divs.length; i++) {\n\t\t//str = divs[i].innerHTML.toLowerCase();\n\n\t\tif (divs[i].innerHTML.toLowerCase().indexOf(x) == -1) {\n\t\t\t//$(\"#\"+divs[i].id).toggleClass(\"toggled\");\n\n\t\t\t$(\"#\" + divs[i].id).css({\n\t\t\t\t'display': 'none'\n\t\t\t});\n\t\t} else {\n\t\t\t$(\"#\" + divs[i].id).css({\n\t\t\t\t'display': 'block'\n\t\t\t});\n\t\t}\n\t}\n\n\treturn false;\n}", "domain": "javascript", "lang": "code", "char_count": 8200, "word_count": 2395, "byte_count": 8200}
{"text": "/**\n * Copyright 2015 ThoughtWorks Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License. You may obtain\n * a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n * License for the specific language governing permissions and limitations\n * under the License.\n */\n\n(function () {\n  'use strict';\n\n  describe('MetadataModalController', function () {\n    var $controller, treeService, modalInstance, toast;\n\n    var metadataService = {\n      editMetadata: function() {}\n    };\n\n    var availableItem = {\n      'namespace': 'bug1606988',\n      'properties': {\n        'UPPER_lower': {\n          'items': {\n            'enum': [\n              'foo',\n              'bar'\n            ],\n            'type': 'string'\n          },\n          'type': 'array'\n        }\n      }\n    };\n\n    var existing = {\n      'upper_lower': 'foo',\n      'custom': 'bar'\n    };\n\n    beforeEach(function() {\n      modalInstance = {\n        dismiss: jasmine.createSpy(),\n        close: jasmine.createSpy()\n      };\n    });\n\n    beforeEach(module('horizon.app.core.metadata.modal',\n      'horizon.framework'));\n    beforeEach(inject(function (_$controller_, $injector) {\n      $controller = _$controller_;\n      treeService = $injector.get('horizon.framework.widgets.metadata.tree.service');\n      toast = $injector.get('horizon.framework.widgets.toast.service');\n      spyOn(toast, 'add');\n    }));\n\n    it('should dismiss modal on cancel', function () {\n      var controller = createController(modalInstance);\n\n      controller.cancel();\n\n      expect(modalInstance.dismiss).toHaveBeenCalledWith('cancel');\n    });\n\n    it('should close modal on successful save', function () {\n      var controller = createController(modalInstance);\n      metadataService.editMetadata = function() {\n        return {\n          then: function(success) {\n            success();\n          }\n        };\n      };\n\n      spyOn(metadataService, 'editMetadata').and.callThrough();\n\n      controller.save();\n\n      expect(modalInstance.close).toHaveBeenCalled();\n      expect(metadataService.editMetadata)\n        .toHaveBeenCalledWith('aggregate', '123', {'custom': 'bar'}, ['UPPER_lower']);\n      expect(toast.add).toHaveBeenCalledWith('success', 'Metadata was successfully updated.');\n    });\n\n    it('should clear saving flag on failed save', function() {\n      var controller = createController(modalInstance);\n      metadataService.editMetadata = function() {\n        return {\n          then: function(success, fail) {\n            fail();\n          }\n        };\n      };\n\n      spyOn(metadataService, 'editMetadata').and.callThrough();\n\n      controller.save();\n\n      expect(modalInstance.close).not.toHaveBeenCalled();\n      expect(metadataService.editMetadata)\n        .toHaveBeenCalledWith('aggregate', '123', {'custom': 'bar'}, ['UPPER_lower']);\n      expect(toast.add).toHaveBeenCalledWith('error', 'Unable to update metadata.');\n    });\n\n    function createController() {\n      //Purposely use different cases in available and existing.\n      return $controller('MetadataModalController', {\n        '$modalInstance': modalInstance,\n        'horizon.framework.widgets.metadata.tree.service': treeService,\n        'horizon.app.core.metadata.service': metadataService,\n        'available': {data: {items: [availableItem]}},\n        'existing': {data: existing},\n        'params': {resource: 'aggregate', id: '123'}\n      });\n    }\n  });\n})();", "domain": "javascript", "lang": "code", "char_count": 3738, "word_count": 708, "byte_count": 3738}
{"text": "// prettier\u914d\u7f6e\u9879\u8bf4\u660e https://blog.csdn.net/peade/article/details/103865934\nmodule.exports = {\n  printWidth: 160, //\u7f16\u8f91\u5668\u6bcf\u884c\u7684\u957f\u5ea6\uff0c\u9ed8\u8ba480\n  tabWidth: 2, //\u5236\u8868\u7b26tab\u7684\u5bbd\u5ea6\uff0c\u9ed8\u8ba4\u503c\u662f2\n  useTabs: false, //\u4ee3\u7801\u7f29\u8fdb\u662f\u5426\u7528\u5236\u8868\u7b26tab\uff0c\u9ed8\u8ba4false\n  semi: false, //\u662f\u5426\u4f7f\u7528\u5206\u53f7\uff0c\u9ed8\u8ba4true\uff0c\u4f7f\u7528\u5206\u53f7\n  singleQuote: true, //\u662f\u5426\u4f7f\u7528\u5355\u5f15\u53f7\uff0c\u9ed8\u8ba4\u4e3afalse\uff0c\u4e0d\u9002\u7528\u5355\u5f15\u53f7\uff0c\u4f7f\u7528\u53cc\u5f15\u53f7\n  quoteProps: \"as-needed\", //\u5bf9\u8c61\u5c5e\u6027\u7684\u5f15\u53f7\u4f7f\u7528 as-needed \u4ec5\u5728\u9700\u8981\u7684\u65f6\u5019\u4f7f\u7528 consistent \u6709\u4e00\u4e2a\u5c5e\u6027\u9700\u8981\u5f15\u53f7\uff0c\u5c31\u90fd\u9700\u8981\u5f15\u53f7 preserve \u4fdd\u7559\u7528\u6237\u8f93\u5165\u7684\u60c5\u51b5\n  jsxSingleQuote: false,\n  trailingComma: \"es5\", //\u672b\u5c3e\u9017\u53f7 none \u672b\u5c3e\u6ca1\u6709\u9017\u53f7 es5 es5\u6709\u6548\u7684\u5730\u65b9\u4fdd\u7559 all \u5728\u53ef\u80fd\u7684\u5730\u65b9\u90fd\u52a0\u4e0a\u9017\u53f7\n  bracketSpacing: true, //\u5b57\u9762\u91cf\u5bf9\u8c61\u62ec\u53f7\u4e2d\u7684\u7a7a\u683c\uff0c\u9ed8\u8ba4true true - Example: { foo: bar }.  false - Example: {foo: bar}.\n  jsxBracketSameLine: false,\n  arrowParens: \"always\", //\u7bad\u5934\u51fd\u6570\u4e2d\u7684\u62ec\u53f7\n  endOfLine: \"lf\", //\u884c\u672b\u5c3e\u6807\u8bc6\n  htmlWhitespaceSensitivity: \"ignore\",\n  vueIndentScriptAndStyle: true,\n};", "domain": "javascript", "lang": "code", "char_count": 765, "word_count": 120, "byte_count": 1117}
{"text": "var webpack = require('webpack');\r\nvar path = require('path');\r\n\r\nvar BUILD_DIR = path.resolve(__dirname, 'public');\r\nvar APP_DIR = path.resolve(__dirname, 'src/client');\r\n\r\nvar config = {\r\n  entry: [\r\n    APP_DIR + '/index.jsx'\r\n  ],\r\n  \r\n  output: {\r\n    path: BUILD_DIR,\r\n    filename: 'bundle.js',\r\n    publicPath: '/'\r\n  },\r\n  \r\n  resolve: {\r\n    extensions: ['.js', '.jsx']\r\n  },\r\n  \r\n  module : {\r\n    rules : [\r\n      {\r\n        test : /\\.jsx?/,\r\n        include : APP_DIR,\r\n        use : 'babel-loader'\r\n      },\r\n      {\r\n        test: /\\.less/,\r\n        loader: 'style-loader!css-loader!less-loader'\r\n      },\r\n      {\r\n        test: /\\.css$/,\r\n        loader: 'style-loader!css-loader'\r\n      }\r\n    ]\r\n  }\r\n};\r\n\r\nmodule.exports = config;", "domain": "javascript", "lang": "code", "char_count": 750, "word_count": 151, "byte_count": 750}
{"text": "global.__dirname = __dirname\njest.mock('@redwoodjs/internal', () => {\n  const path = require('path')\n  return {\n    ...jest.requireActual('@redwoodjs/internal'),\n    getPaths: () => {\n      const BASE_PATH = path.join(global.__dirname, 'fixtures')\n      return {\n        base: BASE_PATH,\n        api: {\n          db: BASE_PATH, // this folder\n        },\n      }\n    },\n  }\n})\n\nimport path from 'path'\n\nimport * as index from '../index'\n\ntest('getSchema returns a parsed schema.prisma', async () => {\n  let schema = await index.getSchema('Post')\n  expect(schema.fields[0].name).toEqual('id')\n  expect(schema.fields[1].name).toEqual('title')\n  expect(schema.fields[2].name).toEqual('slug')\n\n  // can get a different model\n  schema = await index.getSchema('User')\n  expect(schema.fields[0].name).toEqual('id')\n  expect(schema.fields[1].name).toEqual('name')\n  expect(schema.fields[2].name).toEqual('email')\n})\n\ntest('getSchema throws an error if model name not found', async () => {\n  let error\n\n  try {\n    await index.getSchema('Foo')\n  } catch (e) {\n    error = e\n  }\n\n  expect(error).toEqual(new Error(error.message))\n})\n\ntest('nameVariants returns a single word cased variables', () => {\n  const names = ['Home', 'home']\n\n  names.forEach((name) => {\n    const vars = index.nameVariants(name)\n\n    expect(vars.pascalName).toEqual('Home')\n    expect(vars.camelName).toEqual('home')\n    expect(vars.singularPascalName).toEqual('Home')\n    expect(vars.pluralPascalName).toEqual('Homes')\n    expect(vars.singularCamelName).toEqual('home')\n    expect(vars.pluralCamelName).toEqual('homes')\n    expect(vars.singularParamName).toEqual('home')\n    expect(vars.pluralParamName).toEqual('homes')\n    expect(vars.singularConstantName).toEqual('HOME')\n    expect(vars.pluralConstantName).toEqual('HOMES')\n  })\n})\n\ntest('nameVariants returns a multi word cased variables', () => {\n  const names = ['FooBar', 'fooBar', 'foo_bar', 'foo-bar']\n\n  names.forEach((name) => {\n    const vars = index.nameVariants(name)\n\n    expect(vars.pascalName).toEqual('FooBar')\n    expect(vars.camelName).toEqual('fooBar')\n    expect(vars.singularPascalName).toEqual('FooBar')\n    expect(vars.pluralPascalName).toEqual('FooBars')\n    expect(vars.singularCamelName).toEqual('fooBar')\n    expect(vars.pluralCamelName).toEqual('fooBars')\n    expect(vars.singularParamName).toEqual('foo-bar')\n    expect(vars.pluralParamName).toEqual('foo-bars')\n  })\n})\n\ntest('generateTemplate returns a lodash-templated string', () => {\n  const output = index.generateTemplate(path.join('fixtures', 'text.txt'), {\n    root: __dirname,\n    name: 'amet',\n    noun: 'world',\n  })\n\n  expect(output).toEqual(`Lorem ipsum dolar sit amet\\nHello, world!\\n`)\n})\n\n// Be careful when editing the code.js fixture as the prettifier.config.js will cause it to get\n// prettified and then it already match the expected output, with no changes\ntest('generateTemplate returns prettified JS code', () => {\n  const output = index.generateTemplate(path.join('fixtures', 'code.js'), {\n    root: __dirname,\n    name: 'fox',\n    foo: 'dog',\n  })\n\n  expect(output).toEqual(\n    `const line1 = 'The quick brown foxes jumps over the lazy dog.'\\nconst line2 = 'Sphinx of black quartz, judge my vow.'\\n`\n  )\n})", "domain": "javascript", "lang": "code", "char_count": 3230, "word_count": 805, "byte_count": 3230}
{"text": "import React from \"react\"\nimport styled from \"styled-components\"\nimport { useIntl } from \"gatsby-plugin-intl\"\nimport { StaticQuery, graphql } from \"gatsby\"\n\nimport { getLangContentVersion } from \"../utils/translations\"\nimport { getLocaleTimestamp } from \"../utils/moment\"\nimport Translation from \"./Translation\"\nimport Link from \"./Link\"\nimport Icon from \"./Icon\"\nimport { Mixins } from \"./Theme\"\n\nconst StyledFooter = styled.footer`\n  display: flex;\n  justify-content: space-between;\n  flex-wrap: wrap;\n  padding-top: 3rem;\n  padding-bottom: 4rem;\n  max-width: ${(props) => props.theme.breakpoints.xl};\n  padding: 1rem 0;\n  @media (max-width: ${(props) => props.theme.breakpoints.xl}) {\n    padding: 1rem 2rem;\n  }\n`\n\nconst FooterTop = styled.div`\n  ${Mixins.textLevel8}\n  margin: 0;\n  width: 100%;\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n  flex-wrap: wrap;\n`\n\nconst LastUpdated = styled.div`\n  color: ${(props) => props.theme.colors.text200};\n`\n\nconst LinkSection = styled.div`\n  min-width: 300px;\n  @media (min-width: ${(props) => props.theme.breakpoints.l}) {\n    min-width: initial;\n  }\n`\n\nconst SectionHeader = styled.h3`\n  ${Mixins.textLevel8}\n  font-weight: bold;\n`\n\nconst List = styled.ul`\n  ${Mixins.textLevel8}\n  margin: 0;\n  list-style-type: none;\n  list-style-image: none;\n`\n\nconst ListItem = styled.li`\n  margin-bottom: 1rem;\n`\n\nconst FooterLink = styled(Link)`\n  color: ${(props) => props.theme.colors.text200};\n  &:after {\n    color: ${(props) => props.theme.colors.text200};\n  }\n  &:hover {\n    color: ${(props) => props.theme.colors.primary};\n    &:after {\n      color: ${(props) => props.theme.colors.primary};\n    }\n  }\n`\n\nconst SocialIcons = styled.div`\n  margin: 1rem 0;\n`\nconst SocialIcon = styled(Icon)`\n  margin-left: 0.5rem;\n\n  @media (max-width: ${(props) => props.theme.breakpoints.s}) {\n    margin-left: 0;\n    margin-right: 0.5rem;\n  }\n`\n\nconst socialLinks = [\n  {\n    icon: \"github\",\n    to: \"https://github.com/ethereum\",\n  },\n  {\n    icon: \"twitter\",\n    to: \"https://twitter.com/ethereum\",\n  },\n  {\n    icon: \"youtube\",\n    to: \"https://youtube.com/channel/UCNOfzGXD_C9YMYmnefmPH0g\",\n  },\n]\n\nconst Footer = () => {\n  const intl = useIntl()\n\n  const contentVersion = getLangContentVersion(intl.locale)\n\n  const linkSections = [\n    {\n      title: \"page-individuals\",\n      links: [\n        {\n          to: `/what-is-ethereum/`,\n          text:\n            contentVersion > 1\n              ? \"page-home-section-individuals-item-one\"\n              : \"page-home-section-beginners-item-two\",\n          shouldDisplay: true,\n        },\n        {\n          to: `/use/`,\n          text: \"page-use\",\n          shouldDisplay: contentVersion < 1.1,\n        },\n        {\n          to: `/eth/`,\n          text: \"page-home-section-individuals-item-four\",\n          shouldDisplay: contentVersion >= 1.1,\n        },\n        {\n          to: `/dapps/`,\n          text: \"page-home-section-individuals-item-two\",\n          shouldDisplay: contentVersion >= 1.1,\n        },\n        {\n          to: `/wallets/`,\n          text: \"page-home-section-individuals-item-five\",\n          shouldDisplay: contentVersion >= 1.1,\n        },\n        {\n          to: `/learn/`,\n          text:\n            contentVersion > 1\n              ? \"page-home-section-individuals-item-three\"\n              : \"page-learn\",\n          shouldDisplay: true,\n        },\n        {\n          to: `/community/`,\n          text: \"page-community\",\n          shouldDisplay: contentVersion > 1.1,\n        },\n      ],\n    },\n    {\n      title: \"page-developers\",\n      links: [\n        {\n          to: `/build/`,\n          text: \"get-started\",\n          shouldDisplay: contentVersion >= 1.1,\n        },\n        {\n          to: \"https://studio.ethereum.org/\",\n          text: \"ethereum-studio\",\n          shouldDisplay: true,\n        },\n        {\n          to: `/developers/`,\n          text: contentVersion > 1 ? \"developer-resources\" : \"page-developers\",\n          shouldDisplay: true,\n        },\n        {\n          to: \"/whitepaper/\",\n          text: \"footer-ethereum-whitepaper\",\n          shouldDisplay: contentVersion > 1.1,\n        },\n      ],\n    },\n    {\n      title: \"footer-ecosystem\",\n      links: [\n        {\n          to: \"/foundation/\",\n          text: \"ethereum-foundation\",\n          shouldDisplay: contentVersion > 1.1,\n        },\n        {\n          to: \"https://blog.ethereum.org/\",\n          text: \"footer-blog\",\n          shouldDisplay: true,\n        },\n        {\n          to: \"https://esp.ethereum.foundation\",\n          text: \"footer-esp\",\n          shouldDisplay: true,\n        },\n        {\n          to: \"/eips/\",\n          text: \"footer-eips\",\n          shouldDisplay: contentVersion > 1.1,\n        },\n        {\n          to: \"/assets/\",\n          text: \"ethereum-brand-assets\",\n          shouldDisplay: true,\n        },\n        {\n          to: \"https://devcon.org/\",\n          text: \"devcon\",\n          shouldDisplay: true,\n        },\n      ],\n    },\n    {\n      title: \"footer-about\",\n      links: [\n        {\n          to: \"/en/about/\",\n          text: \"footer-about-us\",\n          shouldDisplay: true,\n        },\n        {\n          to: \"/en/languages/\",\n          text: \"language-support\",\n          shouldDisplay: true,\n        },\n        {\n          to: \"/en/privacy-policy/\",\n          text: \"privacy-policy\",\n          shouldDisplay: true,\n        },\n        {\n          to: \"/en/terms-of-use/\",\n          text: \"terms-of-use\",\n          shouldDisplay: true,\n        },\n        {\n          to: \"/en/cookie-policy/\",\n          text: \"cookie-policy\",\n          shouldDisplay: true,\n        },\n        {\n          to: \"mailto:press@ethereum.org\",\n          text: \"contact\",\n          shouldDisplay: true,\n        },\n      ],\n    },\n  ]\n\n  return (\n    <StaticQuery\n      query={graphql`\n        query FooterQuery {\n          allSiteBuildMetadata {\n            edges {\n              node {\n                buildTime\n              }\n            }\n          }\n        }\n      `}\n      render={(data) => (\n        <StyledFooter>\n          <FooterTop>\n            <LastUpdated>\n              <Translation id=\"website-last-updated\" />:{\" \"}\n              {getLocaleTimestamp(\n                intl.locale,\n                data.allSiteBuildMetadata.edges[0].node.buildTime\n              )}\n            </LastUpdated>\n            <SocialIcons>\n              {socialLinks.map((link, idx) => {\n                return (\n                  <Link to={link.to} hideArrow={true} key={idx}>\n                    <SocialIcon name={link.icon} size=\"36\" />\n                  </Link>\n                )\n              })}\n            </SocialIcons>\n          </FooterTop>\n          {linkSections.map((section, idx) => {\n            return (\n              <LinkSection key={idx}>\n                <SectionHeader>\n                  <Translation id={section.title} />\n                </SectionHeader>\n                <List>\n                  {section.links\n                    .filter((link) => link.shouldDisplay)\n                    .map((link, linkIdx) => {\n                      return (\n                        <ListItem key={linkIdx}>\n                          <FooterLink to={link.to}>\n                            <Translation id={link.text} />\n                          </FooterLink>\n                        </ListItem>\n                      )\n                    })}\n                </List>\n              </LinkSection>\n            )\n          })}\n        </StyledFooter>\n      )}\n    />\n  )\n}\n\nexport default Footer", "domain": "javascript", "lang": "code", "char_count": 7539, "word_count": 1456, "byte_count": 7539}
{"text": "\ufeffvar ErrorEnum = {\r  'Config_Error':            [1000,'\u914d\u7f6e\u9519\u8bef'],\r  'Api_Name_Null':           [1001,'API\u540d\u79f0\u4e3a\u7a7a'],\r  'Api_Not_Support':         [1002,'\u4e0d\u652f\u6301\u7684API'],\r  'Api_Service_Not_Exist':   [1003,'API\u5bf9\u5e94\u7684\u670d\u52a1\u4e0d\u5b58\u5728'],\r  'Token_Not_Valid':         [1004,'TOKEN\u65e0\u6548'],\r  'Sign_Not_Valid':          [1005,'\u7b7e\u540d\u65e0\u6548'],\r  'Out_Of_Call':             [1006,'\u8d85\u51fa\u8c03\u7528\u6b21\u6570'],\r  'Out_Of_Service':          [1007,'\u6682\u505c\u670d\u52a1'],\r  'Sign_Type_Not_Valid':     [1008,'\u7b7e\u540d\u7c7b\u578b\u65e0\u6548'],\r  'Merchant_Not_Valid':      [1009,'\u5546\u6237\u65e0\u6548'],\r  'Param_Not_Valid':         [1010,'\u53c2\u6570\u65e0\u6548'],\r  'Charset_Not_Valid':       [1011,'\u5b57\u7b26\u96c6\u65e0\u6548'],\r  'Network_Error':           [1012,'\u7f51\u7edc\u5f02\u5e38'],\r  'Method_Not_Allowed':      [1013,'\u65b9\u6cd5\u4e0d\u88ab\u5141\u8bb8'],\r  'Upload_File_Not_Exist':   [1014,'\u6587\u4ef6\u4e0d\u5b58\u5728'],\r  'Upload_Fail':             [1015,'\u4e0a\u4f20\u5931\u8d25'],\r  'Merchant_No_Authority':   [1016,'\u5546\u6237\u672a\u6388\u6743']\r};\r\rmodule.exports = ErrorEnum;", "domain": "javascript", "lang": "code", "char_count": 822, "word_count": 181, "byte_count": 982}
{"text": "// Karma configuration file, see link for more information\n// https://karma-runner.github.io/1.0/config/configuration-file.html\n\nmodule.exports = function (config) {\n  config.set({\n    basePath: '',\n    frameworks: ['jasmine', '@angular-devkit/build-angular'],\n    plugins: [\n      require('karma-jasmine'),\n      require('karma-chrome-launcher'),\n      require('karma-jasmine-html-reporter'),\n      require('karma-coverage-istanbul-reporter'),\n      require('@angular-devkit/build-angular/plugins/karma')\n    ],\n    client: {\n      clearContext: false // leave Jasmine Spec Runner output visible in browser\n    },\n    coverageIstanbulReporter: {\n      dir: require('path').join(__dirname, './coverage/skyclubitalia-economy-app'),\n      reports: ['html', 'lcovonly', 'text-summary'],\n      fixWebpackSourcePaths: true\n    },\n    reporters: ['progress', 'kjhtml'],\n    port: 9876,\n    colors: true,\n    logLevel: config.LOG_INFO,\n    autoWatch: true,\n    browsers: ['Chrome'],\n    singleRun: false,\n    restartOnFileChange: true\n  });\n};", "domain": "javascript", "lang": "code", "char_count": 1036, "word_count": 181, "byte_count": 1036}
{"text": "var JQVMap = function (params) {\r\n  params = params || {};\r\n  var map = this;\r\n  var mapData = JQVMap.maps[params.map];\r\n  var mapPins;\r\n\r\n  if( !mapData){\r\n    throw new Error('Invalid \"' + params.map + '\" map parameter. Please make sure you have loaded this map file in your HTML.');\r\n  }\r\n\r\n  this.selectedRegions = [];\r\n  this.multiSelectRegion = params.multiSelectRegion;\r\n\r\n  this.container = params.container;\r\n\r\n  this.defaultWidth = mapData.width;\r\n  this.defaultHeight = mapData.height;\r\n\r\n  this.color = params.color;\r\n  this.selectedColor = params.selectedColor;\r\n  this.hoverColor = params.hoverColor;\r\n  this.hoverColors = params.hoverColors;\r\n  this.hoverOpacity = params.hoverOpacity;\r\n  this.setBackgroundColor(params.backgroundColor);\r\n\r\n  this.width = params.container.width();\r\n  this.height = params.container.height();\r\n\r\n  this.resize();\r\n\r\n  jQuery(window).resize(function () {\r\n    var newWidth = params.container.width();\r\n    var newHeight = params.container.height();\r\n\r\n    if(newWidth && newHeight){\r\n      map.width = newWidth;\r\n      map.height = newHeight;\r\n      map.resize();\r\n      map.canvas.setSize(map.width, map.height);\r\n      map.applyTransform();\r\n\r\n      var resizeEvent = jQuery.Event('resize.jqvmap');\r\n      jQuery(params.container).trigger(resizeEvent, [newWidth, newHeight]);\r\n\r\n      if(mapPins){\r\n        jQuery('.jqvmap-pin').remove();\r\n        map.pinHandlers = false;\r\n        map.placePins(mapPins.pins, mapPins.mode);\r\n      }\r\n    }\r\n  });\r\n\r\n  this.canvas = new VectorCanvas(this.width, this.height, params);\r\n  params.container.append(this.canvas.canvas);\r\n\r\n  this.makeDraggable();\r\n\r\n  this.rootGroup = this.canvas.createGroup(true);\r\n\r\n  this.index = JQVMap.mapIndex;\r\n  this.label = jQuery('<div/>').addClass('jqvmap-label').appendTo(jQuery('body')).hide();\r\n\r\n  if (params.enableZoom) {\r\n    jQuery('<div/>').addClass('jqvmap-zoomin').text('+').appendTo(params.container);\r\n    jQuery('<div/>').addClass('jqvmap-zoomout').html('&#x2212;').appendTo(params.container);\r\n  }\r\n\r\n  map.countries = [];\r\n\r\n  for (var key in mapData.paths) {\r\n    var path = this.canvas.createPath({\r\n      path: mapData.paths[key].path\r\n    });\r\n\r\n    path.setFill(this.color);\r\n    path.id = map.getCountryId(key);\r\n    map.countries[key] = path;\r\n\r\n    if (this.canvas.mode === 'svg') {\r\n      path.setAttribute('class', 'jqvmap-region');\r\n    } else {\r\n      jQuery(path).addClass('jqvmap-region');\r\n    }\r\n\r\n    jQuery(this.rootGroup).append(path);\r\n  }\r\n\r\n  jQuery(params.container).delegate(this.canvas.mode === 'svg' ? 'path' : 'shape', 'mouseover mouseout', function (e) {\r\n    var containerPath = e.target,\r\n      code = e.target.id.split('_').pop(),\r\n      labelShowEvent = jQuery.Event('labelShow.jqvmap'),\r\n      regionMouseOverEvent = jQuery.Event('regionMouseOver.jqvmap');\r\n\r\n    code = code.toLowerCase();\r\n\r\n    if (e.type === 'mouseover') {\r\n      jQuery(params.container).trigger(regionMouseOverEvent, [code, mapData.paths[code].name]);\r\n      if (!regionMouseOverEvent.isDefaultPrevented()) {\r\n        map.highlight(code, containerPath);\r\n      }\r\n      if (params.showTooltip) {\r\n        map.label.text(mapData.paths[code].name);\r\n        jQuery(params.container).trigger(labelShowEvent, [map.label, code]);\r\n\r\n        if (!labelShowEvent.isDefaultPrevented()) {\r\n          map.label.show();\r\n          map.labelWidth = map.label.width();\r\n          map.labelHeight = map.label.height();\r\n        }\r\n      }\r\n    } else {\r\n      map.unhighlight(code, containerPath);\r\n\r\n      map.label.hide();\r\n      jQuery(params.container).trigger('regionMouseOut.jqvmap', [code, mapData.paths[code].name]);\r\n    }\r\n  });\r\n\r\n  jQuery(params.container).delegate(this.canvas.mode === 'svg' ? 'path' : 'shape', 'click', function (regionClickEvent) {\r\n\r\n    var targetPath = regionClickEvent.target;\r\n    var code = regionClickEvent.target.id.split('_').pop();\r\n    var mapClickEvent = jQuery.Event('regionClick.jqvmap');\r\n\r\n    code = code.toLowerCase();\r\n\r\n    jQuery(params.container).trigger(mapClickEvent, [code, mapData.paths[code].name]);\r\n\r\n    if ( !params.multiSelectRegion && !mapClickEvent.isDefaultPrevented()) {\r\n      for (var keyPath in mapData.paths) {\r\n        map.countries[keyPath].currentFillColor = map.countries[keyPath].getOriginalFill();\r\n        map.countries[keyPath].setFill(map.countries[keyPath].getOriginalFill());\r\n      }\r\n    }\r\n\r\n    if ( !mapClickEvent.isDefaultPrevented()) {\r\n      if (map.isSelected(code)) {\r\n        map.deselect(code, targetPath);\r\n      } else {\r\n        map.select(code, targetPath);\r\n      }\r\n    }\r\n  });\r\n\r\n  if (params.showTooltip) {\r\n    params.container.mousemove(function (e) {\r\n      if (map.label.is(':visible')) {\r\n        var left = e.pageX - 15 - map.labelWidth;\r\n        var top = e.pageY - 15 - map.labelHeight;\r\n\r\n        if(left < 0) {\r\n          left = e.pageX + 15;\r\n        }\r\n        if(top < 0) {\r\n          top = e.pageY + 15;\r\n        }\r\n\r\n        map.label.css({\r\n          left: left,\r\n          top: top\r\n        });\r\n      }\r\n    });\r\n  }\r\n\r\n  this.setColors(params.colors);\r\n\r\n  this.canvas.canvas.appendChild(this.rootGroup);\r\n\r\n  this.applyTransform();\r\n\r\n  this.colorScale = new ColorScale(params.scaleColors, params.normalizeFunction, params.valueMin, params.valueMax);\r\n\r\n  if (params.values) {\r\n    this.values = params.values;\r\n    this.setValues(params.values);\r\n  }\r\n\r\n  if (params.selectedRegions) {\r\n    if (params.selectedRegions instanceof Array) {\r\n      for(var k in params.selectedRegions) {\r\n        this.select(params.selectedRegions[k].toLowerCase());\r\n      }\r\n    } else {\r\n      this.select(params.selectedRegions.toLowerCase());\r\n    }\r\n  }\r\n\r\n  this.bindZoomButtons();\r\n\r\n  if(params.pins) {\r\n    mapPins = {\r\n      pins: params.pins,\r\n      mode: params.pinMode\r\n    };\r\n\r\n    this.pinHandlers = false;\r\n    this.placePins(params.pins, params.pinMode);\r\n  }\r\n\r\n  if(params.showLabels){\r\n    this.pinHandlers = false;\r\n\r\n    var pins = {};\r\n    for (key in map.countries){\r\n      if (typeof map.countries[key] !== 'function') {\r\n        if( !params.pins || !params.pins[key] ){\r\n          pins[key] = key.toUpperCase();\r\n        }\r\n      }\r\n    }\r\n\r\n    mapPins = {\r\n      pins: pins,\r\n      mode: 'content'\r\n    };\r\n\r\n    this.placePins(pins, 'content');\r\n  }\r\n\r\n  JQVMap.mapIndex++;\r\n};\r\n\r\nJQVMap.prototype = {\r\n  transX: 0,\r\n  transY: 0,\r\n  scale: 1,\r\n  baseTransX: 0,\r\n  baseTransY: 0,\r\n  baseScale: 1,\r\n  width: 0,\r\n  height: 0,\r\n  countries: {},\r\n  countriesColors: {},\r\n  countriesData: {},\r\n  zoomStep: 1.4,\r\n  zoomMaxStep: 4,\r\n  zoomCurStep: 1\r\n};\r\n\r\nJQVMap.xlink = 'http://www.w3.org/1999/xlink';\r\nJQVMap.mapIndex = 1;\r\nJQVMap.maps = {};", "domain": "javascript", "lang": "code", "char_count": 6703, "word_count": 1604, "byte_count": 6703}
{"text": "import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport {autobind} from '../helpers';\n\nexport default class PrUrlInputBox extends React.Component {\n  static propTypes = {\n    onSubmit: PropTypes.func.isRequired,\n    children: PropTypes.node,\n  }\n\n  constructor(props, context) {\n    super(props, context);\n    autobind(this, 'handleSubmitUrlClick', 'handleSubmitUrl', 'handleUrlChange');\n    this.state = {\n      url: '',\n    };\n  }\n\n  render() {\n    return (\n      <form className=\"github-PrUrlInputBox-Subview\" onSubmit={this.handleSubmitUrl}>\n        {this.props.children}\n        <input\n          type=\"text\"\n          className=\"input-text native-key-bindings\"\n          placeholder=\"e.g. https://github.com/owner/repo/pull/123\"\n          value={this.state.url}\n          onChange={this.handleUrlChange}\n        />\n        <div>\n          <input\n            type=\"submit\"\n            value=\"Submit\"\n            onClick={this.handleSubmitUrlClick} className=\"btn btn-primary icon icon-check inline-block-tight\"\n          />\n        </div>\n      </form>\n    );\n  }\n\n  handleSubmitUrlClick(e) {\n    e.preventDefault();\n    this.handleSubmitUrl();\n  }\n\n  handleSubmitUrl() {\n    this.props.onSubmit(this.state.url);\n  }\n\n  handleUrlChange(e) {\n    this.setState({url: e.target.value});\n  }\n}", "domain": "javascript", "lang": "code", "char_count": 1307, "word_count": 265, "byte_count": 1307}
{"text": "(window.webpackJsonp=window.webpackJsonp||[]).push([[253],{zY44:function(n,o){!function(n){n.ng=n.ng||{},n.ng.common=n.ng.common||{},n.ng.common.locales=n.ng.common.locales||{};const o=void 0;n.ng.common.locales.si=[\"si\",[[\"\\u0db4\\u0dd9\",\"\\u0db4\"],[\"\\u0db4\\u0dd9.\\u0dc0.\",\"\\u0db4.\\u0dc0.\"],o],[[\"\\u0db4\\u0dd9.\\u0dc0.\",\"\\u0db4.\\u0dc0.\"],o,o],[[\"\\u0d89\",\"\\u0dc3\",\"\\u0d85\",\"\\u0db6\",\"\\u0db6\\u0dca\\u200d\\u0dbb\",\"\\u0dc3\\u0dd2\",\"\\u0dc3\\u0dd9\"],[\"\\u0d89\\u0dbb\\u0dd2\\u0daf\\u0dcf\",\"\\u0dc3\\u0db3\\u0dd4\\u0daf\\u0dcf\",\"\\u0d85\\u0d9f\\u0dc4\",\"\\u0db6\\u0daf\\u0dcf\\u0daf\\u0dcf\",\"\\u0db6\\u0dca\\u200d\\u0dbb\\u0dc4\\u0dc3\\u0dca\",\"\\u0dc3\\u0dd2\\u0d9a\\u0dd4\",\"\\u0dc3\\u0dd9\\u0db1\"],[\"\\u0d89\\u0dbb\\u0dd2\\u0daf\\u0dcf\",\"\\u0dc3\\u0db3\\u0dd4\\u0daf\\u0dcf\",\"\\u0d85\\u0d9f\\u0dc4\\u0dbb\\u0dd4\\u0dc0\\u0dcf\\u0daf\\u0dcf\",\"\\u0db6\\u0daf\\u0dcf\\u0daf\\u0dcf\",\"\\u0db6\\u0dca\\u200d\\u0dbb\\u0dc4\\u0dc3\\u0dca\\u0db4\\u0dad\\u0dd2\\u0db1\\u0dca\\u0daf\\u0dcf\",\"\\u0dc3\\u0dd2\\u0d9a\\u0dd4\\u0dbb\\u0dcf\\u0daf\\u0dcf\",\"\\u0dc3\\u0dd9\\u0db1\\u0dc3\\u0dd4\\u0dbb\\u0dcf\\u0daf\\u0dcf\"],[\"\\u0d89\\u0dbb\\u0dd2\",\"\\u0dc3\\u0db3\\u0dd4\",\"\\u0d85\\u0d9f\",\"\\u0db6\\u0daf\\u0dcf\",\"\\u0db6\\u0dca\\u200d\\u0dbb\\u0dc4\",\"\\u0dc3\\u0dd2\\u0d9a\\u0dd4\",\"\\u0dc3\\u0dd9\\u0db1\"]],o,[[\"\\u0da2\",\"\\u0db4\\u0dd9\",\"\\u0db8\\u0dcf\",\"\\u0d85\",\"\\u0db8\\u0dd0\",\"\\u0da2\\u0dd6\",\"\\u0da2\\u0dd6\",\"\\u0d85\",\"\\u0dc3\\u0dd0\",\"\\u0d94\",\"\\u0db1\\u0dd9\",\"\\u0daf\\u0dd9\"],[\"\\u0da2\\u0db1\",\"\\u0db4\\u0dd9\\u0db6\",\"\\u0db8\\u0dcf\\u0dbb\\u0dca\\u0dad\\u0dd4\",\"\\u0d85\\u0db4\\u0dca\\u200d\\u0dbb\\u0dda\\u0dbd\\u0dca\",\"\\u0db8\\u0dd0\\u0dba\\u0dd2\",\"\\u0da2\\u0dd6\\u0db1\\u0dd2\",\"\\u0da2\\u0dd6\\u0dbd\\u0dd2\",\"\\u0d85\\u0d9c\\u0ddd\",\"\\u0dc3\\u0dd0\\u0db4\\u0dca\",\"\\u0d94\\u0d9a\\u0dca\",\"\\u0db1\\u0ddc\\u0dc0\\u0dd0\",\"\\u0daf\\u0dd9\\u0dc3\\u0dd0\"],[\"\\u0da2\\u0db1\\u0dc0\\u0dcf\\u0dbb\\u0dd2\",\"\\u0db4\\u0dd9\\u0db6\\u0dbb\\u0dc0\\u0dcf\\u0dbb\\u0dd2\",\"\\u0db8\\u0dcf\\u0dbb\\u0dca\\u0dad\\u0dd4\",\"\\u0d85\\u0db4\\u0dca\\u200d\\u0dbb\\u0dda\\u0dbd\\u0dca\",\"\\u0db8\\u0dd0\\u0dba\\u0dd2\",\"\\u0da2\\u0dd6\\u0db1\\u0dd2\",\"\\u0da2\\u0dd6\\u0dbd\\u0dd2\",\"\\u0d85\\u0d9c\\u0ddd\\u0dc3\\u0dca\\u0dad\\u0dd4\",\"\\u0dc3\\u0dd0\\u0db4\\u0dca\\u0dad\\u0dd0\\u0db8\\u0dca\\u0db6\\u0dbb\\u0dca\",\"\\u0d94\\u0d9a\\u0dca\\u0dad\\u0ddd\\u0db6\\u0dbb\\u0dca\",\"\\u0db1\\u0ddc\\u0dc0\\u0dd0\\u0db8\\u0dca\\u0db6\\u0dbb\\u0dca\",\"\\u0daf\\u0dd9\\u0dc3\\u0dd0\\u0db8\\u0dca\\u0db6\\u0dbb\\u0dca\"]],[[\"\\u0da2\",\"\\u0db4\\u0dd9\",\"\\u0db8\\u0dcf\",\"\\u0d85\",\"\\u0db8\\u0dd0\",\"\\u0da2\\u0dd6\",\"\\u0da2\\u0dd6\",\"\\u0d85\",\"\\u0dc3\\u0dd0\",\"\\u0d94\",\"\\u0db1\\u0dd9\",\"\\u0daf\\u0dd9\"],[\"\\u0da2\\u0db1\",\"\\u0db4\\u0dd9\\u0db6\",\"\\u0db8\\u0dcf\\u0dbb\\u0dca\",\"\\u0d85\\u0db4\\u0dca\\u200d\\u0dbb\\u0dda\\u0dbd\\u0dca\",\"\\u0db8\\u0dd0\\u0dba\\u0dd2\",\"\\u0da2\\u0dd6\\u0db1\\u0dd2\",\"\\u0da2\\u0dd6\\u0dbd\\u0dd2\",\"\\u0d85\\u0d9c\\u0ddd\",\"\\u0dc3\\u0dd0\\u0db4\\u0dca\",\"\\u0d94\\u0d9a\\u0dca\",\"\\u0db1\\u0ddc\\u0dc0\\u0dd0\",\"\\u0daf\\u0dd9\\u0dc3\\u0dd0\"],[\"\\u0da2\\u0db1\\u0dc0\\u0dcf\\u0dbb\\u0dd2\",\"\\u0db4\\u0dd9\\u0db6\\u0dbb\\u0dc0\\u0dcf\\u0dbb\\u0dd2\",\"\\u0db8\\u0dcf\\u0dbb\\u0dca\\u0dad\\u0dd4\",\"\\u0d85\\u0db4\\u0dca\\u200d\\u0dbb\\u0dda\\u0dbd\\u0dca\",\"\\u0db8\\u0dd0\\u0dba\\u0dd2\",\"\\u0da2\\u0dd6\\u0db1\\u0dd2\",\"\\u0da2\\u0dd6\\u0dbd\\u0dd2\",\"\\u0d85\\u0d9c\\u0ddd\\u0dc3\\u0dca\\u0dad\\u0dd4\",\"\\u0dc3\\u0dd0\\u0db4\\u0dca\\u0dad\\u0dd0\\u0db8\\u0dca\\u0db6\\u0dbb\\u0dca\",\"\\u0d94\\u0d9a\\u0dca\\u0dad\\u0ddd\\u0db6\\u0dbb\\u0dca\",\"\\u0db1\\u0ddc\\u0dc0\\u0dd0\\u0db8\\u0dca\\u0db6\\u0dbb\\u0dca\",\"\\u0daf\\u0dd9\\u0dc3\\u0dd0\\u0db8\\u0dca\\u0db6\\u0dbb\\u0dca\"]],[[\"\\u0d9a\\u0dca\\u200d\\u0dbb\\u0dd2.\\u0db4\\u0dd6.\",\"\\u0d9a\\u0dca\\u200d\\u0dbb\\u0dd2.\\u0dc0.\"],o,[\"\\u0d9a\\u0dca\\u200d\\u0dbb\\u0dd2\\u0dc3\\u0dca\\u0dad\\u0dd4 \\u0db4\\u0dd6\\u0dbb\\u0dca\\u0dc0\",\"\\u0d9a\\u0dca\\u200d\\u0dbb\\u0dd2\\u0dc3\\u0dca\\u0dad\\u0dd4 \\u0dc0\\u0dbb\\u0dca\\u0dc2\"]],1,[6,0],[\"y-MM-dd\",\"y MMM d\",\"y MMMM d\",\"y MMMM d, EEEE\"],[\"HH.mm\",\"HH.mm.ss\",\"HH.mm.ss z\",\"HH.mm.ss zzzz\"],[\"{1} {0}\",o,o,o],[\".\",\",\",\";\",\"%\",\"+\",\"-\",\"E\",\"\\xd7\",\"\\u2030\",\"\\u221e\",\"NaN\",\".\"],[\"#,##0.###\",\"#,##0%\",\"\\xa4#,##0.00\",\"#\"],\"LKR\",\"\\u0dbb\\u0dd4.\",\"\\u0dc1\\u0dca\\u200d\\u0dbb\\u0dd3 \\u0dbd\\u0d82\\u0d9a\\u0dcf \\u0dbb\\u0dd4\\u0db4\\u0dd2\\u0dba\\u0dbd\",{JPY:[\"JP\\xa5\",\"\\xa5\"],LKR:[\"\\u0dbb\\u0dd4.\"],THB:[\"\\u0e3f\"],TWD:[\"NT$\"],USD:[\"US$\",\"$\"],XOF:[\"\\u0dc3\\u0dd2\\u0dc6\\u0dca\\u0d91\"]},function(n){let o=Math.floor(Math.abs(n)),e=parseInt(n.toString().replace(/^[^.]*\\.?/,\"\"),10)||0;return 0===n||1===n||0===o&&1===e?1:5},[[[\"\\u0db8\\u0dd0\",\"\\u0db8\",\"\\u0db4\\u0dcf\",\"\\u0d8b\",\"\\u0daf\",\"\\u0dc4\",\"\\u0dbb\\u0dd1\",\"\\u0db8\\u0dd0\"],[\"\\u0db8\\u0dd0\\u0daf\\u0dd2\\u0dba\\u0db8\",\"\\u0db8\\u0db0\\u0dca\\u200d\\u0dba\\u0dcf\\u0dc4\\u0dca\\u0db1\\u0dba\",\"\\u0db4\\u0dcf\\u0db1\\u0dca\\u0daf\\u0dbb\",\"\\u0d8b\\u0daf\\u0dda\",\"\\u0daf\\u0dc0\\u0dbd\\u0dca\",\"\\u0dc4\\u0dc0\\u0dc3\",\"\\u0dbb\\u0dd1\",\"\\u0db8\\u0dd0\\u0daf\\u0dd2\\u0dba\\u0db8\\u0da7 \\u0db4\\u0dc3\\u0dd4\"],o],[[\"\\u0db8\\u0dd0\\u0daf\\u0dd2\\u0dba\\u0db8\",\"\\u0db8\\u0db0\\u0dca\\u200d\\u0dba\\u0dcf\\u0dc4\\u0dca\\u0db1\\u0dba\",\"\\u0db4\\u0dcf\\u0db1\\u0dca\\u0daf\\u0dbb\",\"\\u0d8b\\u0daf\\u0dda\",\"\\u0daf\\u0dc0\\u0dbd\\u0dca\",\"\\u0dc4\\u0dc0\\u0dc3\",\"\\u0dbb\\u0dd1\",\"\\u0db8\\u0dd0\\u0daf\\u0dd2\\u0dba\\u0db8\\u0da7 \\u0db4\\u0dc3\\u0dd4\"],o,o],[\"00:00\",\"12:00\",[\"01:00\",\"06:00\"],[\"06:00\",\"12:00\"],[\"12:00\",\"14:00\"],[\"14:00\",\"18:00\"],[\"18:00\",\"24:00\"],[\"00:00\",\"01:00\"]]]]}(\"undefined\"!=typeof globalThis&&globalThis||\"undefined\"!=typeof global&&global||\"undefined\"!=typeof window&&window)}}]);", "domain": "javascript", "lang": "code", "char_count": 5045, "word_count": 1127, "byte_count": 5045}
{"text": "define(\n\"dojo/cldr/nls/bn/gregorian\", //begin v1.x content\n{\n\t\"months-format-narrow\": [\n\t\t\"\u099c\u09be\",\n\t\t\"\u09ab\u09c7\",\n\t\t\"\u09ae\u09be\",\n\t\t\"\u098f\",\n\t\t\"\u09ae\u09c7\",\n\t\t\"\u099c\u09c1\u09a8\",\n\t\t\"\u099c\u09c1\",\n\t\t\"\u0986\",\n\t\t\"\u09b8\u09c7\",\n\t\t\"\u0985\",\n\t\t\"\u09a8\",\n\t\t\"\u09a1\u09bf\"\n\t],\n\t\"quarters-standAlone-narrow\": [\n\t\t\"\u09e7\",\n\t\t\"\u09e8\",\n\t\t\"\u09e9\",\n\t\t\"\u09ea\"\n\t],\n\t\"field-weekday\": \"\u09b8\u09aa\u09cd\u09a4\u09be\u09b9\u09c7\u09b0 \u09a6\u09bf\u09a8\",\n\t\"dateFormatItem-yQQQ\": \"QQQ y\",\n\t\"dateFormatItem-yMEd\": \"E, d/M/y\",\n\t\"dateFormatItem-MMMEd\": \"E d MMM\",\n\t\"eraNarrow\": [\n\t\t\"\u0996\u09c3\u09b7\u09cd\u099f\u09aa\u09c2\u09b0\u09cd\u09ac\",\n\t\t\"\u0996\u09c3\u09b7\u09cd\u099f\u09be\u09ac\u09cd\u09a6\"\n\t],\n\t\"dateFormat-long\": \"d MMMM, y\",\n\t\"months-format-wide\": [\n\t\t\"\u099c\u09be\u09a8\u09c1\u09af\u09bc\u09be\u09b0\u09c0\",\n\t\t\"\u09ab\u09c7\u09ac\u09cd\u09b0\u09c1\u09af\u09bc\u09be\u09b0\u09c0\",\n\t\t\"\u09ae\u09be\u09b0\u09cd\u099a\",\n\t\t\"\u098f\u09aa\u09cd\u09b0\u09bf\u09b2\",\n\t\t\"\u09ae\u09c7\",\n\t\t\"\u099c\u09c1\u09a8\",\n\t\t\"\u099c\u09c1\u09b2\u09be\u0987\",\n\t\t\"\u0986\u0997\u09b8\u09cd\u099f\",\n\t\t\"\u09b8\u09c7\u09aa\u09cd\u099f\u09c7\u09ae\u09cd\u09ac\u09b0\",\n\t\t\"\u0985\u0995\u09cd\u099f\u09cb\u09ac\u09b0\",\n\t\t\"\u09a8\u09ad\u09c7\u09ae\u09cd\u09ac\u09b0\",\n\t\t\"\u09a1\u09bf\u09b8\u09c7\u09ae\u09cd\u09ac\u09b0\"\n\t],\n\t\"dayPeriods-format-wide-pm\": \"\u0985\u09aa\u09b0\u09be\u09b9\u09cd\u09a3\",\n\t\"dateFormat-full\": \"EEEE, d MMMM, y\",\n\t\"dateFormatItem-Md\": \"d/M\",\n\t\"dateFormatItem-yMd\": \"d/M/y\",\n\t\"field-era\": \"\u09af\u09c1\u0997\",\n\t\"dateFormatItem-yM\": \"M/yyyy\",\n\t\"months-standAlone-wide\": [\n\t\t\"\u099c\u09be\u09a8\u09c1\u09af\u09bc\u09be\u09b0\u09c0\",\n\t\t\"\u09ab\u09c7\u09ac\u09cd\u09b0\u09c1\u09af\u09bc\u09be\u09b0\u09c0\",\n\t\t\"\u09ae\u09be\u09b0\u09cd\u099a\",\n\t\t\"\u098f\u09aa\u09cd\u09b0\u09bf\u09b2\",\n\t\t\"\u09ae\u09c7\",\n\t\t\"\u099c\u09c1\u09a8\",\n\t\t\"\u099c\u09c1\u09b2\u09be\u0987\",\n\t\t\"\u0986\u0997\u09b8\u09cd\u099f\",\n\t\t\"\u09b8\u09c7\u09aa\u09cd\u099f\u09c7\u09ae\u09cd\u09ac\u09b0\",\n\t\t\"\u0985\u0995\u09cd\u099f\u09cb\u09ac\u09b0\",\n\t\t\"\u09a8\u09ad\u09c7\u09ae\u09cd\u09ac\u09b0\",\n\t\t\"\u09a1\u09bf\u09b8\u09c7\u09ae\u09cd\u09ac\u09b0\"\n\t],\n\t\"timeFormat-short\": \"h:mm a\",\n\t\"quarters-format-wide\": [\n\t\t\"\u09aa\u09cd\u09b0\u09a5\u09ae \u099a\u09a4\u09c1\u09b0\u09cd\u09a5\u09be\u0982\u09b6\",\n\t\t\"\u09a6\u09cd\u09ac\u09bf\u09a4\u09c0\u09af\u09bc \u099a\u09a4\u09c1\u09b0\u09cd\u09a5\u09be\u0982\u09b6\",\n\t\t\"\u09a4\u09c3\u09a4\u09c0\u09af\u09bc \u099a\u09a4\u09c1\u09b0\u09cd\u09a5\u09be\u0982\u09b6\",\n\t\t\"\u099a\u09a4\u09c1\u09b0\u09cd\u09a5 \u099a\u09a4\u09c1\u09b0\u09cd\u09a5\u09be\u0982\u09b6\"\n\t],\n\t\"timeFormat-long\": \"h:mm:ss a z\",\n\t\"field-year\": \"\u09ac\u099b\u09b0\",\n\t\"dateFormatItem-yMMM\": \"MMM y\",\n\t\"dateFormatItem-yQ\": \"Q y\",\n\t\"dateFormatItem-yyyyMMMM\": \"MMMM y\",\n\t\"field-hour\": \"\u0998\u09a8\u09cd\u099f\u09be\",\n\t\"dateFormatItem-MMdd\": \"dd-MM\",\n\t\"months-format-abbr\": [\n\t\t\"\u099c\u09be\u09a8\u09c1\u09af\u09bc\u09be\u09b0\u09c0\",\n\t\t\"\u09ab\u09c7\u09ac\u09cd\u09b0\u09c1\u09af\u09bc\u09be\u09b0\u09c0\",\n\t\t\"\u09ae\u09be\u09b0\u09cd\u099a\",\n\t\t\"\u098f\u09aa\u09cd\u09b0\u09bf\u09b2\",\n\t\t\"\u09ae\u09c7\",\n\t\t\"\u099c\u09c1\u09a8\",\n\t\t\"\u099c\u09c1\u09b2\u09be\u0987\",\n\t\t\"\u0986\u0997\u09b8\u09cd\u099f\",\n\t\t\"\u09b8\u09c7\u09aa\u09cd\u099f\u09c7\u09ae\u09cd\u09ac\u09b0\",\n\t\t\"\u0985\u0995\u09cd\u099f\u09cb\u09ac\u09b0\",\n\t\t\"\u09a8\u09ad\u09c7\u09ae\u09cd\u09ac\u09b0\",\n\t\t\"\u09a1\u09bf\u09b8\u09c7\u09ae\u09cd\u09ac\u09b0\"\n\t],\n\t\"dateFormatItem-yyQ\": \"Q yy\",\n\t\"timeFormat-full\": \"h:mm:ss a zzzz\",\n\t\"field-day-relative+0\": \"\u0986\u099c\",\n\t\"field-day-relative+1\": \"\u0986\u0997\u09be\u09ae\u09c0\u0995\u09be\u09b2\",\n\t\"field-day-relative+2\": \"\u0986\u0997\u09be\u09ae\u09c0 \u09aa\u09b0\u09b6\u09c1\",\n\t\"months-standAlone-abbr\": [\n\t\t\"\u099c\u09be\u09a8\u09c1\u09af\u09bc\u09be\u09b0\u09c0\",\n\t\t\"\u09ab\u09c7\u09ac\u09cd\u09b0\u09c1\u09af\u09bc\u09be\u09b0\u09c0\",\n\t\t\"\u09ae\u09be\u09b0\u09cd\u099a\",\n\t\t\"\u098f\u09aa\u09cd\u09b0\u09bf\u09b2\",\n\t\t\"\u09ae\u09c7\",\n\t\t\"\u099c\u09c1\u09a8\",\n\t\t\"\u099c\u09c1\u09b2\u09be\u0987\",\n\t\t\"\u0986\u0997\u09b8\u09cd\u099f\",\n\t\t\"\u09b8\u09c7\u09aa\u09cd\u099f\u09c7\u09ae\u09cd\u09ac\u09b0\",\n\t\t\"\u0985\u0995\u09cd\u099f\u09cb\u09ac\u09b0\",\n\t\t\"\u09a8\u09ad\u09c7\u09ae\u09cd\u09ac\u09b0\",\n\t\t\"\u09a1\u09bf\u09b8\u09c7\u09ae\u09cd\u09ac\u09b0\"\n\t],\n\t\"quarters-format-abbr\": [\n\t\t\"\u099a\u09a4\u09c1\u09b0\u09cd\u09a5\u09be\u0982\u09b6 \u09e7\",\n\t\t\"\u099a\u09a4\u09c1\u09b0\u09cd\u09a5\u09be\u0982\u09b6 \u09e8\",\n\t\t\"\u099a\u09a4\u09c1\u09b0\u09cd\u09a5\u09be\u0982\u09b6 \u09e9\",\n\t\t\"\u099a\u09a4\u09c1\u09b0\u09cd\u09a5\u09be\u0982\u09b6 \u09ea\"\n\t],\n\t\"quarters-standAlone-wide\": [\n\t\t\"\u09aa\u09cd\u09b0\u09a5\u09ae \u099a\u09a4\u09c1\u09b0\u09cd\u09a5\u09be\u0982\u09b6\",\n\t\t\"\u09a6\u09cd\u09ac\u09bf\u09a4\u09c0\u09af\u09bc \u099a\u09a4\u09c1\u09b0\u09cd\u09a5\u09be\u0982\u09b6\",\n\t\t\"\u09a4\u09c3\u09a4\u09c0\u09af\u09bc \u099a\u09a4\u09c1\u09b0\u09cd\u09a5\u09be\u0982\u09b6\",\n\t\t\"\u099a\u09a4\u09c1\u09b0\u09cd\u09a5 \u099a\u09a4\u09c1\u09b0\u09cd\u09a5\u09be\u0982\u09b6\"\n\t],\n\t\"dateFormatItem-M\": \"L\",\n\t\"days-standAlone-wide\": [\n\t\t\"\u09b0\u09ac\u09bf\u09ac\u09be\u09b0\",\n\t\t\"\u09b8\u09cb\u09ae\u09ac\u09be\u09b0\",\n\t\t\"\u09ae\u0999\u09cd\u0997\u09b2\u09ac\u09be\u09b0\",\n\t\t\"\u09ac\u09c1\u09a7\u09ac\u09be\u09b0\",\n\t\t\"\u09ac\u09c3\u09b9\u09b7\u09cd\u09aa\u09a4\u09bf\u09ac\u09be\u09b0\",\n\t\t\"\u09b6\u09c1\u0995\u09cd\u09b0\u09ac\u09be\u09b0\",\n\t\t\"\u09b6\u09a8\u09bf\u09ac\u09be\u09b0\"\n\t],\n\t\"dateFormatItem-MMMMd\": \"d MMMM\",\n\t\"timeFormat-medium\": \"h:mm:ss a\",\n\t\"dateFormatItem-Hm\": \"HH:mm\",\n\t\"quarters-standAlone-abbr\": [\n\t\t\"Q1\",\n\t\t\"Q2\",\n\t\t\"Q3\",\n\t\t\"Q4\"\n\t],\n\t\"eraAbbr\": [\n\t\t\"\u0996\u09c3\u09b7\u09cd\u099f\u09aa\u09c2\u09b0\u09cd\u09ac\",\n\t\t\"\u0996\u09c3\u09b7\u09cd\u099f\u09be\u09ac\u09cd\u09a6\"\n\t],\n\t\"field-minute\": \"\u09ae\u09bf\u09a8\u09bf\u099f\",\n\t\"field-dayperiod\": \"\u09aa\u09c2\u09b0\u09cd\u09ac\u09be\u09b9\u09cd\u09a3/\u0985\u09aa\u09b0\u09be\u09b9\u09cd\u09a3\",\n\t\"days-standAlone-abbr\": [\n\t\t\"\u09b0\u09ac\u09bf\",\n\t\t\"\u09b8\u09cb\u09ae\",\n\t\t\"\u09ae\u0999\u09cd\u0997\u09b2\",\n\t\t\"\u09ac\u09c1\u09a7\",\n\t\t\"\u09ac\u09c3\u09b9\u09b8\u09cd\u09aa\u09a4\u09bf\",\n\t\t\"\u09b6\u09c1\u0995\u09cd\u09b0\",\n\t\t\"\u09b6\u09a8\u09bf\"\n\t],\n\t\"dateFormatItem-d\": \"d\",\n\t\"dateFormatItem-ms\": \"mm:ss\",\n\t\"quarters-format-narrow\": [\n\t\t\"1\",\n\t\t\"2\",\n\t\t\"3\",\n\t\t\"4\"\n\t],\n\t\"field-day-relative+-1\": \"\u0997\u09a4\u0995\u09be\u09b2\",\n\t\"field-day-relative+-2\": \"\u0997\u09a4 \u09aa\u09b0\u09b6\u09c1\",\n\t\"dateFormatItem-MMMd\": \"d MMM\",\n\t\"dateFormatItem-MEd\": \"E, d-M\",\n\t\"dateFormatItem-yMMMM\": \"MMMM y\",\n\t\"field-day\": \"\u09a6\u09bf\u09a8\",\n\t\"days-format-wide\": [\n\t\t\"\u09b0\u09ac\u09bf\u09ac\u09be\u09b0\",\n\t\t\"\u09b8\u09cb\u09ae\u09ac\u09be\u09b0\",\n\t\t\"\u09ae\u0999\u09cd\u0997\u09b2\u09ac\u09be\u09b0\",\n\t\t\"\u09ac\u09c1\u09a7\u09ac\u09be\u09b0\",\n\t\t\"\u09ac\u09c3\u09b9\u09b7\u09cd\u09aa\u09a4\u09bf\u09ac\u09be\u09b0\",\n\t\t\"\u09b6\u09c1\u0995\u09cd\u09b0\u09ac\u09be\u09b0\",\n\t\t\"\u09b6\u09a8\u09bf\u09ac\u09be\u09b0\"\n\t],\n\t\"field-zone\": \"\u098f\u09b2\u09be\u0995\u09be\",\n\t\"dateFormatItem-yyyyMM\": \"MM-yyyy\",\n\t\"dateFormatItem-y\": \"y\",\n\t\"months-standAlone-narrow\": [\n\t\t\"\u099c\u09be\",\n\t\t\"\u09ab\u09c7\",\n\t\t\"\u09ae\u09be\",\n\t\t\"\u098f\",\n\t\t\"\u09ae\u09c7\",\n\t\t\"\u099c\u09c1\u09a8\",\n\t\t\"\u099c\u09c1\",\n\t\t\"\u0986\",\n\t\t\"\u09b8\u09c7\",\n\t\t\"\u0985\",\n\t\t\"\u09a8\",\n\t\t\"\u09a1\u09bf\"\n\t],\n\t\"field-year-relative+-1\": \"\u0986\u0997\u09c7\u09b0 \u09ac\u099b\u09b0\",\n\t\"field-month-relative+-1\": \"\u0997\u09a4 \u09ae\u09be\u09b8\",\n\t\"days-format-abbr\": [\n\t\t\"\u09b0\u09ac\u09bf\",\n\t\t\"\u09b8\u09cb\u09ae\",\n\t\t\"\u09ae\u0999\u09cd\u0997\u09b2\",\n\t\t\"\u09ac\u09c1\u09a7\",\n\t\t\"\u09ac\u09c3\u09b9\u09b8\u09cd\u09aa\u09a4\u09bf\",\n\t\t\"\u09b6\u09c1\u0995\u09cd\u09b0\",\n\t\t\"\u09b6\u09a8\u09bf\"\n\t],\n\t\"dateFormatItem-yMMMd\": \"d MMM, y\",\n\t\"eraNames\": [\n\t\t\"\u0996\u09c3\u09b7\u09cd\u099f\u09aa\u09c2\u09b0\u09cd\u09ac\",\n\t\t\"\u0996\u09c3\u09b7\u09cd\u099f\u09be\u09ac\u09cd\u09a6\"\n\t],\n\t\"days-format-narrow\": [\n\t\t\"\u09b0\",\n\t\t\"\u09b8\u09cb\",\n\t\t\"\u09ae\",\n\t\t\"\u09ac\u09c1\",\n\t\t\"\u09ac\u09c3\",\n\t\t\"\u09b6\u09c1\",\n\t\t\"\u09b6\"\n\t],\n\t\"field-month\": \"\u09ae\u09be\u09b8\",\n\t\"days-standAlone-narrow\": [\n\t\t\"\u09b0\",\n\t\t\"\u09b8\u09cb\",\n\t\t\"\u09ae\",\n\t\t\"\u09ac\u09c1\",\n\t\t\"\u09ac\u09c3\",\n\t\t\"\u09b6\u09c1\",\n\t\t\"\u09b6\"\n\t],\n\t\"dateFormatItem-MMM\": \"LLL\",\n\t\"dayPeriods-format-wide-am\": \"\u09aa\u09c2\u09b0\u09cd\u09ac\u09be\u09b9\u09cd\u09a3\",\n\t\"dateFormatItem-MMMMEd\": \"E d MMMM\",\n\t\"dateFormat-short\": \"d/M/yy\",\n\t\"field-second\": \"\u09b8\u09c7\u0995\u09c7\u09a8\u09cd\u09a1\",\n\t\"dateFormatItem-yMMMEd\": \"E, d MMM, y\",\n\t\"field-month-relative+0\": \"\u098f\u0987 \u09ae\u09be\u09b8\",\n\t\"field-month-relative+1\": \"\u09aa\u09b0\u09c7\u09b0 \u09ae\u09be\u09b8\",\n\t\"dateFormatItem-Ed\": \"d E\",\n\t\"field-week\": \"\u09b8\u09aa\u09cd\u09a4\u09be\u09b9\",\n\t\"dateFormat-medium\": \"d MMM, y\",\n\t\"field-year-relative+0\": \"\u098f\u0987 \u09ac\u099b\u09b0\",\n\t\"field-week-relative+-1\": \"\u0997\u09a4 \u09b8\u09aa\u09cd\u09a4\u09be\u09b9\",\n\t\"field-year-relative+1\": \"\u09aa\u09b0\u09c7\u09b0 \u09ac\u099b\u09b0\",\n\t\"field-week-relative+0\": \"\u098f\u0987 \u09b8\u09aa\u09cd\u09a4\u09be\u09b9\",\n\t\"field-week-relative+1\": \"\u09aa\u09b0\u09ac\u09b0\u09cd\u09a4\u09c0 \u09b8\u09aa\u09cd\u09a4\u09be\u09b9\"\n}\n//end v1.x content\n);", "domain": "javascript", "lang": "code", "char_count": 4366, "word_count": 1289, "byte_count": 6244}
{"text": "/**\n * This module is used to accommodate Swagger 2 data for easier rendering.\n * @module swagger2\n */\n\nconst _ = require('lodash');\nconst wrap = require('word-wrap');\nconst bundler = require('./bundler');\n\n/**\n * Generates an \"operationId\" attribute based on path and method names.\n *\n * @private\n * @param  {String} method_name HTTP method name.\n * @param  {String} path_name   Path name.\n * @return {String}\n */\nconst generateOperationId = (method_name, path_name) => {\n  if (path_name === '/') return method_name;\n\n  // clean url path for requests ending with '/'\n  let clean_path = path_name;\n  if (clean_path.indexOf('/', clean_path.length - 1) !== -1) {\n    clean_path = clean_path.substring(0, clean_path.length - 1);\n  }\n\n  let segments = clean_path.split('/').slice(1);\n  segments = _.transform(segments, (result, segment) => {\n    if (segment[0] === '{' && segment[segment.length - 1] === '}') {\n      segment = `by-${_.capitalize(segment.substring(1, segment.length - 1))}}`;\n    }\n    result.push(segment);\n  });\n\n  return _.camelCase(`${method_name.toLowerCase()}-${segments.join('-')}`);\n};\n\n/**\n * Accommodates Swagger object for easier rendering.\n *\n * @param  {String|Object} swagger File path to Swagger file or **fully bundled and dereferenced** Swagger JS object.\n * @return {Object}                The accommodated Swagger object.\n */\nconst swagger2 = async swagger => {\n  const authorized_methods = ['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'COPY', 'HEAD', 'OPTIONS', 'LINK', 'UNLINK', 'PURGE', 'LOCK', 'UNLOCK', 'PROPFIND'];\n\n  if (typeof swagger === 'string') {\n    try {\n      swagger = await bundler(swagger);\n    } catch (e) {\n      throw e;\n    }\n  } else if (typeof swagger !== 'object') {\n    throw new Error(`Could not find a valid swagger definition: ${swagger}`);\n  }\n\n  swagger.basePath = swagger.basePath || '';\n\n  _.each(swagger.paths, (path, path_name) => {\n    path.endpointName = path_name === '/' ? 'root' : path_name.split('/')[1];\n    _.each(path, (method, method_name) => {\n      if (authorized_methods.indexOf(method_name.toUpperCase()) === -1) return;\n\n      method.operationId = _.camelCase(method.operationId || generateOperationId(method_name, path_name).replace(/\\s/g, '-'));\n      method.descriptionLines = wrap(method.description || method.summary || '', { width: 60, indent: '' }).split(/\\n/);\n      _.each(method.parameters, param => {\n        param.type = param.type || (param.schema ? param.schema.type : undefined);\n      });\n    });\n  });\n\n  swagger.endpoints = _.uniq(_.map(swagger.paths, 'endpointName'));\n\n  return swagger;\n};\n\nmodule.exports = swagger2;", "domain": "javascript", "lang": "code", "char_count": 2615, "word_count": 673, "byte_count": 2615}
{"text": "/*\n* Kendo UI Beta v2013.2.716 (http://kendoui.com)\n* Copyright 2013 Telerik AD. All rights reserved.\n*\n* Kendo UI Beta license terms available at\n* http://www.kendoui.com/purchase/license-agreement/kendo-ui-beta.aspx\n*/\n\n(\"function\"==typeof define&&define.amd?define:function(n,y){return y()})([\"../kendo.core.min\"],function(){!function(){kendo.cultures[\"bn-BD\"]={name:\"bn-BD\",numberFormat:{pattern:[\"-n\"],decimals:2,\",\":\",\",\".\":\".\",groupSize:[3,2],percent:{pattern:[\"-%n\",\"%n\"],decimals:2,\",\":\",\",\".\":\".\",groupSize:[3,2],symbol:\"%\"},currency:{pattern:[\"$ -n\",\"$ n\"],decimals:2,\",\":\",\",\".\":\".\",groupSize:[3,2],symbol:\"\u09f3\"}},calendars:{standard:{days:{names:[\"\u09b0\u09ac\u09bf\u09ac\u09be\u09b0\",\"\u09b8\u09cb\u09ae\u09ac\u09be\u09b0\",\"\u09ae\u0999\u09cd\u0997\u09b2\u09ac\u09be\u09b0\",\"\u09ac\u09c1\u09a7\u09ac\u09be\u09b0\",\"\u09ac\u09c3\u09b9\u09b8\u09cd\u09aa\u09a4\u09bf\u09ac\u09be\u09b0\",\"\u09b6\u09c1\u0995\u09cd\u09b0\u09ac\u09be\u09b0\",\"\u09b6\u09a8\u09bf\u09ac\u09be\u09b0\"],namesAbbr:[\"\u09b0\u09ac\u09bf.\",\"\u09b8\u09cb\u09ae.\",\"\u09ae\u0999\u09cd\u0997\u09b2.\",\"\u09ac\u09c1\u09a7.\",\"\u09ac\u09c3\u09b9\u09b8\u09cd\u09aa\u09a4\u09bf.\",\"\u09b6\u09c1\u0995\u09cd\u09b0.\",\"\u09b6\u09a8\u09bf.\"],namesShort:[\"\u09b0\",\"\u09b8\",\"\u09ae\",\"\u09ac\",\"\u09ac\",\"\u09b6\",\"\u09b6\"]},months:{names:[\"\u099c\u09be\u09a8\u09c1\u09af\u09bc\u09be\u09b0\u09c0\",\"\u09ab\u09c7\u09ac\u09cd\u09b0\u09c1\u09af\u09bc\u09be\u09b0\u09c0\",\"\u09ae\u09be\u09b0\u09cd\u099a\",\"\u098f\u09aa\u09cd\u09b0\u09bf\u09b2\",\"\u09ae\u09c7\",\"\u099c\u09c1\u09a8\",\"\u099c\u09c1\u09b2\u09be\u0987\",\"\u0986\u0997\u09b8\u09cd\u099f\",\"\u09b8\u09c7\u09aa\u09cd\u099f\u09c7\u09ae\u09cd\u09ac\u09b0\",\"\u0985\u0995\u09cd\u099f\u09cb\u09ac\u09b0\",\"\u09a8\u09ad\u09c7\u09ae\u09cd\u09ac\u09b0\",\"\u09a1\u09bf\u09b8\u09c7\u09ae\u09cd\u09ac\u09b0\",\"\"],namesAbbr:[\"\u099c\u09be\u09a8\u09c1.\",\"\u09ab\u09c7\u09ac\u09cd\u09b0\u09c1.\",\"\u09ae\u09be\u09b0\u09cd\u099a\",\"\u098f\u09aa\u09cd\u09b0\u09bf\u09b2\",\"\u09ae\u09c7\",\"\u099c\u09c1\u09a8\",\"\u099c\u09c1\u09b2\u09be\u0987\",\"\u0986\u0997.\",\"\u09b8\u09c7\u09aa\u09cd\u099f\u09c7.\",\"\u0985\u0995\u09cd\u099f\u09cb.\",\"\u09a8\u09ad\u09c7.\",\"\u09a1\u09bf\u09b8\u09c7.\",\"\"]},AM:[\"\u09aa\u09c1\u09b0\u09cd\u09ac\u09be\u09b9\u09cd\u09a8\",\"\u09aa\u09c1\u09b0\u09cd\u09ac\u09be\u09b9\u09cd\u09a8\",\"\u09aa\u09c1\u09b0\u09cd\u09ac\u09be\u09b9\u09cd\u09a8\"],PM:[\"\u0985\u09aa\u09b0\u09be\u09b9\u09cd\u09a8\",\"\u0985\u09aa\u09b0\u09be\u09b9\u09cd\u09a8\",\"\u0985\u09aa\u09b0\u09be\u09b9\u09cd\u09a8\"],patterns:{d:\"dd-MM-yy\",D:\"dd MMMM yyyy\",F:\"dd MMMM yyyy HH.mm.ss\",g:\"dd-MM-yy HH.mm\",G:\"dd-MM-yy HH.mm.ss\",m:\"dd MMMM\",M:\"dd MMMM\",s:\"yyyy'-'MM'-'dd'T'HH':'mm':'ss\",t:\"HH.mm\",T:\"HH.mm.ss\",u:\"yyyy'-'MM'-'dd HH':'mm':'ss'Z'\",y:\"MMMM, yyyy\",Y:\"MMMM, yyyy\"},\"/\":\"-\",\":\":\".\",firstDay:1}}}}(this)});", "domain": "javascript", "lang": "code", "char_count": 1455, "word_count": 648, "byte_count": 1987}
{"text": "const Topic  = require('../../models/forums/topic');\nconst Forum = require('../../models/forums/forum');\nconst Post = require('../../models/forums/post');\nconst User = require('../../models/user');\n\nexports.getPosts = function(req, res) {\n  if (typeof req.body.access_token === 'undefined') {\n    return res.status(400).send('Authentication is required');\n  }\n\n  User.findOne({ token: req.body.access_token }, function(err, user) {\n    if (err || !user) {\n      return res.status(400).send('Authentication failed');\n    } else {\n      Post.find({}, null, {sort: {createdDate: -1}}, function(err, posts) {\n        if (err || !posts.length) {\n          return res.json({\n            type: false,\n            data: \"Error occured: \" + err\n          });\n        } else {\n          return res.json(posts);\n        }\n      });\n    }\n  });\n};\n\nexports.getPostsByTopicId = function(req, res) {\n  if (typeof req.body.access_token === 'undefined') {\n    return res.status(400).send('Authentication is required');\n  }\n\n  User.findOne({ token: req.body.access_token }, function(err, user) {\n    if (err || !user) {\n      return res.status(400).send('Authentication failed');\n    } else {\n      Post.find({topicId: req.body.id}, null, {sort: {createdDate: 1}}, function(err, posts) {\n        if (err || !posts.length) {\n          return res.json({\n            type: false,\n            data: \"Error occured: \" + err\n          });\n        } else {\n          return res.json({type: true, data: posts});\n        }\n      });\n    }\n  });\n};\n\nexports.getPostById = function(req, res) {\n  if (typeof req.body.access_token === 'undefined') {\n    return res.status(400).send('Authentication is required');\n  }\n\n  User.findOne({ token: req.body.access_token }, function(err, user) {\n    if (err || !user) {\n      return res.status(400).send('Authentication failed');\n    } else {\n      Post.findOne({_id: req.body.id}, function(err, post) {\n        if (err || !post) {\n          return res.json({\n            type: false,\n            data: \"Error occured: \" + err\n          });\n        } else {\n          return res.json({type: true, data: post});\n        }\n      });\n    }\n  });\n};\n\nexports.likePostById = function(req, res) {\n  if (typeof req.body.access_token === 'undefined') {\n    return res.status(400).send('Authentication is required');\n  }\n\n  User.findOne({ token: req.body.access_token }, function(err, user) {\n    if (err || !user) {\n      return res.status(400).send('Authentication failed');\n    } else {\n      Post.findOne({_id: req.body.id}, function(err, post) {\n        if (err || !post) {\n          return res.json({\n            type: false,\n            data: \"Error occured: \" + err\n          });\n        } else {\n          console.log(post);\n          if (post.likeUsersId.indexOf(user._id) == -1) {\n            console.log(post);\n            post.likeUsersId.push(user._id);\n            post.save();\n          }\n          return res.json({type: true});\n        }\n      });\n    }\n  });\n};\n\nexports.removeLikePostById = function(req, res) {\n  if (typeof req.body.access_token === 'undefined') {\n    return res.status(400).send('Authentication is required');\n  }\n\n  User.findOne({ token: req.body.access_token }, function(err, user) {\n    if (err || !user) {\n      return res.status(400).send('Authentication failed');\n    } else {\n      Post.findOne({_id: req.body.id}, function(err, post) {\n        if (err || !post) {\n          return res.json({\n            type: false,\n            data: \"Error occured: \" + err\n          });\n        } else {\n          var idx = post.likeUsersId.indexOf(user._id);\n          if (idx > -1) {\n            post.likeUsersId.splice(idx);\n            post.save();\n            return res.json({type: true});\n          }\n        }\n      });\n    }\n  });\n};\n\nexports.dislikePostById = function(req, res) {\n  if (typeof req.body.access_token === 'undefined') {\n    return res.status(400).send('Authentication is required');\n  }\n\n  User.findOne({ token: req.body.access_token }, function(err, user) {\n    if (err || !user) {\n      return res.status(400).send('Authentication failed');\n    } else {\n      Post.findOne({_id: req.body.id}, function(err, post) {\n        if (err || !post) {\n          return res.json({\n            type: false,\n            data: \"Error occured: \" + err\n          });\n        } else {\n          if (post.unlikeUsersId.indexOf(user._id) == -1) {\n            post.unlikeUsersId.push(user._id);\n            post.save();\n            return res.json({type: true});\n          } else {\n            return res.json({\n              type: false,\n              data: \"Error1 occured: \" + err\n            });\n          }\n        }\n      });\n    }\n  });\n};\n\nexports.removeDisLikePostById = function(req, res) {\n  if (typeof req.body.access_token === 'undefined') {\n    return res.status(400).send('Authentication is required');\n  }\n\n  User.findOne({ token: req.body.access_token }, function(err, user) {\n    if (err || !user) {\n      return res.status(400).send('Authentication failed');\n    } else {\n      Post.findOne({_id: req.body.id}, function(err, post) {\n        if (err || !post) {\n          return res.json({\n            type: false,\n            data: \"Error occured: \" + err\n          });\n        } else {\n          var idx = post.unlikeUsersId.indexOf(user._id);\n          if (idx > -1) {\n            post.unlikeUsersId.splice(idx);\n            post.save();\n            return res.json({type: true});\n          }\n        }\n      });\n    }\n  });\n};\n\nexports.addPost = function(req, res) {\n  if (typeof req.body.access_token === 'undefined') {\n    return res.status(400).send('Authentication is required');\n  }\n\n  User.findOne({ token: req.body.access_token }, function(err, user) {\n    if (err || !user) {\n      return res.status(400).send('Authentication failed');\n    } else {\n      var item = req.body.data;\n      item.createdDate = new Date();\n      item.createdUserId = user._id;\n      var newPost = new Post(item);\n      newPost.save(function (err, post) {\n        if (err || !post) {\n          return res.status(500).send(err);\n        } else {\n          if (post.topicId) {\n            Topic.findOne({_id: post.topicId}, function(err, topic) {\n              if (err || !topic) {\n                res.json({type: false, msg: 'err: ' + err});\n              } else {\n                topic.replies++;\n                topic.lastreplied = new Date();\n                topic.save();\n\n                Forum.findOne({_id: topic.forumId}, function (err, parentForum) {\n                  if (err || !parentForum) {\n                    return res.status(500).send('cannot find parent forum');\n                  } else {\n                    parentForum.posts++;\n                    parentForum.lastreplied = new Date();\n                    parentForum.save();\n                    return res.json({type: true, msg: 'successfully added'});\n                  }\n                })\n              }\n            });\n          } else {\n            return res.json({ type: true, msg: 'successfully added'});\n          }\n        }\n      })\n    }\n  });\n};\n\nexports.deletePost = function(req, res) {\n  if (typeof req.body.access_token === 'undefined') {\n    return res.status(400).send('Authentication is required');\n  }\n\n  User.findOne({ token: req.body.access_token }, function(err, user) {\n    if (err || !user) {\n      return res.status(400).send('Authentication failed');\n    } else {\n      Post.findOneAndRemove({_id: req.body.id}, function (err, post) {\n        if (err || !post) {\n          return res.status(500).send(err);\n        } else {\n          if (post.topicId) {\n            Topic.findOne({_id: post.topicId}, function(err, topic) {\n              if (err || topic) {\n                return res.json({type: false, msg: 'err: ' + err});\n              } else {\n                topic.replies--;\n                topic.save();\n\n                Forum.findOne({_id: topic.forumId}, function (err, parentForum) {\n                  if (err || !parentForum) {\n                    return res.status(500).send('cannot find parent forum');\n                  } else {\n                    parentForum.posts--;\n                    parentForum.save();\n                    return res.json({type: true, msg: 'successfully deleted'});\n                  }\n                })\n              }\n            });\n          } else {\n            return res.json({ type: false, msg: 'topic id invalid'});\n          }\n        }\n      })\n    }\n  });\n};", "domain": "javascript", "lang": "code", "char_count": 8462, "word_count": 2087, "byte_count": 8462}
{"text": "import React from 'react';\n\nexport default function MyLocation(props) {\n\tconst { width, height, color, backgroundColor, ...others } = props;\n\treturn (\n\t\t<div {...others} style={{ height: `${height}px`, width: `${width}px` }}>\n\t\t\t<svg\n\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\twidth={width}\n\t\t\t\theight={height}\n\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t>\n\t\t\t\t<path\n\t\t\t\t\td=\"M12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm8.94 3c-.46-4.17-3.77-7.48-7.94-7.94V1h-2v2.06C6.83 3.52 3.52 6.83 3.06 11H1v2h2.06c.46 4.17 3.77 7.48 7.94 7.94V23h2v-2.06c4.17-.46 7.48-3.77 7.94-7.94H23v-2h-2.06zM12 19c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z\"\n\t\t\t\t\tfill={color}\n\t\t\t\t/>\n\t\t\t\t<path d=\"M0 0h24v24H0z\" fill=\"none\" />\n\t\t\t</svg>\n\t\t</div>\n\t);\n}\n\nMyLocation.defaultProps = {\n\tcolor: 'black',\n\twidth: '24',\n\theight: '24'\n};", "domain": "javascript", "lang": "code", "char_count": 812, "word_count": 188, "byte_count": 812}
{"text": "import React, { Component } from \"react\"\nimport PropTypes from \"prop-types\"\nimport styled from \"styled-components\"\nimport { Link } from \"gatsby\"\n\nimport Img from \"gatsby-image\"\nimport AddToCartBtn from \"./AddToCartBtn\"\n\nconst GridItem = styled.div`\n  justify-items: center;\n  justify-content: space-evenly;\n  text-align: center;\n  border: 3px solid #f6f7f8;\n  border-radius: 5px;\n  padding: 5px;\n`\n\nconst ItemLink = styled(Link)`\n  text-decoration: none;\n  color: black;\n`\n\nconst ItemTitle = styled.p`\n  line-height: 1.45em;\n`\n\nconst ItemPrice = styled.p`\n  color: #ff5100;\n`\n\nexport default class ProductItem extends Component {\n  render() {\n    const { node } = this.props\n    return (\n      <GridItem>\n        <ItemLink to={`${node.uid}`}>\n          <Img fluid={node.data.image.localFile.childImageSharp.fluid} />\n          <ItemTitle>{node.data.title.text}</ItemTitle>\n        </ItemLink>\n        <ItemPrice>${node.data.price}</ItemPrice>\n        <form\n          action=\"https://upsafetysolutions.foxycart.com/cart\"\n          method=\"post\"\n          accept-charset=\"utf-8\"\n        >\n          <input\n            type=\"hidden\"\n            name={`${node.data.name_hmac.text}`}\n            value={`${node.data.name.text}`}\n          />\n          <input\n            type=\"hidden\"\n            name={`${node.data.price_hmac.text}`}\n            value={`${node.data.price}`}\n          />\n          <input\n            type=\"hidden\"\n            name={`${node.data.item_code_hmac.text}`}\n            value={`${node.data.item_code_sku.text}`}\n          />\n          <input\n            type=\"hidden\"\n            name={`${node.data.cart_image_hmac.text}`}\n            value={`${node.data.cart_image.url}`}\n          />\n          <input\n            type=\"hidden\"\n            name={`${node.data.weight_hmac.text}`}\n            value={`${node.data.weight}`}\n          />\n          <AddToCartBtn\n            type=\"submit\"\n            value=\"Add To Cart\"\n            className=\"submit\"\n            style={{justifySelf:`end`,}}\n          >\n            ADD TO CART\n          </AddToCartBtn>\n          \n        </form>\n      </GridItem>\n    )\n  }\n}\n\nProductItem.propTypes = {\n  node: PropTypes.object.isRequired,\n  categories: PropTypes.array.isRequired,\n}", "domain": "javascript", "lang": "code", "char_count": 2238, "word_count": 551, "byte_count": 2238}
{"text": "require([\n    'dijit/_WidgetBase',\n\n    'dojo/dom-construct',\n\n    'app/ListPicker'\n], function (\n    _WidgetBase,\n\n    domConstruct,\n\n    ListPicker\n) {\n    describe('ListPicker Widget', function () {\n        var testWidget;\n        beforeEach(function () {\n            testWidget = new ListPicker({\n                availableListArray: [\n                    {code: 'testcode', name: 'testvalue'},\n                    {code: 'testcode2', name: 'testvalue2'}\n                ],\n                listName: 'Species'\n            }, domConstruct.create('div', null, document.body));\n        });\n\n        afterEach(function () {\n            testWidget.destroy();\n            testWidget = null;\n        });\n\n        it('Should create a valid instance of _widget', function () {\n            expect(testWidget).toEqual(jasmine.any(ListPicker));\n        });\n    });\n});", "domain": "javascript", "lang": "code", "char_count": 859, "word_count": 157, "byte_count": 859}
{"text": "import {\n  sortTimeCreator,\n  sortTimeSuccessCreator,\n} from \"../../store/reducers/sortReducers/sortTimeReducer\";\n\nconst weekDays = [\"Sun.\", \"Mon.\", \"Tue.\", \"Wed.\", \"Thu.\", \"Fri.\", \"Sat.\"];\nconst months = [\n  \"Jan.\",\n  \"Feb.\",\n  \"Mar.\",\n  \"Apr.\",\n  \"May\",\n  \"Jun.\",\n  \"Jul.\",\n  \"Aug.\",\n  \"Sep.\",\n  \"Oct.\",\n  \"Nov.\",\n  \"Dec.\",\n];\n\nexport function sortMain(time, xArr, typeForCheck) {\n  return async (dispatch) => {\n    dispatch(sortTimeCreator());\n\n    const WIDTH = 700;\n    const X_PADDING = 80;\n    const VIEW_WIDTH = WIDTH - X_PADDING * 2;\n    const xRatio = Math.round(VIEW_WIDTH / (xArr.length - 2));\n\n    const xAllStep = [];\n    const timeForX = [];\n    const allTimeForX = [];\n    let xIterStep = 4;\n\n    const allYear = [];\n    const allMonth = [];\n    const allHours = [];\n    const sortedYear = [];\n    const sortedHours = [];\n    const outputHours = [];\n    const sortedMonth = [];\n    const outputYear = [];\n    const outputMonth = [];\n    const outputDate = [];\n\n    const outputLines = []; // xDoneStep\n    const outputX = []; // xDoneTextStep\n    const outputTime = []; // time\n\n    for (let i = 0; i < time.length; i++) {\n      typeForCheck == \"1d\"\n        ? timeForX.push(time[i].getHours())\n        : typeForCheck == \"7d\"\n        ? timeForX.push(time[i].getDay())\n        : typeForCheck == \"1m\" || typeForCheck == \"3m\"\n        ? allMonth.push(time[i].getMonth()) &&\n          timeForX.push(time[i].getDate()) &&\n          allHours.push(time[i].getHours())\n        : typeForCheck == \"1y\"\n        ? allMonth.push(time[i].getMonth()) &&\n          timeForX.push(time[i].getDate()) &&\n          allYear.push(time[i].getFullYear())\n        : null;\n    }\n\n    for (let i = 0; i < xArr.length - 1; i++) {\n      if (timeForX[i] !== timeForX[i + 1]) {\n        typeForCheck !== \"3m\" && typeForCheck !== \"1y\"\n          ? xArr[i + 1]\n            ? xAllStep.push(xArr[i + 1] * xRatio + X_PADDING)\n            : xAllStep.push(xArr[i] * xRatio + X_PADDING)\n          : null;\n\n        typeForCheck == \"1d\"\n          ? allTimeForX.push(timeForX[i + 1])\n          : typeForCheck == \"7d\"\n          ? allTimeForX.push(timeForX[i])\n          : typeForCheck == \"1m\"\n          ? allTimeForX.push(timeForX[i + 1]) &&\n            sortedMonth.push(allMonth[i + 1]) &&\n            sortedHours.push(allHours[i + 1])\n          : // (allMonth[i + 1] ? sortedMonth.push(allMonth[i + 1]) : null)\n            null;\n\n        typeForCheck == \"3m\" && allMonth[i] !== allMonth[i + 1]\n          ? allTimeForX.push(timeForX[i + 1]) &&\n            xAllStep.push(xArr[i + 1] * xRatio + X_PADDING) &&\n            sortedMonth.push(allMonth[i + 1]) &&\n            sortedHours.push(allHours[i + 1])\n          : null;\n\n        typeForCheck == \"1y\" && allYear[i] !== allYear[i + 1]\n          ? allTimeForX.push(timeForX[i + 1]) &&\n            xAllStep.push(xArr[i + 1] * xRatio + X_PADDING) &&\n            sortedMonth.push(allMonth[i + 1]) &&\n            sortedYear.push(allYear[i + 1])\n          : null;\n      }\n    }\n\n    if (allTimeForX.length == 6 && typeForCheck == \"7d\") {\n      allTimeForX[allTimeForX.length - 1] < 6\n        ? allTimeForX.push(allTimeForX[allTimeForX.length - 1] + 1)\n        : allTimeForX[allTimeForX.length - 1] == 6\n        ? allTimeForX.push(0)\n        : null;\n      xAllStep.push(xAllStep[0] - X_PADDING);\n    }\n\n    typeForCheck == \"7d\" || typeForCheck == \"3m\" || typeForCheck == \"1y\"\n      ? (xIterStep = 1)\n      : typeForCheck == \"1m\"\n      ? (xIterStep = 5)\n      : null;\n\n    for (let i = 0; i < allTimeForX.length; i += xIterStep) {\n      outputX.push(xAllStep[i]);\n      outputLines.push(xAllStep[i]);\n\n      typeForCheck == \"1d\"\n        ? outputTime.push(allTimeForX[i])\n        : typeForCheck == \"7d\"\n        ? outputTime.push(weekDays[allTimeForX[i]])\n        : typeForCheck == \"1m\" || typeForCheck == \"3m\"\n        ? outputMonth.push(sortedMonth[i]) &&\n          outputDate.push(allTimeForX[i]) &&\n          outputHours.push(sortedHours[i])\n        : typeForCheck == \"1y\"\n        ? outputMonth.push(sortedMonth[i]) &&\n          outputDate.push(allTimeForX[i]) &&\n          outputYear.push(sortedYear[i])\n        : null;\n    }\n\n    if (typeForCheck == \"7d\") {\n      if (X_PADDING > xAllStep[0] - 55) {\n        const excess = outputX.shift();\n        outputX.unshift(xAllStep[0] + VIEW_WIDTH + X_PADDING / 2);\n      }\n\n      if (X_PADDING > xAllStep[xAllStep.length - 1] - 55) {\n        const excess = outputX.pop();\n        outputX.push(\n          xAllStep[xAllStep.length - 1] + VIEW_WIDTH + X_PADDING / 2\n        );\n      }\n    }\n\n    if (typeForCheck == \"1m\" || typeForCheck == \"3m\") {\n      for (let i = 0; i < outputDate.length; i++) {\n        outputTime.push(\n          outputDate[i] +\n            \" \" +\n            months[outputMonth[i]] +\n            \" \" +\n            outputHours[i] +\n            \"h.\"\n        );\n      }\n    } else if (typeForCheck == \"1y\") {\n      for (let i = 0; i < outputDate.length; i++) {\n        outputTime.push(\n          outputDate[i] + \" \" + months[outputMonth[i]] + \" \" + outputYear[i]\n        );\n      }\n    }\n\n    dispatch(sortTimeSuccessCreator({ outputTime, outputX, outputLines }));\n  };\n}", "domain": "javascript", "lang": "code", "char_count": 5142, "word_count": 1285, "byte_count": 5142}
{"text": "/* global angular, gscDatacat */\n\n'use strict';\nangular.module('gscDatacat.services')\n    .factory('dataSvc', [\n        '$rootScope',\n        '$state',\n        'authSvc',\n        '$http',\n        '$q',\n        function($rootScope,\n            $state,\n            authSvc,\n            $http,\n            $q) {\n\n            var self = this;\n\n            self.loadLayers = function() {\n                var dfd = $q.defer();\n                gsc.layer.list(null, null, null, authSvc.authUsr.organizationId)\n                    .then(function(res) {\n                        if (res.status !== 'error' &&\n                            gsc.util.isArrayWithContent(res.layers)) {\n                            dfd.resolve(res.layers);\n                            $rootScope.console.log('Loaded layers');\n                        } else if (res.status === 'error') {\n                            dfd.reject('An error occurred while loading layers');\n                            dfd.reject(res.description);\n                            $rootScope.console.log(res);\n                        } else {\n                            dfd.reject('An error occurred while loading layers');\n                            $rootScope.console.log(res);\n                        }\n                    }, function(err) {\n                        dfd.resolve(err.statusText);\n                    });\n                return dfd.promise;\n            };\n\n            self.loadLayer = function(layerId) {\n                var dfd = $q.defer();\n                gsc.layer.list(null, layerId)\n                    .then(function(res) {\n                        if (res.status !== 'error' &&\n                            gsc.util.isArrayWithContent(res.layers)) {\n                            $rootScope.console.log(res.layers[0]);\n                            dfd.resolve(res.layers[0]);\n                        } else if (res.status === 'error') {\n                            dfd.reject(res.description);\n                        } else {\n                            dfd.reject(\n                                'No layer data returned for specified id');\n                        }\n                    }, function(err) {\n                        dfd.resolve(err.statusText);\n                    });\n                return dfd.promise;\n            };\n\n            self.loadDataSources = function() {\n                var dfd = $q.defer();\n                gsc.datasource.list(null, authSvc.authUsr.organizationId, null, true)\n                    .then(function(res) {\n                        $rootScope.console.log('Loading data sources');\n                        if (gsc.util.isArrayWithContent(res.datasources)) {\n                            dfd.resolve(res.datasources);\n                        } else {\n                            $rootScope.console.error('No data sources');\n                            dfd.reject('No data sources');\n                        }\n                    }, function(err) {\n                        dfd.reject(err.statusText);\n                    });\n                return dfd.promise;\n            };\n\n            self.loadDataOrigin = function(dataSourceId) {\n                var dfd = $q.defer();\n                gsc.datasource.listDataOrigin(dataSourceId)\n                    .then(function(res) {\n                        $rootScope.console.log('Loading data origin');\n                        if (res.status !== 'error' &&\n                            res.dataorigin !== undefined &&\n                            jQuery.isArray(res.dataorigin)) {\n                            dfd.resolve(res.dataorigin);\n                        } else if (res.status === 'error') {\n                            dfd.reject(res.description);\n                        } else {\n                            dfd.reject('Error during loading of data origin');\n                        }\n                    }, function(err) {\n                        dfd.reject(err.statusText);\n                    });\n\n                return dfd.promise;\n            };\n\n            self.loadDataSource = function(dataSourceId) {\n                var dfd = $q.defer();\n                gsc.datasource.list(dataSourceId, null, null, true)\n                    .then(function(res) {\n                        if (res.datasources.length > 0) {\n                            dfd.resolve(res.datasources[0]);\n                        } else {\n                            dfd.reject('No data sources');\n                        }\n                    }, function(err) {\n                        dfd.reject(err.statusText);\n                    });\n                return dfd.promise;\n            };\n\n            self.loadDataSet = function(dataSetId) {\n                var dfd = $q.defer();\n                gsc.dataset.list(undefined, +dataSetId, undefined, undefined)\n                    .then(function(res) {\n                        if (res.status !== 'error' && res.dataset.length > 0) {\n                            dfd.resolve(res.dataset[0]);\n                        } else if (res.status === 'error') {\n                            dfd.reject(res.description);\n                        } else {\n                            dfd.reject('No data sources');\n                        }\n                    }, function(err) {\n                        dfd.reject(err.statusText);\n                    });\n                return dfd.promise;\n            };\n\n            self.listDataSetColumns = function(dataSetId) {\n                var dfd = $q.defer();\n                gsc.dataset.listCols(+dataSetId).\n                    then(function(res) {\n                        console.log(res);\n                        if (res.status !== 'error') {\n                            dfd.resolve(res.columns);\n                        } else {\n                            dfd.reject(res.description);\n                        }\n                    }, function(err) {\n                        dfd.reject(err.statusText);\n                    });\n                return dfd.promise;\n            };\n\n            self.loadDataSets = function(dataSourceId) {\n                var dfd = $q.defer();\n                gsc.dataset.list(dataSourceId,\n                    undefined,\n                    undefined,\n                    authSvc.authUsr.organizationId)\n                    .then(function(res) {\n                        if (res.dataset.length > 0) {\n                            dfd.resolve(res.dataset);\n                        } else {\n                            dfd.reject('No data sources');\n                        }\n                    }, function(err) {\n                        dfd.reject(err.statusText);\n                    });\n                return dfd.promise;\n            };\n\n            self.loadOrganizations = function() {\n                var dfd = $q.defer();\n\n                gsc.organization.list().then(function(res) {\n                    $rootScope.console.log('Loading organizations');\n                    if (res.status !== 'error' && gsc.util.isArrayWithContent(\n                        res.organizations)) {\n                        dfd.resolve(res.organizations);\n                    } else if (res.status === 'error') {\n                        dfd.reject(res.description);\n                    } else {\n                        dfd.reject('No organizations available');\n                    }\n                }, function(err) {\n                    dfd.reject(err.statusText);\n                });\n\n                return dfd.promise;\n            };\n\n            self.loadUsers = function() {\n                var dfd = $q.defer();\n\n                gsc.user.list(+authSvc.authUsr.organizationId)\n                    .then(function(res) {\n\n                        if (typeof res.users === 'string') {\n                            res.users = JSON.parse(res.users);\n                        }\n\n                        $rootScope.console.log('Loaded users for organization');\n                        if (gsc.util.isArrayWithContent(\n                            res.users)) {\n                            dfd.resolve(res.users);\n                        } else if (res.status === 'error') {\n                            dfd.reject(res.description);\n                        } else {\n                            dfd.reject('No users returned');\n                            $rootScope.console.log(res);\n                        }\n                    }, function(err) {\n                        dfd.reject(err.statusText);\n                    });\n\n                return dfd.promise;\n            };\n\n            self.loadUser = function(userId) {\n                var dfd = $q.defer();\n\n                gsc.user.list(+authSvc.authUsr.organizationId)\n                    .then(function(userListResponse) {\n                        $rootScope.console.info('Loaded user');\n                        if (gsc.util.isArrayWithContent(\n                            userListResponse.users)) {\n                            dfd.resolve(userListResponse.users);\n                        } else if (userListResponse.status === 'error') {\n                            $rootScope.console.error('An error occurred loading users');\n                            dfd.reject(userListResponse.description);\n                            $rootScope.console.debug(userListResponse);\n                        } else {\n                            $rootScope.console.info('No users returned');\n                            dfd.reject('No users returned');\n                        }\n                    }, function(err) {\n                        $rootScope.console.error('An error occurred loading users');\n                        $rootScope.console.debug(err);\n                        dfd.reject(err.statusText);\n                    });\n\n                return dfd.promise;\n            };\n\n            self.loadRoles = function() {\n                var dfd = $q.defer();\n                gsc.role.listrole(authSvc.authUsr.organizationId, null, true)\n                    .then(function(res) {\n                        if (res.status !== 'error' && gsc.util.isArrayWithContent(res.roles)) {\n                            $rootScope.console.info('Loaded roles');\n                            dfd.resolve(res.roles);\n                        } else {\n                            $rootScope.console.error('An error occurred loading roles');\n                            dfd.reject(res.description);\n                        }\n                    }, function(err) {\n                        $rootScope.console.error('An error occurred loading roles');\n                        $rootScope.console.debug(err);\n                        dfd.reject(err.statusText);\n                    });\n                return dfd.promise;\n            };\n\n            self.loadPermissions = function(roleId) {\n                var dfd = $q.defer();\n                gsc.permission.list(roleId)\n                    .then(function(res) {\n                        if (res.description === undefined &&\n                            gsc.util.isArrayWithContent(res.functions)) {\n                            $rootScope.console.info('Loaded permissions');\n                            dfd.resolve(res.functions);\n                        } else if (res.description !== undefined &&\n                            res.description === 'No results found.') {\n                            $rootScope.console.info('No permissions found for role');\n                            dfd.resolve([]);\n                        } else {\n                            $rootScope.console.error('An error occurred loading permissions');\n                            $rootScope.console.debug(res);\n                            dfd.reject(res.description);\n                        }\n                    }, function(err) {\n                        $rootScope.console.error('An error occurred loading permissions');\n                        $rootScope.console.debug(err);\n                        dfd.reject(err.statusText);\n                    });\n                return dfd.promise;\n            };\n\n            self.loadGroupLayers = function() {\n                var dfd = $q.defer();\n                gsc.grouplayer.list(authSvc.authUsr.organizationId)\n                    .then(function(res) {\n                        if (res.status !== 'error' &&\n                            gsc.util.isArrayWithContent(res.grouplayers)) {\n                            $rootScope.console.log('Loaded group layers');\n                            dfd.resolve(res.grouplayers);\n                        } else {\n                            $rootScope.console.log('An error occurred loading group layers');\n                            $rootScope.console.log(res);\n                            dfd.reject(res.description);\n                        }\n                    }, function(err) {\n                        $rootScope.console.log('An error occurred loading group layers');\n                        dfd.reject(err.statusText);\n                    });\n\n                return dfd.promise;\n            };\n\n            self.loadGroupLayer = function(groupLayerId) {\n                var dfd = $q.defer();\n                gsc.grouplayer.list(null, null, groupLayerId)\n                    .then(function(res) {\n                        if (res.status !== 'error' &&\n                            gsc.util.isArrayWithContent(res.grouplayers)) {\n                            $rootScope.console.log('Loaded group layer');\n                            dfd.resolve(res.grouplayers[0]);\n                        } else {\n                            $rootScope.console.log('An error occurred loading group layer');\n                            $rootScope.console.log(res);\n                            dfd.reject(res.description);\n                        }\n                    }, function(err) {\n                        $rootScope.console.log('An error occurred loading group layer');\n                        dfd.reject(err.statusText);\n                    });\n\n                return dfd.promise;\n            };\n\n            self.loadFunctions = function() {\n                var dfd = $q.defer();\n                gsc.function.list(authSvc.authUsr.organizationId)\n                    .then(function(res) {\n                        if (res.status !== 'error' &&\n                            gsc.util.isArrayWithContent(res.functions)) {\n                            $rootScope.console.log('Loaded functions');\n                            dfd.resolve(res.functions);\n                        } else {\n                            $rootScope.console.log('An error occurred loading functions');\n                            dfd.reject(res.description);\n                            $rootScope.console.log(res);\n                        }\n                    }, function(err) {\n                        $rootScope.console.log('An error occurred loading functions');\n                        dfd.reject(err.statusText);\n                    });\n                return dfd.promise;\n            };\n\n            self.loadApplications = function() {\n                var dfd = $q.defer();\n\n                gsc.application.list(authSvc.authUsr.organizationId, undefined, undefined)\n                    .then(function(res) {\n                        if (res.status !== 'error' && gsc.util.isArrayWithContent(\n                            res.applications)) {\n                            $rootScope.console.log('Loaded applications');\n                            dfd.resolve(res.applications);\n                        } else {\n                            $rootScope.console.log(\n                                'An error occurred loading applications');\n                            $rootScope.console.log(res.description);\n                            $rootScope.console.log(res);\n                            dfd.reject(res.description);\n                        }\n                    }, function(err) {\n                        $rootScope.console.log(\n                            'An error occurred loading applications');\n                        $rootScope.console.log(err);\n                        dfd.reject(err.statusText);\n                    });\n\n                return dfd.promise;\n            };\n\n            self.loadApplication = function(applicationId) {\n                var dfd = $q.defer();\n\n                gsc.application.list(null, null, applicationId)\n                    .then(function(res) {\n                        if (res.status !== 'error' && gsc.util.isArrayWithContent(\n                            res.applications)) {\n                            $rootScope.console.log('Loaded application');\n                            dfd.resolve(res.applications[0]);\n                        } else {\n                            $rootScope.console.log(\n                                'An error occurred loading application');\n                            $rootScope.console.log(res.description);\n                            $rootScope.console.log(res);\n                            dfd.reject(res.description);\n                        }\n                    }, function(err) {\n                        $rootScope.console.log(\n                            'An error occurred loading applications');\n                        $rootScope.console.log(err);\n                        dfd.reject(err.statusText);\n                    });\n\n                return dfd.promise;\n            };\n\n            return self;\n\n        }]);", "domain": "javascript", "lang": "code", "char_count": 17327, "word_count": 2797, "byte_count": 17327}
{"text": "import { connect } from 'react-redux'\nimport { withRouter } from 'react-router-dom'\nimport { push } from 'connected-react-router'\nimport Submit from './Submit'\n\nimport {\n  closeSubmitAction,\n  onInputNameAction,\n  onInputUrlAction,\n  onInputDescAction,\n  onImgReadAction,\n  onImgZoomAction,\n  onImgMoveControlAction,\n  onImgMoveAction,\n  onImgDoneAction,\n  onImgCancelAction,\n  submitAction,\n  switchToRatingAction,\n  onInputSntValueAction,\n} from './Submit.reducer'\n\nconst mapStateToProps = state =>\n  Object.assign(state.submit, { dapps: state.dapps.dapps })\nconst mapDispatchToProps = dispatch => ({\n  onClickClose: () => dispatch(closeSubmitAction()),\n  onInputName: name => dispatch(onInputNameAction(name)),\n  onInputDesc: name => dispatch(onInputDescAction(name)),\n  onInputUrl: name => dispatch(onInputUrlAction(name)),\n  onImgRead: imgBase64 => dispatch(onImgReadAction(imgBase64)),\n  onImgZoom: zoom => dispatch(onImgZoomAction(zoom)),\n  onImgMoveControl: move => dispatch(onImgMoveControlAction(move)),\n  onImgMove: (x, y) => dispatch(onImgMoveAction(x, y)),\n  onImgCancel: () => dispatch(onImgCancelAction()),\n  onImgDone: imgBase64 => dispatch(onImgDoneAction(imgBase64)),\n  onSubmit: (dapp, sntValue) => dispatch(submitAction(dapp, sntValue)),\n  onClickTerms: () => dispatch(push('/terms')),\n  switchToRating: () => dispatch(switchToRatingAction()),\n  onInputSntValue: sntValue => dispatch(onInputSntValueAction(sntValue)),\n})\n\nexport default withRouter(\n  connect(\n    mapStateToProps,\n    mapDispatchToProps,\n  )(Submit),\n)", "domain": "javascript", "lang": "code", "char_count": 1539, "word_count": 288, "byte_count": 1539}
{"text": "THREE.VTKLoader = function ( manager ) {\n\n\tTHREE.Loader.call( this, manager );\n\n};\n\nTHREE.VTKLoader.prototype = Object.assign( Object.create( THREE.Loader.prototype ), {\n\n\tconstructor: THREE.VTKLoader,\n\n\tload: function ( url, onLoad, onProgress, onError ) {\n\n\t\tvar scope = this;\n\n\t\tvar loader = new THREE.FileLoader( scope.manager );\n\t\tloader.setPath( scope.path );\n\t\tloader.setResponseType( 'arraybuffer' );\n\t\tloader.setRequestHeader( scope.requestHeader );\n\t\tloader.setWithCredentials( scope.withCredentials );\n\t\tloader.load( url, function ( text ) {\n\n\t\t\ttry {\n\n\t\t\t\tonLoad( scope.parse( text ) );\n\n\t\t\t} catch ( e ) {\n\n\t\t\t\tif ( onError ) {\n\n\t\t\t\t\tonError( e );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconsole.error( e );\n\n\t\t\t\t}\n\n\t\t\t\tscope.manager.itemError( url );\n\n\t\t\t}\n\n\t\t}, onProgress, onError );\n\n\t},\n\n\tparse: function ( data ) {\n\n\t\tfunction parseASCII( data ) {\n\n\t\t\t// connectivity of the triangles\n\t\t\tvar indices = [];\n\n\t\t\t// triangles vertices\n\t\t\tvar positions = [];\n\n\t\t\t// red, green, blue colors in the range 0 to 1\n\t\t\tvar colors = [];\n\n\t\t\t// normal vector, one per vertex\n\t\t\tvar normals = [];\n\n\t\t\tvar result;\n\n\t\t\t// pattern for detecting the end of a number sequence\n\t\t\tvar patWord = /^[^\\d.\\s-]+/;\n\n\t\t\t// pattern for reading vertices, 3 floats or integers\n\t\t\tvar pat3Floats = /(\\-?\\d+\\.?[\\d\\-\\+e]*)\\s+(\\-?\\d+\\.?[\\d\\-\\+e]*)\\s+(\\-?\\d+\\.?[\\d\\-\\+e]*)/g;\n\n\t\t\t// pattern for connectivity, an integer followed by any number of ints\n\t\t\t// the first integer is the number of polygon nodes\n\t\t\tvar patConnectivity = /^(\\d+)\\s+([\\s\\d]*)/;\n\n\t\t\t// indicates start of vertex data section\n\t\t\tvar patPOINTS = /^POINTS /;\n\n\t\t\t// indicates start of polygon connectivity section\n\t\t\tvar patPOLYGONS = /^POLYGONS /;\n\n\t\t\t// indicates start of triangle strips section\n\t\t\tvar patTRIANGLE_STRIPS = /^TRIANGLE_STRIPS /;\n\n\t\t\t// POINT_DATA number_of_values\n\t\t\tvar patPOINT_DATA = /^POINT_DATA[ ]+(\\d+)/;\n\n\t\t\t// CELL_DATA number_of_polys\n\t\t\tvar patCELL_DATA = /^CELL_DATA[ ]+(\\d+)/;\n\n\t\t\t// Start of color section\n\t\t\tvar patCOLOR_SCALARS = /^COLOR_SCALARS[ ]+(\\w+)[ ]+3/;\n\n\t\t\t// NORMALS Normals float\n\t\t\tvar patNORMALS = /^NORMALS[ ]+(\\w+)[ ]+(\\w+)/;\n\n\t\t\tvar inPointsSection = false;\n\t\t\tvar inPolygonsSection = false;\n\t\t\tvar inTriangleStripSection = false;\n\t\t\tvar inPointDataSection = false;\n\t\t\tvar inCellDataSection = false;\n\t\t\tvar inColorSection = false;\n\t\t\tvar inNormalsSection = false;\n\n\t\t\tvar lines = data.split( '\\n' );\n\n\t\t\tfor ( var i in lines ) {\n\n\t\t\t\tvar line = lines[ i ].trim();\n\n\t\t\t\tif ( line.indexOf( 'DATASET' ) === 0 ) {\n\n\t\t\t\t\tvar dataset = line.split( ' ' )[ 1 ];\n\n\t\t\t\t\tif ( dataset !== 'POLYDATA' ) throw new Error( 'Unsupported DATASET type: ' + dataset );\n\n\t\t\t\t} else if ( inPointsSection ) {\n\n\t\t\t\t\t// get the vertices\n\t\t\t\t\twhile ( ( result = pat3Floats.exec( line ) ) !== null ) {\n\n\t\t\t\t\t\tif ( patWord.exec( line ) !== null ) break;\n\n\t\t\t\t\t\tvar x = parseFloat( result[ 1 ] );\n\t\t\t\t\t\tvar y = parseFloat( result[ 2 ] );\n\t\t\t\t\t\tvar z = parseFloat( result[ 3 ] );\n\t\t\t\t\t\tpositions.push( x, y, z );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( inPolygonsSection ) {\n\n\t\t\t\t\tif ( ( result = patConnectivity.exec( line ) ) !== null ) {\n\n\t\t\t\t\t\t// numVertices i0 i1 i2 ...\n\t\t\t\t\t\tvar numVertices = parseInt( result[ 1 ] );\n\t\t\t\t\t\tvar inds = result[ 2 ].split( /\\s+/ );\n\n\t\t\t\t\t\tif ( numVertices >= 3 ) {\n\n\t\t\t\t\t\t\tvar i0 = parseInt( inds[ 0 ] );\n\t\t\t\t\t\t\tvar i1, i2;\n\t\t\t\t\t\t\tvar k = 1;\n\t\t\t\t\t\t\t// split the polygon in numVertices - 2 triangles\n\t\t\t\t\t\t\tfor ( var j = 0; j < numVertices - 2; ++ j ) {\n\n\t\t\t\t\t\t\t\ti1 = parseInt( inds[ k ] );\n\t\t\t\t\t\t\t\ti2 = parseInt( inds[ k + 1 ] );\n\t\t\t\t\t\t\t\tindices.push( i0, i1, i2 );\n\t\t\t\t\t\t\t\tk ++;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( inTriangleStripSection ) {\n\n\t\t\t\t\tif ( ( result = patConnectivity.exec( line ) ) !== null ) {\n\n\t\t\t\t\t\t// numVertices i0 i1 i2 ...\n\t\t\t\t\t\tvar numVertices = parseInt( result[ 1 ] );\n\t\t\t\t\t\tvar inds = result[ 2 ].split( /\\s+/ );\n\n\t\t\t\t\t\tif ( numVertices >= 3 ) {\n\n\t\t\t\t\t\t\tvar i0, i1, i2;\n\t\t\t\t\t\t\t// split the polygon in numVertices - 2 triangles\n\t\t\t\t\t\t\tfor ( var j = 0; j < numVertices - 2; j ++ ) {\n\n\t\t\t\t\t\t\t\tif ( j % 2 === 1 ) {\n\n\t\t\t\t\t\t\t\t\ti0 = parseInt( inds[ j ] );\n\t\t\t\t\t\t\t\t\ti1 = parseInt( inds[ j + 2 ] );\n\t\t\t\t\t\t\t\t\ti2 = parseInt( inds[ j + 1 ] );\n\t\t\t\t\t\t\t\t\tindices.push( i0, i1, i2 );\n\n\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\ti0 = parseInt( inds[ j ] );\n\t\t\t\t\t\t\t\t\ti1 = parseInt( inds[ j + 1 ] );\n\t\t\t\t\t\t\t\t\ti2 = parseInt( inds[ j + 2 ] );\n\t\t\t\t\t\t\t\t\tindices.push( i0, i1, i2 );\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( inPointDataSection || inCellDataSection ) {\n\n\t\t\t\t\tif ( inColorSection ) {\n\n\t\t\t\t\t\t// Get the colors\n\n\t\t\t\t\t\twhile ( ( result = pat3Floats.exec( line ) ) !== null ) {\n\n\t\t\t\t\t\t\tif ( patWord.exec( line ) !== null ) break;\n\n\t\t\t\t\t\t\tvar r = parseFloat( result[ 1 ] );\n\t\t\t\t\t\t\tvar g = parseFloat( result[ 2 ] );\n\t\t\t\t\t\t\tvar b = parseFloat( result[ 3 ] );\n\t\t\t\t\t\t\tcolors.push( r, g, b );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else if ( inNormalsSection ) {\n\n\t\t\t\t\t\t// Get the normal vectors\n\n\t\t\t\t\t\twhile ( ( result = pat3Floats.exec( line ) ) !== null ) {\n\n\t\t\t\t\t\t\tif ( patWord.exec( line ) !== null ) break;\n\n\t\t\t\t\t\t\tvar nx = parseFloat( result[ 1 ] );\n\t\t\t\t\t\t\tvar ny = parseFloat( result[ 2 ] );\n\t\t\t\t\t\t\tvar nz = parseFloat( result[ 3 ] );\n\t\t\t\t\t\t\tnormals.push( nx, ny, nz );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( patPOLYGONS.exec( line ) !== null ) {\n\n\t\t\t\t\tinPolygonsSection = true;\n\t\t\t\t\tinPointsSection = false;\n\t\t\t\t\tinTriangleStripSection = false;\n\n\t\t\t\t} else if ( patPOINTS.exec( line ) !== null ) {\n\n\t\t\t\t\tinPolygonsSection = false;\n\t\t\t\t\tinPointsSection = true;\n\t\t\t\t\tinTriangleStripSection = false;\n\n\t\t\t\t} else if ( patTRIANGLE_STRIPS.exec( line ) !== null ) {\n\n\t\t\t\t\tinPolygonsSection = false;\n\t\t\t\t\tinPointsSection = false;\n\t\t\t\t\tinTriangleStripSection = true;\n\n\t\t\t\t} else if ( patPOINT_DATA.exec( line ) !== null ) {\n\n\t\t\t\t\tinPointDataSection = true;\n\t\t\t\t\tinPointsSection = false;\n\t\t\t\t\tinPolygonsSection = false;\n\t\t\t\t\tinTriangleStripSection = false;\n\n\t\t\t\t} else if ( patCELL_DATA.exec( line ) !== null ) {\n\n\t\t\t\t\tinCellDataSection = true;\n\t\t\t\t\tinPointsSection = false;\n\t\t\t\t\tinPolygonsSection = false;\n\t\t\t\t\tinTriangleStripSection = false;\n\n\t\t\t\t} else if ( patCOLOR_SCALARS.exec( line ) !== null ) {\n\n\t\t\t\t\tinColorSection = true;\n\t\t\t\t\tinNormalsSection = false;\n\t\t\t\t\tinPointsSection = false;\n\t\t\t\t\tinPolygonsSection = false;\n\t\t\t\t\tinTriangleStripSection = false;\n\n\t\t\t\t} else if ( patNORMALS.exec( line ) !== null ) {\n\n\t\t\t\t\tinNormalsSection = true;\n\t\t\t\t\tinColorSection = false;\n\t\t\t\t\tinPointsSection = false;\n\t\t\t\t\tinPolygonsSection = false;\n\t\t\t\t\tinTriangleStripSection = false;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tvar geometry = new THREE.BufferGeometry();\n\t\t\tgeometry.setIndex( indices );\n\t\t\tgeometry.setAttribute( 'position', new THREE.Float32BufferAttribute( positions, 3 ) );\n\n\t\t\tif ( normals.length === positions.length ) {\n\n\t\t\t\tgeometry.setAttribute( 'normal', new THREE.Float32BufferAttribute( normals, 3 ) );\n\n\t\t\t}\n\n\t\t\tif ( colors.length !== indices.length ) {\n\n\t\t\t\t// stagger\n\n\t\t\t\tif ( colors.length === positions.length ) {\n\n\t\t\t\t\tgeometry.setAttribute( 'color', new THREE.Float32BufferAttribute( colors, 3 ) );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t// cell\n\n\t\t\t\tgeometry = geometry.toNonIndexed();\n\t\t\t\tvar numTriangles = geometry.attributes.position.count / 3;\n\n\t\t\t\tif ( colors.length === ( numTriangles * 3 ) ) {\n\n\t\t\t\t\tvar newColors = [];\n\n\t\t\t\t\tfor ( var i = 0; i < numTriangles; i ++ ) {\n\n\t\t\t\t\t\tvar r = colors[ 3 * i + 0 ];\n\t\t\t\t\t\tvar g = colors[ 3 * i + 1 ];\n\t\t\t\t\t\tvar b = colors[ 3 * i + 2 ];\n\n\t\t\t\t\t\tnewColors.push( r, g, b );\n\t\t\t\t\t\tnewColors.push( r, g, b );\n\t\t\t\t\t\tnewColors.push( r, g, b );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tgeometry.setAttribute( 'color', new THREE.Float32BufferAttribute( newColors, 3 ) );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn geometry;\n\n\t\t}\n\n\t\tfunction parseBinary( data ) {\n\n\t\t\tvar count, pointIndex, i, numberOfPoints, s;\n\t\t\tvar buffer = new Uint8Array( data );\n\t\t\tvar dataView = new DataView( data );\n\n\t\t\t// Points and normals, by default, are empty\n\t\t\tvar points = [];\n\t\t\tvar normals = [];\n\t\t\tvar indices = [];\n\n\t\t\t// Going to make a big array of strings\n\t\t\tvar vtk = [];\n\t\t\tvar index = 0;\n\n\t\t\tfunction findString( buffer, start ) {\n\n\t\t\t\tvar index = start;\n\t\t\t\tvar c = buffer[ index ];\n\t\t\t\tvar s = [];\n\t\t\t\twhile ( c !== 10 ) {\n\n\t\t\t\t\ts.push( String.fromCharCode( c ) );\n\t\t\t\t\tindex ++;\n\t\t\t\t\tc = buffer[ index ];\n\n\t\t\t\t}\n\n\t\t\t\treturn { start: start,\n\t\t\t\t\tend: index,\n\t\t\t\t\tnext: index + 1,\n\t\t\t\t\tparsedString: s.join( '' ) };\n\n\t\t\t}\n\n\t\t\tvar state, line;\n\n\t\t\twhile ( true ) {\n\n\t\t\t\t// Get a string\n\t\t\t\tstate = findString( buffer, index );\n\t\t\t\tline = state.parsedString;\n\n\t\t\t\tif ( line.indexOf( 'DATASET' ) === 0 ) {\n\n\t\t\t\t\tvar dataset = line.split( ' ' )[ 1 ];\n\n\t\t\t\t\tif ( dataset !== 'POLYDATA' ) throw new Error( 'Unsupported DATASET type: ' + dataset );\n\n\t\t\t\t} else if ( line.indexOf( 'POINTS' ) === 0 ) {\n\n\t\t\t\t\tvtk.push( line );\n\t\t\t\t\t// Add the points\n\t\t\t\t\tnumberOfPoints = parseInt( line.split( ' ' )[ 1 ], 10 );\n\n\t\t\t\t\t// Each point is 3 4-byte floats\n\t\t\t\t\tcount = numberOfPoints * 4 * 3;\n\n\t\t\t\t\tpoints = new Float32Array( numberOfPoints * 3 );\n\n\t\t\t\t\tpointIndex = state.next;\n\t\t\t\t\tfor ( i = 0; i < numberOfPoints; i ++ ) {\n\n\t\t\t\t\t\tpoints[ 3 * i ] = dataView.getFloat32( pointIndex, false );\n\t\t\t\t\t\tpoints[ 3 * i + 1 ] = dataView.getFloat32( pointIndex + 4, false );\n\t\t\t\t\t\tpoints[ 3 * i + 2 ] = dataView.getFloat32( pointIndex + 8, false );\n\t\t\t\t\t\tpointIndex = pointIndex + 12;\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// increment our next pointer\n\t\t\t\t\tstate.next = state.next + count + 1;\n\n\t\t\t\t} else if ( line.indexOf( 'TRIANGLE_STRIPS' ) === 0 ) {\n\n\t\t\t\t\tvar numberOfStrips = parseInt( line.split( ' ' )[ 1 ], 10 );\n\t\t\t\t\tvar size = parseInt( line.split( ' ' )[ 2 ], 10 );\n\t\t\t\t\t// 4 byte integers\n\t\t\t\t\tcount = size * 4;\n\n\t\t\t\t\tindices = new Uint32Array( 3 * size - 9 * numberOfStrips );\n\t\t\t\t\tvar indicesIndex = 0;\n\n\t\t\t\t\tpointIndex = state.next;\n\t\t\t\t\tfor ( i = 0; i < numberOfStrips; i ++ ) {\n\n\t\t\t\t\t\t// For each strip, read the first value, then record that many more points\n\t\t\t\t\t\tvar indexCount = dataView.getInt32( pointIndex, false );\n\t\t\t\t\t\tvar strip = [];\n\t\t\t\t\t\tpointIndex += 4;\n\t\t\t\t\t\tfor ( s = 0; s < indexCount; s ++ ) {\n\n\t\t\t\t\t\t\tstrip.push( dataView.getInt32( pointIndex, false ) );\n\t\t\t\t\t\t\tpointIndex += 4;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// retrieves the n-2 triangles from the triangle strip\n\t\t\t\t\t\tfor ( var j = 0; j < indexCount - 2; j ++ ) {\n\n\t\t\t\t\t\t\tif ( j % 2 ) {\n\n\t\t\t\t\t\t\t\tindices[ indicesIndex ++ ] = strip[ j ];\n\t\t\t\t\t\t\t\tindices[ indicesIndex ++ ] = strip[ j + 2 ];\n\t\t\t\t\t\t\t\tindices[ indicesIndex ++ ] = strip[ j + 1 ];\n\n\t\t\t\t\t\t\t} else {\n\n\n\t\t\t\t\t\t\t\tindices[ indicesIndex ++ ] = strip[ j ];\n\t\t\t\t\t\t\t\tindices[ indicesIndex ++ ] = strip[ j + 1 ];\n\t\t\t\t\t\t\t\tindices[ indicesIndex ++ ] = strip[ j + 2 ];\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// increment our next pointer\n\t\t\t\t\tstate.next = state.next + count + 1;\n\n\t\t\t\t} else if ( line.indexOf( 'POLYGONS' ) === 0 ) {\n\n\t\t\t\t\tvar numberOfStrips = parseInt( line.split( ' ' )[ 1 ], 10 );\n\t\t\t\t\tvar size = parseInt( line.split( ' ' )[ 2 ], 10 );\n\t\t\t\t\t// 4 byte integers\n\t\t\t\t\tcount = size * 4;\n\n\t\t\t\t\tindices = new Uint32Array( 3 * size - 9 * numberOfStrips );\n\t\t\t\t\tvar indicesIndex = 0;\n\n\t\t\t\t\tpointIndex = state.next;\n\t\t\t\t\tfor ( i = 0; i < numberOfStrips; i ++ ) {\n\n\t\t\t\t\t\t// For each strip, read the first value, then record that many more points\n\t\t\t\t\t\tvar indexCount = dataView.getInt32( pointIndex, false );\n\t\t\t\t\t\tvar strip = [];\n\t\t\t\t\t\tpointIndex += 4;\n\t\t\t\t\t\tfor ( s = 0; s < indexCount; s ++ ) {\n\n\t\t\t\t\t\t\tstrip.push( dataView.getInt32( pointIndex, false ) );\n\t\t\t\t\t\t\tpointIndex += 4;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// divide the polygon in n-2 triangle\n\t\t\t\t\t\tfor ( var j = 1; j < indexCount - 1; j ++ ) {\n\n\t\t\t\t\t\t\tindices[ indicesIndex ++ ] = strip[ 0 ];\n\t\t\t\t\t\t\tindices[ indicesIndex ++ ] = strip[ j ];\n\t\t\t\t\t\t\tindices[ indicesIndex ++ ] = strip[ j + 1 ];\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// increment our next pointer\n\t\t\t\t\tstate.next = state.next + count + 1;\n\n\t\t\t\t} else if ( line.indexOf( 'POINT_DATA' ) === 0 ) {\n\n\t\t\t\t\tnumberOfPoints = parseInt( line.split( ' ' )[ 1 ], 10 );\n\n\t\t\t\t\t// Grab the next line\n\t\t\t\t\tstate = findString( buffer, state.next );\n\n\t\t\t\t\t// Now grab the binary data\n\t\t\t\t\tcount = numberOfPoints * 4 * 3;\n\n\t\t\t\t\tnormals = new Float32Array( numberOfPoints * 3 );\n\t\t\t\t\tpointIndex = state.next;\n\t\t\t\t\tfor ( i = 0; i < numberOfPoints; i ++ ) {\n\n\t\t\t\t\t\tnormals[ 3 * i ] = dataView.getFloat32( pointIndex, false );\n\t\t\t\t\t\tnormals[ 3 * i + 1 ] = dataView.getFloat32( pointIndex + 4, false );\n\t\t\t\t\t\tnormals[ 3 * i + 2 ] = dataView.getFloat32( pointIndex + 8, false );\n\t\t\t\t\t\tpointIndex += 12;\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// Increment past our data\n\t\t\t\t\tstate.next = state.next + count;\n\n\t\t\t\t}\n\n\t\t\t\t// Increment index\n\t\t\t\tindex = state.next;\n\n\t\t\t\tif ( index >= buffer.byteLength ) {\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tvar geometry = new THREE.BufferGeometry();\n\t\t\tgeometry.setIndex( new THREE.BufferAttribute( indices, 1 ) );\n\t\t\tgeometry.setAttribute( 'position', new THREE.BufferAttribute( points, 3 ) );\n\n\t\t\tif ( normals.length === points.length ) {\n\n\t\t\t\tgeometry.setAttribute( 'normal', new THREE.BufferAttribute( normals, 3 ) );\n\n\t\t\t}\n\n\t\t\treturn geometry;\n\n\t\t}\n\n\t\tfunction Float32Concat( first, second ) {\n\n\t\t    var firstLength = first.length, result = new Float32Array( firstLength + second.length );\n\n\t\t    result.set( first );\n\t\t    result.set( second, firstLength );\n\n\t\t    return result;\n\n\t\t}\n\n\t\tfunction Int32Concat( first, second ) {\n\n\t\t    var firstLength = first.length, result = new Int32Array( firstLength + second.length );\n\n\t\t    result.set( first );\n\t\t    result.set( second, firstLength );\n\n\t\t    return result;\n\n\t\t}\n\n\t\tfunction parseXML( stringFile ) {\n\n\t\t\t// Changes XML to JSON, based on https://davidwalsh.name/convert-xml-json\n\n\t\t\tfunction xmlToJson( xml ) {\n\n\t\t\t\t// Create the return object\n\t\t\t\tvar obj = {};\n\n\t\t\t\tif ( xml.nodeType === 1 ) { // element\n\n\t\t\t\t\t// do attributes\n\n\t\t\t\t\tif ( xml.attributes ) {\n\n\t\t\t\t\t\tif ( xml.attributes.length > 0 ) {\n\n\t\t\t\t\t\t\tobj[ 'attributes' ] = {};\n\n\t\t\t\t\t\t\tfor ( var j = 0; j < xml.attributes.length; j ++ ) {\n\n\t\t\t\t\t\t\t\tvar attribute = xml.attributes.item( j );\n\t\t\t\t\t\t\t\tobj[ 'attributes' ][ attribute.nodeName ] = attribute.nodeValue.trim();\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( xml.nodeType === 3 ) { // text\n\n\t\t\t\t\tobj = xml.nodeValue.trim();\n\n\t\t\t\t}\n\n\t\t\t\t// do children\n\t\t\t\tif ( xml.hasChildNodes() ) {\n\n\t\t\t\t\tfor ( var i = 0; i < xml.childNodes.length; i ++ ) {\n\n\t\t\t\t\t\tvar item = xml.childNodes.item( i );\n\t\t\t\t\t\tvar nodeName = item.nodeName;\n\n\t\t\t\t\t\tif ( typeof obj[ nodeName ] === 'undefined' ) {\n\n\t\t\t\t\t\t\tvar tmp = xmlToJson( item );\n\n\t\t\t\t\t\t\tif ( tmp !== '' ) obj[ nodeName ] = tmp;\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tif ( typeof obj[ nodeName ].push === 'undefined' ) {\n\n\t\t\t\t\t\t\t\tvar old = obj[ nodeName ];\n\t\t\t\t\t\t\t\tobj[ nodeName ] = [ old ];\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tvar tmp = xmlToJson( item );\n\n\t\t\t\t\t\t\tif ( tmp !== '' ) obj[ nodeName ].push( tmp );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\treturn obj;\n\n\t\t\t}\n\n\t\t\t// Taken from Base64-js\n\t\t\tfunction Base64toByteArray( b64 ) {\n\n\t\t\t\tvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array;\n\t\t\t\tvar i;\n\t\t\t\tvar lookup = [];\n\t\t\t\tvar revLookup = [];\n\t\t\t\tvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n\t\t\t\tvar len = code.length;\n\n\t\t\t\tfor ( i = 0; i < len; i ++ ) {\n\n\t\t\t\t\tlookup[ i ] = code[ i ];\n\n\t\t\t\t}\n\n\t\t\t\tfor ( i = 0; i < len; ++ i ) {\n\n\t\t\t\t\trevLookup[ code.charCodeAt( i ) ] = i;\n\n\t\t\t\t}\n\n\t\t\t\trevLookup[ '-'.charCodeAt( 0 ) ] = 62;\n\t\t\t\trevLookup[ '_'.charCodeAt( 0 ) ] = 63;\n\n\t\t\t\tvar j, l, tmp, placeHolders, arr;\n\t\t\t\tvar len = b64.length;\n\n\t\t\t\tif ( len % 4 > 0 ) {\n\n\t\t\t\t\tthrow new Error( 'Invalid string. Length must be a multiple of 4' );\n\n\t\t\t\t}\n\n\t\t\t\tplaceHolders = b64[ len - 2 ] === '=' ? 2 : b64[ len - 1 ] === '=' ? 1 : 0;\n\t\t\t\tarr = new Arr( len * 3 / 4 - placeHolders );\n\t\t\t\tl = placeHolders > 0 ? len - 4 : len;\n\n\t\t\t\tvar L = 0;\n\n\t\t\t\tfor ( i = 0, j = 0; i < l; i += 4, j += 3 ) {\n\n\t\t\t\t\ttmp = ( revLookup[ b64.charCodeAt( i ) ] << 18 ) | ( revLookup[ b64.charCodeAt( i + 1 ) ] << 12 ) | ( revLookup[ b64.charCodeAt( i + 2 ) ] << 6 ) | revLookup[ b64.charCodeAt( i + 3 ) ];\n\t\t\t\t\tarr[ L ++ ] = ( tmp & 0xFF0000 ) >> 16;\n\t\t\t\t\tarr[ L ++ ] = ( tmp & 0xFF00 ) >> 8;\n\t\t\t\t\tarr[ L ++ ] = tmp & 0xFF;\n\n\t\t\t\t}\n\n\t\t\t\tif ( placeHolders === 2 ) {\n\n\t\t\t\t\ttmp = ( revLookup[ b64.charCodeAt( i ) ] << 2 ) | ( revLookup[ b64.charCodeAt( i + 1 ) ] >> 4 );\n\t\t\t\t\tarr[ L ++ ] = tmp & 0xFF;\n\n\t\t\t\t} else if ( placeHolders === 1 ) {\n\n\t\t\t\t\ttmp = ( revLookup[ b64.charCodeAt( i ) ] << 10 ) | ( revLookup[ b64.charCodeAt( i + 1 ) ] << 4 ) | ( revLookup[ b64.charCodeAt( i + 2 ) ] >> 2 );\n\t\t\t\t\tarr[ L ++ ] = ( tmp >> 8 ) & 0xFF;\n\t\t\t\t\tarr[ L ++ ] = tmp & 0xFF;\n\n\t\t\t\t}\n\n\t\t\t\treturn arr;\n\n\t\t\t}\n\n\t\t\tfunction parseDataArray( ele, compressed ) {\n\n\t\t\t\tvar numBytes = 0;\n\n\t\t\t\tif ( json.attributes.header_type === 'UInt64' ) {\n\n\t\t\t\t\tnumBytes = 8;\n\n\t\t\t\t}\telse if ( json.attributes.header_type === 'UInt32' ) {\n\n\t\t\t\t\tnumBytes = 4;\n\n\t\t\t\t}\n\n\n\t\t\t\t// Check the format\n\t\t\t\tif ( ele.attributes.format === 'binary' && compressed ) {\n\n\t\t\t\t\tvar rawData, content, byteData, blocks, cSizeStart, headerSize, padding, dataOffsets, currentOffset;\n\n\t\t\t\t\tif ( ele.attributes.type === 'Float32' ) {\n\n\t\t\t\t\t\tvar txt = new Float32Array( );\n\n\t\t\t\t\t} else if ( ele.attributes.type === 'Int64' ) {\n\n\t\t\t\t\t\tvar txt = new Int32Array( );\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// VTP data with the header has the following structure:\n\t\t\t\t\t// [#blocks][#u-size][#p-size][#c-size-1][#c-size-2]...[#c-size-#blocks][DATA]\n\t\t\t\t\t//\n\t\t\t\t\t// Each token is an integer value whose type is specified by \"header_type\" at the top of the file (UInt32 if no type specified). The token meanings are:\n\t\t\t\t\t// [#blocks] = Number of blocks\n\t\t\t\t\t// [#u-size] = Block size before compression\n\t\t\t\t\t// [#p-size] = Size of last partial block (zero if it not needed)\n\t\t\t\t\t// [#c-size-i] = Size in bytes of block i after compression\n\t\t\t\t\t//\n\t\t\t\t\t// The [DATA] portion stores contiguously every block appended together. The offset from the beginning of the data section to the beginning of a block is\n\t\t\t\t\t// computed by summing the compressed block sizes from preceding blocks according to the header.\n\n\t\t\t\t\trawData = ele[ '#text' ];\n\n\t\t\t\t\tbyteData = Base64toByteArray( rawData );\n\n\t\t\t\t\tblocks = byteData[ 0 ];\n\t\t\t\t\tfor ( var i = 1; i < numBytes - 1; i ++ ) {\n\n\t\t\t\t\t\tblocks = blocks | ( byteData[ i ] << ( i * numBytes ) );\n\n\t\t\t\t\t}\n\n\t\t\t\t\theaderSize = ( blocks + 3 ) * numBytes;\n\t\t\t\t\tpadding = ( ( headerSize % 3 ) > 0 ) ? 3 - ( headerSize % 3 ) : 0;\n\t\t\t\t\theaderSize = headerSize + padding;\n\n\t\t\t\t\tdataOffsets = [];\n\t\t\t\t\tcurrentOffset = headerSize;\n\t\t\t\t\tdataOffsets.push( currentOffset );\n\n\t\t\t\t\t// Get the blocks sizes after the compression.\n\t\t\t\t\t// There are three blocks before c-size-i, so we skip 3*numBytes\n\t\t\t\t\tcSizeStart = 3 * numBytes;\n\n\t\t\t\t\tfor ( var i = 0; i < blocks; i ++ ) {\n\n\t\t\t\t\t\tvar currentBlockSize = byteData[ i * numBytes + cSizeStart ];\n\n\t\t\t\t\t\tfor ( var j = 1; j < numBytes - 1; j ++ ) {\n\n\t\t\t\t\t\t\t// Each data point consists of 8 bytes regardless of the header type\n\t\t\t\t\t\t\tcurrentBlockSize = currentBlockSize | ( byteData[ i * numBytes + cSizeStart + j ] << ( j * 8 ) );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcurrentOffset = currentOffset + currentBlockSize;\n\t\t\t\t\t\tdataOffsets.push( currentOffset );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfor ( var i = 0; i < dataOffsets.length - 1; i ++ ) {\n\n\t\t\t\t\t\tvar data = fflate.unzlibSync( byteData.slice( dataOffsets[ i ], dataOffsets[ i + 1 ] ) ); // eslint-disable-line no-undef\n\t\t\t\t\t\tcontent = data.buffer;\n\n\t\t\t\t\t\tif ( ele.attributes.type === 'Float32' ) {\n\n\t\t\t\t\t\t\tcontent = new Float32Array( content );\n\t\t\t\t\t\t\ttxt = Float32Concat( txt, content );\n\n\t\t\t\t\t\t} else if ( ele.attributes.type === 'Int64' ) {\n\n\t\t\t\t\t\t\tcontent = new Int32Array( content );\n\t\t\t\t\t\t\ttxt = Int32Concat( txt, content );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tdelete ele[ '#text' ];\n\n\t\t\t\t\tif ( ele.attributes.type === 'Int64' ) {\n\n\t\t\t\t\t\tif ( ele.attributes.format === 'binary' ) {\n\n\t\t\t\t\t\t\ttxt = txt.filter( function ( el, idx ) {\n\n\t\t\t\t\t\t\t\tif ( idx % 2 !== 1 ) return true;\n\n\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tif ( ele.attributes.format === 'binary' && ! compressed ) {\n\n\t\t\t\t\t\tvar content = Base64toByteArray( ele[ '#text' ] );\n\n\t\t\t\t\t\t//  VTP data for the uncompressed case has the following structure:\n\t\t\t\t\t\t// [#bytes][DATA]\n\t\t\t\t\t\t// where \"[#bytes]\" is an integer value specifying the number of bytes in the block of data following it.", "domain": "javascript", "lang": "code", "char_count": 20007, "word_count": 4574, "byte_count": 20007}
{"text": "module.exports={A:{A:{\"2\":\"I D F E A B oB\"},B:{\"1\":\"Z MB M R S N U V W\",\"2\":\"C O H P J K L\"},C:{\"1\":\"0 1 2 3 4 5 6 7 8 9 I D F E A B C O H P J K L b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB TB IB JB KB LB T NB OB PB QB RB HB Y XB UB VB WB SB Z MB M mB R S N U V\",\"2\":\"nB cB G a vB yB\"},D:{\"1\":\"0 1 2 3 4 5 6 7 8 9 I D F E A B C O H P J K L b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB TB IB JB KB LB T NB OB PB QB RB HB Y XB UB VB WB SB Z MB M R S N U V W 0B dB eB fB\",\"2\":\"G a\"},E:{\"1\":\"a I D F E A B C O H iB jB kB lB ZB X Q pB qB\",\"2\":\"G gB YB\"},F:{\"1\":\"0 1 2 3 4 5 6 7 8 9 B C P J K L b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB GB IB JB KB LB T NB OB PB QB RB HB Y X aB wB Q\",\"4\":\"E rB sB tB uB\"},G:{\"1\":\"F xB bB zB YC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC\",\"2\":\"YB\"},H:{\"2\":\"GC\"},I:{\"1\":\"M LC MC\",\"2\":\"cB G HC IC JC KC bB\"},J:{\"1\":\"D A\"},K:{\"1\":\"C FB X aB Q\",\"4\":\"A B\"},L:{\"1\":\"W\"},M:{\"1\":\"N\"},N:{\"2\":\"A B\"},O:{\"1\":\"NC\"},P:{\"1\":\"G OC PC QC RC SC ZB TC UC VC\"},Q:{\"1\":\"WC\"},R:{\"1\":\"XC\"},S:{\"1\":\"hB\"}},B:1,C:\"Server-sent events\"};", "domain": "javascript", "lang": "code", "char_count": 1116, "word_count": 634, "byte_count": 1116}
{"text": "\"use strict\";\r\n/**\r\n * Accounting API\r\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\r\n *\r\n * The version of the OpenAPI document: 2.0.2\r\n * Contact: api@xero.com\r\n *\r\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\r\n * https://openapi-generator.tech\r\n * Do not edit the class manually.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nclass Invoices {\r\n    static getAttributeTypeMap() {\r\n        return Invoices.attributeTypeMap;\r\n    }\r\n}\r\nexports.Invoices = Invoices;\r\nInvoices.discriminator = undefined;\r\nInvoices.attributeTypeMap = [\r\n    {\r\n        \"name\": \"invoices\",\r\n        \"baseName\": \"Invoices\",\r\n        \"type\": \"Array<Invoice>\"\r\n    }\r\n];\r\n//# sourceMappingURL=invoices.js.map", "domain": "javascript", "lang": "code", "char_count": 820, "word_count": 154, "byte_count": 820}
{"text": "const { browserStackErrorReporter } = requireHelper('browserstack-error-reporter');\nconst utils = requireHelper('e2e-utils');\nconst config = requireHelper('e2e-config');\nrequireHelper('rejection');\n\nconst axePageObjects = requireHelper('axe-page-objects');\n\njasmine.getEnv().addReporter(browserStackErrorReporter);\n\nconst clickOnMultiselect = async () => {\n  const multiselectEl = await element.all(by.css('div[aria-controls=\"dropdown-list\"]')).first();\n  await browser.driver\n    .wait(protractor.ExpectedConditions.presenceOf(multiselectEl), config.waitsFor);\n  await multiselectEl.click();\n};\n\nconst setTimer = () => {\n  let starttime = 0;\n  browser.controlFlow().execute(() => {\n    starttime = Date.now();\n  });\n  return {\n    get elapsed() {\n      return browser.controlFlow().execute(() => Date.now() - starttime);\n    }\n  };\n};\n\ndescribe('Multiselect example-states tests', () => {\n  beforeEach(async () => {\n    await utils.setPage('/components/multiselect/example-states');\n  });\n\n  it('Should not have errors', async () => {\n    await utils.checkForErrors();\n  });\n\n  it('Should open multiselect list on click', async () => {\n    await clickOnMultiselect();\n    await browser.driver\n      .wait(protractor.ExpectedConditions.presenceOf(element(by.className('is-open'))), config.waitsFor);\n\n    expect(await element(by.className('is-open')).isDisplayed()).toBe(true);\n  });\n\n  it('Should scroll down to end of list, and Vermont should be visible', async () => {\n    await clickOnMultiselect();\n    await browser.driver\n      .wait(protractor.ExpectedConditions.presenceOf(element(by.className('is-open'))), config.waitsFor);\n\n    await browser.executeScript('document.querySelector(\"ul[role=\\'listbox\\']\").scrollTop = 10000');\n    const multiselectElList = await element(by.css('ul[role=\"listbox\"]'));\n    const vermontOption = await element(by.css('li[data-val=\"VT\"]'));\n    const posVT = await vermontOption.getLocation();\n    const multiselectElListSize = await multiselectElList.getSize();\n    const posMultiselectElList = await multiselectElList.getLocation();\n\n    expect(posVT.y > posMultiselectElList.y &&\n      posVT.y < (posMultiselectElList.y + multiselectElListSize.height)).toBeTruthy();\n  });\n\n  if (!utils.isSafari()) {\n    xit('Should show validation message error \"Required\" on tab out', async () => {\n      // Disabled until dropdown fixes are in 4.9\n      const multiselectEl = await element.all(by.css('div[aria-controls=\"dropdown-list\"]')).get(2);\n      await browser.driver\n        .wait(protractor.ExpectedConditions.presenceOf(multiselectEl), config.waitsFor);\n      await multiselectEl.sendKeys(protractor.Key.TAB);\n      await browser.driver\n        .wait(protractor.ExpectedConditions.presenceOf(element(by.className('message-text'))), config.waitsFor);\n\n      expect(await element(by.css('.message-text')).getText()).toEqual('Required');\n    });\n\n    xit('Should show validation message error \"Required\" on click', async () => {\n      // Disabled until dropdown fixes are in 4.9\n      const multiselectEl = await element.all(by.css('div[aria-controls=\"dropdown-list\"]')).get(2);\n      await browser.driver\n        .wait(protractor.ExpectedConditions.presenceOf(multiselectEl), config.waitsFor);\n      await element(by.css('body')).sendKeys(protractor.Key.TAB);\n      await element(by.css('body')).sendKeys(protractor.Key.TAB);\n      await element(by.css('body')).sendKeys(protractor.Key.TAB);\n      await multiselectEl.sendKeys(protractor.Key.ENTER);\n      await multiselectEl.sendKeys(protractor.Key.ENTER);\n      await multiselectEl.sendKeys(protractor.Key.ENTER);\n      await element.all(by.css('.trigger')).first().click();\n      await browser.driver\n        .wait(protractor.ExpectedConditions.presenceOf(element(by.className('message-text'))), config.waitsFor);\n\n      expect(await element(by.css('.message-text')).getText()).toEqual('Required');\n    });\n  }\n\n  if (!utils.isIE()) {\n    xit('Should be accessible on init with no WCAG 2AA violations', async () => {\n      await clickOnMultiselect();\n      const res = await axePageObjects(browser.params.theme);\n\n      expect(res.violations.length).toEqual(0);\n    });\n  }\n});\n\ndescribe('Multiselect example-index tests', () => {\n  beforeEach(async () => {\n    await utils.setPage('/components/multiselect/example-index');\n  });\n\n  if (!utils.isSafari()) {\n    it('Should arrow down to Arizona, and focus', async () => {\n      const multiselectEl = await element.all(by.css('div[aria-controls=\"dropdown-list\"]')).first();\n      await browser.driver\n        .wait(protractor.ExpectedConditions.presenceOf(multiselectEl), config.waitsFor);\n      await multiselectEl.click();\n      await browser.driver\n        .wait(protractor.ExpectedConditions.presenceOf(await element(by.css('ul[role=\"listbox\"]'))), config.waitsFor);\n      const multiselectSearchEl = await element(by.id('dropdown-search'));\n      await multiselectSearchEl.click();\n      await multiselectSearchEl.sendKeys(protractor.Key.ARROW_DOWN);\n      await multiselectSearchEl.sendKeys(protractor.Key.ARROW_DOWN);\n      await browser.driver\n        .wait(protractor.ExpectedConditions.presenceOf(await element(by.className('is-focused'))), config.waitsFor);\n\n      expect(await element(by.className('is-focused')).getText()).toEqual('Arizona');\n    });\n\n    it('Should tab into deselect Alaska then tab out and input should be empty', async () => {\n      const multiselectEl = await element.all(by.css('div[aria-controls=\"dropdown-list\"]')).first();\n      await browser.driver\n        .wait(protractor.ExpectedConditions.presenceOf(multiselectEl), config.waitsFor);\n      await element(by.css('body')).sendKeys(protractor.Key.TAB);\n      await element(by.css('body')).sendKeys(protractor.Key.TAB);\n      await element(by.css('body')).sendKeys(protractor.Key.TAB);\n      await multiselectEl.sendKeys(protractor.Key.ENTER);\n      const multiselectSearchEl = await element(by.id('dropdown-search'));\n      await multiselectSearchEl.sendKeys(protractor.Key.ENTER);\n      await multiselectSearchEl.sendKeys(protractor.Key.TAB);\n\n      expect(await element.all(by.css('.dropdown span')).first().getText()).toEqual('');\n    });\n\n    it('Should arrow down to Arizona select, arrow down, and select Arkansas, and update search input', async () => {\n      const multiselectEl = await element.all(by.css('div[aria-controls=\"dropdown-list\"]')).first();\n      await browser.driver\n        .wait(protractor.ExpectedConditions.presenceOf(multiselectEl), config.waitsFor);\n      await multiselectEl.click();\n      await browser.driver\n        .wait(protractor.ExpectedConditions.presenceOf(await element(by.css('ul[role=\"listbox\"]'))), config.waitsFor);\n      const multiselectSearchEl = await element(by.id('dropdown-search'));\n      await multiselectSearchEl.click();\n      await multiselectSearchEl.sendKeys(protractor.Key.ARROW_DOWN);\n      await multiselectSearchEl.sendKeys(protractor.Key.ARROW_DOWN);\n      await multiselectSearchEl.sendKeys(protractor.Key.ENTER);\n      await multiselectSearchEl.sendKeys(protractor.Key.ARROW_DOWN);\n      await multiselectSearchEl.sendKeys(protractor.Key.ENTER);\n\n      expect(await element(by.className('is-focused')).getText()).toEqual('Arkansas');\n      const multiselectSearchElVal = element(by.id('dropdown-search')).getAttribute('value');\n\n      expect(await multiselectSearchElVal).toEqual('Alaska, Arizona, Arkansas');\n    });\n  }\n\n  if (utils.isChrome() && utils.isCI()) {\n    it('Should not visual regress', async () => {\n      const multiselectEl = await element.all(by.css('div[aria-controls=\"dropdown-list\"]')).first();\n      const multiselectElList = await element(by.id('dropdown-list'));\n      await browser.driver\n        .wait(protractor.ExpectedConditions.presenceOf(multiselectEl), config.waitsFor);\n      await browser.driver.sleep(config.waitsFor);\n\n      expect(await browser.protractorImageComparison.checkElement(multiselectEl, 'multiselect-init')).toEqual(0);\n\n      await clickOnMultiselect();\n      await browser.driver\n        .wait(protractor.ExpectedConditions.presenceOf(multiselectElList), config.waitsFor);\n      await browser.driver.sleep(config.waitsFor);\n\n      expect(await browser.protractorImageComparison.checkElement(multiselectElList, 'multiselect-open')).toEqual(0);\n    });\n  }\n\n  it('Should search for Colorado', async () => {\n    const multiselectEl = await element.all(by.css('div[aria-controls=\"dropdown-list\"]')).first();\n    await browser.driver\n      .wait(protractor.ExpectedConditions.presenceOf(multiselectEl), config.waitsFor);\n    await multiselectEl.click();\n    await element(by.id('dropdown-search')).click();\n    await browser.driver.switchTo().activeElement().clear();\n    await element(by.id('dropdown-search')).sendKeys('Colorado');\n    await browser.driver\n      .wait(protractor.ExpectedConditions.presenceOf(await element(by.css('.is-focused i'))), config.waitsFor);\n\n    expect(await element(by.className('is-focused')).getText()).toEqual('Colorado');\n  });\n\n  it('Should do nothing on disabled', async () => {\n    const multiselectEl = await element.all(by.css('div[aria-controls=\"dropdown-list\"]')).get(1);\n    await browser.driver\n      .wait(protractor.ExpectedConditions.presenceOf(multiselectEl), config.waitsFor);\n\n    expect(await element.all(by.className('is-disabled')).first().getAttribute('disabled')).toBeTruthy();\n    await multiselectEl.click();\n\n    expect(await element.all(by.className('is-disabled')).first().getAttribute('disabled')).toBeTruthy();\n  });\n});\n\ndescribe('Multiselect example-clear-all tests', () => {\n  beforeEach(async () => {\n    await utils.setPage('/components/multiselect/example-clear-all');\n  });\n\n  if (!utils.isSafari()) {\n    it('Should clear all', async () => {\n      const buttonEl = await element(by.id('btn-clear'));\n      await browser.driver\n        .wait(protractor.ExpectedConditions.presenceOf(buttonEl), config.waitsFor);\n\n      expect(await element(by.css('.dropdown span')).getText()).toEqual('Orange');\n      await buttonEl.click();\n      await browser.driver\n        .wait(protractor.ExpectedConditions.textToBePresentInElement(await element.all(by.css('.dropdown span')).first(), ''), config.waitsFor);\n\n      expect(await element(by.css('.dropdown span')).getText()).toEqual('');\n    });\n  }\n});\n\ndescribe('Multiselect example-select-all-performance tests', () => {\n  beforeEach(async () => {\n    await utils.setPage('/components/multiselect/test-select-all-performance');\n  });\n\n  xit('Should select all performance test', async () => {\n    const timer = setTimer();\n    await clickOnMultiselect();\n    await browser.driver\n      .wait(protractor.ExpectedConditions.presenceOf(element(by.className('is-open'))), config.waitsFor);\n\n    const all = await element.all(by.css('.dropdown-option')).count();\n    const selectAll = element(by.css('li.dropdown-select-all-list-item'));\n    await browser.driver\n      .wait(protractor.ExpectedConditions.presenceOf(selectAll), config.waitsFor);\n\n    await selectAll.click();\n    const selected = await element.all(by.css('.dropdown-option.is-selected')).count();\n\n    expect(selected).toEqual(all);\n    expect(timer.elapsed).toBeLessThan(1300);\n  });\n\n  xit('Should clear all selected performance test', async () => {\n    const timer = setTimer();\n    await clickOnMultiselect();\n    await browser.driver\n      .wait(protractor.ExpectedConditions.presenceOf(element(by.className('is-open'))), config.waitsFor);\n\n    const all = await element.all(by.css('.dropdown-option')).count();\n    const selectAll = element(by.css('li.dropdown-select-all-list-item'));\n    await browser.driver\n      .wait(protractor.ExpectedConditions.presenceOf(selectAll), config.waitsFor);\n\n    await selectAll.click();\n    let selected = await element.all(by.css('.dropdown-option.is-selected')).count();\n\n    expect(selected).toEqual(all);\n\n    await selectAll.click();\n    selected = await element.all(by.css('.dropdown-option.is-selected')).count();\n\n    expect(selected).toEqual(0);\n    expect(timer.elapsed).toBeLessThan(2200);\n  });\n});\n\ndescribe('Multiselect typeahead-reloading tests', () => {\n  beforeEach(async () => {\n    await utils.setPage('/components/multiselect/test-reload-typeahead');\n  });\n\n  if (!utils.isSafari()) {\n    it('Should make ajax calls properly on typeahead for multiple items', async () => {\n      // Open the list\n      const dropdownEl = await element(by.css('div[aria-controls=\"dropdown-list\"]'));\n      await browser.driver\n        .wait(protractor.ExpectedConditions.presenceOf(dropdownEl), config.waitsFor);\n\n      await dropdownEl.sendKeys(protractor.Key.ARROW_DOWN);\n      await browser.driver\n        .wait(protractor.ExpectedConditions.presenceOf(await element(by.css('.dropdown.is-open'))), config.waitsFor);\n      const dropdownSearchEl = await element(by.id('dropdown-search'));\n      await dropdownSearchEl.click();\n\n      // Search for \"new\" and select \"New Jersey\"\n      // NOTE: Sleep simulates the Multiselect's default typeahead delay (300ms)\n      await dropdownSearchEl.sendKeys('New');\n      await browser.driver.sleep(config.sleep);\n      await dropdownSearchEl.sendKeys(protractor.Key.ARROW_DOWN);\n      await dropdownSearchEl.sendKeys(protractor.Key.ENTER);\n\n      // Search for \"new\" and select \"New York\"\n      await dropdownSearchEl.sendKeys('New');\n      await browser.driver.sleep(config.sleep);\n      await dropdownSearchEl.sendKeys(protractor.Key.ARROW_DOWN);\n      await dropdownSearchEl.sendKeys(protractor.Key.ARROW_DOWN);\n      await dropdownSearchEl.sendKeys(protractor.Key.ARROW_DOWN);\n      await dropdownSearchEl.sendKeys(protractor.Key.ENTER);\n\n      expect(await element(by.css('.dropdown span')).getText()).toEqual('New Jersey, New York');\n    });\n  }\n});", "domain": "javascript", "lang": "code", "char_count": 13755, "word_count": 3176, "byte_count": 13755}
{"text": "import React from \"react\";\nimport ContentType from \"./ContentType\";\nimport ActionType from \"./ActionType\";\nimport { GenerateGUID } from \"../Utils\";\n\nconst DefaultMessage = {\n  CurrentID: undefined,\n  RoomID: undefined,\n  MessageContent: {\n    ActionType: undefined,\n    ContentType: undefined,\n    ContentValue: undefined\n  }\n};\n\nfunction GetDefaultObject() {\n  return Object.assign({}, DefaultMessage);\n}\n\nconst MessageBuilder = {\n  AppConnected: content => {\n    let returnMessage = GetDefaultObject();\n    returnMessage.CurrentID = GenerateGUID();\n    returnMessage.RoomID = \"\";\n    returnMessage.MessageContent.ActionType = ActionType.APP_CONNECTED;\n    returnMessage.MessageContent.ContentType = ContentType.TEXT_PLAIN;\n    returnMessage.MessageContent.ContentValue = content;\n    return returnMessage;\n  },\n  AppDisconected: content => {\n    let returnMessage = GetDefaultObject();\n    returnMessage.CurrentID = GenerateGUID();\n    returnMessage.RoomID = \"\";\n    returnMessage.MessageContent.ActionType = ActionType.APP_DISCONNECTED;\n    returnMessage.MessageContent.ContentType = ContentType.APPLICATION_JSON;\n    returnMessage.MessageContent.ContentValue = content;\n    return returnMessage;\n  },\n  HostConnected: content => {\n    let returnMessage = GetDefaultObject();\n    returnMessage.CurrentID = GenerateGUID();\n    returnMessage.RoomID = \"\";\n    returnMessage.MessageContent.ActionType = ActionType.HOST_CONNECTED;\n    returnMessage.MessageContent.ContentType = ContentType.APPLICATION_JSON;\n    returnMessage.MessageContent.ContentValue = content;\n    return returnMessage;\n  },\n  HostDisconnected: content => {\n    let returnMessage = GetDefaultObject();\n    returnMessage.CurrentID = GenerateGUID();\n    returnMessage.RoomID = \"\";\n    returnMessage.MessageContent.ActionType = ActionType.HOST_DISCONNECTED;\n    returnMessage.MessageContent.ContentType = ContentType.APPLICATION_JSON;\n    returnMessage.MessageContent.ContentValue = content;\n    return returnMessage;\n  },\n  AnexoPedidoMedico: content => {\n    let returnMessage = GetDefaultObject();\n    returnMessage.CurrentID = GenerateGUID();\n    returnMessage.RoomID = \"\";\n    returnMessage.MessageContent.ActionType = ActionType.PEDIDO_MEDICO_ANEXO;\n    returnMessage.MessageContent.ContentType = ContentType.APPLICATION_BASE64;\n    returnMessage.MessageContent.ContentValue = content;\n    return returnMessage;\n  },\n  Texto: content => {\n    let returnMessage = GetDefaultObject();\n    returnMessage.CurrentID = GenerateGUID();\n    returnMessage.RoomID = \"\";\n    returnMessage.MessageContent.ActionType = ActionType.ENVIAR_TEXTO_LAUDO;\n    returnMessage.MessageContent.ContentType = ContentType.TEXT_PLAIN;\n    returnMessage.MessageContent.ContentValue = content;\n    return returnMessage;\n  },\n  Audio: content => {\n    let returnMessage = GetDefaultObject();\n    returnMessage.CurrentID = GenerateGUID();\n    returnMessage.RoomID = \"\";\n    returnMessage.MessageContent.ActionType = ActionType.DITADO_AUDIO;\n    returnMessage.MessageContent.ContentType = ContentType.APPLICATION_BASE64;\n    returnMessage.MessageContent.ContentValue = content;\n    return returnMessage;\n  },\n  StateChanged: content => {\n    let returnMessage = GetDefaultObject();\n    returnMessage.CurrentID = GenerateGUID();\n    returnMessage.RoomID = \"\";\n    returnMessage.MessageContent.ActionType = ActionType.STATE_CHANGED;\n    returnMessage.MessageContent.ContentType = ContentType.APPLICATION_JSON;\n    returnMessage.MessageContent.ContentValue = content;\n    return returnMessage;\n  },\n  Laudar: content => {\n    let returnMessage = GetDefaultObject();\n    returnMessage.CurrentID = GenerateGUID();\n    returnMessage.RoomID = \"\";\n    returnMessage.MessageContent.ActionType = ActionType.ATALHO_ACAO_LAUDAR;\n    returnMessage.MessageContent.ContentType = ContentType.APPLICATION_JSON;\n    returnMessage.MessageContent.ContentValue = content;\n    return returnMessage;\n  },\n  Revisar: content => {\n    let returnMessage = GetDefaultObject();\n    returnMessage.CurrentID = GenerateGUID();\n    returnMessage.RoomID = \"\";\n    returnMessage.MessageContent.ActionType = ActionType.ATALHO_ACAO_REVISAR;\n    returnMessage.MessageContent.ContentType = ContentType.APPLICATION_JSON;\n    returnMessage.MessageContent.ContentValue = content;\n    return returnMessage;\n  },\n  LaudarRevisar: content => {\n    let returnMessage = GetDefaultObject();\n    returnMessage.CurrentID = GenerateGUID();\n    returnMessage.RoomID = \"\";\n    returnMessage.MessageContent.ActionType =\n      ActionType.ATALHO_ACAO_LAUDAR_REVISAR;\n    returnMessage.MessageContent.ContentType = ContentType.APPLICATION_JSON;\n    returnMessage.MessageContent.ContentValue = content;\n    return returnMessage;\n  },\n  ReconhecimentoSTT: content => {\n    let returnMessage = GetDefaultObject();\n    returnMessage.CurrentID = GenerateGUID();\n    returnMessage.RoomID = \"\";\n    returnMessage.MessageContent.ActionType = ActionType.RECONHECIMENTO_VOZ_STT;\n    returnMessage.MessageContent.ContentType = ContentType.TEXT_PLAIN;\n    returnMessage.MessageContent.ContentValue = content;\n    return returnMessage;\n  },\n  ComandoAssistente: content => {\n    let returnMessage = GetDefaultObject();\n    returnMessage.CurrentID = GenerateGUID();\n    returnMessage.RoomID = \"\";\n    returnMessage.MessageContent.ActionType = ActionType.COMANDO_ASSISTENTE;\n    returnMessage.MessageContent.ContentType = ContentType.APPLICATION_JSON;\n    returnMessage.MessageContent.ContentValue = content;\n    return returnMessage;\n  }\n};\n\nexport { MessageBuilder, ContentType, ActionType };", "domain": "javascript", "lang": "code", "char_count": 5563, "word_count": 871, "byte_count": 5563}
{"text": "function getText(s)\r\n    {\r\n    switch(s)\r\n        {\r\n        case \"Cannot delete Asset Base Folder.\":return \"Impossible d'effacer le r\\u00E9pertoire racine.\";\r\n        case \"Delete this file ?\":return \"Voulez vous effacer ce fichier ?\";\r\n        case \"Uploading...\":return \"publication en cours...\";\r\n        case \"File already exists. Do you want to replace it?\":return \"File already exists. Do you want to replace it?\"\r\n        \r\n\t\tcase \"Files\": return \"Fichiers\";\r\n\t\tcase \"del\": return \"Effacer\";\r\n\t\tcase \"Empty...\": return \"Empty...\";\r\n        }\r\n    }\r\nfunction loadText()\r\n    {\r\n    var txtLang = document.getElementsByName(\"txtLang\");\r\n    txtLang[0].innerHTML = \"Nouveau r\\u00E9pertoire\";\r\n    txtLang[1].innerHTML = \"Effacer le r\\u00E9pertoire\";\r\n    txtLang[2].innerHTML = \"Publier un fichier\";\r\n\r\n\tvar optLang = document.getElementsByName(\"optLang\");\r\n    optLang[0].text = \"Tous les fichiers\";\r\n    optLang[1].text = \"Media\";\r\n    optLang[2].text = \"Images\";\r\n    optLang[3].text = \"Flash\";\r\n    \r\n    document.getElementById(\"btnOk\").value = \" ok \";\r\n    document.getElementById(\"btnUpload\").value = \"publier\";\r\n    }\r\nfunction writeTitle()\r\n    {\r\n    document.write(\"<title>Gestionnaire de fichiers</title>\")\r\n    }", "domain": "javascript", "lang": "code", "char_count": 1232, "word_count": 293, "byte_count": 1232}
{"text": "const createSubscriber = require('../../../../../../controllers/api/guilds/feeds/subscribers/createSubscriber.js')\nconst roleServices = require('../../../../../../services/role.js')\nconst userServices = require('../../../../../../services/user.js')\nconst subscriberServices = require('../../../../../../services/subscriber.js')\nconst createError = require('../../../../../../util/createError.js')\nconst {\n  createResponse,\n  createNext\n} = require('../../../../../mocks/express.js')\n\njest.mock('../../../../../../services/role.js')\njest.mock('../../../../../../services/user.js')\njest.mock('../../../../../../services/subscriber.js')\njest.mock('../../../../../../util/createError.js')\n\ndescribe('Unit::controllers/api/guilds/feeds/subscribers/createSubscriber', function () {\n  afterEach(function () {\n    roleServices.isRoleOfGuild.mockReset()\n    userServices.getMemberOfGuild.mockReset()\n    subscriberServices.createSubscriber.mockReset()\n  })\n  it('returns the created subscriber for user', async function () {\n    const req = {\n      params: {},\n      body: {\n        type: 'user'\n      }\n    }\n    const json = jest.fn()\n    const res = {\n      status: jest.fn(() => ({ json }))\n    }\n    const createdSubscriber = 3245634\n    userServices.getMemberOfGuild.mockResolvedValue({})\n    subscriberServices.createSubscriber.mockResolvedValue(createdSubscriber)\n    const next = createNext()\n    await createSubscriber(req, res, next)\n    expect(next).not.toHaveBeenCalled()\n    expect(res.status).toHaveBeenCalledWith(201)\n    expect(json).toHaveBeenCalledWith(createdSubscriber)\n  })\n  it('returns the created subscriber for role', async function () {\n    const req = {\n      params: {},\n      body: {\n        type: 'role'\n      }\n    }\n    const json = jest.fn()\n    const res = {\n      status: jest.fn(() => ({ json }))\n    }\n    const createdSubscriber = 3245634\n    roleServices.isRoleOfGuild.mockResolvedValue(true)\n    subscriberServices.createSubscriber.mockResolvedValue(createdSubscriber)\n    const next = createNext()\n    await createSubscriber(req, res, next)\n    expect(next).not.toHaveBeenCalled()\n    expect(res.status).toHaveBeenCalledWith(201)\n    expect(json).toHaveBeenCalledWith(createdSubscriber)\n  })\n  it('calls next with error if role service fails fail', async function () {\n    const req = {\n      params: {},\n      body: {\n        type: 'role'\n      }\n    }\n    const json = jest.fn()\n    const res = {\n      status: jest.fn(() => ({ json }))\n    }\n    const error = new Error('etwsgry')\n    roleServices.isRoleOfGuild.mockRejectedValue(error)\n    const next = createNext()\n    await createSubscriber(req, res, next)\n    expect(next).toHaveBeenCalledWith(error)\n  })\n  it('calls next with error if user service fails fail', async function () {\n    const req = {\n      params: {},\n      body: {\n        type: 'user'\n      }\n    }\n    const res = createResponse()\n    const error = new Error('etwsgry')\n    userServices.getMemberOfGuild.mockRejectedValue(error)\n    const next = createNext()\n    await createSubscriber(req, res, next)\n    expect(next).toHaveBeenCalledWith(error)\n  })\n  it('calls next with error if subscriber service fails fail', async function () {\n    const req = {\n      params: {},\n      body: {\n        type: 'role'\n      }\n    }\n    const res = createResponse()\n    const error = new Error('etwsgry')\n    roleServices.isRoleOfGuild.mockResolvedValue(true)\n    subscriberServices.createSubscriber.mockRejectedValue(error)\n    const next = createNext()\n    await createSubscriber(req, res, next)\n    expect(next).toHaveBeenCalledWith(error)\n  })\n  it('calls user services with the right args', async function () {\n    const req = {\n      params: {\n        guildID: 'w4try5',\n        feedID: '32wet4ryh'\n      },\n      body: {\n        id: '3254r',\n        type: 'user',\n        filters: {\n          a: ['a']\n        }\n      }\n    }\n    const res = createResponse()\n    userServices.getMemberOfGuild.mockResolvedValue({})\n    subscriberServices.createSubscriber.mockResolvedValue()\n    const next = createNext()\n    await createSubscriber(req, res, next)\n    expect(userServices.getMemberOfGuild)\n      .toHaveBeenCalledWith(req.body.id, req.params.guildID)\n  })\n  it('calls role services with the right args', async function () {\n    const req = {\n      params: {\n        guildID: 'w4try5',\n        feedID: '32wet4ryh'\n      },\n      body: {\n        id: '3254r',\n        type: 'role',\n        filters: {\n          a: ['a']\n        }\n      }\n    }\n    const res = createResponse()\n    roleServices.isRoleOfGuild.mockResolvedValue(true)\n    subscriberServices.createSubscriber.mockResolvedValue()\n    const next = createNext()\n    await createSubscriber(req, res, next)\n    expect(roleServices.isRoleOfGuild)\n      .toHaveBeenCalledWith(req.body.id, req.params.guildID)\n  })\n  it('calls subscriber services with the right args', async function () {\n    const req = {\n      params: {\n        guildID: 'w4try5',\n        feedID: 'qw4etry'\n      },\n      body: {\n        id: '3254r',\n        type: 'role',\n        filters: {\n          a: ['a']\n        }\n      }\n    }\n    const res = createResponse()\n    roleServices.isRoleOfGuild.mockResolvedValue(true)\n    subscriberServices.createSubscriber.mockResolvedValue()\n    const next = createNext()\n    await createSubscriber(req, res, next)\n    expect(subscriberServices.createSubscriber)\n      .toHaveBeenCalledWith({\n        ...req.body,\n        feed: req.params.feedID\n      })\n    subscriberServices.createSubscriber.mockReset()\n    // Make sure filters is turned into an empty object\n    req.body.filters = null\n    await createSubscriber(req, res, next)\n    expect(subscriberServices.createSubscriber)\n      .toHaveBeenCalledWith({\n        ...req.body,\n        filters: {},\n        feed: req.params.feedID\n      })\n  })\n  it('returns 403 when is not role of guild', async function () {\n    const req = {\n      params: {},\n      body: {\n        type: 'role'\n      }\n    }\n    const json = jest.fn()\n    const res = {\n      status: jest.fn(() => ({ json }))\n    }\n    roleServices.isRoleOfGuild.mockResolvedValue(false)\n    const next = createNext()\n    const createdError = 34\n    createError.mockReturnValue(createdError)\n    await createSubscriber(req, res, next)\n    expect(res.status).toHaveBeenCalledWith(403)\n    expect(json).toHaveBeenCalledWith(createdError)\n  })\n  it('returns 403 when is not user of guild', async function () {\n    const req = {\n      params: {},\n      body: {\n        type: 'user'\n      }\n    }\n    const json = jest.fn()\n    const res = {\n      status: jest.fn(() => ({ json }))\n    }\n    userServices.getMemberOfGuild.mockResolvedValue(null)\n    const next = createNext()\n    const createdError = 34\n    createError.mockReturnValue(createdError)\n    await createSubscriber(req, res, next)\n    expect(res.status).toHaveBeenCalledWith(403)\n    expect(json).toHaveBeenCalledWith(createdError)\n  })\n})", "domain": "javascript", "lang": "code", "char_count": 6922, "word_count": 1441, "byte_count": 6922}
{"text": "const gulp = require('gulp')\nconst config = require('../config')\nconst browserSync = require('browser-sync')\nconst openBrowser = require('react-dev-utils/openBrowser')\nconst WebpackDevServerUtils = require('react-dev-utils/WebpackDevServerUtils')\nconst { prepareUrls, choosePort } = WebpackDevServerUtils\n\ngulp.task('browser-sync', done => {\n  const DEFAULT_PORT = 3000\n  const HOST = '0.0.0.0'\n  const protocol = 'http'\n  choosePort(HOST, DEFAULT_PORT)\n    .then(port => {\n      if (port === null) return\n      const urls = prepareUrls(protocol, HOST, port)\n      browserSync.init({\n        port,\n        server: {\n          baseDir: config.directories.dist.base,\n          serveStaticOptions: {\n            extensions: ['html']\n          }\n        },\n        open: false,\n        logConnections: true,\n        tunnel: config.tunnel,\n        files: ['**/*.css']\n      })\n      openBrowser(urls.localUrlForBrowser)\n      done()\n    })\n})", "domain": "javascript", "lang": "code", "char_count": 937, "word_count": 177, "byte_count": 937}
{"text": "jQuery(document).ready(gformInitDatepicker);\n\nfunction gformInitDatepicker(){\n    jQuery('.datepicker').each(\n        function (){\n            var element = jQuery(this);\n            var format = \"mm/dd/yy\";\n\n            if(element.hasClass(\"mdy\"))\n                format = \"mm/dd/yy\";\n            else if(element.hasClass(\"dmy\"))\n                format = \"dd/mm/yy\";\n            else if(element.hasClass(\"dmy_dash\"))\n                format = \"dd-mm-yy\";\n            else if(element.hasClass(\"dmy_dot\"))\n                format = \"dd.mm.yy\";\n            else if(element.hasClass(\"ymd_slash\"))\n                format = \"yy/mm/dd\";\n            else if(element.hasClass(\"ymd_dash\"))\n                format = \"yy-mm-dd\";\n            else if(element.hasClass(\"ymd_dot\"))\n                format = \"yy.mm.dd\";\n\n            var image = \"\";\n            var showOn = \"focus\";\n            if(element.hasClass(\"datepicker_with_icon\")){\n                showOn = \"both\";\n                image = jQuery('#gforms_calendar_icon_' + this.id).val();\n            }\n\n            element.datepicker({ yearRange: '-100:+20', showOn: showOn, buttonImage: image, buttonImageOnly: true, dateFormat: format, changeMonth: true, changeYear: true });\n        }\n    );\n}", "domain": "javascript", "lang": "code", "char_count": 1238, "word_count": 259, "byte_count": 1238}
{"text": "/*\n * Tencent is pleased to support the open source community by making BK-CI \u84dd\u9cb8\u6301\u7eed\u96c6\u6210\u5e73\u53f0 available.\n *\n * Copyright (C) 2019 THL A29 Limited, a Tencent company.  All rights reserved.\n *\n * BK-CI \u84dd\u9cb8\u6301\u7eed\u96c6\u6210\u5e73\u53f0 is licensed under the MIT license.\n *\n * A copy of the MIT License is included in this file.\n *\n *\n * Terms of the MIT License:\n * ---------------------------------------------------\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\n/**\n * @file main entry\n */\n\nimport Vue from 'vue'\nimport App from './App'\nimport createRouter from './router'\nimport store from './store'\nimport focus from './directives/focus/index.js'\n\nimport VeeValidate from 'vee-validate'\nimport validationENMessages from 'vee-validate/dist/locale/en'\nimport validationCNMessages from 'vee-validate/dist/locale/zh_CN'\nimport ExtendsCustomRules from './utils/customRules'\nimport validDictionary from './utils/validDictionary'\nimport PortalVue from 'portal-vue' // eslint-disable-line\nimport createLocale from '../../locale'\nimport '@icon-cool/bk-icon-devops/src/index'\nimport '@icon-cool/bk-icon-devops'\n\nimport { actionMap, resourceMap, resourceTypeMap } from '../../common-lib/permission-conf'\nimport bkMagic from 'bk-magic-vue'\nimport BkPipeline from 'bkui-pipeline'\n\n// \u5168\u91cf\u5f15\u5165 bk-magic-vue \u6837\u5f0f\nrequire('bk-magic-vue/dist/bk-magic-vue.min.css')\n\nconst { i18n, setLocale } = createLocale(require.context('@locale/pipeline/', false, /\\.json$/))\n\nVue.use(focus)\nVue.use(bkMagic)\nVue.use(PortalVue)\n\nVue.use(VeeValidate, {\n    i18nRootKey: 'validations', // customize the root path for validation messages.\n    i18n,\n    fieldsBagName: 'veeFields',\n    dictionary: {\n        'en-US': validationENMessages,\n        'zh-CN': validationCNMessages\n    }\n})\nVeeValidate.Validator.localize(validDictionary)\nExtendsCustomRules(VeeValidate.Validator.extend)\nconsole.log(BkPipeline)\nVue.use(BkPipeline, {\n    i18n\n})\n\nVue.prototype.$setLocale = setLocale\nVue.prototype.$permissionActionMap = actionMap\nVue.prototype.$permissionResourceMap = resourceMap\nVue.prototype.$permissionResourceTypeMap = resourceTypeMap\nVue.prototype.$bkMessage = function (config) {\n    config.ellipsisLine = config.ellipsisLine || 3\n    bkMagic.bkMessage(config)\n}\n/* eslint-disable */\n// \u6269\u5c55\u5b57\u7b26\u4e32\uff0c\u5224\u65ad\u662f\u5426\u4e3a\u84dd\u76fe\u53d8\u91cf\u683c\u5f0f\nString.prototype.isBkVar = function () {\n    return /^\\${{([\\w\\_]+)}}$/g.test(this)\n}\n/* eslint-disable */\n\nVue.mixin({\n    methods: {\n        // handleError (e, permissionAction, instance, projectId, resourceMap = this.$permissionResourceMap.pipeline) {\n        handleError (e, noPermissionList) {\n            if (e.code === 403) { // \u6ca1\u6709\u6743\u9650\u7f16\u8f91\n                // this.setPermissionConfig(resourceMap, permissionAction, instance ? [instance] : [], projectId)\n                this.$showAskPermissionDialog({\n                    noPermissionList\n                })\n            } else {\n                this.$showTips({\n                    message: e.message || e,\n                    theme: 'error'\n                })\n            }\n        },\n        /**\n         * \u8bbe\u7f6e\u6743\u9650\u5f39\u7a97\u7684\u53c2\u6570\n         */\n        setPermissionConfig (resourceId, actionId, instanceId = [], projectId = this.$route.params.projectId) {\n            this.$showAskPermissionDialog({\n                noPermissionList: [{\n                    actionId,\n                    resourceId,\n                    instanceId,\n                    projectId\n                }]\n            })\n        }\n    }\n})\n\nif (window.top === window.self) { // \u53ea\u80fd\u4ee5iframe\u5f62\u5f0f\u5d4c\u5165\n    location.href = `${WEB_URL_PREFIX}${location.pathname}`\n}\n\nglobal.pipelineVue = new Vue({\n    el: '#app',\n    router: createRouter(store),\n    i18n,\n    store,\n    components: {\n        App\n    },\n    template: '<App/>'\n})", "domain": "javascript", "lang": "code", "char_count": 4666, "word_count": 854, "byte_count": 4788}
{"text": "import React from 'react';\nimport { Link as RouterLink } from 'react-router-dom';\nimport clsx from 'clsx';\nimport PropTypes from 'prop-types';\nimport {\n  AppBar,\n  Box,\n  Toolbar,\n  makeStyles,\n  Typography\n} from '@material-ui/core';\nimport PublicIcon from '@material-ui/icons/Public';\n\nconst useStyles = makeStyles(() => ({\n  root: {},\n  avatar: {\n    width: 60,\n    height: 60\n  },\n  heading: {\n    color: 'white',\n  }\n}));\n\nconst TopBar = ({\n  className,\n  onMobileNavOpen,\n  ...rest\n}) => {\n  const classes = useStyles();\n\n  return (\n    <AppBar\n      className={clsx(classes.root, className)}\n      elevation={0}\n      {...rest}\n    >\n      <Toolbar>\n        <RouterLink to=\"/\">\n          <Box display=\"flex\" flexDirection=\"row\">\n            <PublicIcon className={classes.heading} />\n            <Typography className={classes.heading} variant=\"h4\">\n              COVID-19 Twitter Tracker\n            </Typography>\n          </Box>\n        </RouterLink>\n        <Box flexGrow={1} />\n      </Toolbar>\n    </AppBar>\n  );\n};\n\nTopBar.propTypes = {\n  className: PropTypes.string,\n  onMobileNavOpen: PropTypes.func\n};\n\nexport default TopBar;", "domain": "javascript", "lang": "code", "char_count": 1142, "word_count": 283, "byte_count": 1142}
{"text": "'use strict';\n\nangular.module('licenses').controller('LicenseFormController',['$scope', '$filter','$rootScope', '$reactive', 'LicensesTypes', 'LicensesGov', 'SIMPERTypes','DateSimper',\n  function($scope, $filter, $rootScope, $reactive, LicensesTypes, LicensesGov, SIMPERTypes, DateSimper) {\n    $reactive(this).attach($scope);\n\n    $scope.select = {};\n    $scope.detail = {};\n\n    $scope.dateUntil = [];\n\n    $scope.init = () => {\n      $scope.select.licenseTypes = LicensesTypes;\n      $scope.select.licenseGov = LicensesGov;\n      $scope.select.simperTypes = SIMPERTypes;\n    };\n\n    $scope.datePlus = (d,index) => {\n      var dateNow = new Date($filter('date')(d.govdetails[index].issue, 'dd-MM-yyyy'));\n      dateNow = new Date(dateNow.setHours(0,0,0,0));\n      var year = dateNow.getFullYear();\n      var month = dateNow.getMonth();\n      var day = dateNow.getDate();\n      var dateUntil = new Date(year + 4, month, day);\n      $scope.dateUntil[index] = dateUntil;\n      DateSimper.dateUntil($scope.dateUntil);\n    };\n\n\n    ////////////////\n    // ARRAY USER //\n    ////////////////\n    $scope.addNewLicense = () => {\n      if(!$scope.license.details) $scope.license.details = [];\n      $scope.license.details.push({\n\n      });\n    };\n\n    $scope.deleteLicense = (index) => {\n      $scope.license.details.splice(index,1);\n    };\n\n     //////////////\n    // DUE DATE //\n   //////////////\n\n   $scope.dateAddYears = () => {\n     var numberYearsToAdd = 4;\n     $scope.license.details.simperissue = $scope.issueDate;\n     $scope.license.details.simperdue = $scope.issueDate.setDate($scope.issueDate.getFullYear() + numberYearsToAdd);\n     console.log($scope.issueDate);\n   };\n  }]);", "domain": "javascript", "lang": "code", "char_count": 1682, "word_count": 393, "byte_count": 1682}
{"text": "/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/* globals expect, should  */\nimport { DataBinder } from '../../src/data_binder/data_binder';\n\nimport {\n  catchConsoleErrors\n} from './catch_console_errors';\n\nimport {\n  registerTestTemplates, ChildTemplate, PrimitiveChildrenTemplate, ReferenceParentTemplate, ArrayContainerTemplate,\n  MapContainerTemplate, SetContainerTemplate\n} from './testTemplates';\n\nimport * as _ from 'underscore';\n\nimport { PropertyElement } from '../../src/internal/property_element';\nimport { PropertyFactory } from '@fluid-experimental/property-properties';\nimport { RESOLVE_NEVER, RESOLVE_NO_LEAFS, RESOLVE_ALWAYS } from '../../src/internal/constants';\nimport { MockSharedPropertyTree } from './mock_shared_property_tree';\n\ndescribe('Property element', function() {\n\n  let dataBinder;\n  let workspace;\n\n  // Silence the actual console.error, so the test logs are clean\n  console.error = function() {\n  };\n\n  catchConsoleErrors();\n\n  beforeAll(function() {\n    registerTestTemplates();\n  });\n\n  beforeEach(async function() {\n    workspace = await MockSharedPropertyTree();\n  });\n\n  describe('hierarchy walking', function() {\n    beforeEach(function() {\n      dataBinder = new DataBinder();\n      // Bind to the workspace\n      dataBinder.attachTo(workspace);\n    });\n\n    afterEach(function() {\n      // Unbind checkout view\n      dataBinder.detach();\n      dataBinder = null;\n    });\n\n    it('dereferencing', function() {\n      workspace.root.insert('refParent', PropertyFactory.create(ReferenceParentTemplate.typeid, 'single'));\n      workspace.root.insert('child', PropertyFactory.create(PrimitiveChildrenTemplate.typeid, 'single'));\n      workspace.root.get(['refParent', 'single_ref'], RESOLVE_NEVER).setValue('/child');\n\n      const rootElem = new PropertyElement(workspace.root);\n      expect(rootElem.isValid()).toEqual(true);\n\n      const refParentElem = rootElem.getChild('refParent');\n      expect(refParentElem.getProperty().getId()).toEqual('refParent');\n\n      const directToRef = ['single_ref'];\n      expect(refParentElem.getChild(directToRef, RESOLVE_NEVER).getProperty().getId()).toEqual('single_ref');\n      expect(refParentElem.getChild(directToRef, RESOLVE_NO_LEAFS).getProperty().getId()).toEqual('single_ref');\n      expect(refParentElem.getChild(directToRef, RESOLVE_ALWAYS).getProperty().getId()).toEqual('child');\n\n      const pathToRef = ['refParent', 'single_ref'];\n      expect(rootElem.getChild(pathToRef, RESOLVE_NEVER).getProperty().getId()).toEqual('single_ref');\n      expect(rootElem.getChild(pathToRef, RESOLVE_NO_LEAFS).getProperty().getId()).toEqual('single_ref');\n      expect(rootElem.getChild(pathToRef, RESOLVE_ALWAYS).getProperty().getId()).toEqual('child');\n\n      const pathThroughRef = ['refParent', 'single_ref', 'aString'];\n      expect(rootElem.getChild(pathThroughRef, RESOLVE_NEVER).isValid()).toEqual(false);\n      expect(rootElem.getChild(pathThroughRef, RESOLVE_NO_LEAFS).getProperty().getId()).toEqual('aString');\n      expect(rootElem.getChild(pathThroughRef, RESOLVE_ALWAYS).getProperty().getId()).toEqual('aString');\n    });\n\n  });\n\n  it('reference containers', function() {\n    workspace.root.insert('refParent', PropertyFactory.create(ReferenceParentTemplate.typeid, 'single'));\n    workspace.root.insert('child', PropertyFactory.create(PrimitiveChildrenTemplate.typeid, 'single'));\n    workspace.root.get(['refParent', 'array_ref']).push('/child');\n    workspace.root.get(['refParent', 'map_ref']).insert('aKey', '/child');\n\n    const rootElem = new PropertyElement(workspace.root);\n    expect(rootElem.isValid()).toEqual(true);\n\n    const refParentElem = rootElem.getChild('refParent');\n    expect(refParentElem.getProperty().getId()).toEqual('refParent');\n\n    const pathToArrayRef = ['array_ref', 0];\n    expect(refParentElem.getChild(pathToArrayRef, RESOLVE_NEVER).getProperty().getId()).toEqual('array_ref');\n    expect(refParentElem.getChild(pathToArrayRef, RESOLVE_NEVER).getChildToken()).toEqual(0);\n    expect(refParentElem.getChild(pathToArrayRef, RESOLVE_NO_LEAFS).getProperty().getId()).toEqual('array_ref');\n    expect(refParentElem.getChild(pathToArrayRef, RESOLVE_NO_LEAFS).getChildToken()).toEqual(0);\n    expect(refParentElem.getChild(pathToArrayRef, RESOLVE_ALWAYS).getProperty().getId()).toEqual('child');\n\n    const pathToMapRef = ['map_ref', 'aKey'];\n    expect(refParentElem.getChild(pathToMapRef, RESOLVE_NEVER).getProperty().getId()).toEqual('map_ref');\n    expect(refParentElem.getChild(pathToMapRef, RESOLVE_NEVER).getChildToken()).toEqual('aKey');\n    expect(refParentElem.getChild(pathToMapRef, RESOLVE_NO_LEAFS).getProperty().getId()).toEqual('map_ref');\n    expect(refParentElem.getChild(pathToMapRef, RESOLVE_NO_LEAFS).getChildToken()).toEqual('aKey');\n    expect(refParentElem.getChild(pathToMapRef, RESOLVE_ALWAYS).getProperty().getId()).toEqual('child');\n\n    const pathThroughArrayRef = ['refParent', 'array_ref', 0, 'aString'];\n    expect(rootElem.getChild(pathThroughArrayRef, RESOLVE_NEVER).isValid()).toEqual(false);\n    expect(rootElem.getChild(pathThroughArrayRef, RESOLVE_NO_LEAFS).getProperty().getId()).toEqual('aString');\n    expect(rootElem.getChild(pathThroughArrayRef, RESOLVE_ALWAYS).getProperty().getId()).toEqual('aString');\n\n    const pathThroughMapRef = ['refParent', 'map_ref', 'aKey', 'aString'];\n    expect(rootElem.getChild(pathThroughMapRef, RESOLVE_NEVER).isValid()).toEqual(false);\n    expect(rootElem.getChild(pathThroughMapRef, RESOLVE_NO_LEAFS).getProperty().getId()).toEqual('aString');\n    expect(rootElem.getChild(pathThroughMapRef, RESOLVE_ALWAYS).getProperty().getId()).toEqual('aString');\n  });\n\n  it('parenting', function() {\n    const child = PropertyFactory.create(PrimitiveChildrenTemplate.typeid, 'single');\n    const refParent = PropertyFactory.create(ReferenceParentTemplate.typeid, 'single');\n\n    workspace.root.insert('refParent', refParent);\n    workspace.root.insert('child', child);\n    workspace.root.get(['refParent', 'array_ref']).push('/child');\n    workspace.root.get(['refParent', 'map_ref']).insert('aKey', '/child');\n    workspace.root.get(['child', 'arrayOfNumbers']).push(42);\n\n    const rootElem = new PropertyElement(workspace.root);\n    expect(rootElem.isValid()).toEqual(true);\n\n    // Root has no parent\n    expect(rootElem.getParent().isValid()).toEqual(false);\n\n    const refParentElem = rootElem.getChild('refParent');\n    expect(refParentElem.getParent().getProperty()).toEqual(workspace.root);\n\n    const arrayEntryElem = refParentElem.getChild(['array_ref', 0], RESOLVE_NEVER);\n    expect(arrayEntryElem.getChildToken()).toEqual(0);\n    expect(arrayEntryElem.getParent().getProperty()).toEqual(workspace.root.get(['refParent', 'array_ref']));\n    expect(arrayEntryElem.getParent().getChildToken()).toBeUndefined();\n\n    const mapEntryElem = refParentElem.getChild(['map_ref', 'aKey'], RESOLVE_NEVER);\n    expect(mapEntryElem.getChildToken()).toEqual('aKey');\n    expect(mapEntryElem.getParent().getProperty()).toEqual(workspace.root.get(['refParent', 'map_ref']));\n    expect(mapEntryElem.getParent().getChildToken()).toBeUndefined();\n\n    const childElem = rootElem.getChild('child');\n    const numberElem = childElem.getChild(['arrayOfNumbers', 0]);\n    expect(numberElem.getChildToken()).toEqual(0);\n    expect(numberElem.getValue()).toEqual(42);\n\n    const parentElem = numberElem.getParent();\n    expect(parentElem.getProperty().getId()).toEqual('arrayOfNumbers');\n  });\n\n  it('getValue', function() {\n    const myData = PropertyFactory.create(PrimitiveChildrenTemplate.typeid, 'single');\n    myData.get('arrayOfNumbers').setValues([1, 2, 3]);\n    myData.get('arrayOfStrings').push('a');\n    myData.get('arrayOfStrings').push('b');\n    myData.get('arrayOfStrings').push('c');\n    myData.get('mapOfNumbers').set('a', 1);\n    myData.get('mapOfNumbers').set('b', 2);\n    myData.get('mapOfNumbers').set('c', 3);\n    myData.get('mapOfStrings').set('a', 'A');\n    myData.get('mapOfStrings').set('b', 'B');\n    myData.get('mapOfStrings').set('c', 'C');\n    myData.get('aString').setValue('my string');\n    myData.get('aNumber').setValue(42);\n    myData.resolvePath('nested.aNumber').setValue(12);\n\n    const allData = {\n      thedata: myData.getValues()\n    };\n    // console.log('All the data:', allData);\n\n    workspace.root.insert('thedata', myData);\n\n    const propElem = new PropertyElement(workspace.root);\n\n    const test = (data, child) => {\n      propElem.becomeChild(child);\n      // console.log('checking', propElem.toString(),':');\n      const computed = propElem.getValue();\n      const expected = data[child];\n      // console.log(computed, ' expecting ', expected);\n      expect(computed).toEqual(expected);\n      if (propElem.getTypeId() !== 'String') {\n        _.each(data[child], (value, key) => {\n          test(data[child], key);\n        });\n      }\n      propElem.becomeParent();\n    };\n\n    test(allData, 'thedata');\n  });\n\n  it('setValue', function() {\n    const myData = PropertyFactory.create(PrimitiveChildrenTemplate.typeid, 'single');\n    const propElem = new PropertyElement(myData);\n    propElem.getChild('arrayOfNumbers').setValue([1, 2, 3]);\n    propElem.getChild(['arrayOfNumbers', 1]).setValue(42);\n    expect(propElem.getChild('arrayOfNumbers').getValue()).toEqual([1, 42, 3]);\n\n    propElem.getChild('arrayOfStrings').setValue(['a', 'b', 'c']);\n    propElem.getChild(['arrayOfStrings', 1]).setValue('INTERRUPTING COW');\n    expect(propElem.getChild('arrayOfStrings').getValue()).toEqual(['a', 'INTERRUPTING COW', 'c']);\n\n    propElem.getChild('mapOfNumbers').setValue({ a: 1, b: 2, c: 3 });\n    propElem.getChild(['mapOfNumbers', 'b']).setValue(42);\n    expect(propElem.getChild('mapOfNumbers').getValue()).toEqual({ a: 1, b: 42, c: 3 });\n\n    propElem.getChild('mapOfStrings').setValue({ a: 'A', b: 'B', c: 'C' });\n    propElem.getChild(['mapOfStrings', 'b']).setValue('INTERRUPTING... not funny second time');\n    expect(propElem.getChild('mapOfStrings').getValue()).toEqual(\n      { a: 'A', b: 'INTERRUPTING... not funny second time', c: 'C' }\n    );\n\n    propElem.getChild('nested').setValue({ aNumber: 12 });\n    expect(propElem.getChild('nested').getValue()).toEqual({ aNumber: 12 });\n\n    expect(myData.getValues()).toEqual(propElem.getValue());\n  });\n\n  it('isPrimitiveCollection basic', function() {\n    const myData = PropertyFactory.create(PrimitiveChildrenTemplate.typeid, 'single');\n    const propElem = new PropertyElement(myData);\n\n    expect(propElem.isPrimitiveCollection()).toEqual(false);\n    expect(propElem.getChild('nested').isPrimitiveCollection()).toEqual(false);\n    expect(propElem.getChild('arrayOfStrings').isPrimitiveCollection()).toEqual(true);\n    expect(propElem.getChild('mapOfNumbers').isPrimitiveCollection()).toEqual(true);\n    expect(propElem.getChild('mapOfStrings').isPrimitiveCollection()).toEqual(true);\n    expect(propElem.getChild('aString').isPrimitiveCollection()).toEqual(false);\n    expect(propElem.getChild('aNumber').isPrimitiveCollection()).toEqual(false);\n  });\n\n  it('isPrimitiveCollection array of prop', function() {\n    const myArrayData = PropertyFactory.create(ArrayContainerTemplate.typeid, 'single');\n    const propElem = new PropertyElement(myArrayData);\n    expect(propElem.isPrimitiveCollection()).toEqual(false);\n    expect(propElem.getChild('subArray').isPrimitiveCollection()).toEqual(false);\n    expect(propElem.getChild('unrepresentedSubArray').isPrimitiveCollection()).toEqual(false);\n  });\n\n  it('isPrimitiveCollection set of prop', function() {\n    const mySetData = PropertyFactory.create(SetContainerTemplate.typeid, 'single');\n    const propElem = new PropertyElement(mySetData);\n    expect(propElem.isPrimitiveCollection()).toEqual(false);\n    expect(propElem.getChild('subSet').isPrimitiveCollection()).toEqual(false);\n    expect(propElem.getChild('unrepresentedSubSet').isPrimitiveCollection()).toEqual(false);\n  });\n\n  it('isPrimitiveCollection map of prop', function() {\n    const myMapData = PropertyFactory.create(MapContainerTemplate.typeid, 'single');\n    const propElem = new PropertyElement(myMapData);\n    expect(propElem.isPrimitiveCollection()).toEqual(false);\n    expect(propElem.getChild('subMap').isPrimitiveCollection()).toEqual(false);\n    expect(propElem.getChild('unrepresentedSubMap').isPrimitiveCollection()).toEqual(false);\n  });\n\n  it('crazy paths for child token', function() {\n    const mymap = PropertyFactory.create('Float64', 'map');\n    workspace.root.insert('themap', mymap);\n\n    mymap.insert('\"my.child.path\"', 42);\n    const propElem = new PropertyElement(mymap);\n    propElem.becomeChild('\"my.child.path\"');\n    expect(propElem.isValid()).toEqual(true);\n\n    expect(propElem.getValue()).toEqual(42);\n\n    expect(propElem.getAbsolutePath()).toEqual('/themap[\"my.child.path\"]');\n  });\n\n  it('array of properties parenting', function() {\n    const array = PropertyFactory.create(ArrayContainerTemplate.typeid, 'single');\n    const child0 = PropertyFactory.create(ChildTemplate.typeid, 'single');\n    const child1 = PropertyFactory.create(ChildTemplate.typeid, 'single');\n    child0.get('text').setValue('child0 text');\n    child1.get('text').setValue('child1 text');\n    array.get('subArray').push(child0);\n    array.get('subArray').push(child1);\n    workspace.root.insert('theArray', array);\n\n    const rootElem = new PropertyElement(workspace.root);\n    const childElem = rootElem.getChild(['theArray', 'subArray', 1, 'text']);\n    expect(childElem.getValue()).toEqual('child1 text');\n\n    expect(childElem.getParent().getParent().getProperty().getId()).toEqual('subArray');\n    expect(childElem.getParent().getParent().getChildToken()).toBeUndefined();\n  });\n\n  it('map of properties parenting', function() {\n    const map = PropertyFactory.create(MapContainerTemplate.typeid, 'single');\n    const child0 = PropertyFactory.create(ChildTemplate.typeid, 'single');\n    const child1 = PropertyFactory.create(ChildTemplate.typeid, 'single');\n    child0.get('text').setValue('child0 text');\n    child1.get('text').setValue('child1 text');\n    map.get('subMap').insert('child0', child0);\n    map.get('subMap').insert('child1', child1);\n    workspace.root.insert('theMap', map);\n\n    const rootElem = new PropertyElement(workspace.root);\n    const childElem = rootElem.getChild(['theMap', 'subMap', 'child1', 'text']);\n    expect(childElem.getValue()).toEqual('child1 text');\n\n    expect(childElem.getParent().getProperty().getId()).toEqual('child1');\n    expect(childElem.getParent().getChildToken()).toBeUndefined();\n\n    expect(childElem.getParent().getParent().getProperty().getId()).toEqual('subMap');\n    expect(childElem.getParent().getParent().getChildToken()).toBeUndefined();\n  });\n\n  it('double references', function() {\n    const text = PropertyFactory.create('String', 'single');\n    const ref1 = PropertyFactory.create('Reference', 'single');\n    const ref2 = PropertyFactory.create('Reference', 'single');\n    const ref3 = PropertyFactory.create('Reference', 'single');\n    workspace.root.insert('text', text);\n    workspace.root.insert('ref1', ref1);\n    workspace.root.insert('ref2', ref2);\n    workspace.root.insert('ref3', ref3);\n    ref3.setValue('/ref2');\n    ref2.setValue('/ref1');\n    ref1.setValue('/text');\n    text.setValue('theText');\n\n    const rootElem = new PropertyElement(workspace.root);\n    expect(rootElem.getChild('ref3', RESOLVE_ALWAYS).getValue()).toEqual('theText');\n    expect(rootElem.getChild('ref3', RESOLVE_NEVER).getValue()).toEqual('/ref2');\n  });\n\n  it('double references array', function() {\n    const text = PropertyFactory.create('String', 'single');\n    const refs = PropertyFactory.create('Reference', 'array');\n    workspace.root.insert('text', text);\n    workspace.root.insert('refs', refs);\n    refs.push('/text');\n    refs.push('/refs[0]');\n    refs.push('/refs[1]');\n    text.setValue('theText');\n\n    const rootElem = new PropertyElement(workspace.root);\n    expect(rootElem.getChild(['refs', 2], RESOLVE_ALWAYS).getValue()).toEqual('theText');\n    expect(rootElem.getChild(['refs', 2], RESOLVE_NO_LEAFS).getValue()).toEqual('/refs[1]');\n    expect(rootElem.getChild(['refs', 2], RESOLVE_NEVER).getValue()).toEqual('/refs[1]');\n  });\n\n  it('tokenized path, toString, getContext', function() {\n    const arrayData = PropertyFactory.create('String', 'array');\n    workspace.root.insert('theArray', arrayData);\n    arrayData.push('hi');\n\n    const rootElem = new PropertyElement(workspace.root);\n    expect(rootElem.getTokenizedPath().length).toEqual(0);\n    expect(rootElem.getContext()).toEqual('single');\n    rootElem.becomeChild('theArray');\n    expect(rootElem.getContext()).toEqual('array');\n    expect(rootElem.getTokenizedPath().length).toEqual(1);\n    expect(rootElem.getTokenizedPath()[0]).toEqual('theArray');\n    expect(rootElem.toString()).toEqual('</theArray>');\n\n    rootElem.becomeChild(0);\n    expect(rootElem.getContext()).toEqual('single');\n    expect(rootElem.getTokenizedPath().length).toEqual(2);\n    expect(rootElem.getTokenizedPath()[0]).toEqual('theArray');\n    expect(rootElem.getTokenizedPath()[1]).toEqual('0');\n    expect(rootElem.toString()).toEqual('</theArray[0]>');\n\n    expect((new PropertyElement()).toString()).toEqual('<invalid>');\n  });\n\n  it('becoming the parent', function() {\n    const arrayData = PropertyFactory.create('String', 'array');\n    workspace.root.insert('theArray', arrayData);\n    arrayData.push('hi');\n\n    const rootElem = new PropertyElement(workspace.root);\n    rootElem.becomeChild('theArray');\n    expect(rootElem.getProperty()).toEqual(workspace.root.get('theArray'));\n    rootElem.becomeChild(0);\n    expect(rootElem.getProperty()).toEqual(workspace.root.get('theArray'));\n    expect(rootElem.getChildToken()).toEqual(0);\n    rootElem.becomeParent();\n    expect(rootElem.getProperty()).toEqual(workspace.root.get('theArray'));\n    expect(rootElem.getChildToken()).toBeUndefined();\n    rootElem.becomeParent();\n    expect(rootElem.getProperty()).toEqual(workspace.root);\n    expect(rootElem.getChildToken()).toBeUndefined();\n    rootElem.becomeParent();\n    expect(rootElem.isValid()).toEqual(false);\n  });\n\n  it('isPrimitiveCollection', function() {\n    const types = ['String', 'Float32', 'Reference'];\n    const contexts = ['single', 'array', 'map'];\n    types.forEach((theType) => {\n      contexts.forEach((context) => {\n        const prop = PropertyFactory.create(theType, context);\n        expect((new PropertyElement(prop)).isPrimitiveCollection()).toEqual(context !== 'single');\n      });\n    });\n\n    const nodeArray = PropertyFactory.create('NodeProperty', 'array');\n    const propElem = new PropertyElement(nodeArray);\n    expect(propElem.isPrimitiveCollection()).toEqual(false);\n\n    const array = PropertyFactory.create('Float32', 'array');\n    array.push(42);\n    const element = new PropertyElement(array);\n    expect(element.isPrimitiveCollection()).toEqual(true);\n    element.becomeChild(0);\n    expect(element.isPrimitiveCollection()).toEqual(false);\n  });\n\n  it('cloning', function() {\n    const arrayData = PropertyFactory.create('String', 'array');\n    workspace.root.insert('theArray', arrayData);\n    arrayData.push('hi');\n\n    const rootElem = new PropertyElement(workspace.root);\n    rootElem.becomeChild('theArray');\n    rootElem.becomeChild(0);\n    const clone = rootElem.clone();\n    expect(clone.getProperty()).toEqual(rootElem.getProperty());\n    expect(clone.getChildToken()).toEqual(rootElem.getChildToken());\n  });\n\n  it('a reference with *', function() {\n    const myData = PropertyFactory.create('Float64');\n    const myReference1 = PropertyFactory.create('Reference');\n    const myReference2 = PropertyFactory.create('Reference');\n\n    workspace.root.insert('myData', myData);\n    workspace.root.insert('myReference1', myReference1);\n    workspace.root.insert('myReference2', myReference2);\n\n    myData.setValue(42);\n    myReference1.setValue('/myData');", "domain": "javascript", "lang": "code", "char_count": 20007, "word_count": 4941, "byte_count": 20007}
{"text": "const { Router } = require('express');\nconst router = Router();\n\nconst passport = require('passport');\nconst { isLoggedIn, isNotloggedIn } = require('../lib/auth');\n\n\nrouter.get('/signup', isNotloggedIn, (req, res) => {\n    res.render('auth/signup');\n});\n\nrouter.get('/signin', isNotloggedIn, (req, res) => {\n    res.render('auth/signin');\n});\n\nrouter.post('/signin', isNotloggedIn, (req, res, next) => {\n    passport.authenticate('local.signin', {\n        successRedirect: '/profile',\n        failureRedirect: '/signin',\n        failureFlash: true\n    })(req, res, next);\n});\n\nrouter.post('/signup', isNotloggedIn, passport.authenticate('local.signup', {\n    successRedirect: '/profile',\n    failureRedirect: '/signup',\n    failureFlash: true\n}));\n\n\n\n\nrouter.get('/profile', isLoggedIn, (req, res) => {\n    res.render('profile');\n});\n\nrouter.get('/logout', isLoggedIn, (req, res) => {\n    req.logOut()\n    res.redirect('/signin');\n});\n\n\nmodule.exports = router;", "domain": "javascript", "lang": "code", "char_count": 962, "word_count": 247, "byte_count": 962}
{"text": "import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport Styles from './ContactFormStyles.module.css';\n\nexport default class ContactForm extends Component {\n  state = {\n    name: '',\n    number: '',\n  };\n  handleChangeName = event => {\n    this.setState({ name: event.target.value });\n  };\n  handleChangeNumber = event => {\n    this.setState({ number: event.target.value });\n  };\n  handleFormSubmit = event => {\n    event.preventDefault();\n    const contacts = this.props.contacts;\n    // console.log('props',this.props);\n    const { name } = this.state;\n    if (contacts.find(el => el.name.toLowerCase() === name.toLowerCase())) {\n      alert(`\"${name}\" is alredy in contacts `);\n    } else {\n      this.props.addUserContact(this.state.name, this.state.number);\n    }\n    this.setState({ name: '', number: '' });\n  };\n  render() {\n    return (\n      <form className={Styles.form__style}onSubmit={this.handleFormSubmit}>\n        <label>\n          <input\n          placeholder=\"Name\"\n          className={Styles.input__style}\n          type=\"text\"\n          value={this.state.name}\n          onChange={this.handleChangeName}\n          ></input>\n        </label>\n        <label>\n          <input\n          placeholder=\"Number\"\n          className={Styles.input__style}\n            type=\"number\"\n            value={this.state.number}\n            onChange={this.handleChangeNumber}\n          ></input>\n        </label>\n        <button className={Styles.addbtn__style}type=\"submit\" onSubmit={this.handleFormSubmit}>\n          Add contact\n        </button>\n      </form>\n    );\n  }\n}\n\nContactForm.propTypes = {\n  contacts: PropTypes.arrayOf(\n    PropTypes.shape({\n      name:PropTypes.string,\n      number:PropTypes.string,\n      id:PropTypes.string\n\n    })\n  ).isRequired,\n  addUserContact: PropTypes.func.isRequired,\n};", "domain": "javascript", "lang": "code", "char_count": 1843, "word_count": 430, "byte_count": 1843}
{"text": "// Licensed to Cloudera, Inc. under one\n// or more contributor license agreements.  See the NOTICE file\n// distributed with this work for additional information\n// regarding copyright ownership.  Cloudera, Inc. licenses this file\n// to you under the Apache License, Version 2.0 (the\n// \"License\"); you may not use this file except in compliance\n// with the License.  You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport $ from 'jquery';\n\nimport catalogUtils from 'catalog/catalogUtils';\nimport { getOptimizer } from './optimizer/optimizer';\nimport { DataCatalog } from './dataCatalog';\n\n/**\n * Helper function to reload a Optimizer multi table attribute, like topAggs or topFilters\n *\n * @param {MultiTableEntry} multiTableEntry\n * @param {Object} [options]\n * @param {boolean} [options.silenceErrors] - Default true\n * @param {string} promiseAttribute\n * @param {string} dataAttribute\n * @param {Function} apiHelperFunction\n * @return {CancellableJqPromise}\n */\nconst genericOptimizerReload = function (\n  multiTableEntry,\n  options,\n  promiseAttribute,\n  dataAttribute,\n  apiHelperFunction\n) {\n  if (multiTableEntry.dataCatalog.canHaveOptimizerMeta()) {\n    return multiTableEntry.trackedPromise(\n      promiseAttribute,\n      catalogUtils.fetchAndSave(apiHelperFunction, dataAttribute, multiTableEntry, options)\n    );\n  }\n  multiTableEntry[promiseAttribute] = $.Deferred().reject();\n  return multiTableEntry[promiseAttribute];\n};\n\n/**\n * Helper function to get a Optimizer multi table attribute, like topAggs or topFilters\n *\n * @param {MultiTableEntry} multiTableEntry\n * @param {Object} [options]\n * @param {boolean} [options.silenceErrors] - Default false\n * @param {boolean} [options.refreshCache] - Default false\n * @param {boolean} [options.cachedOnly] - Default false\n * @param {boolean} [options.cancellable] - Default false\n * @param {string} promiseAttribute\n * @param {string} dataAttribute\n * @param {Function} apiHelperFunction\n * @return {CancellableJqPromise}\n */\nconst genericOptimizerGet = function (\n  multiTableEntry,\n  options,\n  promiseAttribute,\n  dataAttribute,\n  apiHelperFunction\n) {\n  if (DataCatalog.cacheEnabled() && options && options.cachedOnly) {\n    return (\n      catalogUtils.applyCancellable(multiTableEntry[promiseAttribute], options) ||\n      $.Deferred().reject(false).promise()\n    );\n  }\n  if (!DataCatalog.cacheEnabled() || (options && options.refreshCache)) {\n    return catalogUtils.applyCancellable(\n      genericOptimizerReload(\n        multiTableEntry,\n        options,\n        promiseAttribute,\n        dataAttribute,\n        apiHelperFunction\n      ),\n      options\n    );\n  }\n  return catalogUtils.applyCancellable(\n    multiTableEntry[promiseAttribute] ||\n      genericOptimizerReload(\n        multiTableEntry,\n        options,\n        promiseAttribute,\n        dataAttribute,\n        apiHelperFunction\n      ),\n    options\n  );\n};\n\nclass MultiTableEntry {\n  /**\n   *\n   * @param {Object} options\n   * @param {string} options.identifier\n   * @param {DataCatalog} options.dataCatalog\n   * @param {string[][]} options.paths\n   * @constructor\n   */\n  constructor(options) {\n    const self = this;\n    self.identifier = options.identifier;\n    self.dataCatalog = options.dataCatalog;\n    self.paths = options.paths;\n\n    self.topAggs = undefined;\n    self.topAggsPromise = undefined;\n\n    self.topColumns = undefined;\n    self.topColumnsPromise = undefined;\n\n    self.topFilters = undefined;\n    self.topFiltersPromise = undefined;\n\n    self.topJoins = undefined;\n    self.topJoinsPromise = undefined;\n  }\n\n  /**\n   * Save the multi table entry to cache\n   *\n   * @return {Promise}\n   */\n  save() {\n    const self = this;\n    window.clearTimeout(self.saveTimeout);\n    return self.dataCatalog.persistMultiTableEntry(self);\n  }\n\n  /**\n   * Save the multi table entry at a later point of time\n   */\n  saveLater() {\n    const self = this;\n    if (CACHEABLE_TTL.default > 0) {\n      window.clearTimeout(self.saveTimeout);\n      self.saveTimeout = window.setTimeout(() => {\n        self.save();\n      }, 1000);\n    }\n  }\n  /**\n   * Helper function that ensure that cancellable promises are not tracked anymore when cancelled\n   *\n   * @param {string} promiseName - The attribute name to use\n   * @param {CancellableJqPromise} cancellableJqPromise\n   */\n  trackedPromise(promiseName, cancellableJqPromise) {\n    const self = this;\n    self[promiseName] = cancellableJqPromise;\n    return cancellableJqPromise.fail(() => {\n      if (cancellableJqPromise.cancelled) {\n        delete self[promiseName];\n      }\n    });\n  }\n\n  /**\n   * Returns the dialect of this entry.\n   *\n   * @return {string} - 'impala', 'hive', 'solr', etc.\n   */\n  getDialect() {\n    return this.getConnector().dialect || this.getConnector().id; // .id for editor v1\n  }\n\n  /**\n   * Returns the connector for this entry\n   *\n   * @return {Connector}\n   */\n  getConnector() {\n    return this.dataCatalog.connector;\n  }\n\n  /**\n   * Gets the top aggregate UDFs for the entry. It will fetch it if not cached or if the refresh option is set.\n   *\n   * @param {Object} [options]\n   * @param {boolean} [options.silenceErrors] - Default false\n   * @param {boolean} [options.cachedOnly] - Default false\n   * @param {boolean} [options.refreshCache] - Default false\n   * @param {boolean} [options.cancellable] - Default false\n   *\n   * @return {CancellableJqPromise}\n   */\n  getTopAggs(options) {\n    const optimizer = getOptimizer(this.dataCatalog.connector);\n    return genericOptimizerGet(\n      this,\n      options,\n      'topAggsPromise',\n      'topAggs',\n      optimizer.fetchTopAggs.bind(optimizer)\n    );\n  }\n\n  /**\n   * Gets the top columns for the entry. It will fetch it if not cached or if the refresh option is set.\n   *\n   * @param {Object} [options]\n   * @param {boolean} [options.silenceErrors] - Default false\n   * @param {boolean} [options.cachedOnly] - Default false\n   * @param {boolean} [options.refreshCache] - Default false\n   * @param {boolean} [options.cancellable] - Default false\n   *\n   * @return {CancellableJqPromise}\n   */\n  getTopColumns(options) {\n    const optimizer = getOptimizer(this.dataCatalog.connector);\n    return genericOptimizerGet(\n      this,\n      options,\n      'topColumnsPromise',\n      'topColumns',\n      optimizer.fetchTopColumns.bind(optimizer)\n    );\n  }\n\n  /**\n   * Gets the top filters for the entry. It will fetch it if not cached or if the refresh option is set.\n   *\n   * @param {Object} [options]\n   * @param {boolean} [options.silenceErrors] - Default false\n   * @param {boolean} [options.cachedOnly] - Default false\n   * @param {boolean} [options.refreshCache] - Default false\n   * @param {boolean} [options.cancellable] - Default false\n   *\n   * @return {CancellableJqPromise}\n   */\n  getTopFilters(options) {\n    const optimizer = getOptimizer(this.dataCatalog.connector);\n    return genericOptimizerGet(\n      this,\n      options,\n      'topFiltersPromise',\n      'topFilters',\n      optimizer.fetchTopFilters.bind(optimizer)\n    );\n  }\n\n  /**\n   * Gets the top joins for the entry. It will fetch it if not cached or if the refresh option is set.\n   *\n   * @param {Object} [options]\n   * @param {boolean} [options.silenceErrors] - Default false\n   * @param {boolean} [options.cachedOnly] - Default false\n   * @param {boolean} [options.refreshCache] - Default false\n   * @param {boolean} [options.cancellable] - Default false\n   *\n   * @return {CancellableJqPromise}\n   */\n  getTopJoins(options) {\n    const optimizer = getOptimizer(this.dataCatalog.connector);\n    return genericOptimizerGet(\n      this,\n      options,\n      'topJoinsPromise',\n      'topJoins',\n      optimizer.fetchTopJoins.bind(optimizer)\n    );\n  }\n}\n\nexport default MultiTableEntry;", "domain": "javascript", "lang": "code", "char_count": 8095, "word_count": 1529, "byte_count": 8095}
{"text": "import * as openpgp from 'openpgp'\n\nopenpgp.config.aead_protect = false\nopenpgp.config.prefer_hash_algorithm = 2 // SHA1\nvar hkp = new openpgp.HKP('https://pgp.mit.edu')\nvar hkp2 = new openpgp.HKP('http://keys.gnupg.net')\nvar keyring = new openpgp.Keyring()\n\n// Print a key\nfunction printKey () {\n  let keyid = printKeyid(this.primaryKey.getKeyId())\n  let userid = printUser(this.getPrimaryUser().user)\n  return keyid + ' ' + userid\n}\n// openpgp.key.toString = printKey\n\nfunction printKeyid (keyid) {\n  return keyid.toHex()\n}\n// openpgp.Keyid.prototype.toString = openpgp.Keyid.prototype.toHex\n\nfunction printUser (user) {\n  return user.userId.userid\n}\n\nfunction getFullSignature (signature) {\n  let key = keyring.getKeysForId(printKeyid(signature.keyid))[0]\n  let user = key.getPrimaryUser().user\n  signature.user = user\n  signature.email = printUser(user).match(/<(.*)>/)[1]\n  return signature\n}\n\n// Find the public key(s) for `email` on the local browser keyring.\nfunction locallookup (email) {\n  let keys = keyring.publicKeys.getForAddress(email)\n  if (keys.length === 0) {\n    return null\n  }\n  // keys[0].toString = printKey\n  return keys[0]\n}\n\nexport class PGP {\n  // Find the public key(s) for `email` on a server (note - how can you trust the PGP server?) add them to the browser keyring.\n  static async lookup (email) {\n    // Has no option to do an exact email search for some reason.\n    // william@example.net instead returns results for \"william example net\"\n    // so we must work around this stupidity\n    try {\n      let keys = await hkp.lookup({ query: email })\n      if (typeof keys === 'undefined') return null\n      keys = openpgp.key.readArmored(keys).keys\n      // Find keys with an exact match for the email address given\n      let results = []\n      for (let k of keys) {\n        for (let u of k.users) {\n          if (u.userId.userid.includes(`<${email}>`)) {\n            results.push(k.primaryKey.keyid.toHex())\n            keyring.publicKeys.push(k)\n          }\n        }\n      }\n      results = results.length > 0 ? results : null\n      return results\n    } catch (err) {\n      console.log('err =', err)\n      return null\n    }\n  }\n\n  // Generate a key pair in the browser and add it to the browser keyring.\n  static async keygen (name, email) {\n    const { privateKeyArmored, publicKeyArmored } = await openpgp.generateKey({\n      userIds: [\n        {\n          name: name,\n          email: email\n        }\n      ]\n    })\n    keyring.publicKeys.importKey(publicKeyArmored)\n    keyring.privateKeys.importKey(privateKeyArmored)\n    // let key = openpgp.key.readArmored(privateKeyArmored).keys[0]\n    // key.toString = printKey\n    // We need to manually call this to save the keypair to localstorage\n    keyring.store()\n  }\n\n  // Returns a human-readable list of all the public keys in the browser's keyring.\n  static async list () {\n    let print = []\n    for (let key of keyring.publicKeys.keys) {\n      print.push(printKey.apply(key))\n    }\n    return print\n  }\n\n  // Encrypt `msg` using the public key for `email`\n  static async encrypt (email, msg) {\n    // Load Alice's keypair from localstorage\n    // let privateKey = keyring.privateKeys.keys[0]\n    let publicKey = locallookup(email)\n    const encrypted = await openpgp.encrypt({\n      publicKeys: publicKey, // NOTE: it's plural...\n      data: msg\n    })\n    return encrypted.data\n  }\n\n  // Decrypt `msg` using the private key for `email`\n  // msg should be the full encrypted message including the -----BEGIN PGP MESSAGE----- and -----END PGP MESSAGE----- lines.\n  static async decrypt (email, msg) {\n    let privateKey = PGP.lookupPrivateKey(email)\n    const decrypted = openpgp.decrypt({\n      privateKey: privateKey,\n      message: openpgp.message.readArmored(msg)\n    })\n    return decrypted.data\n  }\n\n  // Sign `msg` using the private key for `email'\n  static async sign (email, msg) {\n    // Load keypair from localstorage\n    let privateKey = PGP.lookupPrivateKey(email)\n    if (privateKey) {\n      const signed = await openpgp.sign({\n        privateKeys: privateKey,\n        data: msg\n      })\n      return signed.data\n    } else {\n      throw new Error(\n        'No PrivateKey in the OpenPGP keyring for the email address: ' + email\n      )\n    }\n  }\n\n  // Verify a signed `msg` using the public key for `email`\n  static async verify (email, msg) {\n    let publicKeys = locallookup(email)\n    const verified = await openpgp.verify({\n      publicKeys: publicKeys,\n      message: openpgp.cleartext.readArmored(msg)\n    })\n    let signature = verified.signatures.map(getFullSignature)\n    signature = signature.filter(x => x.email === email)\n    if (signature.length !== 1) {\n      return false\n    } else {\n      return signature[0].valid\n    }\n  }\n\n  // Sign `plaintext` using the private key for `email'\n  static async createBinaryDetachedSignature (email, plaintext) {\n    // Load keypair from localstorage\n    let privateKey = PGP.lookupPrivateKey(email)\n    if (privateKey) {\n      // Is the only difference between cleartext signatures and detached binary the text normalization?\n      // If so, I could probably add that functionality to openpgpjs - I'd just need a little guidance\n      // on how to encode the PacketType and add the functionality to export to armor.js\n      let bytes = openpgp.util.str2Uint8Array(plaintext)\n      let message = openpgp.message.fromBinary(bytes)\n      let signedMessage = message.sign([privateKey])\n      let signature = signedMessage.packets.filterByTag(\n        openpgp.enums.packet.signature\n      )\n      let armoredMessage = openpgp.armor.encode(\n        openpgp.enums.armor.message,\n        signature.write()\n      )\n      // Github won't recognize the signature unless we rename the headers (Tested 2017-01-04)\n      armoredMessage = armoredMessage.replace(\n        '-----BEGIN PGP MESSAGE-----\\r\\n',\n        '-----BEGIN PGP SIGNATURE-----\\r\\n'\n      )\n      armoredMessage = armoredMessage.replace(\n        '-----END PGP MESSAGE-----\\r\\n',\n        '-----END PGP SIGNATURE-----\\r\\n'\n      )\n      return armoredMessage\n    } else {\n      throw new Error(\n        'No PrivateKey in the OpenPGP keyring for the email address: ' + email\n      )\n    }\n  }\n\n  // Verify `message` with detached `signature` using the public key for `email`\n  static async verifyDetachedSignature (email, message, signature) {\n    locallookup(email)\n    console.log('email, message, signature =', email, message, signature)\n    let msg = openpgp.message.readSignedContent(message, signature)\n    console.log('msg =', msg)\n    var result = msg.verify(keyring.publicKeys.keys)\n    console.log('result[0] =', result[0])\n    console.log('keyid =', printKeyid(result[0].keyid))\n    return result[0].valid\n  }\n\n  // Returns true if the keyring has a private key for `email`.\n  static hasPrivateKey (email) {\n    let keys = keyring.privateKeys.getForAddress(email)\n    return keys.length > 0\n  }\n\n  // Export public signing key\n  static exportPublicKey (email) {\n    return PGP.lookupPrivateKey(email)\n      .toPublic()\n      .armor()\n      .trim()\n      .replace(/\\r/g, '')\n  }\n\n  // Upload the public signing key to the MIT key server\n  static async publish (email) {\n    let key = PGP.exportPublicKey(email)\n    return Promise.all([hkp.upload(key), hkp2.upload(key)])\n  }\n\n  static lookupPrivateKey (email) {\n    let keys = keyring.privateKeys.getForAddress(email)\n    if (keys.length === 0) {\n      return null\n    }\n    // keys[0].toString = printKey\n    return keys[0]\n  }\n}", "domain": "javascript", "lang": "code", "char_count": 7495, "word_count": 1565, "byte_count": 7495}
{"text": "export default class Counter {\n  constructor() {\n    this.count = 0;\n    this.$value = document.querySelector(\"#value\");\n    this.initEventListeners();\n  }\n\n  increase() {\n    if (this.count >= 10) {\n      return;\n    }\n    this.count += 1;\n    this.$value.innerText = this.count;\n  }\n\n  decrease() {\n    if (this.count <= 0) {\n      return;\n    }\n    this.count -= 1;\n    this.$value.innerText = this.count;\n  }\n\n  reset() {\n    this.count = 0;\n    this.$value.innerText = this.count;\n  }\n\n  initEventListeners() {\n    document\n      .querySelector(\".increase-btn\")\n      .addEventListener(\"click\", this.increase.bind(this));\n\n    document\n      .querySelector(\".decrease-btn\")\n      .addEventListener(\"click\", this.decrease.bind(this));\n\n    document\n      .querySelector(\".reset-btn\")\n      .addEventListener(\"click\", this.reset.bind(this));\n  }\n}", "domain": "javascript", "lang": "code", "char_count": 850, "word_count": 204, "byte_count": 850}
{"text": "import {\n  refreshLinks,\n  setMenuItems,\n  toggleAutoRefresh,\n  toggleDisplayFolderLinks,\n  toggleRepeatFolders,\n  allFoldersHandler,\n  folderPicked,\n  generateLinks,\n  processRemoveFolder,\n  resetCustomFolders,\n  showPicker,\n  showPrompt,\n  showRemoveFolderPrompt\n} from './core';\nimport { getOAuthToken } from './utils';\n\nglobal.refreshLinks = refreshLinks;\n\n/**\n * Simple trigger that runs on sheet open.\n */\nglobal.onOpen = event => {\n  try {\n    setMenuItems(event);\n  } catch (e) {\n    Logger.log(e);\n  }\n};\n\n/**\n * Simple trigger that runs upon addon installation.\n */\nglobal.onInstall = e => {\n  global.onOpen(e);\n};\n\nglobal.toggleAutoRefresh = toggleAutoRefresh;\nglobal.toggleDisplayFolderLinks = toggleDisplayFolderLinks;\nglobal.toggleRepeatFolders = toggleRepeatFolders;\n\nglobal.getOAuthToken = getOAuthToken;\n\nglobal.allFoldersHandler = allFoldersHandler;\nglobal.folderPicked = folderPicked;\nglobal.generateLinks = generateLinks;\nglobal.processRemoveFolder = processRemoveFolder;\nglobal.resetCustomFolders = resetCustomFolders;\nglobal.showPicker = showPicker;\nglobal.showPrompt = showPrompt;\nglobal.showRemoveFolderPrompt = showRemoveFolderPrompt;", "domain": "javascript", "lang": "code", "char_count": 1159, "word_count": 192, "byte_count": 1159}
{"text": "// Copyright 2020 the V8 project authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n/**\n * @fileoverview Mutator for object expressions.\n */\n\n'use strict';\n\nconst babelTypes = require('@babel/types');\n\nconst common = require('./common.js');\nconst mutator = require('./mutator.js');\nconst random = require('../random.js');\n\nconst MAX_PROPERTIES = 50;\n\n/**\n * Turn the key of an object property into a string literal.\n */\nfunction keyToString(key) {\n  if (babelTypes.isNumericLiteral(key)) {\n    return babelTypes.stringLiteral(key.value.toString());\n  }\n  if (babelTypes.isIdentifier(key)) {\n    return babelTypes.stringLiteral(key.name);\n  }\n  // Already a string literal.\n  return key;\n}\n\nclass ObjectMutator extends mutator.Mutator {\n  constructor(settings) {\n    super();\n    this.settings = settings;\n  }\n\n  get visitor() {\n    const thisMutator = this;\n\n    return {\n      ObjectExpression(path) {\n        const properties = path.node.properties;\n        if (!random.choose(thisMutator.settings.MUTATE_OBJECTS) ||\n            properties.length > MAX_PROPERTIES) {\n          return;\n        }\n\n        // Use the indices of object properties for mutations. We ignore\n        // getters and setters.\n        const propertyIndicies = [];\n        for (const [index, property] of properties.entries()) {\n          if (babelTypes.isObjectProperty(property)) {\n            propertyIndicies.push(index);\n          }\n        }\n\n        // The mutations below require at least one property.\n        if (!propertyIndicies.length) {\n          return;\n        }\n\n        // Annotate object expression with the action taken.\n        function annotate(message) {\n          thisMutator.annotate(path.node, message);\n        }\n\n        function getOneRandomProperty() {\n          return properties[random.single(propertyIndicies)];\n        }\n\n        function getTwoRandomProperties() {\n          const [a, b] = random.sample(propertyIndicies, 2);\n          return [properties[a], properties[b]];\n        }\n\n        function swapPropertyValues() {\n          if (propertyIndicies.length > 1) {\n            annotate('Swap properties');\n            const [a, b] = getTwoRandomProperties();\n            [a.value, b.value] = [b.value, a.value];\n          }\n        }\n\n        function duplicatePropertyValue() {\n          if (propertyIndicies.length > 1) {\n            const [a, b] = random.shuffle(getTwoRandomProperties());\n            if (common.isLargeNode(b.value)) {\n              return;\n            }\n            annotate('Duplicate a property value');\n            a.value = babelTypes.cloneDeep(b.value);\n          }\n        }\n\n        function insertRandomValue() {\n          annotate('Insert a random value');\n          const property = getOneRandomProperty();\n          property.value = common.randomValue(path);\n        }\n\n        function stringifyKey() {\n          annotate('Stringify a property key');\n          const property = getOneRandomProperty();\n          property.key = keyToString(property.key);\n        }\n\n        function removeProperty() {\n          annotate('Remove a property');\n          properties.splice(random.single(propertyIndicies), 1);\n        }\n\n        // Mutation options. Repeated mutations have a higher probability.\n        const mutations = [\n          swapPropertyValues,\n          swapPropertyValues,\n          duplicatePropertyValue,\n          duplicatePropertyValue,\n          insertRandomValue,\n          insertRandomValue,\n          removeProperty,\n          stringifyKey,\n        ];\n\n        // Perform mutation.\n        random.single(mutations)();\n      },\n    }\n  }\n}\n\nmodule.exports = {\n  ObjectMutator: ObjectMutator,\n};", "domain": "javascript", "lang": "code", "char_count": 3743, "word_count": 686, "byte_count": 3743}
{"text": "/*\n * File: app.js\n *\n * This file was generated by Sencha Architect version 3.0.4.\n * http://www.sencha.com/products/architect/\n *\n * This file requires use of the Sencha Touch 2.3.x library, under independent license.\n * License of Sencha Architect does not include license for Sencha Touch 2.3.x. For more\n * details see http://www.sencha.com/license or contact license@sencha.com.\n *\n * This file will be auto-generated each and everytime you save your project.\n *\n * Do NOT hand edit this file.\n */\n\n// @require @packageOverrides\nExt.Loader.setConfig({\n\n});\n\n\nExt.application({\n\n    requires: [\n        'Ext.MessageBox'\n    ],\n    models: [\n        'Employee'\n    ],\n    stores: [\n        'EmployeeJsonPStore'\n    ],\n    views: [\n        'MainView',\n        'EmployeeNavigationView',\n        'EmployeeList',\n        'EmployeeFormPanel'\n    ],\n    controllers: [\n        'EmployeeController'\n    ],\n    name: 'SenchaCrud',\n\n    getGenericServerMessage: function() {\n        return \"Connectivity Error, try again later.\";\n    },\n\n    launch: function() {\n\n        Ext.create('SenchaCrud.view.MainView', {fullscreen: true});\n    }\n\n});", "domain": "javascript", "lang": "code", "char_count": 1137, "word_count": 205, "byte_count": 1137}
{"text": "var __awaiter=this&&this.__awaiter||function(t,e,r,n){function i(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,o){function a(t){try{u(n.next(t))}catch(t){o(t)}}function s(t){try{u(n[\"throw\"](t))}catch(t){o(t)}}function u(t){t.done?r(t.value):i(t.value).then(a,s)}u((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol===\"function\"&&(a[Symbol.iterator]=function(){return this}),a;function s(t){return function(e){return u([t,e])}}function u(a){if(n)throw new TypeError(\"Generator is already executing.\");while(r)try{if(n=1,i&&(o=a[0]&2?i[\"return\"]:a[0]?i[\"throw\"]||((o=i[\"return\"])&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;if(i=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:r.label++;return{value:a[1],done:false};case 5:r.label++;i=a[1];a=[0];continue;case 7:a=r.ops.pop();r.trys.pop();continue;default:if(!(o=r.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(a[0]===6&&r.label<o[1]){r.label=o[1];o=a;break}if(o&&r.label<o[2]){r.label=o[2];r.ops.push(a);break}if(o[2])r.ops.pop();r.trys.pop();continue}a=e.call(t,r)}catch(t){a=[6,t];i=0}finally{n=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register([\"./p-92f7c087.system.js\",\"./p-d2d3f0b5.system.js\",\"./p-7660814d.system.js\",\"./p-0b5de7fa.system.js\",\"./p-af5365d2.system.js\",\"./p-956bb589.system.js\",\"./p-5fcc633d.system.js\",\"./p-576893c9.system.js\",\"./p-4c5bd054.system.js\"],(function(t){\"use strict\";var e,r,n,i,o,a,s,u,l,c,d,f,h,p,b,m,v,g;return{setters:[function(t){e=t.r;r=t.e;n=t.h;i=t.H;o=t.g},function(t){a=t.e},function(t){s=t.c},function(t){u=t.g},function(){},function(t){l=t.createGesture},function(t){c=t.s},function(t){d=t.i;f=t.b;h=t.c;p=t.g;b=t.e;m=t.f},function(t){v=t.g;g=t.s}],execute:function(){var w=this;var x=function(t,e,r){if(r===void 0){r=400}var n=s();var i=t.host||t;var o=t.querySelector(\".toast-wrapper\");var a=\"calc(-12px - var(--safe-area-bottom, 0px))\";var u=\"calc(12px + var(--safe-area-top, 0px))\";n.addElement(o);switch(e){case\"bottom\":n.fromTo(\"transform\",\"translate3d(0, 200%, 0)\",\"translate3d(0, \"+a+\", 0)\");break;case\"middle\":var l=\"50%\";o.style.top=\"\"+l;n.fromTo(\"opacity\",.01,1);break;default:n.fromTo(\"transform\",\"translate3d(0, -200%, 0)\",\"translate3d(0, \"+u+\", 0)\");break}var c=s().addElement(i).easing(\"cubic-bezier(.155,1.105,.295,1.12)\").duration(r).addAnimation(n);var d=s().beforeStyles({transform:\"translateY(0)\",\"transform-origin\":\"top center\",overflow:\"hidden\"});c.addAnimation(d);return c};var y=function(t,e,r){if(r===void 0){r=300}var n=s();var i=t.host||t;var o=t.querySelector(\".toast-wrapper\");var a=\"calc(-12px - var(--safe-area-bottom, 0px))\";var u=\"calc(12px + var(--safe-area-top, 0px))\";n.addElement(o);switch(e){case\"bottom\":n.fromTo(\"transform\",\"translate3d(0, \"+a+\", 0)\",\"translate3d(0, 200%, 0)\");break;case\"middle\":n.fromTo(\"opacity\",.99,0);break;default:n.fromTo(\"transform\",\"translate3d(0, \"+u+\", 0)\",\"translate3d(0, -200%, 0)\");break}var l=s().addElement(i).easing(\"cubic-bezier(.36,.66,.04,1)\").duration(r).addAnimation(n);var c=s().beforeClearStyles([\"transform\"]).afterClearStyles([\"transform\"]).onFinish((function(t){if(t!==1){return}}));l.addAnimation(c);return l};var k=function(t,e,r,n){var i=t.querySelector(\".toast-wrapper\");var o=i.clientHeight;console.log(o);var s=false;var c=r===\"top\"?-.9999:1e-4;var d=r===\"top\"?1e-4:.9999;var f=function(t){return __awaiter(w,void 0,void 0,(function(){var e;return __generator(this,(function(r){e=t.event.target;if(e){return[2,true]}return[2,false]}))}))};var h=function(){e.progressStart(true,s?1:0)};var p=function(t){var r=a(c,t.deltaY/(o*2),d);e.progressStep(r)};var b=function(t){var r=t.velocityY;var i=a(c,t.deltaY/(o*2),d);var l=(t.deltaY+r*1e3)/o;var f=l>=.5;var h=f?-.001:.001;if(!f){e.easing(\"cubic-bezier(1, 0, 0.68, 0.28)\");h+=u([0,0],[1,0],[.68,.28],[1,1],i)[0]}else{e.easing(\"cubic-bezier(0.32, 0.72, 0, 1)\");h+=u([0,0],[.32,.72],[0,1],[1,1],i)[0]}var p=f?_(i*o,r):_((1-i)*o,r);s=f;m.enable(false);e.onFinish((function(){if(!f){m.enable(true)}})).progressEnd(f?1:0,h,p);if(f){n()}};var m=l({el:t,gestureName:\"toastSwipeToClose\",gesturePriority:40,direction:\"y\",threshold:10,canStart:f,onStart:h,onMove:p,onEnd:b});return m};var _=function(t,e){return a(400,t/Math.abs(e*1.1),500)};var T=\":host{--border-width:0;--border-style:none;--border-color:initial;--box-shadow:0 15px 25px 0 rgba(var(--box-shadow-color, var(--bkkr-text-color-rgb, 0, 0, 0)), 0.1), 0 6px 20px 0 rgba(var(--box-shadow-color, var(--bkkr-text-color-rgb, 0, 0, 0)), 0.12), 0 13.2px 40px 0 rgba(var(--box-shadow-color, var(--bkkr-text-color-rgb, 0, 0, 0)), 0.08);--min-width:auto;--width:auto;--min-height:auto;--height:auto;--max-height:auto;--white-space:pre-wrap;--background:var(--bkkr-background-color, #fff);--border-radius:2em;--button-color:color-get(primary, base);--color:var(--bkkr-color-step-850, #262626);--max-width:700px;--start:calc(var(--bkkr-spacer, 16px) / 2);--end:var(--start);top:0;left:0;display:block;position:absolute;width:100%;height:100%;outline:none;color:var(--color);font-family:var(--default-font-sans-serif);font-size:14px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;contain:strict;z-index:1001;pointer-events:none}:host(.overlay-hidden){display:none}.toast-wrapper{border-radius:var(--border-radius);right:var(--end);left:var(--start);margin-left:auto;margin-right:auto;margin-top:auto;margin-bottom:auto;display:block;position:absolute;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow)}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.toast-wrapper{margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}.toast-container{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;height:inherit;min-height:inherit;max-height:inherit;pointer-events:auto;contain:content}.toast-content{padding-left:15px;padding-right:15px;padding-top:15px;padding-bottom:15px;display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;text-align:center}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.toast-content{padding-left:unset;padding-right:unset;-webkit-padding-start:15px;padding-inline-start:15px;-webkit-padding-end:15px;padding-inline-end:15px}}.toast-header{margin-bottom:2px;font-weight:700}.toast-message{-ms-flex:1;flex:1;white-space:var(--white-space)}.toast-button-group{display:-ms-flexbox;display:flex}.toast-button{border:0;outline:none;color:var(--button-color);z-index:0}.toast-icon{font-size:1.4em}.toast-button-inner{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.toast-wrapper.toast-top{top:0;-webkit-transform:translate3d(0, -200%, 0);transform:translate3d(0, -200%, 0)}.toast-wrapper.toast-middle{opacity:0.01}.toast-wrapper.toast-bottom{bottom:0;-webkit-transform:translate3d(0, 200%, 0);transform:translate3d(0, 200%, 0)}:host(.bkkr-color){--button-color:inherit;color:current-color(contrast)}:host(.bkkr-color) .toast-button-cancel{color:inherit}:host(.bkkr-color) .toast-wrapper{background:current-color(base)}\";var C=t(\"bkkr_toast\",function(){function t(t){var n=this;e(this,t);this.didPresent=r(this,\"toastDidPresent\",7);this.willPresent=r(this,\"toastWillPresent\",7);this.willDismiss=r(this,\"toastWillDismiss\",7);this.didDismiss=r(this,\"toastDidDismiss\",7);this.gestureAnimationDismissing=false;this.presented=false;this.duration=0;this.keyboardClose=false;this.position=\"top\";this.swipeToClose=true;this.animated=true;this.dispatchCancelHandler=function(t){var e=t.detail.role;if(d(e)){var r=n.getButtons().find((function(t){return t.role===\"cancel\"}));n.callButtonHandler(r)}}}t.prototype.swipeToCloseChanged=function(t){if(this.gesture){this.gesture.enable(t)}else if(t){this.initSwipeToClose()}};t.prototype.connectedCallback=function(){f(this.el)};t.prototype.present=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(e){switch(e.label){case 0:return[4,h(this,x,this.position)];case 1:e.sent();if(this.swipeToClose){this.initSwipeToClose()}if(this.duration>0){this.durationTimeout=setTimeout((function(){return t.dismiss(undefined,\"timeout\")}),this.duration)}return[2]}}))}))};t.prototype.initSwipeToClose=function(){var t=this;var e=this.leaveAnimation||y;var r=this.animation=e(this.el.shadowRoot,this.position);this.gesture=k(this.el.shadowRoot,r,this.position,(function(){t.gestureAnimationDismissing=true;t.animation.onFinish((function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.dismiss(undefined,\"gesture\")];case 1:t.sent();this.gestureAnimationDismissing=false;return[2]}}))}))}))}));this.gesture.enable(true)};t.prototype.dismiss=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r,n;return __generator(this,(function(i){switch(i.label){case 0:if(this.gestureAnimationDismissing&&e!==\"gesture\"){return[2,false]}if(this.durationTimeout){clearTimeout(this.durationTimeout)}r=p.get(this)||[];return[4,b(this,t,e,y,this.position)];case 1:n=i.sent();if(n){if(this.animation){this.animation.destroy()}r.forEach((function(t){return t.destroy()}))}this.animation=undefined;return[2,n]}}))}))};t.prototype.onDidDismiss=function(){return m(this.el,\"toastDidDismiss\")};t.prototype.onWillDismiss=function(){return m(this.el,\"toastWillDismiss\")};t.prototype.getButtons=function(){var t=this.buttons?this.buttons.map((function(t){return typeof t===\"string\"?{text:t}:t})):[];return t};t.prototype.buttonClick=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r;return __generator(this,(function(n){switch(n.label){case 0:e=t.role;if(d(e)){return[2,this.dismiss(undefined,e)]}return[4,this.callButtonHandler(t)];case 1:r=n.sent();if(r){return[2,this.dismiss(undefined,e)]}return[2,Promise.resolve()]}}))}))};t.prototype.callButtonHandler=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r;return __generator(this,(function(n){switch(n.label){case 0:if(!(t&&t.handler))return[3,4];n.label=1;case 1:n.trys.push([1,3,,4]);return[4,t.handler()];case 2:e=n.sent();if(e===false){return[2,false]}return[3,4];case 3:r=n.sent();console.error(r);return[3,4];case 4:return[2,true]}}))}))};t.prototype.renderButtons=function(t,e){var r;var i=this;if(t.length===0){return}var o=(r={\"toast-button-group\":true},r[\"toast-button-group-\"+e]=true,r);return n(\"div\",{class:o},t.map((function(t){return n(\"button\",{type:\"button\",class:D(t),tabIndex:0,onClick:function(){return i.buttonClick(t)},part:\"button\"},n(\"div\",{class:\"toast-button-inner\"},t.icon&&n(\"BKKR-icon\",{icon:t.icon,slot:t.text===undefined?\"icon-only\":undefined,class:\"toast-icon\"}),t.text))})))};t.prototype.render=function(){var t;var e=this.getButtons();var r=e.filter((function(t){return t.side===\"start\"}));var o=e.filter((function(t){return t.side!==\"start\"}));var a=(t={\"toast-wrapper\":true},t[\"toast-\"+this.position]=true,t);return n(i,{style:{zIndex:\"\"+(6e4+this.overlayIndex)},class:g(this.color,Object.assign({},v(this.cssClass))),tabindex:\"-1\",onBkkrToastWillDismiss:this.dispatchCancelHandler},n(\"div\",{class:a},n(\"div\",{class:\"toast-container\",part:\"container\"},this.renderButtons(r,\"start\"),n(\"div\",{class:\"toast-content\"},this.header!==undefined&&n(\"div\",{class:\"toast-header\",part:\"header\"},this.header),this.message!==undefined&&n(\"div\",{class:\"toast-message\",part:\"message\",innerHTML:c(this.message)})),this.renderButtons(o,\"end\"))))};Object.defineProperty(t.prototype,\"el\",{get:function(){return o(this)},enumerable:false,configurable:true});Object.defineProperty(t,\"watchers\",{get:function(){return{swipeToClose:[\"swipeToCloseChanged\"]}},enumerable:false,configurable:true});return t}());var D=function(t){var e;return Object.assign((e={\"toast-button\":true,\"toast-button-icon-only\":t.icon!==undefined&&t.text===undefined},e[\"toast-button-\"+t.role]=t.role!==undefined,e[\"state-focusable\"]=true,e[\"state-activatable\"]=true,e),v(t.cssClass))};C.style=T}}}));", "domain": "javascript", "lang": "code", "char_count": 12724, "word_count": 4887, "byte_count": 12724}
{"text": "import { APP_URL, gen, password, website } from '../../../../helpers'\n\ncontext('Login Flow Success', () => {\n  const email = gen.email()\n  const password = gen.password()\n\n  before(() => {\n    cy.registerApi({ email, password, fields: { 'traits.website': website } })\n  })\n\n  beforeEach(() => {\n    cy.clearCookies()\n    cy.visit(APP_URL + '/auth/login')\n  })\n\n  it('should sign up and be logged in', () => {\n    cy.get('input[name=\"identifier\"]').type(email)\n    cy.get('input[name=\"password\"]').type(password)\n    cy.get('button[type=\"submit\"]').click()\n\n    cy.session().should((session) => {\n      const { identity } = session\n      expect(identity.id).to.not.be.empty\n      expect(identity.schema_id).to.equal('default')\n      expect(identity.schema_url).to.equal(`${APP_URL}/schemas/default`)\n      expect(identity.traits.website).to.equal(website)\n      expect(identity.traits.email).to.equal(email)\n    })\n  })\n\n  it('should sign in with case insensitive identifier', () => {\n    cy.get('input[name=\"identifier\"]').type(email.toUpperCase())\n    cy.get('input[name=\"password\"]').type(password)\n    cy.get('button[type=\"submit\"]').click()\n\n    cy.session().should((session) => {\n      const { identity } = session\n      expect(identity.id).to.not.be.empty\n      expect(identity.schema_id).to.equal('default')\n      expect(identity.schema_url).to.equal(`${APP_URL}/schemas/default`)\n      expect(identity.traits.website).to.equal(website)\n      expect(identity.traits.email).to.equal(email)\n    })\n  })\n})", "domain": "javascript", "lang": "code", "char_count": 1510, "word_count": 439, "byte_count": 1510}
{"text": "// eslint-disable-next-line ember/no-classic-components\nimport Component from '@ember/component';\nimport { action } from '@ember/object';\nimport { reads } from '@ember/object/computed';\nimport { inject } from '@ember/service';\nimport { tagName } from '@ember-decorators/component';\n// eslint-disable-next-line ember/no-mixins\nimport Sortable from 'api-umbrella-admin-ui/mixins/sortable';\nimport bootbox from 'bootbox';\nimport classic from 'ember-classic-decorator';\n\n@classic\n@tagName(\"\")\nexport default class RewriteTable extends Component.extend(Sortable) {\n  @inject()\n  store;\n\n  openModal = false;\n\n  @reads('model.rewrites')\n  sortableCollection;\n\n  @action\n  add() {\n    this.set('rewriteModel', this.store.createRecord('api/rewrite'));\n    this.set('openModal', true);\n  }\n\n  @action\n  edit(rewrite) {\n    this.set('rewriteModel', rewrite);\n    this.set('openModal', true);\n  }\n\n  @action\n  remove(rewrite) {\n    bootbox.confirm('Are you sure you want to remove this rewrite?', function(response) {\n      if(response) {\n        this.model.rewrites.removeObject(rewrite);\n      }\n    }.bind(this));\n  }\n}", "domain": "javascript", "lang": "code", "char_count": 1111, "word_count": 228, "byte_count": 1111}
{"text": "module.exports={A:{A:{\"2\":\"H D G E A B IB\"},B:{\"2\":\"0 C p J L N I\"},C:{\"1\":\"1 4 6 7 8 9 v w x y z AB BB CB\",\"2\":\"0 2 3 cB F K H D G E A B C p J L N I O P Q R S T U V W X Y Z a c d e f g h i j k l m n o M q r s t u aB UB\"},D:{\"1\":\"1 4 6 7 8 9 s t u v w x y z AB BB CB OB GB JB HB eB KB LB MB\",\"2\":\"0 2 F K H D G E A B C p J L N I O P Q R S T U V W X Y Z a c d e f g h i j k l m n o M q r\"},E:{\"1\":\"B C TB b VB\",\"2\":\"F K H D G E A NB FB PB QB RB SB\"},F:{\"1\":\"f g h i j k l m n o M q r s t u v w x y z\",\"2\":\"2 E B C J L N I O P Q R S T U V W X Y Z a c d e WB XB YB ZB b DB bB EB\"},G:{\"1\":\"C mB nB oB\",\"2\":\"5 G FB dB fB gB hB iB jB kB lB\"},H:{\"2\":\"pB\"},I:{\"1\":\"GB\",\"2\":\"3 5 F qB rB sB tB uB vB\"},J:{\"2\":\"D A\"},K:{\"1\":\"M\",\"2\":\"A B C b DB EB\"},L:{\"1\":\"HB\"},M:{\"1\":\"1\"},N:{\"2\":\"A B\"},O:{\"1\":\"wB\"},P:{\"1\":\"K xB yB\",\"2\":\"F\"},Q:{\"1\":\"zB\"},R:{\"1\":\"0B\"}},B:1,C:\"rel=noopener\"};", "domain": "javascript", "lang": "code", "char_count": 865, "word_count": 541, "byte_count": 865}
{"text": "var express = require(\"express\")\nvar pokemon = require(\"../models/pokemon\")\nvar router = express.Router(); //create router here\n\nrouter.get(\"/\", function(req, res){\n    pokemon.all(function(data){\n        var pokemonObj = {\n            pokemons: data\n        };\n        console.log(pokemonObj);\n        res.render(\"index\", pokemonObj)\n    });\n});\n\nrouter.post(\"/api/pokemons\", function(req, res) {\n    pokemon.add([\n        \"pokemon_name\"\n      ], [\n        req.body.pokemon_name\n      ], function(result) {\n        // Send back the ID of the new quote\n        res.json({ id: result.insertId });\n      });\n    });\n\nrouter.put(\"/api/pokemons/:id\", function(req, res) {\n        var condition = \"id = \" + req.params.id;\n      \n        console.log(\"condition\", condition);\n      \n        pokemon.update({\n          caught: true\n        }, condition, function(result) {\n          if (result.changedRows == 0) {\n            // If no rows were changed, then the ID must not exist, so 404\n            return res.status(404).end();\n          } else {\n            res.status(200).end();\n          }\n        });\n      });\n\nmodule.exports = router;", "domain": "javascript", "lang": "code", "char_count": 1136, "word_count": 276, "byte_count": 1136}
{"text": "/*!\n    * assets-reload v1.3.0\n    * (c) 2019 wilsonliuxyz@gmail.com\n    * @description switch all assets cdn name (script,link,background-image,img). when you open one website in a test domain you can switch cdn name to location.hostname\n    * @license MIT\n    */\n(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n\ttypeof define === 'function' && define.amd ? define(factory) :\n\t(global.assetsReload = factory());\n}(this, (function () { 'use strict';\n\nvar AssetsReload = function AssetsReload(replaceFunc, beforeInsertHook) {\n  this.replaceFunc = replaceFunc;\n  this.beforeInsertHook = beforeInsertHook || (function () {});\n  this.reloadCache = {\n    SCRIPT: [],\n    IMG: [],\n    LINK: [],\n    BACKGROUNDIMAGE: []\n  };\n\n  this.mapConf = {\n    SCRIPT: {\n      linkKey: 'src',\n    },\n    IMG: {\n      linkKey: 'src',\n    },\n    LINK: {\n      linkKey: 'href',\n    }\n  };\n};\n// reload all of one type assets enum: SCRIPT IMG LINK\nAssetsReload.prototype.reloadAll = function reloadAll (nodeName) {\n  var domNodeList = document.getElementsByTagName(nodeName);\n  var len = domNodeList.length;\n  if (len === 0) {\n    return false\n  }\n  for (var i = 0; i < len; i++) {\n    this.reload(domNodeList[i]);\n  }\n};\n/**\n *\n **/\nAssetsReload.prototype.reload = function reload (domElement) {\n  var nodeName = domElement.nodeName;\n  var ref = this.mapConf[nodeName];\n    var linkKey = ref.linkKey;\n  var link = domElement[linkKey];\n\n  var newUrl = this.replaceFunc(link, domElement);\n  if (!newUrl) {\n    return false\n  }\n\n  var newNode = document.createElement(nodeName);\n  this.extendAttr(domElement, newNode);\n\n  newNode[linkKey] = newUrl;\n  this.beforeInsertHook(nodeName, domElement, newNode);\n  this.reloadCache[nodeName].push(link);\n  domElement.parentNode.insertBefore(newNode, domElement);\n  domElement.parentNode.removeChild(domElement);\n};\n/**\n * @desc replace backgroundImage\n **/\nAssetsReload.prototype.reloadBackgroundImage = function reloadBackgroundImage () {\n  // detect is support styleSheets\n  var isSupportStyleSheets = document.styleSheets && document.styleSheets[0];\n  if (!isSupportStyleSheets) { return false }\n\n  var styleSheetsLength = document.styleSheets.length;\n  for (var i = 0; i < styleSheetsLength; i++) {\n    var styleSheets = document.styleSheets[i];\n    try {\n      if (!(styleSheets.rules && styleSheets.rules.length > 0)) {\n        continue\n      }\n      for (var j = 0; j < styleSheets.rules.length; j++) {\n        var item = styleSheets.rules[j];\n        // is back null\n        var backStr = item.selectorText && item.style && item.style.backgroundImage;\n        if (!backStr) {\n          continue\n        }\n        // is has real url\n        var matchRes = backStr.match(/url\\([\"|'](.*)[\"|']\\)/);\n        var backgroundImage = matchRes && matchRes[1];\n        if (!backgroundImage) {\n          continue\n        }\n        // base64 not replace\n        if (backgroundImage.indexOf('data:image/') !== -1) {\n          continue;\n        }\n        var nodeName = \"BACKGROUNDIMAGE\";\n        var newUrl = this.replaceFunc(backgroundImage, item);\n\n        if (!newUrl) {\n          continue\n        }\n        var cssText = item.selectorText + \"{ background-image: url(\" + newUrl + \")}\";\n        var cssTextKey = i + cssText;\n        if (this.reloadCache[nodeName].indexOf(cssTextKey) === -1) {\n          this.beforeInsertHook(nodeName, backgroundImage, newUrl);\n          this.reloadCache[nodeName].push(cssTextKey);\n          // insertRule tail styleSheets\n\n          styleSheets.insertRule(cssText, styleSheets.rules.length);\n        }\n      }\n    } catch (err) {\n      console.log(\"CdnAssetsSwitch replaceBackGroundImage\", err);\n    }\n  }\n};\n/**\n * @desc entend origin node attributes\n **/\nAssetsReload.prototype.extendAttr = function extendAttr (oldNode, newNode) {\n  var attrMap = {\n    'crossorigin': 'crossOrigin'\n  };\n  if (!(oldNode && oldNode.attributes)) {\n    return\n  }\n  for (var key in oldNode.attributes) {\n    if (oldNode.attributes.hasOwnProperty(key)) {\n      var nodeAttr = oldNode.attributes[key];\n      var name = attrMap[nodeAttr.name] || nodeAttr.name;\n      // extend function\n      if (['onerror', 'onload', 'onabort'].indexOf(name) !== -1) {\n        newNode[name] = oldNode[name];\n      } else {\n        newNode[nodeAttr.name] = nodeAttr.value;\n      }\n    }\n  }\n};\n\nreturn AssetsReload;\n\n})));", "domain": "javascript", "lang": "code", "char_count": 4409, "word_count": 973, "byte_count": 4409}
{"text": "// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors\n// For license information, please see license.txt\n/* eslint-disable */\n\nfrappe.query_reports[\"Inactive Sales Items\"] = {\n\t\"filters\": [\n\t\t{\n\t\t\tfieldname: \"territory\",\n\t\t\tlabel: __(\"Territory\"),\n\t\t\tfieldtype: \"Link\",\n\t\t\toptions: \"Territory\",\n\t\t\treqd: 1,\n\t\t},\n\t\t{\n\t\t\tfieldname: \"item\",\n\t\t\tlabel: __(\"Item\"),\n\t\t\tfieldtype: \"Link\",\n\t\t\toptions: \"Item\"\n\t\t},\n\t\t{\n\t\t\tfieldname: \"item_group\",\n\t\t\tlabel: __(\"Item Group\"),\n\t\t\tfieldtype: \"Link\",\n\t\t\toptions: \"Item Group\"\n\t\t},\n\t\t{\n\t\t\tfieldname: \"based_on\",\n\t\t\tlabel: __(\"Based On\"),\n\t\t\tfieldtype: \"Select\",\n\t\t\toptions: \"Sales Order\\nSales Invoice\",\n\t\t\tdefault: \"Sales Order\"\n\t\t},\n\t\t{\n\t\t\tfieldname: \"days\",\n\t\t\tlabel: __(\"Days Since Last order\"),\n\t\t\tfieldtype: \"Select\",\n\t\t\toptions: [30, 60, 90],\n\t\t\tdefault: 30\n\t\t},\n\t]\n};", "domain": "javascript", "lang": "code", "char_count": 827, "word_count": 220, "byte_count": 827}
{"text": "import React from 'react';\n\nexport default function WindSun(props) {\n  return (\n    <svg xmlns=\"http://www.w3.org/2000/svg\" data-name=\"Layer 1\" viewBox=\"0 0 24 24\" width={24} height={24} {...props}>\n      <path d=\"M11,4.5a.99943.99943,0,0,0,1-1v-1a1,1,0,0,0-2,0v1A.99943.99943,0,0,0,11,4.5Zm-7,7a.99943.99943,0,0,0-1-1H2a1,1,0,0,0,0,2H3A.99943.99943,0,0,0,4,11.5Zm.63574,4.9502-.707.707a.99989.99989,0,1,0,1.41406,1.41406l.707-.707A.99989.99989,0,1,0,4.63574,16.4502Zm0-9.9004A.99989.99989,0,0,0,6.0498,5.13574l-.707-.707A.99989.99989,0,0,0,3.92871,5.84277Zm12.02149.293a.99672.99672,0,0,0,.707-.293l.707-.707a.99989.99989,0,1,0-1.41406-1.41406l-.707.707a1,1,0,0,0,.707,1.707ZM13,12a.99943.99943,0,0,0,1,1h5a3.00328,3.00328,0,0,0,3-3,1,1,0,0,0-2,0,1.01348,1.01348,0,0,1-1,1H14A.99943.99943,0,0,0,13,12Zm7,3H15a1,1,0,0,0,0,2h5a1,1,0,0,1,0,2,1,1,0,0,0,0,2,3,3,0,0,0,0-6ZM9,19a1,1,0,1,0,1,1A1,1,0,0,0,9,19Zm6,0H13a1,1,0,0,0,0,2h2a1.01348,1.01348,0,0,1,1,1,1,1,0,0,0,2,0A3.00328,3.00328,0,0,0,15,19Zm-4-4a3.5,3.5,0,0,1,0-7,3.41539,3.41539,0,0,1,2.1875.77441,1.00008,1.00008,0,1,0,1.26562-1.54882A5.39339,5.39339,0,0,0,11,6a5.5,5.5,0,0,0,0,11,1,1,0,0,0,0-2Z\" />\n    </svg>\n  );\n}", "domain": "javascript", "lang": "code", "char_count": 1174, "word_count": 78, "byte_count": 1174}
{"text": "(function($) {\n    \"use strict\"; // Start of use strict\n\n    $(window).on('load', function() {\n        var $allSlides, $flexslider;\n        if (jQuery().flexslider) {\n            $flexslider = $('.flexslider');\n            $allSlides = $flexslider.find('.item');\n            $flexslider.addClass(\"fade-loading\");\n            return $('.flexslider').flexslider({\n                animation: 'fade',\n                pauseOnHover: true,\n                slideshowSpeed: 5000,\n                animationSpeed: 400,\n                prevText: '',\n                nextText: '',\n                before: function(slider) {\n                    var $activeSlide;\n                    $activeSlide = $flexslider.find('.flex-active-slide');\n                    if ($activeSlide.index() === $allSlides.length - 1) {\n                        $allSlides.eq(0).find('.animate').children().addClass(\"animate\").removeClass(\"animated\");\n                        $allSlides.not('.flex-active-slide').find('.animate').children().addClass(\"animate\").removeClass(\"animated\");\n                    } else {\n                        $allSlides.not('.flex-active-slide').find('.animate').children().addClass(\"animate\").removeClass(\"animated\");\n                    }\n                    return setTimeout((function() {\n                        return $allSlides.eq(slider.animatingTo).find('.animate').children().addClass(\"animated\").removeClass(\"animate\");\n                    }), 50);\n                }\n            });\n        }\n    });\n\n})(jQuery);", "domain": "javascript", "lang": "code", "char_count": 1514, "word_count": 302, "byte_count": 1514}
{"text": "/*!\n * VisualEditor IME test for Internet Explorer on Windows in Korean.\n *\n * @copyright 2011-2015 VisualEditor Team and others; see http://ve.mit-license.org\n */\n\nve.ce.imetests.push( [ 'input-ie-win-korean', [\n\t/*jshint quotmark:double */\n\t{\"imeIdentifier\":\"Korean\",\"userAgent\":\"Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; OfficeLiveConnector.1.3; OfficeLivePatch.0.0; .NET4.0C)\",\"startDom\":\"x\"},\n\t{\"seq\":0,\"time\":3611.081,\"action\":\"sendEvent\",\"args\":[\"keydown\",{\"keyCode\":229}]},\n\t{\"seq\":1,\"time\":3611.082,\"action\":\"sendEvent\",\"args\":[\"compositionstart\",{}]},\n\t{\"seq\":2,\"time\":3611.112,\"action\":\"changeText\",\"args\":[\"\u314e\"]},\n\t{\"seq\":3,\"time\":3611.112,\"action\":\"changeSel\",\"args\":[1,1]},\n\t{\"seq\":4,\"time\":3611.112,\"action\":\"endLoop\",\"args\":[]},\n\t{\"seq\":5,\"time\":3611.162,\"action\":\"sendEvent\",\"args\":[\"keyup\",{\"keyCode\":71}]},\n\t{\"seq\":6,\"time\":3611.195,\"action\":\"endLoop\",\"args\":[]},\n\t{\"seq\":7,\"time\":3611.352,\"action\":\"sendEvent\",\"args\":[\"keydown\",{\"keyCode\":229}]},\n\t{\"seq\":8,\"time\":3611.379,\"action\":\"changeText\",\"args\":[\"\ud558\"]},\n\t{\"seq\":9,\"time\":3611.379,\"action\":\"endLoop\",\"args\":[]},\n\t{\"seq\":10,\"time\":3611.493,\"action\":\"sendEvent\",\"args\":[\"keyup\",{\"keyCode\":75}]},\n\t{\"seq\":11,\"time\":3611.513,\"action\":\"endLoop\",\"args\":[]},\n\t{\"seq\":12,\"time\":3611.618,\"action\":\"sendEvent\",\"args\":[\"keydown\",{\"keyCode\":229}]},\n\t{\"seq\":13,\"time\":3611.647,\"action\":\"changeText\",\"args\":[\"\ud55c\"]},\n\t{\"seq\":14,\"time\":3611.647,\"action\":\"endLoop\",\"args\":[]},\n\t{\"seq\":15,\"time\":3611.734,\"action\":\"sendEvent\",\"args\":[\"keyup\",{\"keyCode\":83}]},\n\t{\"seq\":16,\"time\":3611.765,\"action\":\"endLoop\",\"args\":[]},\n\t{\"seq\":17,\"time\":3611.919,\"action\":\"sendEvent\",\"args\":[\"keydown\",{\"keyCode\":229}]},\n\t{\"seq\":18,\"time\":3611.949,\"action\":\"changeText\",\"args\":[\"\ud55c\u3131\"]},\n\t{\"seq\":19,\"time\":3611.949,\"action\":\"changeSel\",\"args\":[2,2]},\n\t{\"seq\":20,\"time\":3611.949,\"action\":\"endLoop\",\"args\":[]},\n\t{\"seq\":21,\"time\":3612.045,\"action\":\"sendEvent\",\"args\":[\"keyup\",{\"keyCode\":82}]},\n\t{\"seq\":22,\"time\":3612.083,\"action\":\"endLoop\",\"args\":[]},\n\t{\"seq\":23,\"time\":3612.386,\"action\":\"sendEvent\",\"args\":[\"keydown\",{\"keyCode\":229}]},\n\t{\"seq\":24,\"time\":3612.418,\"action\":\"changeText\",\"args\":[\"\ud55c\uadf8\"]},\n\t{\"seq\":25,\"time\":3612.418,\"action\":\"endLoop\",\"args\":[]},\n\t{\"seq\":26,\"time\":3612.536,\"action\":\"sendEvent\",\"args\":[\"keyup\",{\"keyCode\":77}]},\n\t{\"seq\":27,\"time\":3612.569,\"action\":\"endLoop\",\"args\":[]},\n\t{\"seq\":28,\"time\":3612.767,\"action\":\"sendEvent\",\"args\":[\"keydown\",{\"keyCode\":229}]},\n\t{\"seq\":29,\"time\":3612.803,\"action\":\"changeText\",\"args\":[\"\ud55c\uae00\"]},\n\t{\"seq\":30,\"time\":3612.803,\"action\":\"endLoop\",\"args\":[]},\n\t{\"seq\":31,\"time\":3612.938,\"action\":\"sendEvent\",\"args\":[\"keyup\",{\"keyCode\":70}]},\n\t{\"seq\":32,\"time\":3612.971,\"action\":\"endLoop\",\"args\":[]},\n\t{\"seq\":33,\"time\":3613.169,\"action\":\"sendEvent\",\"args\":[\"compositionend\",{}]},\n\t{\"seq\":34,\"time\":3613.178,\"action\":\"sendEvent\",\"args\":[\"keydown\",{\"keyCode\":32}]},\n\t{\"seq\":35,\"time\":3613.186,\"action\":\"sendEvent\",\"args\":[\"keypress\",{\"keyCode\":32}]},\n\t{\"seq\":36,\"time\":3613.205,\"action\":\"changeText\",\"args\":[\"\ud55c\uae00 \"]},\n\t{\"seq\":37,\"time\":3613.205,\"action\":\"changeSel\",\"args\":[3,3]},\n\t{\"seq\":38,\"time\":3613.205,\"action\":\"endLoop\",\"args\":[]},\n\t{\"seq\":39,\"time\":3613.309,\"action\":\"sendEvent\",\"args\":[\"keyup\",{\"keyCode\":32}]},\n\t{\"seq\":40,\"time\":3613.339,\"action\":\"endLoop\",\"args\":[]},\n\t{\"seq\":41,\"time\":3613.54,\"action\":\"sendEvent\",\"args\":[\"keydown\",{\"keyCode\":229}]},\n\t{\"seq\":42,\"time\":3613.547,\"action\":\"sendEvent\",\"args\":[\"compositionstart\",{}]},\n\t{\"seq\":43,\"time\":3613.574,\"action\":\"changeText\",\"args\":[\"\ud55c\uae00 \u3145\"]},\n\t{\"seq\":44,\"time\":3613.574,\"action\":\"changeSel\",\"args\":[4,4]},\n\t{\"seq\":45,\"time\":3613.574,\"action\":\"endLoop\",\"args\":[]},\n\t{\"seq\":46,\"time\":3613.69,\"action\":\"sendEvent\",\"args\":[\"keyup\",{\"keyCode\":84}]},\n\t{\"seq\":47,\"time\":3613.725,\"action\":\"endLoop\",\"args\":[]},\n\t{\"seq\":48,\"time\":3613.801,\"action\":\"sendEvent\",\"args\":[\"keydown\",{\"keyCode\":229}]},\n\t{\"seq\":49,\"time\":3613.825,\"action\":\"changeText\",\"args\":[\"\ud55c\uae00 \uc2dc\"]},\n\t{\"seq\":50,\"time\":3613.825,\"action\":\"endLoop\",\"args\":[]},\n\t{\"seq\":51,\"time\":3613.941,\"action\":\"sendEvent\",\"args\":[\"keyup\",{\"keyCode\":76}]},\n\t{\"seq\":52,\"time\":3613.977,\"action\":\"endLoop\",\"args\":[]},\n\t{\"seq\":53,\"time\":3614.047,\"action\":\"sendEvent\",\"args\":[\"keydown\",{\"keyCode\":229}]},\n\t{\"seq\":54,\"time\":3614.077,\"action\":\"changeText\",\"args\":[\"\ud55c\uae00 \uc2f7\"]},\n\t{\"seq\":55,\"time\":3614.077,\"action\":\"endLoop\",\"args\":[]},\n\t{\"seq\":56,\"time\":3614.192,\"action\":\"sendEvent\",\"args\":[\"keyup\",{\"keyCode\":71}]},\n\t{\"seq\":57,\"time\":3614.228,\"action\":\"endLoop\",\"args\":[]},\n\t{\"seq\":58,\"time\":3614.363,\"action\":\"sendEvent\",\"args\":[\"keydown\",{\"keyCode\":229}]},\n\t{\"seq\":59,\"time\":3614.395,\"action\":\"changeText\",\"args\":[\"\ud55c\uae00 \uc2dc\ud5c8\"]},\n\t{\"seq\":60,\"time\":3614.395,\"action\":\"changeSel\",\"args\":[5,5]},\n\t{\"seq\":61,\"time\":3614.395,\"action\":\"endLoop\",\"args\":[]},\n\t{\"seq\":62,\"time\":3614.468,\"action\":\"sendEvent\",\"args\":[\"keyup\",{\"keyCode\":74}]},\n\t{\"seq\":63,\"time\":3614.512,\"action\":\"endLoop\",\"args\":[]},\n\t{\"seq\":64,\"time\":3614.591,\"action\":\"sendEvent\",\"args\":[\"keydown\",{\"keyCode\":229}]},\n\t{\"seq\":65,\"time\":3614.63,\"action\":\"changeText\",\"args\":[\"\ud55c\uae00 \uc2dc\ud5d8\"]},\n\t{\"seq\":66,\"time\":3614.63,\"action\":\"endLoop\",\"args\":[]},\n\t{\"seq\":67,\"time\":3614.764,\"action\":\"sendEvent\",\"args\":[\"keyup\",{\"keyCode\":65}]},\n\t{\"seq\":68,\"time\":3614.814,\"action\":\"endLoop\",\"args\":[]},\n\t{\"seq\":69,\"time\":3614.895,\"action\":\"sendEvent\",\"args\":[\"compositionend\",{}]},\n\t{\"seq\":70,\"time\":3614.904,\"action\":\"sendEvent\",\"args\":[\"keydown\",{\"keyCode\":32}]},\n\t{\"seq\":71,\"time\":3614.912,\"action\":\"sendEvent\",\"args\":[\"keypress\",{\"keyCode\":32}]},\n\t{\"seq\":72,\"time\":3614.931,\"action\":\"changeText\",\"args\":[\"\ud55c\uae00 \uc2dc\ud5d8 \"]},\n\t{\"seq\":73,\"time\":3614.931,\"action\":\"changeSel\",\"args\":[6,6]},\n\t{\"seq\":74,\"time\":3614.931,\"action\":\"endLoop\",\"args\":[]},\n\t{\"seq\":75,\"time\":3615.048,\"action\":\"sendEvent\",\"args\":[\"keyup\",{\"keyCode\":32}]},\n\t{\"seq\":76,\"time\":3615.082,\"action\":\"endLoop\",\"args\":[]},\n\t{\"seq\":77,\"time\":3615.381,\"action\":\"sendEvent\",\"args\":[\"keydown\",{\"keyCode\":229}]},\n\t{\"seq\":78,\"time\":3615.39,\"action\":\"sendEvent\",\"args\":[\"compositionstart\",{}]},\n\t{\"seq\":79,\"time\":3615.417,\"action\":\"changeText\",\"args\":[\"\ud55c\uae00 \uc2dc\ud5d8 \u314e\"]},\n\t{\"seq\":80,\"time\":3615.417,\"action\":\"changeSel\",\"args\":[7,7]},\n\t{\"seq\":81,\"time\":3615.417,\"action\":\"endLoop\",\"args\":[]},\n\t{\"seq\":82,\"time\":3615.486,\"action\":\"sendEvent\",\"args\":[\"keyup\",{\"keyCode\":71}]},\n\t{\"seq\":83,\"time\":3615.535,\"action\":\"endLoop\",\"args\":[]},\n\t{\"seq\":84,\"time\":3615.64,\"action\":\"sendEvent\",\"args\":[\"keydown\",{\"keyCode\":229}]},\n\t{\"seq\":85,\"time\":3615.669,\"action\":\"changeText\",\"args\":[\"\ud55c\uae00 \uc2dc\ud5d8 \ud558\"]},\n\t{\"seq\":86,\"time\":3615.669,\"action\":\"endLoop\",\"args\":[]},\n\t{\"seq\":87,\"time\":3615.762,\"action\":\"sendEvent\",\"args\":[\"keyup\",{\"keyCode\":75}]},\n\t{\"seq\":88,\"time\":3615.803,\"action\":\"endLoop\",\"args\":[]},\n\t{\"seq\":89,\"time\":3615.913,\"action\":\"sendEvent\",\"args\":[\"keydown\",{\"keyCode\":229}]},\n\t{\"seq\":90,\"time\":3615.937,\"action\":\"changeText\",\"args\":[\"\ud55c\uae00 \uc2dc\ud5d8 \ud569\"]},\n\t{\"seq\":91,\"time\":3615.937,\"action\":\"endLoop\",\"args\":[]},\n\t{\"seq\":92,\"time\":3616.066,\"action\":\"sendEvent\",\"args\":[\"keyup\",{\"keyCode\":81}]},\n\t{\"seq\":93,\"time\":3616.104,\"action\":\"endLoop\",\"args\":[]},\n\t{\"seq\":94,\"time\":3616.339,\"action\":\"sendEvent\",\"args\":[\"keydown\",{\"keyCode\":229}]},\n\t{\"seq\":95,\"time\":3616.372,\"action\":\"changeText\",\"args\":[\"\ud55c\uae00 \uc2dc\ud5d8 \ud569\u3134\"]},\n\t{\"seq\":96,\"time\":3616.372,\"action\":\"changeSel\",\"args\":[8,8]},\n\t{\"seq\":97,\"time\":3616.372,\"action\":\"endLoop\",\"args\":[]},\n\t{\"seq\":98,\"time\":3616.485,\"action\":\"sendEvent\",\"args\":[\"keyup\",{\"keyCode\":83}]},\n\t{\"seq\":99,\"time\":3616.523,\"action\":\"endLoop\",\"args\":[]},\n\t{\"seq\":100,\"time\":3616.613,\"action\":\"sendEvent\",\"args\":[\"keydown\",{\"keyCode\":229}]},\n\t{\"seq\":101,\"time\":3616.641,\"action\":\"changeText\",\"args\":[\"\ud55c\uae00 \uc2dc\ud5d8 \ud569\ub2c8\"]},\n\t{\"seq\":102,\"time\":3616.641,\"action\":\"endLoop\",\"args\":[]},\n\t{\"seq\":103,\"time\":3616.726,\"action\":\"sendEvent\",\"args\":[\"keyup\",{\"keyCode\":76}]},\n\t{\"seq\":104,\"time\":3616.775,\"action\":\"endLoop\",\"args\":[]},\n\t{\"seq\":105,\"time\":3616.927,\"action\":\"sendEvent\",\"args\":[\"keydown\",{\"keyCode\":229}]},\n\t{\"seq\":106,\"time\":3616.959,\"action\":\"changeText\",\"args\":[\"\ud55c\uae00 \uc2dc\ud5d8 \ud569\ub2cf\"]},\n\t{\"seq\":107,\"time\":3616.959,\"action\":\"endLoop\",\"args\":[]},\n\t{\"seq\":108,\"time\":3617.08,\"action\":\"sendEvent\",\"args\":[\"keyup\",{\"keyCode\":69}]},\n\t{\"seq\":109,\"time\":3617.126,\"action\":\"endLoop\",\"args\":[]},\n\t{\"seq\":110,\"time\":3617.313,\"action\":\"sendEvent\",\"args\":[\"keydown\",{\"keyCode\":229}]},\n\t{\"seq\":111,\"time\":3617.344,\"action\":\"changeText\",\"args\":[\"\ud55c\uae00 \uc2dc\ud5d8 \ud569\ub2c8\ub2e4\"]},\n\t{\"seq\":112,\"time\":3617.344,\"action\":\"changeSel\",\"args\":[9,9]},\n\t{\"seq\":113,\"time\":3617.344,\"action\":\"endLoop\",\"args\":[]},\n\t{\"seq\":114,\"time\":3617.388,\"action\":\"sendEvent\",\"args\":[\"keyup\",{\"keyCode\":75}]},\n\t{\"seq\":115,\"time\":3617.429,\"action\":\"endLoop\",\"args\":[]}\n] ] );", "domain": "javascript", "lang": "code", "char_count": 8662, "word_count": 4081, "byte_count": 8806}
{"text": "import React from \"react\";\n\nclass Logo extends React.Component {\n\n    constructor(props) {\n        super(props);\n    }\n\n    render() {\n\n        const gameLogoStyle = {\n            fontSize: `${this.props.baseHeight}px`,\n        };\n\n\n        return (\n            <div id=\"game-logo\" style={gameLogoStyle}>\n                <div id=\"game-logo__reactive-text\">Reactive</div>\n                <div id=\"game-logo__floating-text\">Floating</div>\n                <div id=\"game-logo__point-text\">Point</div>\n            </div>\n        );\n    }\n\n}\n\nexport default Logo;", "domain": "javascript", "lang": "code", "char_count": 557, "word_count": 123, "byte_count": 557}
{"text": "var stompClient = null;\r\nvar connected = false;\r\nvar connectDelayTime = 2000;\r\nvar refreshJobSnapshotDelayTime =1000;\r\nvar job_state = \"job_state_\";\r\nvar job_start_time = \"job_start_time_\";\r\nvar job_end_time = \"job_end_time_\";\r\nvar job_queue_count = \"job_queue_count_\";\r\nvar job_total_process_count = \"job_total_process_count_\";\r\nvar job_total_result_count = \"job_total_result_count_\";\r\nvar job_exception_count = \"job_total_process_count_\";\r\nvar job_avg_process_time = \"job_avg_process_time_\";\r\nvar job_max_process_time = \"job_max_process_time_\";\r\nvar job_min_Process_time = \"job_min_Process_time_\";\r\nvar job_cronTrigger=\"job_cronTrigger_\";\r\nvar job_queue_operation=\"job_queue_operation_\";\r\nvar job_operation=\"job_operation_\";\r\nvar job_scheduled=\"job_scheduledTd_\";\r\n\r\n$(function() {\r\n\t$(\"#search_job_bt\").click(function(){\r\n\t\t$('#job_search').find('#pageIndex').val(0);\r\n\t\tsearchJob();\r\n\t});\r\n\t$(\"#create_job_bt\").click(function(){\r\n\t\tsearchJob();\r\n\t});\r\n\t$(\"#upload_jobProfile\").click(function() {\r\n\t\tuploadJobProfile();\r\n\t});\r\n\t$(\"#search_job_name\").bind('keydown',function(event){  \r\n\t  if(event.keyCode == \"13\"){ \r\n\t\t  $('#job_search').find('#pageIndex').val(0);\r\n\t\t  searchJob();\r\n\t  }  \r\n\t});  \r\n\tconnect();\r\n\t// \u52a0\u8f7d\u6570\u636e\r\n\tsearchJob();\r\n});\r\n\r\nfunction showDiv(showDivID){\r\n\tvar showDivs=$(\"div[class='showDiv']\");\r\n\tfor (var i = 0; i < showDivs.length; i++) {\r\n\t\tvar showDiv=$(showDivs[i]);\r\n\t\tvar display=showDiv.css(\"display\");\r\n\t\tvar lastShowDivId=showDiv.attr(\"id\");\r\n\t\tif(showDivID!=lastShowDivId&&(\"inline\"==display||\"inline-block\"==display||\"block\"==display)){\r\n\t\t\tshowDiv.css(\"display\",\"none\");\r\n\t\t\tvar showDivIdRecordInput=$(\"<input type='text' name='showDivIdRecordInput' value='\"+lastShowDivId+\"' style='display: none' />\");\r\n\t\t\tshowDivIdRecordInput.appendTo($(\"#showDivIdRecordDiv\"));\r\n\t\t}else if(showDivID==showDiv.attr(\"id\")){\r\n\t\t\tshowDiv.css(\"display\",\"block\");\t\r\n\t\t}else{\r\n\t\t\tshowDiv.css(\"display\",\"none\");\r\n\t\t}\r\n\t}\t\r\n}\r\n\r\nfunction returnLastShowDiv(){\r\n\tvar showDivIdRecordInputs=$(\"#showDivIdRecordDiv\").find(\"input[name='showDivIdRecordInput']\");\r\n\tif(showDivIdRecordInputs.length>0){\r\n\t\tvar lastShowDivInput=$(showDivIdRecordInputs[showDivIdRecordInputs.length-1]);\r\n\t\tvar lastShowDivId=lastShowDivInput.val();\r\n\t\tvar showDivs=$(\"div[class='showDiv']\");\r\n\t\tfor (var i = 0; i < showDivs.length; i++) {\r\n\t\t\tvar showDiv=$(showDivs[i]);\r\n\t\t\tif(lastShowDivId==showDiv.attr(\"id\")){\r\n\t\t\t\tshowDiv.css(\"display\",\"block\");\t\r\n\t\t\t}else{\r\n\t\t\t\tshowDiv.css(\"display\",\"none\");\r\n\t\t\t}\r\n\t\t}\t\r\n\t\tlastShowDivInput.remove();\r\n\t}\r\n}\r\n/**\r\n * \u4e0e\u540e\u53f0\u5efa\u7acbwebsocket\u8fde\u63a5\r\n * \r\n * @returns\r\n */\r\nfunction connect() {\r\n\tif(!connected){\r\n\t\tvar socket = new SockJS('/crawler_websocket');\r\n\t    stompClient = Stomp.over(socket);\r\n\t    stompClient.connect({}, function (frame) {\r\n\t    \tconnected=true;\r\n\t        stompClient.subscribe('/topic/job/jobSnapshot', function (responseMsg) {\r\n\t        \tvar msg=JSON.parse(responseMsg.body);\r\n\t        \tif (msg.isOk == 1) {\r\n\t        \t\trefreshJobSnapshots(msg.data);\r\n\t    \t\t}\r\n\t        });\r\n\t    });\r\n\t    window.setTimeout(connect, connectDelayTime);\r\n\t}else{\r\n\t\twindow.setTimeout(requestRefreshJobSnapshot,refreshJobSnapshotDelayTime);\r\n\t}\r\n}\r\n\r\n/**\r\n * \u8bf7\u6c42\u5237\u65b0job\u8fd0\u884c\u5feb\u7167\r\n * \r\n * @returns\r\n */\r\nfunction requestRefreshJobSnapshot() {\r\n\tvar jobTrs = $('#jobs').find(\"tr\");\r\n\tvar jobNames=\"\";\r\n\tvar workSpaceNames=\"\";\r\n\tvar requestMsg=new Object();\r\n\tfor (var i = 0; i < jobTrs.length; i++) {\r\n\t\tvar jobTr=$(jobTrs[i]);\r\n\t\tvar jobSnapshot = new Object();\r\n\t\tjobNames+=jobTr.find(\"[name='name']\").val()+\",\";\r\n\t\tworkSpaceNames+=jobTr.find(\"[name='workSpaceName']\").val()+\",\";\r\n\t}\r\n\trequestMsg.jobNames=jobNames;\r\n\trequestMsg.workSpaceNames=workSpaceNames;\r\n    stompClient.send(\"/crawler/refreshJobSnapshot\", {}, JSON.stringify(requestMsg));\r\n    window.setTimeout(requestRefreshJobSnapshot,refreshJobSnapshotDelayTime);\r\n}\r\n\r\n/**\r\n * \u52a8\u6001\u663e\u793ajob \u8fd0\u884c\u4fe1\u606f\r\n * \r\n * @param jobSnapshots\r\n * @returns\r\n */\r\nfunction refreshJobSnapshots(jobSnapshots) {\r\n\tif(null!=jobSnapshots){\r\n\t\tfor (var i = 0; i < jobSnapshots.length; i++) {\r\n\t\t\tvar jobSnapshot = jobSnapshots[i];\r\n\t\t\tvar jobName = jobSnapshot.name;\r\n\t\t\tvar jobTr=$(\"tr[name='\"+jobName+\"']\");\r\n\t\t\tif(null!=jobTr&&undefined!=jobTr){\r\n\t\t\t\tvar oldStatus=jobTr.find(\"[name='state']\").text();\r\n\t\t\t\tvar newStatus=getState(jobSnapshot.status);\r\n\t\t\t\t// \u53ea\u6709\u5f53\u72b6\u6001\u53d1\u751f\u6539\u53d8\u65f6\u624d\u66f4\u65b0\u4e00\u4e0b\u5185\u5bb9\r\n\t\t\t\tif(oldStatus!=newStatus){\r\n\t\t\t\t\tvar color=getStateColor(newStatus);\r\n\t\t\t\t\tif(jobSnapshot.status==3||jobSnapshot.status==4){\r\n\t\t\t\t\t\tnewStatus=\"<a  style='color:\"+color+\"' href=\\\"javascript:masterScheduled.showWorkerInfo('\" + jobName+ \"')\\\">\"+newStatus+\"</a>\";\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tjobTr.find(\"[name='state']\").css(\"color\",color).html(newStatus);\r\n\t\t\t\t\tvar startTime=jobSnapshot.startTime;\r\n\t\t\t\t\tvar startTimeTd =jobTr.find(\"[name='startTime']\");\r\n\t\t\t\t\tvar oldStartTime=startTimeTd.html();\r\n\t\t\t\t\tif(\"\"==oldStartTime&&startTime!=null&&startTime!=\"null\"&&startTime!=\"\"){\r\n\t\t\t\t\t\tstartTime=startTime.substring(5,startTime.length);\r\n\t\t\t\t\t\tstartTimeTd.html(startTime);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(\"\"!=oldStartTime&&(startTime==null||startTime==\"null\"||startTime==\"\")){\r\n\t\t\t\t\t\tstartTimeTd.html(\"\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar opetationHtml=masterScheduled.getOperation(jobSnapshot.name,jobSnapshot.status);\r\n\t\t\t\t\t$(\"#\" + job_operation + jobName).html(opetationHtml);\r\n\t\t\t\t}\r\n\t\t\t\tvar workSpaceShowStr=getWorkSpaceHtml(jobSnapshot.workSpaceName,\r\n\t\t\t\t\t\tjobSnapshot.totalProcessCount,\r\n\t\t\t\t\t\tjobSnapshot.workSpaceDoingSize,\r\n\t\t\t\t\t\tjobSnapshot.workSpaceErrSize);\r\n\t\t\t\t$(\"#\" + job_queue_count + jobName).html(workSpaceShowStr);\r\n\t\t\t\tvar errCountHtml=getErrCountHtml(jobSnapshot.name,jobSnapshot.id,jobSnapshot.errCount);\r\n\t\t\t\t$(\"#\" + job_exception_count + jobName).html(errCountHtml);\t\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nfunction getErrCountHtml(jobName,jobSnapshotId,errCount){\r\n\tvar errCountHtml;\r\n\tif(errCount>0){\r\n\t\terrCountHtml=\"<a href=\\\"javascript:showErrMsg('\" + jobName+ \"','\" + jobSnapshotId+ \"')\\\">\"+errCount+\"</a>\";\r\n\t}else{\r\n\t\terrCountHtml=errCount;\r\n\t}\r\n\treturn errCountHtml;\r\n}\r\n\r\n\r\nfunction showErrMsg(jobName,jobSnapshotId){\r\n\tvar workerErrMsgDiv=$(\"#job_worker_errMsg_div\");\r\n\tvar pageIndex=workerErrMsgDiv.find(\"input[id='pageIndex']\").val();\r\n\tvar url = \"/crawler/job/jobSnapshot/queryErrMsg\";\r\n\t$.post(url, {\r\n\t\tjobName:jobName,\r\n\t\tjobSnapshotId : jobSnapshotId,\r\n\t\tpageIndex : pageIndex\r\n\t}, function(responseMsg) {\r\n\t\tif (responseMsg.isOk == 1) {\r\n\t\t\tvar data=responseMsg.data.list;\r\n\t\t\tvar table = workerErrMsgDiv.find('table');\r\n\t\t\tworkerErrMsgDiv.find('#jobName').val(jobName);\r\n\t\t\tworkerErrMsgDiv.find('#jobSnapshotId').val(jobSnapshotId);\r\n\t\t\tvar table=workerErrMsgDiv.find(\"table\");\r\n\t\t\ttable.find(\"tr[name='jobWorkerErrMsgDiv']\").remove();\r\n\t\t\tif (null != data && data.length > 0) {\r\n\t\t\t\tworkerErrMsgDiv.find(\"input[id='pageIndex']\").val(pageIndex);\r\n\t\t\t\tfor (var i = 0; i < data.length; i++) {\r\n\t\t\t\t\tvar workerErrMsg = data[i];\r\n\t\t\t\t\tvar tr = $(\"<tr name='jobWorkerErrMsgDiv'></tr>\");\r\n\t\t\t\t\t$(\"<td>\"+ workerErrMsg.workerName + \"</td>\").appendTo(tr);\r\n\t\t\t\t\t$(\"<td>\"+ workerErrMsg.startTime + \"</td>\").appendTo(tr);\r\n\t\t\t\t\tvar divId=\"workerErrMsg_\"+workerErrMsg.id;\r\n\t\t\t\t\t$(\"<td><a href=\\\"javascript:showErrMsgDetail('\" + divId+ \"')\\\">\"+ workerErrMsg.type + \"</a></td>\").appendTo(tr);\r\n\t\t\t\t\t$(\"<div id='\"+divId+\"' style='display: none;'><pre style='color:#FF0000;font-size:10px' >\"+ workerErrMsg.msg + \"</pre></div>\").appendTo(tr);\r\n\t\t\t\t\ttr.appendTo(table);\r\n\t\t\t\t}\r\n\t\t\t\tpageInfo(\"#job_worker_errMsg_div\",responseMsg,\"lastSearchJobWorkerErrMsg\",\"nextSearchWorkerErrMsg\");\r\n\t\t\t}\r\n\t\t\tshowDiv(\"job_worker_errMsg_div\");\r\n\t\t}\r\n\t});\r\n}\r\n\r\nfunction showErrMsgDetail(divId){\r\n\tshowLayer($(\"#\"+divId));\r\n}\r\n\r\nfunction nextSearchWorkerErrMsg() {\r\n\tvar workerErrMsgDiv=$('#job_worker_errMsg_div');\r\n\tvar jobName=workerErrMsgDiv.find('#jobName').val();\r\n\tvar jobSnapshotId=workerErrMsgDiv.find('#jobSnapshotId').val();\r\n\tvar pageIndex=workerErrMsgDiv.find('#pageIndex').val();\r\n\tpageIndex=parseInt(pageIndex);\r\n\tpageIndex=pageIndex+1;\r\n\tworkerErrMsgDiv.find('#pageIndex').val(pageIndex)\r\n\tshowErrMsg(jobName,jobSnapshotId);\r\n}\r\n\r\nfunction lastSearchJobWorkerErrMsg() {\r\n\tvar workerErrMsgDiv=$('#job_worker_errMsg_div');\r\n\tvar jobName=workerErrMsgDiv.find('#jobName').val();\r\n\tvar jobSnapshotId=workerErrMsgDiv.find('#jobSnapshotId').val();\r\n\tvar pageIndex=workerErrMsgDiv.find('#pageIndex').val();\r\n\tpageIndex=parseInt(pageIndex);\r\n\tpageIndex=pageIndex-1;\r\n\tworkerErrMsgDiv.find('#pageIndex').val(pageIndex)\r\n\tshowErrMsg(jobName,jobSnapshotId);\r\n}\r\n\r\n\r\n\r\nfunction uploadJobProfile(url,file) {\r\n\tvar url=\"/crawler/job/upload/profile\";\r\n\tuploadFile(url,$(\"#jobProfile\")[0].files[0]);\r\n}\r\n\r\n\r\nfunction searchJob() {\r\n\tvar jobName = $('#search_job_name').val();\r\n\tvar jobSearch=$('#job_search');\r\n\tvar pageIndex=jobSearch.find('#pageIndex').val();\r\n\tvar url=\"/crawler/job/query\";\r\n\t$.post(url, {\r\n\t\tpageIndex:pageIndex,\r\n\t\tjobName : jobName\r\n\t}, function(responseMsg) {\r\n\t\tif (responseMsg.isOk == 1) {\r\n\t\t\tshowJobTable(responseMsg);\r\n\t\t}\r\n\t});\r\n}\r\n\r\nfunction nextSearchJob() {\r\n\tvar jobSearch=$('#job_search');\r\n\tvar pageIndex=jobSearch.find('#pageIndex').val();\r\n\tpageIndex=parseInt(pageIndex);\r\n\tpageIndex=pageIndex+1;\r\n\tjobSearch.find('#pageIndex').val(pageIndex)\r\n\tsearchJob();\r\n}\r\n\r\nfunction lastSearchJob() {\r\n\tvar jobSearch=$('#job_search');\r\n\tvar pageIndex=jobSearch.find('#pageIndex').val();\r\n\tpageIndex=parseInt(pageIndex);\r\n\tpageIndex=pageIndex-1;\r\n\tjobSearch.find('#pageIndex').val(pageIndex)\r\n\tsearchJob();\r\n}\r\n\r\nfunction showJobTable(result) {\r\n\tvar jobs=result.data.list;\r\n\tif(null!=jobs&&jobs.length>0){\r\n\t\tvar jobDiv=$('#job_div');\r\n\t\tvar table = jobDiv.find('table');\r\n\t\ttable.find(\"tr[class=job]\").remove();\r\n\t\tvar job;\r\n\t\tfor (var i = 0; i < jobs.length; i++) {\r\n\t\t\tjob = jobs[i];\r\n\t\t\tvar tr = $(\"<tr class='job' name='\"+job.name+\"' title='\"+job.describe+\"'></tr>\");\r\n\t\t\t$(\"<input name='version' style='display:none' type='text' value='\"+job.version+\"' />\").appendTo(tr);\r\n\t\t\t$(\"<input name='name' style='display:none' type='text' value='\"+job.name+\"' />\").appendTo(tr);\r\n\t\t\t$(\"<input name='level' style='display:none' type='text' value='\"+job.level+\"' />\").appendTo(tr);\r\n\t\t\t$(\"<input name='workSpaceName' style='display:none' type='text' value='\"+job.workSpaceName+\"' />\").appendTo(tr);\r\n\t\t\t$(\"<input name='workerClass' style='display:none' type='text' value='\"+job.workerClass+\"' />\").appendTo(tr);\r\n\t\t\t$(\"<input name='designatedNodeName' style='display:none' type='text' value='\"+job.designatedNodeName+\"' />\").appendTo(tr);\r\n\t\t\t$(\"<input name='needNodes' style='display:none' type='text' value='\"+job.needNodes+\"' />\").appendTo(tr);\r\n\t\t\t$(\"<input name='isScheduled' style='display:none' type='text' value='\"+job.isScheduled+\"' />\").appendTo(tr);\r\n\t\t\t$(\"<input name='describe' style='display:none' type='text' value='\"+job.describe+\"' />\").appendTo(tr);\r\n\t\t\t$(\"<td title='\"+job.name+\"'>\"+job.name+\"</td>\").appendTo(tr);\r\n\t\t\tvar cronTrigger=job.cronTrigger;\r\n\t\t\tvar ctTd=$(\"<td></td\");\r\n\t\t\t$(\"<input name='cronTrigger'  flag='\"+job.name+\"' style='display:none' type='text' value='\"+cronTrigger+\"' />\").appendTo(ctTd);\r\n\t\t\t$(\"<input name='update_cronTrigger'  flag='\"+job.name+\"'  style='display:none' type='text' value='\"+cronTrigger+\"' />\").appendTo(ctTd);\r\n\t\t\tif(cronTrigger==null||cronTrigger==\"\"||cronTrigger==\"null\"){\r\n\t\t\t\tcronTrigger=\"#\";\r\n\t\t\t}\r\n\t\t\t$(\"<a     name='cronTrigger'  style='color:#FF0000;text-decoration:none;' href=\\\"javascript:editCronTrigger('\"+job.name+\"')\\\">\"+cronTrigger+\"</a>\").appendTo(ctTd);\r\n\t\t\tctTd.appendTo(tr);\r\n\t\t\t\r\n\t\t\tvar scheduledTd = $(\"<td name='isScheduled'></td>\");\r\n\t\t\tvar scheduledOperation=getIsScheduledShowHtml(job.name,job.isScheduled);\r\n\t\t\t$(scheduledOperation).appendTo(scheduledTd);\r\n\t\t\tscheduledTd.appendTo(tr);\r\n\t\t\t\r\n\t\t\tvar status=getState(job.status);\r\n\t\t\tvar color=getStateColor(status);\r\n\t\t\t$(\"<td name='state' style='font-weight:bold;color:\"+color+\"'>\"+ status + \"</td>\").appendTo(tr);\r\n\t\t\t$(\"<td name='startTime'></td>\").appendTo(tr);\r\n\t\t\tvar queueHtml=getWorkSpaceHtml(job.queueName,0,0,0);\r\n\t\t\t$(\"<td id='\" + job_queue_count + job.name + \"'>\"+queueHtml+\"</td>\").appendTo(tr);\r\n\t\r\n\t\t\t$(\"<td id='\" + job_exception_count + job.name + \"'>0</td>\").appendTo(tr);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tvar td = $(\"<td id='\" + job_operation + job.name + \"'></td>\");\r\n\t\t\tvar html=masterScheduled.getOperation(job.name,job.state);\r\n\t\t\t$(html).appendTo(td);\r\n\t\t\ttd.appendTo(tr);\r\n\t\t\tvar otherTd = $(\"<td></td>\");\r\n\t\t\tvar otherOperation=\"<a href=\\\"javascript:showHistoryJobSnapshot('\" + job.name+ \"')\\\">\u8bb0\u5f55</a>&nbsp;\";\r\n\t\t\totherOperation += \"<a href=\\\"javascript:showJobParams('\" + job.name+ \"')\\\">\u914d\u7f6e</a>&nbsp;\";\r\n\t\t\totherOperation += \"<a href=\\\"javascript:showExtractItemTable('\" + job.name+ \"')\\\">\u62bd\u53d6\u9879</a>&nbsp;\";\r\n\t\t\totherOperation += \"<a href=\\\"/crawler/job/download/profile/\"+ job.name+\"\\\"  >\u4e0b\u8f7d</a>\";\r\n\t\t\t$(otherOperation).appendTo(otherTd);\r\n\t\t\totherTd.appendTo(tr);\r\n\t\t\ttr.appendTo(table);\r\n\t\t}\r\n\t\ttable.find(\"input[name='update_cronTrigger']\").bind('keydown',function(event){  \r\n\t\t\t  if(event.keyCode == \"13\"){ \r\n\t\t\t\t  var jobName=$(this).attr(\"flag\");\r\n\t\t\t\t  updateCronTrigger(jobName);  \r\n\t\t\t  }  \r\n\t\t});  \r\n\t\ttable.find(\"input[name='update_nextJobName']\").bind('keydown',function(event){  \r\n\t\t\t  if(event.keyCode == \"13\"){ \r\n\t\t\t\t  var jobName=$(this).attr(\"flag\");\r\n\t\t\t\t  updateNextJobName(jobName);  \r\n\t\t\t  }  \r\n\t\t}); \r\n\t\tpageInfo(\"#job_div\",result,\"lastSearchJob\",\"nextSearchJob\");\r\n\t}\r\n}\r\n\r\nfunction pageInfo(showDivId,responseMsg,lastSearch,nextSearch){\r\n\tvar pageIndex=responseMsg.data.pageIndex;\r\n\tvar pageSize=responseMsg.data.pageSize;\r\n\tvar totalPage=responseMsg.data.totalPage;\r\n\tvar totalSize=responseMsg.data.totalSize;\r\n\tvar showDivId=$(showDivId);\r\n\tshowDivId.find('#pageIndex').val(pageIndex);\r\n\tshowDivId.find('#totalPage').val(totalPage);\r\n\tshowDivId.find('#totalSize').val(totalSize);\r\n\tvar pageInfoHtml=\"<div><span>\";\r\n\tpageInfoHtml+=\"\u603b\u5171<span style='color:#FF0000;font-weight:bold'>\"+totalSize+\"</span>\u6761\u8bb0\u5f55\";\r\n\tpageInfoHtml+=\"\u6bcf\u9875<span style='color:#FF0000;font-weight:bold'>\"+pageSize+\"</span>\u6761\";\r\n\tpageInfoHtml+=\"\u603b\u9875\u6570:<span style='color:#FF0000;font-weight:bold'>\"+totalPage+\"</span>\";\r\n\tpageInfoHtml+=\"\u5f53\u524d\u9875:<span style='color:#FF0000;font-weight:bold'>\"+(parseInt(pageIndex)+1)+\"</span>\";\r\n\tpageInfoHtml+=\"</span>\";\r\n\tif(totalPage>1){\r\n\t\tif(pageIndex>=totalPage-1){\r\n\t\t\tpageInfoHtml+=\"<a class='pull-right' style='color:#FF0000;font-weight:bold' href='javascript:\"+lastSearch+\"()'>\u4e0a\u4e00\u9875</a>\";\r\n\t\t}else if(pageIndex==0){\r\n\t\t\tpageInfoHtml+=\"<a class='pull-right' style='color:#FF0000;font-weight:bold' href='javascript:\"+nextSearch+\"()'>\u4e0b\u4e00\u9875</a>\";\r\n\t\t}else{\r\n\t\t\tpageInfoHtml+=\"<a class='pull-right' style='color:#FF0000;font-weight:bold' href='javascript:\"+nextSearch+\"()'>\u4e0b\u4e00\u9875</a>\";\r\n\t\t\tpageInfoHtml+=\"<a class='pull-right' style='color:#FF0000;font-weight:bold' href='javascript:\"+lastSearch+\"()'>\u4e0a\u4e00\u9875&nbsp;&nbsp;&nbsp;&nbsp;</a>\";\r\n\t\t}\r\n\t}\r\n\tpageInfoHtml+=\"</div>\";\r\n\tvar pageInfoDiv=showDivId.find('#pageInfo');\r\n\tpageInfoDiv.find(\"div\").remove();\r\n\t$(pageInfoHtml).appendTo(pageInfoDiv);\r\n}\r\n\r\n/**\r\n * READY(1), WAITING_EXECUTED(2), EXECUTING(3), SUSPEND(4), STOP(5),\r\n * FINISHED(6);\r\n */\r\nfunction getState(state) {\r\n\tvar stateStr = \"\u51c6\u5907\";\r\n\tif (0 == state) {\r\n\t\tstateStr = \"\u51c6\u5907\";\r\n\t} else if (1 == state) {\r\n\t\tstateStr = \"\u5b9a\u65f6\u8ba1\u5212\u4e2d\";\r\n\t}  else if (2 == state) {\r\n\t\tstateStr = \"\u7b49\u5f85\u88ab\u6267\u884c\";\r\n\t} else if (3 == state) {\r\n\t\tstateStr = \"\u521d\u59cb\u5316\";\r\n\t} else if (4 == state) {\r\n\t\tstateStr = \"\u8fd0\u884c\";\r\n\t}else if (5 == state) {\r\n\t\tstateStr = \"\u6682\u505c\";\r\n\t}else if (6 == state) {\r\n\t\tstateStr = \"\u505c\u6b62\";\r\n\t}else if (7 == state) {\r\n\t\tstateStr = \"\u5b8c\u6210\";\r\n\t}\r\n\treturn stateStr;\r\n}\r\nfunction getStateColor(state){\r\n\tvar color = \"#227700\";\r\n\tif (0 == state) {\r\n\t\tcolor = \"#227700\";\r\n\t}else if (1 == state) {\r\n\t\tcolor = \"#FF0000\";\r\n\t} else if (2 == state) {\r\n\t\tcolor = \"#FF8888\";\r\n\t}else if (3 == state) {\r\n\t\tcolor = \"#FF0000\";\r\n\t} else if (4 == state) {\r\n\t\tcolor = \"#FF0000\";\r\n\t} else if (5 == state) {\r\n\t\tcolor = \"#FF3333\";\r\n\t} else if (6== state) {\r\n\t\tcolor = \"#FF0000\";\r\n\t} else if (7 == state) {\r\n\t\tcolor = \"#FF0000\";\r\n\t}\r\n\treturn color;\r\n}\r\n\r\n// \u5bf9Date\u7684\u6269\u5c55\uff0c\u5c06 Date \u8f6c\u5316\u4e3a\u6307\u5b9a\u683c\u5f0f\u7684String\r\n// \u6708(M)\u3001\u65e5(d)\u3001\u5c0f\u65f6(h)\u3001\u5206(m)\u3001\u79d2(s)\u3001\u5b63\u5ea6(q) \u53ef\u4ee5\u7528 1-2 \u4e2a\u5360\u4f4d\u7b26\uff0c\r\n// \u5e74(y)\u53ef\u4ee5\u7528 1-4 \u4e2a\u5360\u4f4d\u7b26\uff0c\u6beb\u79d2(S)\u53ea\u80fd\u7528 1 \u4e2a\u5360\u4f4d\u7b26(\u662f 1-3 \u4f4d\u7684\u6570\u5b57)\r\n// \u4f8b\u5b50\uff1a\r\n// (new Date()).Format(\"yyyy-MM-dd hh:mm:ss.S\") ==> 2006-07-02 08:09:04.423\r\n// (new Date()).Format(\"yyyy-M-d h:m:s.S\") ==> 2006-7-2 8:9:4.18\r\nDate.prototype.Format = function(fmt){ // author: meizz\r\n\tvar o = {   \r\n\t\t\t\"M+\" : this.getMonth()+1,                 // \u6708\u4efd\r\n\t\t\t\"d+\" : this.getDate(),                    // \u65e5\r\n\t\t\t\"h+\" : this.getHours(),                   // \u5c0f\u65f6\r\n\t\t\t\"m+\" : this.getMinutes(),                 // \u5206\r\n\t\t\t\"s+\" : this.getSeconds(),                 // \u79d2\r\n\t\t\t\"q+\" : Math.floor((this.getMonth()+3)/3), // \u5b63\u5ea6\r\n\t\t\t\"S\"  : this.getMilliseconds()             // \u6beb\u79d2\r\n\t};   \r\n\tif(/(y+)/.test(fmt)){\r\n\t\tfmt=fmt.replace(RegExp.$1, (this.getFullYear()+\"\").substr(4 - RegExp.$1.length));   \r\n\t}   \t\r\n\tfor(var k in o){\r\n\t\tif(new RegExp(\"(\"+ k +\")\").test(fmt)){\r\n\t\t\tfmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : ((\"00\"+ o[k]).substr((\"\"+ o[k]).length)));  \r\n\t\t}\r\n\t}    \r\n\treturn fmt;   \r\n}\r\n\r\nfunction getWorkSpaceHtml(workSpaceName,totalProcessCount,doingSize,errSize){\r\n\tvar totalProcessCountHtml=\"<span title='\u4efb\u52a1\u5904\u7406\u6570\u91cf' style='color:#FF0000;font-size: 14px; font-weight: bold;'>\"\r\n\t\t+totalProcessCount+\"</span>\";\r\n\tvar doingSizeHtml=\"0\";\r\n\tif(doingSize>0){\r\n\t\tdoingSizeHtml=\"<a  title='\u4efb\u52a1\u961f\u5217\u6570\u91cf' href=\\\"javascript:showDoingDataDiv('\" +workSpaceName+ \"')\\\">\" \r\n\t\t\t\t+\"<span style='color:#227700;font-size:14px; font-weight: bold;'>\"+doingSize+\"</span>\"\r\n\t\t\t\t+\"</a>&nbsp;\";\r\n\t}else{\r\n\t\tdoingSizeHtml=\"<span title='\u4efb\u52a1\u961f\u5217\u6570\u91cf' style='color:#227700;font-size: 14px; font-weight: bold;'>\"+doingSize+\"</span>\";\r\n\t}\r\n\tvar errSizeHtml=\"0\";\r\n\tif(errSize>0){\r\n\t\terrSizeHtml=\"<a  title='\u4efb\u52a1\u9519\u8bef\u961f\u5217\u6570\u91cf' href=\\\"javascript:showErrDataDiv('\" + workSpaceName+ \"')\\\">\" \r\n\t\t\t\t+\"<span style='color:#FF0000;font-size: 14px; font-weight: bold;'>\"+errSize+\"</span>\"\r\n\t\t\t\t+\"</a>&nbsp;\";\r\n\t}else{\r\n\t\terrSizeHtml=\"<span title='\u4efb\u52a1\u9519\u8bef\u961f\u5217\u6570\u91cf' style='color:#FF0000;font-size: 14px; font-weight: bold;'>\"+errSize+\"</span>&nbsp;\";\r\n\t}\r\n\tvar queueShowStr=totalProcessCountHtml+\"/&nbsp;(\"+doingSizeHtml+\"&nbsp;|&nbsp;\"+errSizeHtml+\")\";\r\n\treturn queueShowStr;\r\n}\r\n\r\n\r\nfunction showJobParams(jobName) {\r\n\tvar jobTr=$('#job_div').find(\"table\").find(\"tr[name='\"+jobName+\"']\");\r\n\tvar jobParamsDiv = $(\"#job_params_div\");\r\n\r\n\tjobParamsDiv.find(\"input[name='name']\").val(jobName);\r\n\t\r\n\tvar level=jobTr.find(\"input[name='level']\").val();\r\n\tjobParamsDiv.find(\"input[name='level']\").val(level);\r\n\t\r\n\tvar workSpaceName=jobTr.find(\"input[name='workSpaceName']\").val();\r\n\tjobParamsDiv.find(\"input[name='workSpaceName']\").val(workSpaceName);\r\n\t\r\n\tvar workerClass=jobTr.find(\"input[name='workerClass']\").val();\r\n\tjobParamsDiv.find(\"input[name='workerClass']\").val(workerClass);\r\n\t\r\n\tvar designatedNodeName=jobTr.find(\"input[name='designatedNodeName']\").val();\r\n\tjobParamsDiv.find(\"input[name='designatedNodeName']\").val(designatedNodeName);\r\n\t\r\n\tvar needNodes=jobTr.find(\"input[name='needNodes']\").val();\r\n\tjobParamsDiv.find(\"input[name='needNodes']\").val(needNodes);\r\n\t\r\n\tvar describe=jobTr.find(\"input[name='describe']\").val();\r\n\tjobParamsDiv.find(\"input[name='describe']\").val(describe);\r\n\r\n\tvar url = \"/crawler/job/queryJobParams/\" + jobName;\r\n\t$.get(url, function(result) {\r\n\t\tvar jobParams=result.data;\r\n\t\tif(null!=jobParams){\r\n\t\t\tvar jobParamsTable =jobParamsDiv.find(\"table[id='jobParams']\");\r\n\t\t\tjobParamsTable.find(\"tr[class=jobParams]\").remove();\r\n\t\t\tfor (var i = 0; i < jobParams.length; i++) {\r\n\t\t\t\tvar jobParam=jobParams[i];\r\n\t\t\t\tvar tr = $(\"<tr class='jobParams' name='\"+jobParam.id+\"' ></tr>\");\r\n\t\t\t\t$(\"<input name='version' style='display:none' type='text' value='\"+jobParam.version+\"' />\").appendTo(tr);\r\n\t\t\t\tvar jobParamNameTd=$(\"<td></td\");\r\n\t\t\t\t$(\"<input name='name'  flag='\"+jobParam.id+\"' style='display:none' type='text' value='\"+jobParam.name+\"' />\").appendTo(jobParamNameTd);\r\n\t\t\t\t$(\"<input name='update_name'  flag='\"+jobParam.id+\"' size='20'  style='display:none' type='text' value='\"+jobParam.name+\"' />\").appendTo(jobParamNameTd);", "domain": "javascript", "lang": "code", "char_count": 20026, "word_count": 5554, "byte_count": 20446}
{"text": "module.exports = {\n  purpleRedTheme: {\n    palette: {\n      primary: {\n        light: '#EDE7F6',\n        main: '#673AB7',\n        dark: '#512DA8',\n        contrastText: '#fff',\n      },\n      secondary: {\n        light: '#FCE4EC',\n        main: '#EC407A',\n        dark: '#C2185B',\n        contrastText: '#fff',\n      },\n    },\n  },\n  greenOrangeTheme: {\n    palette: {\n      primary: {\n        light: '#F1F8E9',\n        main: '#689F38',\n        dark: '#33691E',\n        contrastText: '#fff',\n      },\n      secondary: {\n        light: '#FFF8E1',\n        main: '#FF8F00',\n        dark: '#E65100',\n        contrastText: '#fff',\n      },\n    },\n  },\n  magentaTheme: {\n    palette: {\n      primary: {\n        light: '#FCE4EC',\n        main: '#EC407A',\n        dark: '#D81B60',\n        contrastText: '#fff',\n      },\n      secondary: {\n        light: '#FFF8E1',\n        main: '#FFA000',\n        dark: '#FF6F00',\n        contrastText: '#fff',\n      },\n    },\n  },\n  purpleTheme: {\n    palette: {\n      primary: {\n        light: '#EDE7F6',\n        main: '#AB47BC',\n        dark: '#8E24AA',\n        contrastText: '#fff',\n      },\n      secondary: {\n        light: '#E0F7FA',\n        main: '#00BCD4',\n        dark: '#006064',\n        contrastText: '#fff',\n      },\n    },\n  },\n  blueTheme: {\n    palette: {\n      primary: {\n        light: '#E8EAF6',\n        main: '#3F51B5',\n        dark: '#283593',\n        contrastText: '#fff',\n      },\n      secondary: {\n        light: '#E1F5FE',\n        main: '#03A9F4',\n        dark: '#0277BD',\n        contrastText: '#fff',\n      },\n    },\n  },\n  orangeTheme: {\n    palette: {\n      primary: {\n        light: '#FFF3E0',\n        main: '#EF6C00',\n        dark: '#E65100',\n        contrastText: '#fff',\n      },\n      secondary: {\n        light: '#F3E5F5',\n        main: '#9C27B0',\n        dark: '#7B1FA2',\n        contrastText: '#fff',\n      },\n    },\n  },\n  cyanTheme: {\n    palette: {\n      primary: {\n        light: '#E0F7FA',\n        main: '#009688',\n        dark: '#00695C',\n        contrastText: '#fff',\n      },\n      secondary: {\n        light: '#F1F8E9',\n        main: '#689F38',\n        dark: '#33691E',\n        contrastText: '#fff',\n      },\n    },\n  },\n  redTheme: {\n    palette: {\n      primary: {\n        light: '#FFEBEE',\n        main: '#EF5350',\n        dark: '#E53935',\n        contrastText: '#fff',\n      },\n      secondary: {\n        light: '#ECEFF1',\n        main: '#607D8B',\n        dark: '#455A64',\n        contrastText: '#fff',\n      },\n    },\n  },\n  skyBlueTheme: {\n    palette: {\n      primary: {\n        light: '#E3F2FD',\n        main: '#2196F3',\n        dark: '#1565C0',\n        contrastText: '#fff',\n      },\n      secondary: {\n        light: '#E0F2F1',\n        main: '#00BFA5',\n        dark: '#00796B',\n        contrastText: '#fff',\n      },\n    },\n  },\n  greyTheme: {\n    palette: {\n      primary: {\n        light: '#ECEFF1',\n        main: '#607D8B',\n        dark: '#455A64',\n        contrastText: '#fff',\n      },\n      secondary: {\n        light: '#E0E0E0',\n        main: '#757575',\n        dark: '#424242',\n        contrastText: '#fff',\n      },\n    },\n  },\n  yellowBlueTheme: {\n    palette: {\n      primary: {\n        light: '#E1F5FE',\n        main: '#039BE5',\n        dark: '#01579B',\n        contrastText: '#fff',\n      },\n      secondary: {\n        light: '#FFF3E0',\n        main: '#FF9800',\n        dark: '#E65100',\n        contrastText: '#fff',\n      },\n    },\n  },\n  pinkBlueTheme: {\n    palette: {\n      primary: {\n        light: '#E0F7FA',\n        main: '#00BCD4',\n        dark: '#006064',\n        contrastText: '#fff',\n      },\n      secondary: {\n        light: '#FCE4EC',\n        main: '#F06292',\n        dark: '#AD1457',\n        contrastText: '#fff',\n      },\n    },\n  },\n  yellowCyanTheme: {\n    palette: {\n      primary: {\n        light: '#FFF3E0',\n        main: '#F9A825',\n        dark: '#F57F17',\n        contrastText: '#fff',\n      },\n      secondary: {\n        light: '#E0F7FA',\n        main: '#00BCD4',\n        dark: '#006064',\n        contrastText: '#fff',\n      },\n    },\n  },\n  blueCyanTheme: {\n    palette: {\n      primary: {\n        light: '#E8EAF6',\n        main: '#3F51B5',\n        dark: '#283593',\n        contrastText: '#fff',\n      },\n      secondary: {\n        light: '#E0F7FA',\n        main: '#00BCD4',\n        dark: '#00838F',\n        contrastText: '#fff',\n      },\n    },\n  },\n  greenPurpleTheme: {\n    palette: {\n      primary: {\n        light: '#EDE7F6',\n        main: '#7C4DFF',\n        dark: '#311B92',\n        contrastText: '#fff',\n      },\n      secondary: {\n        light: '#E8F5E9',\n        main: '#00C853',\n        dark: '#1B5E20',\n        contrastText: '#fff',\n      },\n    },\n  },\n  pinkGreenTheme: {\n    palette: {\n      primary: {\n        light: '#DCEDC8',\n        main: '#689F38',\n        dark: '#33691E',\n        contrastText: '#fff',\n      },\n      secondary: {\n        light: '#FCE4EC',\n        main: '#EC407A',\n        dark: '#D81B60',\n        contrastText: '#fff',\n      },\n    },\n  },\n  goldTheme: {\n    palette: {\n      primary: {\n        light: '#FFF9C4',\n        main: '#FF9100',\n        dark: '#FF6D00',\n        contrastText: '#fff',\n      },\n      secondary: {\n        light: '#EFEBE9',\n        main: '#8D6E63',\n        dark: '#4E342E',\n        contrastText: '#fff',\n      },\n    },\n  }\n};", "domain": "javascript", "lang": "code", "char_count": 5309, "word_count": 1298, "byte_count": 5309}
{"text": "import { put, takeLatest, select } from 'redux-saga/effects';\nimport ModelchimpClient from 'utils/modelchimpClient';\nimport { LOAD_EXPERIMENT_DATA,\n  CREATE_EXPERIMENT_LABELS,\n  DELETE_EXPERIMENT_LABELS,\n  SUBMIT_DELETE_EXPERIMENTS,\n } from './constants';\nimport {\n  loadExperimentAction,\n  loadExperimentSuccessAction,\n  loadExperimentErrorAction,\n  createExperimentLabelsSuccessAction,\n  createExperimentLabelsErrorAction,\n  deleteExperimentLabelsSuccessAction,\n  deleteExperimentLabelsErrorAction,\n  submitDeleteExperimentsSuccessAction,\n  submitDeleteExperimentsErrorAction,\n} from './actions';\nimport {\n  makeSelectExperimentColumns,\n  makeSelectExperimentMetricColumns,\n  makeSelectDeleteList,\n} from './selectors';\nimport { mapKeys } from 'lodash';\n\n\nexport function* getExperimentList({ projectId }) {\n  let requestURL = `experiment/list/${projectId}/`;\n  let cols = yield select(makeSelectExperimentColumns());\n  let metricCols = yield select(makeSelectExperimentMetricColumns());\n\n  if ((cols && cols.length > 0) || (metricCols && metricCols.length > 0)) {\n    cols = cols.map(e => `param_fields[]=${e}&`);\n    cols = cols.join('');\n    metricCols = metricCols.map(e => `metric_fields[]=${e}&`);\n    metricCols = metricCols.join('');\n\n    requestURL = `${requestURL}?${cols}${metricCols}`;\n  }\n\n  try {\n    const experiments = yield ModelchimpClient.get(requestURL);\n\n    yield put(loadExperimentSuccessAction(experiments));\n  } catch (err) {\n    yield put(loadExperimentErrorAction(err));\n  }\n}\n\nexport function* createLabel({ modelId, labelData, projectId }) {\n  const requestURL = `experiment/${modelId}/label/`;\n  const formData = new FormData();\n\n  mapKeys(labelData, (v, k) => formData.append(k, v));\n\n  try {\n    const data = yield ModelchimpClient.post(requestURL, { body: formData });\n    yield put(createExperimentLabelsSuccessAction(data));\n    yield put(loadExperimentAction(projectId));\n\n  } catch (err) {\n    yield put(createExperimentLabelsErrorAction(err));\n  }\n}\n\nexport function* deleteLabel({ modelId, label, projectId }) {\n  const requestURL = `experiment/${modelId}/label/?label=${label}`;\n\n  try {\n    const data = yield ModelchimpClient.delete(requestURL);\n\n    if (data) {\n      yield put(deleteExperimentLabelsSuccessAction(data));\n      yield put(loadExperimentAction(projectId));\n    }\n  } catch (err) {\n    yield put(deleteExperimentLabelsErrorAction(err));\n  }\n}\n\nexport function* deleteExperimentList({ projectId }) {\n  let requestURL = `experiment/delete/${projectId}/`;\n  const formData = new FormData();\n  const deleteList = yield select(makeSelectDeleteList());\n\n  formData.append('model_ids', deleteList.toJS());\n\n  try {\n    const data = yield ModelchimpClient.delete(requestURL, { body: formData });\n    yield put(submitDeleteExperimentsSuccessAction());\n    yield put(loadExperimentAction(projectId));\n  } catch (err) {\n    yield put(submitDeleteExperimentsErrorAction(err));\n  }\n}\n\nexport default function* experimentListSaga() {\n  yield takeLatest(LOAD_EXPERIMENT_DATA, getExperimentList);\n  yield takeLatest(CREATE_EXPERIMENT_LABELS, createLabel);\n  yield takeLatest(DELETE_EXPERIMENT_LABELS, deleteLabel);\n  yield takeLatest(SUBMIT_DELETE_EXPERIMENTS, deleteExperimentList);\n}", "domain": "javascript", "lang": "code", "char_count": 3228, "word_count": 607, "byte_count": 3228}
{"text": "var random = require('geojson-random');\n\n/**\n * Generates random {@link GeoJSON} data, including {@link Point|Points} and {@link Polygon|Polygons}, for testing\n * and experimentation.\n *\n * @module turf/random\n * @category data\n * @param {String} [type='point'] type of features desired: 'points' or 'polygons'\n * @param {Number} [count=1] how many geometries should be generated.\n * @param {Object} options options relevant to the feature desired. Can include:\n * @param {Array<number>} options.bbox a bounding box inside of which geometries\n * are placed. In the case of {@link Point} features, they are guaranteed to be within this bounds,\n * while {@link Polygon} features have their centroid within the bounds.\n * @param {Number} [options.num_vertices=10] options.vertices the number of vertices added\n * to polygon features.\n * @param {Number} [options.max_radial_length=10] the total number of decimal\n * degrees longitude or latitude that a polygon can extent outwards to\n * from its center.\n * @return {FeatureCollection} generated random features\n * @example\n * var points = turf.random('points', 100, {\n *   bbox: [-70, 40, -60, 60]\n * });\n *\n * //=points\n *\n * var polygons = turf.random('polygons', 4, {\n *   bbox: [-70, 40, -60, 60]\n * });\n *\n * //=polygons\n */\nmodule.exports = function(type, count, options) {\n    options = options || {};\n    count = count || 1;\n    switch (type) {\n        case 'point':\n        case 'points':\n        case undefined:\n            return random.point(count, options.bbox);\n        case 'polygon':\n        case 'polygons':\n            return random.polygon(\n                count,\n                options.num_vertices,\n                options.max_radial_length,\n                options.bbox);\n        default:\n            throw new Error('Unknown type given: valid options are points and polygons');\n    }\n};", "domain": "javascript", "lang": "code", "char_count": 1856, "word_count": 391, "byte_count": 1856}
{"text": "$(document).ready(function(){\n\n  $(\"form#height\").submit(function(event){\n\n    event.preventDefault();\n    alert(\"form works\");\n    var inputHeight = parseInt($(\"input#heightInput\").val());\n\n    alert(inputHeight);\n\n    if (inputHeight >= 48) {\n      $(\"div#rideConditions1\").show();\n      $(\"div.ridesContainer\").show();\n      $(\"span.inch48\").removeClass(\"inch48\").addClass(\"inch48Blue\");\n      $(\"span.inch24\").removeClass(\"inch24\").addClass(\"inch24Green\")\n      $(\"span.inch12\").removeClass(\"inch12\").addClass(\"inch12Red\");\n    } else if (inputHeight >=12 && inputHeight <= 20) {\n      $(\"div#rideConditions2\").show();\n      $(\"div.ridesContainer\").show();\n      $(\"span.inch48\").removeClass(\"inch48\").addClass(\"inch48Blue\");\n      $(\"span.inch24\").removeClass(\"inch24\").addClass(\"inch24Green\")\n      $(\"span.inch12\").removeClass(\"inch12\").addClass(\"inch12Red\");\n    } else {\n      $(\"div#rideConditions3\").show();\n      $(\"div.ridesContainer\").show();\n      $(\"span.inch48\").removeClass(\"inch48\").addClass(\"inch48Red\");\n      $(\"span.inch24\").removeClass(\"inch24\").addClass(\"inch24Red\")\n      $(\"span.inch12\").removeClass(\"inch12\").addClass(\"inch12Green\");\n    }\n\n    $(\"div#introImagery\").hide();\n\n  });\n\n\n});\n\n\n// below follows these instructions\n// Create a website for an amusement park that prompts the user to enter their height.\n// The page should then only displays information about rides the user is tall enough to safely ride.\n//\n//\n// $(\"form#height\").submit(function(event){\n//\n//   event.preventDefault();\n//   alert(\"form works\");\n//   var inputHeight = parseInt($(\"input#heightInput\").val());\n//\n//   alert(inputHeight);\n//\n//   if (inputHeight >= 48) {\n//     $(\"div#adultRides\").show();\n//     $(\"div#kidsRides\").show();\n//   } else if (inputHeight <= 47) {\n//     $(\"div#kidsRides\").show();\n//     $(\"div#toddlerRides\").show();\n//   } else {\n//     $(\"div#toddlerRides\").show()\n//   }\n//\n//   $(\"div#introImagery\").hide();\n//\n// });", "domain": "javascript", "lang": "code", "char_count": 1956, "word_count": 576, "byte_count": 1956}
{"text": "// \u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c\u0438\nexport let events = {\n    events: {},\n    on: function (eventName, fn) {\n        this.events[eventName] = this.events[eventName] || [];\n        this.events[eventName].push(fn);\n    },\n    off: function (eventName, fn) {\n        if (this.events[eventName]) {\n            for (let i = 0, len = this.events[eventName].length; i < len; i++) {\n                if (this.events[eventName][i] === fn) {\n                    this.events[eventName].splice(i, 1);\n                    break;\n                }\n            }\n        }\n    },\n    trigger: function (eventName, data) {\n        if (this.events[eventName]) {\n            this.events[eventName].forEach(function (fn) {\n                fn(data);\n            });\n        }\n    }\n};", "domain": "javascript", "lang": "code", "char_count": 751, "word_count": 179, "byte_count": 770}
{"text": "\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n    return new (P || (P = Promise))(function (resolve, reject) {\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\n    });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.InfoOnlyDigital = void 0;\nconst control_base_1 = require(\"./control-base\");\nclass InfoOnlyDigital extends control_base_1.ControlBase {\n    loadAsync(type, uuid, control) {\n        return __awaiter(this, void 0, void 0, function* () {\n            yield this.updateObjectAsync(uuid, {\n                type: type,\n                common: {\n                    name: control.name,\n                    role: 'switch',\n                },\n                native: { control: control },\n            });\n            yield this.loadOtherControlStatesAsync(control.name, uuid, control.states, ['active']);\n            if (!control.hasOwnProperty('states') || !control.states.hasOwnProperty('active')) {\n                return;\n            }\n            yield this.createBooleanControlStateObjectAsync(control.name, uuid, control.states, 'active', 'indicator');\n            if (!control.hasOwnProperty('details')) {\n                return;\n            }\n            if (control.details.hasOwnProperty('text')) {\n                const text = control.details.text;\n                yield this.updateStateObjectAsync(uuid + '.active-text', {\n                    name: control.name + ': active as text',\n                    read: true,\n                    write: false,\n                    type: 'string',\n                    role: 'text',\n                }, control.states.active, (name, value) => {\n                    this.setStateAck(name, value == 1 ? text.on : text.off);\n                });\n            }\n            if (control.details.hasOwnProperty('image')) {\n                const image = control.details.text;\n                yield this.updateStateObjectAsync(uuid + '.active-image', {\n                    name: control.name + ': active as image',\n                    read: true,\n                    write: false,\n                    type: 'string',\n                    role: 'text',\n                }, control.states.active, (name, value) => {\n                    this.setStateAck(name, value == 1 ? image.on : image.off);\n                });\n            }\n            if (control.details.hasOwnProperty('color')) {\n                const color = control.details.text;\n                yield this.updateStateObjectAsync(uuid + '.active-color', {\n                    name: control.name + ': active as color',\n                    read: true,\n                    write: false,\n                    type: 'string',\n                    role: 'text',\n                }, control.states.active, (name, value) => {\n                    this.setStateAck(name, value == 1 ? color.on : color.off);\n                });\n            }\n        });\n    }\n}\nexports.InfoOnlyDigital = InfoOnlyDigital;\n//# sourceMappingURL=InfoOnlyDigital.js.map", "domain": "javascript", "lang": "code", "char_count": 3484, "word_count": 710, "byte_count": 3484}
{"text": "// Copyright 2009 the Sputnik authors.  All rights reserved.\n// This code is governed by the BSD license found in the LICENSE file.\n\n/**\n * @name: S9.9_A1;\n * @section: 9.9;\n * @assertion: ToObject conversion from undefined value must throw TypeError;\n * @description: Trying to convert undefined to Object; \n*/\n\n// CHECK#1\ntry{\n  undefined['foo'];\n  $ERROR('#1.1: undefined[\\'foo\\'] must throw TypeError. Actual: ' + (undefined['foo']));\n} \ncatch(e){\n  if((e instanceof TypeError) !== true){\n    $ERROR('#1.2: undefined[\\'foo\\'] must throw TypeError. Actual: ' + (e));\n  }\n}\n\n// CHECK#2\ntry{\n  with(undefined) x = 2;\n  $ERROR('#2.1: with(undefined) x = 2 must throw TypeError. Actual: x === ' + (x));\n} \ncatch(e){\n  if((e instanceof TypeError) !== true){\n    $ERROR('#2.2: with(undefined) x = 2 must throw TypeError. Actual: ' + (e));\n  }\n}\n\n// CHECK#3\ntry{\n  for(var y in undefined) y = 2;\n  $ERROR('#3.1: for(var y in undefined) y = 2 must throw TypeError. Actual: y === ' + (y));\n} \ncatch(e){\n  if((e instanceof TypeError) !== true){\n    $ERROR('#3.2: for(var y in undefined) y = 2 must throw TypeError. Actual: ' + (e));\n  }\n}\n\n// CHECK#4\ntry{\n  for(var z in this.foo) z = 2;\n  $ERROR('#4.1: for(var z in this.foo) z = 2 must throw TypeError. Actual: z === ' + (z));\n} \ncatch(e){\n  if((e instanceof TypeError) !== true){\n    $ERROR('#4.2: for(var z in this.foo) z = 2 must throw TypeError. Actual: ' + (e));\n  }\n}", "domain": "javascript", "lang": "code", "char_count": 1418, "word_count": 431, "byte_count": 1418}
{"text": "var __reflect = (this && this.__reflect) || function (p, c, t) {\n    p.__class__ = c, t ? t.push(c) : t = [c], p.__types__ = p.__types__ ? t.concat(p.__types__) : t;\n};\n/**\n  * \u4e3b\u754c\u9762\u6d88\u606f\n  * by dily\n  * (c) copyright 2014 - 2035\n  * All Rights Reserved.\n  * \u5305\u62ec \u89d2\u8272UI\u3001\u4e3b\u529f\u80fd\u3001\u6d3b\u52a8\u7b49\u7b49\n  */\nvar MainNotify = (function () {\n    function MainNotify() {\n    }\n    //\u6253\u5f00\u4e3b\u754c\u9762UI\n    MainNotify.OPEN_MAIN = \"MainNotify_OPEN_MAIN\";\n    //\u5173\u95ed\u4e3b\u754c\u9762UI\n    MainNotify.CLOSE_MAIN = \"MainNotify_CLOSE_MAIN\";\n    //\u6253\u5f00\u89d2\u8272UI\n    MainNotify.OPEN_ROLE = \"MainNotify_OPEN_ROLE\";\n    //\u5173\u95ed\u89d2\u8272UI\n    MainNotify.CLOSE_ROLE = \"MainNotify_CLOSE_ROLE\";\n    //\u6253\u5f00\u529f\u80fdUI\n    MainNotify.OPEN_FUNCTION = \"MainNotify_OPEN_FUNCTION\";\n    //\u5173\u95ed\u529f\u80fdUI\n    MainNotify.CLOSE_FUNCTION = \"MainNotify_CLOSE_FUNCTION\";\n    //\u6253\u5f00\u6d3b\u52a8UI\n    MainNotify.OPEN_ACTIVITY = \"MainNotify_OPEN_ACTIVITY\";\n    //\u5173\u95ed\u6d3b\u52a8UI\n    MainNotify.CLOSE_ACTIVITY = \"MainNotify_CLOSE_ACTIVITY\";\n    return MainNotify;\n}());\n__reflect(MainNotify.prototype, \"MainNotify\");", "domain": "javascript", "lang": "code", "char_count": 971, "word_count": 193, "byte_count": 1075}
{"text": "/** \n * Kendo UI v2020.2.617 (http://www.telerik.com/kendo-ui)                                                                                                                                               \n * Copyright 2020 Progress Software Corporation and/or one of its subsidiaries or affiliates. All rights reserved.                                                                                      \n *                                                                                                                                                                                                      \n * Kendo UI commercial licenses may be obtained at                                                                                                                                                      \n * http://www.telerik.com/purchase/license-agreement/kendo-ui-complete                                                                                                                                  \n * If you do not own a commercial license, this file shall be governed by the trial license terms.                                                                                                      \n                                                                                                                                                                                                       \n                                                                                                                                                                                                       \n                                                                                                                                                                                                       \n                                                                                                                                                                                                       \n                                                                                                                                                                                                       \n                                                                                                                                                                                                       \n                                                                                                                                                                                                       \n                                                                                                                                                                                                       \n                                                                                                                                                                                                       \n                                                                                                                                                                                                       \n                                                                                                                                                                                                       \n                                                                                                                                                                                                       \n                                                                                                                                                                                                       \n                                                                                                                                                                                                       \n                                                                                                                                                                                                       \n\n*/\n!function(n){\"function\"==typeof define&&define.amd?define([\"kendo.core.min\"],n):n()}(function(){!function(n,y){kendo.cultures.vun={name:\"vun\",numberFormat:{pattern:[\"-n\"],decimals:2,\",\":\",\",\".\":\".\",groupSize:[3],percent:{pattern:[\"-n%\",\"n%\"],decimals:2,\",\":\",\",\".\":\".\",groupSize:[3],symbol:\"%\"},currency:{name:\"\",abbr:\"\",pattern:[\"-$n\",\"$n\"],decimals:0,\",\":\",\",\".\":\".\",groupSize:[3],symbol:\"TSh\"}},calendars:{standard:{days:{names:[\"Jumapilyi\",\"Jumatatuu\",\"Jumanne\",\"Jumatanu\",\"Alhamisi\",\"Ijumaa\",\"Jumamosi\"],namesAbbr:[\"Jpi\",\"Jtt\",\"Jnn\",\"Jtn\",\"Alh\",\"Iju\",\"Jmo\"],namesShort:[\"Jpi\",\"Jtt\",\"Jnn\",\"Jtn\",\"Alh\",\"Iju\",\"Jmo\"]},months:{names:[\"Januari\",\"Februari\",\"Machi\",\"Aprilyi\",\"Mei\",\"Junyi\",\"Julyai\",\"Agusti\",\"Septemba\",\"Oktoba\",\"Novemba\",\"Desemba\"],namesAbbr:[\"Jan\",\"Feb\",\"Mac\",\"Apr\",\"Mei\",\"Jun\",\"Jul\",\"Ago\",\"Sep\",\"Okt\",\"Nov\",\"Des\"]},AM:[\"AM\",\"am\",\"AM\"],PM:[\"PM\",\"pm\",\"PM\"],patterns:{d:\"dd/MM/yyyy\",D:\"dddd, d MMMM yyyy\",F:\"dddd, d MMMM yyyy HH:mm:ss\",g:\"dd/MM/yyyy HH:mm\",G:\"dd/MM/yyyy HH:mm:ss\",m:\"MMMM d\",M:\"MMMM d\",s:\"yyyy'-'MM'-'dd'T'HH':'mm':'ss\",t:\"HH:mm\",T:\"HH:mm:ss\",u:\"yyyy'-'MM'-'dd HH':'mm':'ss'Z'\",y:\"MMMM yyyy\",Y:\"MMMM yyyy\"},\"/\":\"/\",\":\":\":\",firstDay:1}}}}(this)});\n//# sourceMappingURL=kendo.culture.vun.min.js.map", "domain": "javascript", "lang": "code", "char_count": 5441, "word_count": 681, "byte_count": 5441}
{"text": "/**\n * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/* globals document, console, window */\n\nimport ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';\nimport ArticlePluginSet from '@ckeditor/ckeditor5-core/tests/_utils/articlepluginset';\n\nimport EditorWatchdog from '../../src/editorwatchdog';\n\nclass TypingError {\n\tconstructor( editor ) {\n\t\tthis.editor = editor;\n\t}\n\n\tinit() {\n\t\tconst inputCommand = this.editor.commands.get( 'input' );\n\n\t\tinputCommand.on( 'execute', ( evt, data ) => {\n\t\t\tconst commandArgs = data[ 0 ];\n\n\t\t\tif ( commandArgs.text === '1' ) {\n\t\t\t\t// Simulate error.\n\t\t\t\tthis.editor.foo.bar = 'bom';\n\t\t\t}\n\t\t} );\n\t}\n}\n\nconst editorConfig = {\n\timage: { toolbar: [ 'toggleImageCaption', 'imageTextAlternative' ] },\n\tplugins: [\n\t\tArticlePluginSet, TypingError\n\t],\n\ttoolbar: [ 'heading', '|', 'bold', 'italic', 'link', 'bulletedList', 'numberedList', 'blockQuote',\n\t\t'insertTable', 'mediaEmbed', 'undo', 'redo' ],\n\ttable: {\n\t\tcontentToolbar: [\n\t\t\t'tableColumn',\n\t\t\t'tableRow',\n\t\t\t'mergeTableCells'\n\t\t]\n\t}\n};\n\nconst watchdog1 = createWatchdog(\n\tdocument.getElementById( 'editor-1' ),\n\tdocument.getElementById( 'editor-1-state' ),\n\t'First'\n);\n\nconst watchdog2 = createWatchdog(\n\tdocument.getElementById( 'editor-2' ),\n\tdocument.getElementById( 'editor-2-state' ),\n\t'Second'\n);\n\nObject.assign( window, { watchdog1, watchdog2 } );\n\ndocument.getElementById( 'random-error' ).addEventListener( 'click', () => {\n\tthrow new Error( 'foo' );\n} );\n\nfunction createWatchdog( editorElement, stateElement, name ) {\n\tconst watchdog = new EditorWatchdog( ClassicEditor );\n\n\twatchdog.create( editorElement, editorConfig );\n\n\twatchdog.on( 'error', () => {\n\t\tconsole.log( `${ name } editor crashed!` );\n\t} );\n\n\twatchdog.on( 'restart', () => {\n\t\tconsole.log( `${ name } editor restarted.` );\n\t} );\n\n\twatchdog.on( 'stateChange', () => {\n\t\tconsole.log( `${ name } watchdog state changed to '${ watchdog.state }'` );\n\n\t\tstateElement.innerText = watchdog.state;\n\n\t\tif ( watchdog.state === 'crashedPermanently' ) {\n\t\t\twatchdog.editor.isReadOnly = true;\n\t\t}\n\t} );\n\n\tstateElement.innerText = watchdog.state;\n\n\treturn watchdog;\n}", "domain": "javascript", "lang": "code", "char_count": 2263, "word_count": 497, "byte_count": 2263}
{"text": "(function(env) {\n    env.ddg_spice_expatistan = function(api_result) {\n        \"use strict\";\n\n        if(!api_result || api_result.status !== 'OK') {\n            return Spice.failed('expatistan');\n        }\n\n        Spice.add({\n            id: \"expatistan\",\n            name: \"Answer\",\n            data: api_result,\n            meta: {\n                sourceUrl: api_result.source_url,\n                sourceName: 'Expatistan'\n            },\n            normalize: function(item) {\n\n                // Vars\n                var city, cost, subtitle, title;\n\n                // Guard if abstract or source_url don't exist\n                if (!api_result.abstract || !api_result.source_url) {\n                    return Spice.failed('expatistan');\n                }\n\n                // We have a comparison result return the full abstract\n                if(api_result.source_url.match(/comparison/)) {\n                    title = api_result.abstract;\n                } else {\n                // We have a single result extract the index and create a subtitle\n                    city = api_result.abstract.match(/<b>(.*?)<\\/b>/g)[0];\n                    title = api_result.abstract.match(/\\s[0-9]+\\s/)[0];\n                    subtitle = city + \" - Cost of living index\";\n                }\n\n                return {\n                    title: DDG.strip_html(title),\n                    subtitle: DDG.strip_html(subtitle)\n                };\n            },\n            templates: {\n                group: 'text',\n                options: {\n                    moreAt: true\n                }\n            }\n        });\n    }\n}(this));", "domain": "javascript", "lang": "code", "char_count": 1627, "word_count": 279, "byte_count": 1627}
{"text": "// THIS FILE IS AUTO GENERATED\nvar GenIcon = require('../lib').GenIcon\nmodule.exports.HiLibrary = function HiLibrary (props) {\n  return GenIcon({\"tag\":\"svg\",\"attr\":{\"viewBox\":\"0 0 20 20\",\"fill\":\"currentColor\"},\"child\":[{\"tag\":\"path\",\"attr\":{\"fillRule\":\"evenodd\",\"d\":\"M10.496 2.132a1 1 0 00-.992 0l-7 4A1 1 0 003 8v7a1 1 0 100 2h14a1 1 0 100-2V8a1 1 0 00.496-1.868l-7-4zM6 9a1 1 0 00-1 1v3a1 1 0 102 0v-3a1 1 0 00-1-1zm3 1a1 1 0 012 0v3a1 1 0 11-2 0v-3zm5-1a1 1 0 00-1 1v3a1 1 0 102 0v-3a1 1 0 00-1-1z\",\"clipRule\":\"evenodd\"}}]})(props);\n};", "domain": "javascript", "lang": "code", "char_count": 538, "word_count": 172, "byte_count": 538}
{"text": "\ufeff/*\n * Provides methods for working with localized strings. \n */\ncmsdefine([], function () {\n\n    /**\n     * Get localized string for specific resource key.\n     * \n     * @param {string} Resource key \n     * @returns {string} Localized string\n     */\n    function getString(key) {\n        var translation,\n            localizationStrings = window.CMS['localizationStrings'];\n\n        if (localizationStrings !== undefined) {    \n            translation = localizationStrings[key];\n        }\n\n        return (translation !== undefined) ? translation : key;\n    }\n\n    return {\n        getString: getString\n    };\n});", "domain": "javascript", "lang": "code", "char_count": 616, "word_count": 109, "byte_count": 618}
{"text": "import React,{Component} from 'react'\nimport {connect} from 'react-redux'\nimport {menuDisplayActions,changeActiveTheme} from '../../Actions/topBarActions'\nimport {faMoon,faSun, faPaperPlane} from '@fortawesome/fontawesome-free-solid'\nimport {faFacebook,faTwitter,faGithub,faLinkedin,faPiedPiper} from '@fortawesome/fontawesome-free-brands'\nimport IconedButton from '../iconedButton'\nimport './main.css'\nimport {initiateSendMessage} from '../../Actions/messagesHandler'\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\n\nclass Menu extends Component{\n    constructor(props) {\n        super(props);\n        this.state = {\n            light:false,\n            dark:false,\n            pied:false,\n            messageToDev:\"\"\n        }\n        this.setWrapperRef = this.setWrapperRef.bind(this);\n        this.handleClickOutside = this.handleClickOutside.bind(this);\n    }\n    \n    componentDidMount() {\n        document.addEventListener('mousedown', this.handleClickOutside);\n        this.checkActiveTheme()\n    }\n    \n    componentWillUnmount() {\n        document.removeEventListener('mousedown', this.handleClickOutside);\n    }\n      \n    componentDidUpdate(prevProps){\n        if(this.props.theme !== prevProps.theme){\n            this.checkActiveTheme()\n        }\n    }\n\n    checkActiveTheme(){\n        switch(this.props.theme){\n            case \"LIGHT\":{\n                this.setState({light:true,dark:false,pied:false});\n                break;\n            }\n\n            case \"DARK\":{\n                this.setState({dark:true,light:false,pied:false});\n                break;\n            }\n\n            case \"PIED\":{\n                this.setState({dark:false,light:false,pied:true});\n                break;\n            }\n\n            default:{\n                break;\n            }\n          }\n      }\n\n    changeTheme(theme){\n        console.log(\"HERE\")\n        this.props.dispatch(changeActiveTheme(theme))\n    }\n    openSocial(network){\n        let url = null\n        switch(network){\n            case \"facebook\":{\n                url = 'https://www.facebook.com/abdulhamidoumer.oumer'\n                break\n            }\n\n            case \"twitter\":{\n                url = 'https://twitter.com/Aotwitts3'\n                break\n            }\n\n            case \"github\":{\n                url = 'https://github.com/abdulhamidOumer'\n                break\n            }\n\n            case \"linkedin\":{\n                url = 'https://www.linkedin.com/in/abdulhamid-mohammed-3a9485108/'\n                break\n            }\n            default:\n                break\n        }\n\n        const openUrl = window.open(url, '_blank')\n        openUrl.focus()\n    }\n    setWrapperRef(node) {\n      this.wrapperRef = node;\n    }\n\n    handleClickOutside(event) {\n      if (this.wrapperRef && !this.wrapperRef.contains(event.target)) {\n          this.props.dispatch(menuDisplayActions('HIDE'));\n      }\n    }\n\n    sendMessageToDev(){\n        const message = this.state.messageToDev\n        this.props.dispatch(initiateSendMessage(message))\n    }\n\n    handleInput(event){\n        const message = event.target.value\n        this.setState({\n            messageToDev:message\n        })\n    }\n\n    render(){\n        return(\n            <div className='top-menu' ref={this.setWrapperRef}>\n                <h3 className='title-discriptions no-border'>Themes</h3>\n                \n                <div className='center-container'>\n                    <IconedButton onClick={this.changeTheme.bind(this,\"LIGHT\")} icon={faSun} discription='Light Mode' active={this.state.light}/>\n                    <IconedButton onClick={this.changeTheme.bind(this,\"DARK\")} icon={faMoon} discription='Dark Mode'  active={this.state.dark}/>\n                    <IconedButton onClick={this.changeTheme.bind(this,\"PIED\")} icon={faPiedPiper} discription='Pied Piper'  active={this.state.pied}/>\n                </div>\n\n                <h3 className='title-discriptions'>Contact</h3>\n                \n                <div className='direct-message'>\n                    <textarea value={this.state.messageToDev} onChange={this.handleInput.bind(this)} placeholder='Direct Message' className='message-input'></textarea>\n                    <button className='send-messenger-button' onClick={this.sendMessageToDev.bind(this)}>\n                        <label>Send To Developer</label>\n                        <FontAwesomeIcon icon={faPaperPlane} className='messenger-icon'/>\n                    </button>\n                </div>\n\n                <div className='center-container'>\n                    <IconedButton onClick={this.openSocial.bind(this,'facebook')} icon={faFacebook} active/>\n                    <IconedButton onClick={this.openSocial.bind(this,'twitter')} icon={faTwitter} active/>\n                    <IconedButton onClick={this.openSocial.bind(this,'github')} icon={faGithub}  active/>\n                    <IconedButton onClick={this.openSocial.bind(this,'linkedin')} icon={faLinkedin} active/>\n                </div>\n\n            </div>\n        )\n    }\n}\n\nMenu = connect(store=>{\n    return{\n        theme:store.theme\n    }\n})(Menu)\n\nexport default Menu", "domain": "javascript", "lang": "code", "char_count": 5136, "word_count": 973, "byte_count": 5136}
{"text": "import React, {PropTypes} from 'react';\nimport {connect} from 'react-redux';\nimport Snackbar from 'material-ui/Snackbar';\n\nimport {notice, requestClose} from '../../redux/modules/noticeBar';\n\nvar Notice = React.createClass({\n    propTypes: {\n        open: PropTypes.bool.isRequired,\n        message: PropTypes.string.isRequired\n    },\n\n    handleRequestClose: function () {\n        this.props.requestClose();\n    },\n\n    render: function () {\n        return (\n            <div>\n                <Snackbar\n                    open={this.props.open}\n                    message={this.props.message}\n                    autoHideDuration={3000}\n                    onRequestClose={this.handleRequestClose}\n                    bodyStyle={{fontFamily: 'Lato', fontSize: '2em', fontWeight:'bold'}}\n                />\n            </div>\n        );\n    }\n});\n\nfunction mapStateToProps (state) {\n    return { \n        open: state.noticeBar.open,\n        message: state.noticeBar.message,\n    };\n}\n\nexport default connect(\n    mapStateToProps , \n    {notice, requestClose}\n)(Notice)", "domain": "javascript", "lang": "code", "char_count": 1070, "word_count": 201, "byte_count": 1070}
{"text": "import express from \"express\";\nimport { promises } from \"fs\";\nimport moment from \"moment\";\nconst { writeFile, readFile } = promises;\n\nimport {inserirLancamento} from \"../controllers/lancamentosControllers.js\";\nimport {media, somatorio, teste} from \"../libs/calculos.js\";\n\nconst router = express.Router();\n\nrouter.get(\"/totalMes/:mes\", async (req, res) => {\n    let numeros = [1, 2, 3, 4, 5, 6, 7];\n    /*numeros.forEach(async x => {\n        let result = await teste(x);\n        console.log(result);\n    });*/\n    /*for (let x of numeros) {\n        let result = await teste(x);\n        console.log(result);        \n    }*/\n    for (let i = 0; i < numeros.length; i++) {\n        let result = await teste(numeros[i]);\n        console.log(result);\n    }\n\n\n    let json = JSON.parse(await readFile(global.fileName));\n    let lancamentos = json.lancamentos.filter(lancamento => {\n        const mes = moment(lancamento.data, \"DD/MM/YYYY\").month() + 1;\n        return mes === parseInt(req.params.mes);        \n    });\n    lancamentos = lancamentos.map(lancamento => {\n        return lancamento.valor;\n    });\n    res.send({valor: somatorio(lancamentos)});\n});\n\nrouter.post(\"/receita\", async (req, res) => {\n    try {\n        let lancamento = req.body;        \n        res.send(await inserirLancamento(lancamento));\n    } catch (err) {\n        res.status(400).send({error: err.message});\n    }    \n});\n\nrouter.post(\"/despesa\", async (req, res) => {\n    try {\n        let lancamento = req.body;\n        res.send(await inserirLancamento(lancamento, \"D\"));\n    } catch (err) {\n        res.status(400).send({error: err.message});\n    }    \n});\n\nexport default router;", "domain": "javascript", "lang": "code", "char_count": 1654, "word_count": 427, "byte_count": 1654}
{"text": "var hypnoticBall, database;\nvar position;\n\n\nfunction setup(){\n  database = firebase.database();\n  console.log(database);\n  createCanvas(500,500);\n\n  hypnoticBall = createSprite(250,250,10,10);\n  hypnoticBall.shapeColor = \"red\";\n\n\n  var hypnoticBallPosition = database.ref('ball/position');\n  hypnoticBallPosition.on(\"value\", readPosition, showError);\n}\n\nfunction draw(){\n  background(\"white\");\n  \n    if(keyDown(LEFT_ARROW)){\n      writePosition(-1,0);\n   console.log(\"left\");\n    }\n    else if(keyDown(RIGHT_ARROW)){\n      writePosition(1,0);\n    }\n    else if(keyDown(UP_ARROW)){\n      writePosition(0,-1);\n    }\n    else if(keyDown(DOWN_ARROW)){\n      writePosition(0,+1);\n    }\n    drawSprites();\n  \n}\n\nfunction writePosition(x,y){\n  database.ref(\"ball/position\").set ({\n    \"x\" : position.x + x,\n    \"y\" : position.y + y\n  })\n}\n\nfunction readPosition(data){\n  position = data.val();\n  console.log(position.x);\n  hypnoticBall.x = position.x;\n  hypnoticBall.y = position.y;\n}\n\nfunction showError(){\n  console.log(\"Error in writing to the database\");\n}", "domain": "javascript", "lang": "code", "char_count": 1054, "word_count": 279, "byte_count": 1054}
{"text": "const chromeLauncher = require('chrome-launcher');\nconst CDP = require('chrome-remote-interface');\n\nmodule.exports = class Browser {\n    async initialize() {\n        const chrome = await chromeLauncher.launch({\n            chromeFlags: [\n                //'--disable-gpu',\n                //'--headless'\n            ]\n        });\n        const protocol = await CDP({\n            port: chrome.port\n        });\n        await Promise.all([protocol.Page.enable(), protocol.Runtime.enable()]);\n        this.protocol = protocol;\n    }\n\n    navigate(url) {\n        return this.protocol.Page.navigate({ url });\n    }\n\n    loadEventFired(callback) {\n        return this.protocol.Page.loadEventFired(callback);\n    }\n\n    reload(callback) {\n        return this.protocol.Page.reload({ ignoreCache: true });\n    }\n\n    async getPageTextContent() {\n        const { result } = await this.protocol.Runtime.evaluate({\n            expression: \"document.querySelector('body').textContent\"\n        });\n        return result.value;\n    }\n\n    async captureScreenshot() {\n        const { data } = await this.protocol.Page.captureScreenshot();\n        return data;\n    }\n}", "domain": "javascript", "lang": "code", "char_count": 1150, "word_count": 228, "byte_count": 1150}
{"text": "// This file was automatically generated from common.soy.\n// Please don't edit this file by hand.\n\nif (typeof apps == 'undefined') { var apps = {}; }\n\n\napps.messages = function(opt_data, opt_ignored, opt_ijData) {\n  return '<div style=\"display: none\"><span id=\"subtitle\">a visual programming environment</span><span id=\"blocklyMessage\">Blockly</span><span id=\"codeTooltip\">See generated JavaScript code.</span><span id=\"linkTooltip\">Save and link to blocks.</span><span id=\"runTooltip\">Run the program defined by the blocks in the workspace.</span><span id=\"runProgram\">Run Program</span><span id=\"resetProgram\">Reset</span><span id=\"dialogOk\">\u09a0\u09bf\u0995 \u0986\u099b\u09c7</span><span id=\"dialogCancel\">Cancel</span><span id=\"catLogic\">Logic</span><span id=\"catLoops\">Loops</span><span id=\"catMath\">Math</span><span id=\"catText\">Text</span><span id=\"catLists\">Lists</span><span id=\"catColour\">Colour</span><span id=\"catVariables\">Variables</span><span id=\"catProcedures\">Functions</span><span id=\"httpRequestError\">There was a problem with the request.</span><span id=\"linkAlert\">Share your blocks with this link:\\\\n\\\\n%1</span><span id=\"hashError\">Sorry, \\'%1\\' doesn\\'t correspond with any saved program.</span><span id=\"xmlError\">Could not load your saved file.  Perhaps it was created with a different version of Blockly?</span><span id=\"listVariable\">list</span><span id=\"textVariable\">text</span></div>';\n};\n\n\napps.dialog = function(opt_data, opt_ignored, opt_ijData) {\n  return '<div id=\"dialogShadow\" class=\"dialogAnimate\"></div><div id=\"dialogBorder\"></div><div id=\"dialog\"></div>';\n};\n\n\napps.codeDialog = function(opt_data, opt_ignored, opt_ijData) {\n  return '<div id=\"dialogCode\" class=\"dialogHiddenContent\"><pre id=\"containerCode\"></pre>' + apps.ok(null, null, opt_ijData) + '</div>';\n};\n\n\napps.storageDialog = function(opt_data, opt_ignored, opt_ijData) {\n  return '<div id=\"dialogStorage\" class=\"dialogHiddenContent\"><div id=\"containerStorage\"></div>' + apps.ok(null, null, opt_ijData) + '</div>';\n};\n\n\napps.ok = function(opt_data, opt_ignored, opt_ijData) {\n  return '<div class=\"farSide\" style=\"padding: 1ex 3ex 0\"><button class=\"secondary\" onclick=\"BlocklyApps.hideDialog(true)\">\u09a0\u09bf\u0995 \u0986\u099b\u09c7</button></div>';\n};\n\n;\n// This file was automatically generated from template.soy.\n// Please don't edit this file by hand.\n\nif (typeof planepage == 'undefined') { var planepage = {}; }\n\n\nplanepage.messages = function(opt_data, opt_ignored, opt_ijData) {\n  return apps.messages(null, null, opt_ijData) + '<div style=\"display: none\"><span id=\"Plane_rows\">Rows: %1</span><span id=\"Plane_getRows\">rows (%1)</span><span id=\"Plane_rows1\">1st class rows: %1</span><span id=\"Plane_getRows1\">1st class rows (%1)</span><span id=\"Plane_rows2\">2nd class rows: %1</span><span id=\"Plane_getRows2\">2nd class rows (%1)</span><span id=\"Plane_seats\">Seats: %1</span><span id=\"Plane_placeholder\">?</span><span id=\"Plane_setSeats\">seats =</span></div>';\n};\n\n\nplanepage.start = function(opt_data, opt_ignored, opt_ijData) {\n  var output = planepage.messages(null, null, opt_ijData) + '<table width=\"100%\"><tr><td><h1><span id=\"title\"><a href=\"../index.html?lang=' + soy.$$escapeHtml(opt_ijData.lang) + '\">Blockly</a> : Plane Seat Calculator</span> &nbsp; ';\n  var iLimit130 = opt_ijData.maxLevel + 1;\n  for (var i130 = 1; i130 < iLimit130; i130++) {\n    output += ' ' + ((i130 == opt_ijData.level) ? '<span class=\"tab\" id=\"selected\">' + soy.$$escapeHtml(i130) + '</span>' : (i130 < opt_ijData.level) ? '<a class=\"tab previous\" href=\"?lang=' + soy.$$escapeHtml(opt_ijData.lang) + '&level=' + soy.$$escapeHtml(i130) + '\">' + soy.$$escapeHtml(i130) + '</a>' : '<a class=\"tab\" href=\"?lang=' + soy.$$escapeHtml(opt_ijData.lang) + '&level=' + soy.$$escapeHtml(i130) + '\">' + soy.$$escapeHtml(i130) + '</a>');\n  }\n  output += '</h1></td><td class=\"farSide\"><select id=\"languageMenu\"></select></td></tr></table><script type=\"text/javascript\" src=\"../slider.js\"><\\/script><svg id=\"plane\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:svg=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" version=\"1.1\" width=\"600\" height=\"256\" viewBox=\"0 142 600 256\"><defs><g id=\"row1st\"><rect class=\"seat1st\" width=\"10\" height=\"10\" x=\"75\" y=\"245\" /><rect class=\"seat1st\" width=\"10\" height=\"10\" x=\"75\" y=\"256\" /><rect class=\"seat1st\" width=\"10\" height=\"10\" x=\"75\" y=\"274\" /><rect class=\"seat1st\" width=\"10\" height=\"10\" x=\"75\" y=\"285\" /></g><g id=\"row2nd\"><rect class=\"seat2nd\" width=\"10\" height=\"8\" x=\"75\" y=\"245\" /><rect class=\"seat2nd\" width=\"10\" height=\"8\" x=\"75\" y=\"253\" /><rect class=\"seat2nd\" width=\"10\" height=\"8\" x=\"75\" y=\"271\" /><rect class=\"seat2nd\" width=\"10\" height=\"8\" x=\"75\" y=\"279\" /><rect class=\"seat2nd\" width=\"10\" height=\"8\" x=\"75\" y=\"287\" /></g><linearGradient id=\"grad1\" x1=\"0%\" y1=\"100%\" x2=\"0%\" y2=\"0%\"><stop offset=\"0%\" style=\"stop-color:#fff;stop-opacity:0\" /><stop offset=\"100%\" style=\"stop-color:#fff;stop-opacity:1\" /></linearGradient><linearGradient id=\"grad2\" x1=\"0%\" y1=\"0%\" x2=\"0%\" y2=\"100%\"><stop offset=\"0%\" style=\"stop-color:#fff;stop-opacity:0\" /><stop offset=\"100%\" style=\"stop-color:#fff;stop-opacity:1\" /></linearGradient></defs><path d=\"M 404,1 373,15 230,244 230,297 373,524 404,542 330,351 330,189 z\" id=\"wing\" /><path d=\"m 577,269 22,-93 -27,6 -44,88 44,88 27,6 z\" id=\"tail\" /><path d=\"m 483,296 h -407 c -38,0 -75,-13 -75,-26 c 0,-13 38,-26 75,-26 h 407 l 94,24 z\" id=\"fuselage\" /><rect width=\"610\" height=\"100\" x=\"-5\" y=\"142\" fill=\"url(#grad1)\" /><rect width=\"610\" height=\"100\" x=\"-5\" y=\"298\" fill=\"url(#grad2)\" /><text id=\"row1stText\" x=\"55\" y=\"380\"></text><text id=\"row2ndText\" x=\"350\" y=\"380\"></text><text x=\"55\" y=\"210\"><tspan id=\"seatText\"></tspan><tspan id=\"seatYes\" style=\"fill: #0c0;\" dy=\"10\">&#x2713;</tspan><tspan id=\"seatNo\" style=\"fill: #f00;\" dy=\"10\">&#x2717;</tspan></text>' + ((opt_ijData.level > 1) ? '<rect id=\"crew_right\" class=\"crew\" width=\"10\" height=\"10\" x=\"35\" y=\"256\" /><rect id=\"crew_left\" class=\"crew\" width=\"10\" height=\"10\" x=\"35\" y=\"274\" />' : '') + '</svg><p>';\n  switch (opt_ijData.level) {\n    case 1:\n      output += 'An airplane has a number of rows of passenger seats.  Each row contains four seats.';\n      break;\n    case 2:\n      output += 'An airplane has two seats in the flight deck (for the pilot and co-pilot), and a number of rows of passenger seats.  Each row contains four seats.';\n      break;\n    case 3:\n      output += 'An airplane has two seats in the flight deck (for the pilot and co-pilot), and a number of rows of 1st class and 2nd class passenger seats.  Each 1st class row contains four seats. Each 2nd class row contains five seats.';\n      break;\n  }\n  output += '</p><p>Build a formula (below) that calculates the total number of seats on the airplane as the rows are changed (above).</p><script type=\"text/javascript\" src=\"../../blockly_compressed.js\"><\\/script><script type=\"text/javascript\" src=\"../../blocks_compressed.js\"><\\/script><script type=\"text/javascript\" src=\"../../javascript_compressed.js\"><\\/script><script type=\"text/javascript\" src=\"../../' + soy.$$escapeHtml(opt_ijData.langSrc) + '\"><\\/script><script type=\"text/javascript\" src=\"blocks.js\"><\\/script>' + planepage.toolbox(null, null, opt_ijData) + '<div id=\"blockly\"></div>';\n  return output;\n};\n\n\nplanepage.toolbox = function(opt_data, opt_ignored, opt_ijData) {\n  return '<xml id=\"toolbox\" style=\"display: none\"><block type=\"math_number\"></block><block type=\"math_arithmetic\"></block><block type=\"math_arithmetic\"><field name=\"OP\">MULTIPLY</field></block>' + ((opt_ijData.level <= 2) ? '<block type=\"plane_get_rows\"></block>' : '<block type=\"plane_get_rows1st\"></block><block type=\"plane_get_rows2nd\"></block>') + '</xml>';\n};", "domain": "javascript", "lang": "code", "char_count": 7655, "word_count": 2307, "byte_count": 7679}
{"text": "import { NotImplementedError } from '../extensions/index.js';\n\n/**\n * Given matrix where you have to find cats by ears \"^^\"\n *\n * @param {Array<Array>} matrix \n * @return {Number} count of cats found\n *\n * @example\n * countCats([\n *  [0, 1, '^^'],\n *  [0, '^^', 2],\n *  ['^^', 1, 2]\n * ]) => 3`\n *\n */\nexport default function countCats(matrix) {\n  // let result = 0;\n\n  // for (let i = 0; i < matrix.length; i++){\n  //   for (let j = 0; j < matrix[i].length; j++){\n  //     if (matrix[i][j] == '^^' ) {result++}\n  //   }\n  // }\n  return matrix.flat(1).filter(elem => elem === '^^').length;\n}", "domain": "javascript", "lang": "code", "char_count": 591, "word_count": 185, "byte_count": 591}
{"text": "// @ts-check\nconst {\n\tpackageJson,\n\tinstall,\n\tgetExtsFromCommand,\n\tuninstall,\n} = require('mrm-core');\nconst { isUsingYarnBerry } = require('mrm-core/src/npm');\nconst { castArray } = require('lodash');\nconst husky = require('husky');\n\nconst packages = {\n\t'lint-staged': '>=10',\n\thusky: '>=7',\n};\n\n/**\n * Default lint-staged rules\n *\n * @param name Name of the rule to match user overrides\n * @param [condition] Function that returns true when the rule should be added\n * @param extensions Default extension (if we can't infer them from an npm script)\n * @param [script] Name of an npm script to infer extensions\n * @param [param] Command line parameter of an npm script to infer extensions (for example, `ext` for `--ext`)\n * @param command Command to run for a lint-staged rule\n */\nconst defaultRules = [\n\t// ESLint\n\t{\n\t\tname: 'eslint',\n\t\tcondition: pkg => !!pkg.get('devDependencies.eslint'),\n\t\textensions: ['js'],\n\t\tscript: 'lint',\n\t\tparam: 'ext',\n\t\tcommand: 'eslint --cache --fix',\n\t},\n\t// Stylelint\n\t{\n\t\tname: 'stylelint',\n\t\tcondition: pkg => !!pkg.get('devDependencies.stylelint'),\n\t\textensions: ['css'],\n\t\tscript: 'lint:css',\n\t\tcommand: 'stylelint --fix',\n\t},\n\t// Prettier\n\t{\n\t\tname: 'prettier',\n\t\tcondition: pkg =>\n\t\t\t!!pkg.get('devDependencies.prettier') &&\n\t\t\t!pkg.get('devDependencies.eslint-plugin-prettier'),\n\t\textensions: ['js', 'css', 'md'],\n\t\tscript: 'format',\n\t\tcommand: 'prettier --write',\n\t},\n];\n\n/**\n * Merge default rules with user overrides\n *\n * @param {Array} defaults\n * @param {Object} overrides\n */\nfunction mergeRules(defaults, overrides) {\n\t// Overrides for default rules\n\tconst rulesWithOverrides = defaults.map(rule => ({\n\t\t...rule,\n\t\t...overrides[rule.name],\n\t}));\n\n\t// Custom rules\n\treturn Object.entries(overrides).reduce((acc, [name, rule]) => {\n\t\tif (acc.some(x => x.name === name)) {\n\t\t\treturn acc;\n\t\t}\n\t\treturn [...acc, rule];\n\t}, rulesWithOverrides);\n}\n\n/**\n * Convert an array of extensions to a glob pattern\n *\n * Example: ['js', 'ts'] -> '*.{js,ts}'\n *\n * @param {string[]} exts\n */\nfunction extsToGlob(exts) {\n\tif (exts.length > 1) {\n\t\treturn `*.{${exts}}`;\n\t}\n\n\treturn `*.${exts}`;\n}\n\n/**\n * Generate a regular expression to detect a rule in existing rules. For simplicity\n * assumes that the first word in the command is the binary you're running.\n *\n * Example: 'eslint --fix' -> /\\beslint\\b/\n *\n * TODO: Allow overriding for more complex commands\n *\n * @param {string} command\n */\nfunction getRuleRegExp(command) {\n\treturn new RegExp(`\\\\b${command.split(' ').shift()}\\\\b`);\n}\n\n/**\n * Check if a given command belongs to a rule\n *\n * @param {string | string[]} ruleCommands\n * @param {string} command\n */\nfunction isCommandBelongsToRule(ruleCommands, command) {\n\tconst regExp = getRuleRegExp(command);\n\treturn castArray(ruleCommands).some(x => regExp.test(x));\n}\n\nmodule.exports = function task({ lintStagedRules }) {\n\tconst pkg = packageJson();\n\tconst allRules = mergeRules(defaultRules, lintStagedRules);\n\tconst existingRules = Object.entries(pkg.get('lint-staged', {}));\n\n\t// Remove exising rules that run any of default commands\n\tconst commandsToRemove = allRules.map(rule => rule.command);\n\tconst existingRulesToKeep = existingRules.filter(([, ruleCommands]) =>\n\t\tcommandsToRemove\n\t\t\t.map(command => isCommandBelongsToRule(ruleCommands, command))\n\t\t\t.every(x => x === false)\n\t);\n\n\t// New rules\n\tconst rulesToAdd = allRules.map(\n\t\t({\n\t\t\tcondition = () => true,\n\t\t\textensions: defaultExtensions,\n\t\t\tscript,\n\t\t\tparam,\n\t\t\tcommand,\n\t\t\tenabled = true,\n\t\t}) => {\n\t\t\tif (!enabled || !condition(pkg)) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst extensions =\n\t\t\t\tgetExtsFromCommand(pkg.getScript(script), param) || defaultExtensions;\n\t\t\tconst pattern = extsToGlob(extensions);\n\n\t\t\treturn [pattern, command];\n\t\t}\n\t);\n\n\t// Merge existing and new rules, clean up\n\tconst rulesToWrite = [...existingRulesToKeep, ...rulesToAdd].filter(Boolean);\n\n\t// Merge rules with the same pattern and convert to an object\n\t// Wrap commands in an array only when a pattern has multiple commands\n\tconst rules = {};\n\trulesToWrite.forEach(([pattern, command]) => {\n\t\tif (rules[pattern]) {\n\t\t\trules[pattern] = [...castArray(rules[pattern]), command];\n\t\t} else {\n\t\t\trules[pattern] = command;\n\t\t}\n\t});\n\n\tif (Object.keys(rules).length === 0) {\n\t\tconst names = defaultRules.map(rule => rule.name);\n\t\tconsole.log(\n\t\t\t`\\nCannot add lint-staged: only ${names.join(\n\t\t\t\t', '\n\t\t\t)} or custom rules are supported.`\n\t\t);\n\t\treturn;\n\t}\n\n\t// package.json\n\tpkg\n\t\t// Remove husky 0.14 config\n\t\t.unset('scripts.precommit')\n\t\t// Remove husky 4 config\n\t\t.unset('husky')\n\t\t// Remove simple-git-hooks\n\t\t.unset('simple-git-hooks')\n\t\t// Add new config\n\t\t.merge({\n\t\t\t'lint-staged': rules,\n\t\t});\n\n\tif (isUsingYarnBerry()) {\n\t\t// Yarn 2 doesn't support `prepare` lifecycle yet\n\t\t// https://yarnpkg.com/advanced/lifecycle-scripts\n\t\tpkg.appendScript('postinstall', 'husky install');\n\t\tif (!pkg.get('private')) {\n\t\t\t// In case package isn't private, pinst ensures that postinstall\n\t\t\t// is disabled on publish\n\t\t\tpkg\n\t\t\t\t.appendScript('prepublishOnly', 'pinst --disable')\n\t\t\t\t.appendScript('postpublish', 'pinst --enable');\n\t\t\tpackages.pinst = '>=2';\n\t\t}\n\t} else {\n\t\t// npm, Yarn 1, pnpm\n\t\tpkg.appendScript('prepare', 'husky install');\n\t}\n\n\tpkg.save();\n\n\tuninstall('simple-git-hooks');\n\t// Install dependencies\n\tinstall(packages);\n\t// Install husky\n\thusky.install();\n\t// Set lint-staged config\n\thusky.add('.husky/pre-commit', 'npx lint-staged');\n};\n\nmodule.exports.description = 'Adds lint-staged';\nmodule.exports.parameters = {\n\tlintStagedRules: {\n\t\ttype: 'config',\n\t\tdefault: {},\n\t},\n};", "domain": "javascript", "lang": "code", "char_count": 5566, "word_count": 1340, "byte_count": 5566}
{"text": "/* Change this file to get your personal Porfolio */\n\n//Home Page\nconst greeting = {\n  title: \"Ambareesh R\",\n  logo_name: \"Ambareesh\",\n  subTitle:\n    \"An Aspiring Deep Learning practitioner who is passionate about building scalable and robust AI enabled applications . With strong technical skills and academic background in engineering, statistics, machine learning and full stack development.\",\n};\n\nconst socialMediaLinks = [\n  {\n    name: \"Github\",\n    link: \"https://github.com/ambareeshr\",\n    fontAwesomeIcon: \"fa-github\", // Reference https://fontawesome.com/icons/github?style=brands\n    backgroundColor: \"#181717\", // Reference https://simpleicons.org/?q=github\n  },\n  {\n    name: \"LinkedIn\",\n    link: \"https://www.linkedin.com/in/ambareesh-r\",\n    fontAwesomeIcon: \"fa-linkedin-in\", // Reference https://fontawesome.com/icons/linkedin-in?style=brands\n    backgroundColor: \"#0077B5\", // Reference https://simpleicons.org/?q=linkedin\n  },\n  {\n    name: \"Gmail\",\n    link: \"mailto:rambareeshceg@gmail.com\",\n    fontAwesomeIcon: \"fa-google\", // Reference https://fontawesome.com/icons/google?style=brands\n    backgroundColor: \"#D14836\", // Reference https://simpleicons.org/?q=gmail\n  }\n];\n\nconst skills = {\n  data: [\n    {\n      title: \"AI & Data Science\",\n      fileName: \"DataScienceImg\",\n      skills: [\n        \"\u26a1 Developing highly scalable production ready models for various machine learning and statistical use cases\",\n        \"\u26a1 Worked in many Computer Vision and Natural Language Processing projects\",\n        \"\u26a1 Experienced in Deep Learning frameworks such as Tensorflow and Pytorch.\",\n      ],\n      softwareSkills: [\n        {\n          skillName: \"Tensorflow\",\n          logoName: \"logos-tensorflow\",\n          style: {\n            backgroundColor: \"transparent\",\n          },\n        },\n        {\n          skillName: \"Keras\",\n          logoName: \"simple-icons:keras\",\n          style: {\n            backgroundColor: \"white\",\n            color: \"#D00000\",\n          },\n        },\n        {\n          skillName: \"PyTorch\",\n          logoName: \"logos-pytorch\",\n          style: {\n            backgroundColor: \"transparent\",\n          },\n        },\n        {\n          skillName: \"Python\",\n          logoName: \"ion-logo-python\",\n          style: {\n            backgroundColor: \"transparent\",\n            color: \"#3776AB\",\n          },\n        },\n      ],\n    },\n    {\n      title: \"Full Stack Development\",\n      fileName: \"FullStackImg\",\n      skills: [\n        \"\u26a1 Building responsive website UI using Angular\",\n        \"\u26a1 Creating application backend in Flask, .Net & Java\",\n        \"\u26a1 Worked in relational databases such as SQL, MySQL and non-relational databases such as MongoDB, Redis\"\n      ],\n      softwareSkills: [\n        {\n          skillName: \"HTML5\",\n          logoName: \"simple-icons:html5\",\n          style: {\n            color: \"#E34F26\",\n          },\n        },\n        {\n          skillName: \"CSS3\",\n          logoName: \"fa-css3\",\n          style: {\n            color: \"#1572B6\",\n          },\n        },\n        {\n          skillName: \"Sass\",\n          logoName: \"simple-icons:sass\",\n          style: {\n            color: \"#CC6699\",\n          },\n        },\n        {\n          skillName: \"JavaScript\",\n          logoName: \"simple-icons:javascript\",\n          style: {\n            backgroundColor: \"#000000\",\n            color: \"#F7DF1E\",\n          },\n        },\n        {\n          skillName: \"Angular\",\n          logoName: \"logos:angular-icon\",\n          style: {\n            color: \"#2C8EBB\",\n          },\n        },\n        {\n          skillName: \"ReactJS\",\n          logoName: \"simple-icons:react\",\n          style: {\n            color: \"#61DAFB\",\n          },\n        },\n        {\n          skillName: \"NodeJS\",\n          logoName: \"simple-icons:node-dot-js\",\n          style: {\n            color: \"#339933\",\n          },\n        },\n        {\n          skillName: \"NPM\",\n          logoName: \"simple-icons:npm\",\n          style: {\n            color: \"#CB3837\",\n          },\n        },\n        {\n          skillName: \"Flask\",\n          logoName: \"logos:flask\",\n          style: {\n            color: \"#663399\",\n          },\n        },\n        {\n          skillName: \"Flutter\",\n          logoName: \"simple-icons:flutter\",\n          style: {\n            color: \"#02569B\",\n          },\n        },\n      ],\n    },\n    {\n      title: \"Cloud Infra-Architecture\",\n      fileName: \"CloudInfraImg\",\n      skills: [\n        \"\u26a1 Experience working on multiple cloud platforms\",\n        \"\u26a1 Created Continous Integration/Continous Deployment (CI/CD) pipelines for many projects.\",\n        \"\u26a1 Deploying deep learning models on cloud to use on mobile devices\",\n      ],\n      softwareSkills: [\n        {\n          skillName: \"AWS\",\n          logoName: \"simple-icons:amazonaws\",\n          style: {\n            color: \"#FF9900\",\n          },\n        },\n        {\n          skillName: \"Azure\",\n          logoName: \"simple-icons:microsoftazure\",\n          style: {\n            color: \"#0089D6\",\n          },\n        },\n        {\n          skillName: \"Firebase\",\n          logoName: \"simple-icons:firebase\",\n          style: {\n            color: \"#FFCA28\",\n          },\n        },\n        {\n          skillName: \"MySQL\",\n          logoName: \"logos:mysql\",\n          style: {\n            color: \"#336791\",\n          },\n        },\n        {\n          skillName: \"MongoDB\",\n          logoName: \"simple-icons:mongodb\",\n          style: {\n            color: \"#47A248\",\n          },\n        },\n        {\n          skillName: \"Docker\",\n          logoName: \"simple-icons:docker\",\n          style: {\n            color: \"#1488C6\",\n          },\n        },\n        {\n          skillName: \"Kubernetes\",\n          logoName: \"simple-icons:kubernetes\",\n          style: {\n            color: \"#326CE5\",\n          },\n        },\n      ],\n    },\n  ],\n};\n\n\nconst degrees = {\n  degrees: [\n    {\n      title: \"Anna University, College of Engineering Guindy\",\n      subtitle: \"B.Tech. in Information Technology\",\n      logo_path: \"annaUnivLogo.png\",\n      alt_name: \"Anna University, CEG\",\n      duration: \"2015 - 2019\",\n      descriptions: [\n        \"\u26a1 Courses Taken : Data Structures, Algorithms, DBMS, OS, CA, AI etc.\",\n        \"\u26a1 Apart from this, I have done courses on Deep Learning, Data Science and Full Stack Development.\",\n      ],\n      website_link: \"https://www.annauniv.edu/\",\n    },\n  ],\n};\n\nconst certifications = {\n  certifications: [\n    {\n      title: \"Deep Learning Nanodegree\",\n      subtitle: \"- Udacity\",\n      logo_path: \"aws_facebookai_logo.png\",\n      certificate_link:\n        \"https://confirm.udacity.com/KGNC4KFP\",\n      alt_name: \"Udacity\",\n      color_code: \"#02B3E4\",\n    },\n    {\n      title: \"Recommender Systems and Deep Learning in Python\",\n      subtitle: \"- Udemy\",\n      logo_path: \"udemy_logo.png\",\n      certificate_link:\n        \"https://ude.my/UC-2c264bae-b840-4b28-afb3-db1c58761357/\",\n      alt_name: \"Udemy\",\n      color_code: \"#0C9D5899\",\n    },\n    {\n      title: \"Cluster Analysis and Unsupervised Machine Learning in Python\",\n      subtitle: \"- Udemy\",\n      logo_path: \"udemy_logo.png\",\n      certificate_link:\n        \"https://ude.my/UC-854cf59e-757d-4612-badf-cbf00117cb32\",\n      alt_name: \"Udemy\",\n      color_code: \"#0C9D5899\",\n    }\n  ],\n};\n\n\n// Contact Page\nconst contactPageData = {\n  contactSection: {\n    title: \"Contact Me\",\n    profile_image_path: \"android-chrome-512x512.png\",\n    description:\n      \"Want to discuss about any project or just wanna say Hi?\",\n  },\n  addressSection: {\n    title: \"Address\",\n    subtitle:\n      \"Sai Dharshan Apts, South Gangaiamman koil 2nd Street, Choolaimedu, Chennai-600094 \",\n    avatar_image_path: \"address_image.svg\",\n    location_map_link: \"https://goo.gl/maps/N34TVpwA3pzqrArw8\",\n  },\n  phoneSection: {\n    title: \"Phone Number\",\n    subtitle: \"+91 9791141626\",\n  },\n};\n\n\n\n\nexport {\n  greeting,\n  socialMediaLinks,\n  skills,\n  degrees,\n  certifications,\n  contactPageData\n};", "domain": "javascript", "lang": "code", "char_count": 7972, "word_count": 1446, "byte_count": 7994}
{"text": "/*!\n * reveal.js 3.5.0 (2017-05-27, 23:22)\n * http://lab.hakim.se/reveal-js\n * MIT licensed\n *\n * Copyright (C) 2017 Hakim El Hattab, http://hakim.se\n */\n!function(a,b){\"function\"==typeof define&&define.amd?define(function(){return a.Reveal=b(),a.Reveal}):\"object\"==typeof exports?module.exports=b():a.Reveal=b()}(this,function(){\"use strict\";function a(a){if(!0!==Pb)if(Pb=!0,b(),Yb.transforms2d||Yb.transforms3d){Xb.wrapper=document.querySelector(\".reveal\"),Xb.slides=document.querySelector(\".reveal .slides\"),window.addEventListener(\"load\",N,!1);var d=zb.getQueryHash();void 0!==d.dependencies&&delete d.dependencies,q(Ob,a),q(Ob,d),C(),c()}else{document.body.setAttribute(\"class\",\"no-transforms\");for(var e=r(document.getElementsByTagName(\"img\")),f=r(document.getElementsByTagName(\"iframe\")),g=e.concat(f),h=0,i=g.length;h<i;h++){var j=g[h];j.getAttribute(\"data-src\")&&(j.setAttribute(\"src\",j.getAttribute(\"data-src\")),j.removeAttribute(\"data-src\"))}}}function b(){Fb=/(iphone|ipod|ipad|android)/gi.test(Nb),Gb=/chrome/i.test(Nb)&&!/edge/i.test(Nb);var a=document.createElement(\"div\");Yb.transforms3d=\"WebkitPerspective\"in a.style||\"MozPerspective\"in a.style||\"msPerspective\"in a.style||\"OPerspective\"in a.style||\"perspective\"in a.style,Yb.transforms2d=\"WebkitTransform\"in a.style||\"MozTransform\"in a.style||\"msTransform\"in a.style||\"OTransform\"in a.style||\"transform\"in a.style,Yb.requestAnimationFrameMethod=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame,Yb.requestAnimationFrame=\"function\"==typeof Yb.requestAnimationFrameMethod,Yb.canvas=!!document.createElement(\"canvas\").getContext,Yb.overviewTransitions=!/Version\\/[\\d\\.]+.*Safari/.test(Nb),Yb.zoom=\"zoom\"in a.style&&!Fb&&(Gb||/Version\\/[\\d\\.]+.*Safari/.test(Nb))}function c(){function a(){e.length&&head.js.apply(null,e),d()}function b(b){head.ready(b.src.match(/([\\w\\d_\\-]*)\\.?js$|[^\\\\\\/]*$/i)[0],function(){\"function\"==typeof b.callback&&b.callback.apply(this),0==--f&&a()})}for(var c=[],e=[],f=0,g=0,h=Ob.dependencies.length;g<h;g++){var i=Ob.dependencies[g];i.condition&&!i.condition()||(i.async?e.push(i.src):c.push(i.src),b(i))}c.length?(f=c.length,head.js.apply(null,c)):a()}function d(){e(),m(),i(),ga(),n(),Ea(),qa(!0),setTimeout(function(){Xb.slides.classList.remove(\"no-transition\"),Qb=!0,Xb.wrapper.classList.add(\"ready\"),E(\"ready\",{indexh:Ab,indexv:Bb,currentSlide:Db})},1),B()&&(p(),\"complete\"===document.readyState?h():window.addEventListener(\"load\",h))}function e(){Xb.slides.classList.add(\"no-transition\"),Xb.background=j(Xb.wrapper,\"div\",\"backgrounds\",null),Xb.progress=j(Xb.wrapper,\"div\",\"progress\",\"<span></span>\"),Xb.progressbar=Xb.progress.querySelector(\"span\"),j(Xb.wrapper,\"aside\",\"controls\",'<button class=\"navigate-left\" aria-label=\"previous slide\"></button><button class=\"navigate-right\" aria-label=\"next slide\"></button><button class=\"navigate-up\" aria-label=\"above slide\"></button><button class=\"navigate-down\" aria-label=\"below slide\"></button>'),Xb.slideNumber=j(Xb.wrapper,\"div\",\"slide-number\",\"\"),Xb.speakerNotes=j(Xb.wrapper,\"div\",\"speaker-notes\",null),Xb.speakerNotes.setAttribute(\"data-prevent-swipe\",\"\"),Xb.speakerNotes.setAttribute(\"tabindex\",\"0\"),j(Xb.wrapper,\"div\",\"pause-overlay\",null),Xb.controls=document.querySelector(\".reveal .controls\"),Xb.wrapper.setAttribute(\"role\",\"application\"),Xb.controlsLeft=r(document.querySelectorAll(\".navigate-left\")),Xb.controlsRight=r(document.querySelectorAll(\".navigate-right\")),Xb.controlsUp=r(document.querySelectorAll(\".navigate-up\")),Xb.controlsDown=r(document.querySelectorAll(\".navigate-down\")),Xb.controlsPrev=r(document.querySelectorAll(\".navigate-prev\")),Xb.controlsNext=r(document.querySelectorAll(\".navigate-next\")),Xb.statusDiv=f()}function f(){var a=document.getElementById(\"aria-status-div\");return a||(a=document.createElement(\"div\"),a.style.position=\"absolute\",a.style.height=\"1px\",a.style.width=\"1px\",a.style.overflow=\"hidden\",a.style.clip=\"rect( 1px, 1px, 1px, 1px )\",a.setAttribute(\"id\",\"aria-status-div\"),a.setAttribute(\"aria-live\",\"polite\"),a.setAttribute(\"aria-atomic\",\"true\"),Xb.wrapper.appendChild(a)),a}function g(a){var b=\"\";if(3===a.nodeType)b+=a.textContent;else if(1===a.nodeType){var c=a.getAttribute(\"aria-hidden\"),d=\"none\"===window.getComputedStyle(a).display;\"true\"===c||d||r(a.childNodes).forEach(function(a){b+=g(a)})}return b}function h(){var a=P(window.innerWidth,window.innerHeight),b=Math.floor(a.width*(1+Ob.margin)),c=Math.floor(a.height*(1+Ob.margin)),d=a.width,e=a.height;w(\"@page{size:\"+b+\"px \"+c+\"px; margin: 0px;}\"),w(\".reveal section>img, .reveal section>video, .reveal section>iframe{max-width: \"+d+\"px; max-height:\"+e+\"px}\"),document.body.classList.add(\"print-pdf\"),document.body.style.width=b+\"px\",document.body.style.height=c+\"px\",O(d,e),r(Xb.wrapper.querySelectorAll(Kb)).forEach(function(a,b){a.setAttribute(\"data-index-h\",b),a.classList.contains(\"stack\")&&r(a.querySelectorAll(\"section\")).forEach(function(a,c){a.setAttribute(\"data-index-h\",b),a.setAttribute(\"data-index-v\",c)})}),r(Xb.wrapper.querySelectorAll(Jb)).forEach(function(a){if(!1===a.classList.contains(\"stack\")){var f=(b-d)/2,g=(c-e)/2,h=a.scrollHeight,i=Math.max(Math.ceil(h/c),1);i=Math.min(i,Ob.pdfMaxPagesPerSlide),(1===i&&Ob.center||a.classList.contains(\"center\"))&&(g=Math.max((c-h)/2,0));var j=document.createElement(\"div\");if(j.className=\"pdf-page\",j.style.height=(c+Ob.pdfPageHeightOffset)*i+\"px\",a.parentNode.insertBefore(j,a),j.appendChild(a),a.style.left=f+\"px\",a.style.top=g+\"px\",a.style.width=d+\"px\",a.slideBackgroundElement&&j.insertBefore(a.slideBackgroundElement,a),Ob.showNotes){var k=La(a);if(k){var l=8,m=\"string\"==typeof Ob.showNotes?Ob.showNotes:\"inline\",n=document.createElement(\"div\");n.classList.add(\"speaker-notes\"),n.classList.add(\"speaker-notes-pdf\"),n.setAttribute(\"data-layout\",m),n.innerHTML=k,\"separate-page\"===m?j.parentNode.insertBefore(n,j.nextSibling):(n.style.left=l+\"px\",n.style.bottom=l+\"px\",n.style.width=b-2*l+\"px\",j.appendChild(n))}}if(Ob.slideNumber&&/all|print/i.test(Ob.showSlideNumber)){var o=parseInt(a.getAttribute(\"data-index-h\"),10)+1,p=parseInt(a.getAttribute(\"data-index-v\"),10)+1,q=document.createElement(\"div\");q.classList.add(\"slide-number\"),q.classList.add(\"slide-number-pdf\"),q.innerHTML=oa(o,\".\",p),j.appendChild(q)}}}),r(Xb.wrapper.querySelectorAll(Jb+\" .fragment\")).forEach(function(a){a.classList.add(\"visible\")}),E(\"pdf-ready\")}function i(){setInterval(function(){0===Xb.wrapper.scrollTop&&0===Xb.wrapper.scrollLeft||(Xb.wrapper.scrollTop=0,Xb.wrapper.scrollLeft=0)},1e3)}function j(a,b,c,d){for(var e=a.querySelectorAll(\".\"+c),f=0;f<e.length;f++){var g=e[f];if(g.parentNode===a)return g}var h=document.createElement(b);return h.classList.add(c),\"string\"==typeof d&&(h.innerHTML=d),a.appendChild(h),h}function k(){B();Xb.background.innerHTML=\"\",Xb.background.classList.add(\"no-transition\"),r(Xb.wrapper.querySelectorAll(Kb)).forEach(function(a){var b=l(a,Xb.background);r(a.querySelectorAll(\"section\")).forEach(function(a){l(a,b),b.classList.add(\"stack\")})}),Ob.parallaxBackgroundImage?(Xb.background.style.backgroundImage='url(\"'+Ob.parallaxBackgroundImage+'\")',Xb.background.style.backgroundSize=Ob.parallaxBackgroundSize,setTimeout(function(){Xb.wrapper.classList.add(\"has-parallax-background\")},1)):(Xb.background.style.backgroundImage=\"\",Xb.wrapper.classList.remove(\"has-parallax-background\"))}function l(a,b){var c={background:a.getAttribute(\"data-background\"),backgroundSize:a.getAttribute(\"data-background-size\"),backgroundImage:a.getAttribute(\"data-background-image\"),backgroundVideo:a.getAttribute(\"data-background-video\"),backgroundIframe:a.getAttribute(\"data-background-iframe\"),backgroundColor:a.getAttribute(\"data-background-color\"),backgroundRepeat:a.getAttribute(\"data-background-repeat\"),backgroundPosition:a.getAttribute(\"data-background-position\"),backgroundTransition:a.getAttribute(\"data-background-transition\")},d=document.createElement(\"div\");d.className=\"slide-background \"+a.className.replace(/present|past|future/,\"\"),c.background&&(/^(http|file|\\/\\/)/gi.test(c.background)||/\\.(svg|png|jpg|jpeg|gif|bmp)([?#]|$)/gi.test(c.background)?a.setAttribute(\"data-background-image\",c.background):d.style.background=c.background),(c.background||c.backgroundColor||c.backgroundImage||c.backgroundVideo||c.backgroundIframe)&&d.setAttribute(\"data-background-hash\",c.background+c.backgroundSize+c.backgroundImage+c.backgroundVideo+c.backgroundIframe+c.backgroundColor+c.backgroundRepeat+c.backgroundPosition+c.backgroundTransition),c.backgroundSize&&(d.style.backgroundSize=c.backgroundSize),c.backgroundSize&&d.setAttribute(\"data-background-size\",c.backgroundSize),c.backgroundColor&&(d.style.backgroundColor=c.backgroundColor),c.backgroundRepeat&&(d.style.backgroundRepeat=c.backgroundRepeat),c.backgroundPosition&&(d.style.backgroundPosition=c.backgroundPosition),c.backgroundTransition&&d.setAttribute(\"data-background-transition\",c.backgroundTransition),b.appendChild(d),a.classList.remove(\"has-dark-background\"),a.classList.remove(\"has-light-background\"),a.slideBackgroundElement=d;var e=window.getComputedStyle(d);if(e&&e.backgroundColor){var f=y(e.backgroundColor);f&&0!==f.a&&(z(e.backgroundColor)<128?a.classList.add(\"has-dark-background\"):a.classList.add(\"has-light-background\"))}return d}function m(){Ob.postMessage&&window.addEventListener(\"message\",function(a){var b=a.data;\"string\"==typeof b&&\"{\"===b.charAt(0)&&\"}\"===b.charAt(b.length-1)&&(b=JSON.parse(b),b.method&&\"function\"==typeof zb[b.method]&&zb[b.method].apply(zb,b.args))},!1)}function n(a){var b=Xb.wrapper.querySelectorAll(Jb).length;Xb.wrapper.classList.remove(Ob.transition),\"object\"==typeof a&&q(Ob,a),!1===Yb.transforms3d&&(Ob.transition=\"linear\"),Xb.wrapper.classList.add(Ob.transition),Xb.wrapper.setAttribute(\"data-transition-speed\",Ob.transitionSpeed),Xb.wrapper.setAttribute(\"data-background-transition\",Ob.backgroundTransition),Xb.controls.style.display=Ob.controls?\"block\":\"none\",Xb.progress.style.display=Ob.progress?\"block\":\"none\",Ob.shuffle&&ia(),Ob.rtl?Xb.wrapper.classList.add(\"rtl\"):Xb.wrapper.classList.remove(\"rtl\"),Ob.center?Xb.wrapper.classList.add(\"center\"):Xb.wrapper.classList.remove(\"center\"),!1===Ob.pause&&_(),Ob.showNotes?(Xb.speakerNotes.classList.add(\"visible\"),Xb.speakerNotes.setAttribute(\"data-layout\",\"string\"==typeof Ob.showNotes?Ob.showNotes:\"inline\")):Xb.speakerNotes.classList.remove(\"visible\"),Ob.mouseWheel?(document.addEventListener(\"DOMMouseScroll\",kb,!1),document.addEventListener(\"mousewheel\",kb,!1)):(document.removeEventListener(\"DOMMouseScroll\",kb,!1),document.removeEventListener(\"mousewheel\",kb,!1)),Ob.rollingLinks?F():G(),Ob.previewLinks?(H(),I(\"[data-preview-link=false]\")):(I(),H(\"[data-preview-link]:not([data-preview-link=false])\")),Hb&&(Hb.destroy(),Hb=null),b>1&&Ob.autoSlide&&Ob.autoSlideStoppable&&Yb.canvas&&Yb.requestAnimationFrame&&(Hb=new yb(Xb.wrapper,function(){return Math.min(Math.max((Date.now()-cc)/ac,0),1)}),Hb.on(\"click\",xb),dc=!1),!1===Ob.fragments&&r(Xb.slides.querySelectorAll(\".fragment\")).forEach(function(a){a.classList.add(\"visible\"),a.classList.remove(\"current-fragment\")});var c=\"none\";Ob.slideNumber&&!B()&&(\"all\"===Ob.showSlideNumber?c=\"block\":\"speaker\"===Ob.showSlideNumber&&Da()&&(c=\"block\")),Xb.slideNumber.style.display=c,fa()}function o(){if(_b=!0,window.addEventListener(\"hashchange\",sb,!1),window.addEventListener(\"resize\",tb,!1),Ob.touch&&(Xb.wrapper.addEventListener(\"touchstart\",eb,!1),Xb.wrapper.addEventListener(\"touchmove\",fb,!1),Xb.wrapper.addEventListener(\"touchend\",gb,!1),window.navigator.pointerEnabled?(Xb.wrapper.addEventListener(\"pointerdown\",hb,!1),Xb.wrapper.addEventListener(\"pointermove\",ib,!1),Xb.wrapper.addEventListener(\"pointerup\",jb,!1)):window.navigator.msPointerEnabled&&(Xb.wrapper.addEventListener(\"MSPointerDown\",hb,!1),Xb.wrapper.addEventListener(\"MSPointerMove\",ib,!1),Xb.wrapper.addEventListener(\"MSPointerUp\",jb,!1))),Ob.keyboard&&(document.addEventListener(\"keydown\",db,!1),document.addEventListener(\"keypress\",cb,!1)),Ob.progress&&Xb.progress&&Xb.progress.addEventListener(\"click\",lb,!1),Ob.focusBodyOnPageVisibilityChange){var a;\"hidden\"in document?a=\"visibilitychange\":\"msHidden\"in document?a=\"msvisibilitychange\":\"webkitHidden\"in document&&(a=\"webkitvisibilitychange\"),a&&document.addEventListener(a,ub,!1)}var b=[\"touchstart\",\"click\"];Nb.match(/android/gi)&&(b=[\"touchstart\"]),b.forEach(function(a){Xb.controlsLeft.forEach(function(b){b.addEventListener(a,mb,!1)}),Xb.controlsRight.forEach(function(b){b.addEventListener(a,nb,!1)}),Xb.controlsUp.forEach(function(b){b.addEventListener(a,ob,!1)}),Xb.controlsDown.forEach(function(b){b.addEventListener(a,pb,!1)}),Xb.controlsPrev.forEach(function(b){b.addEventListener(a,qb,!1)}),Xb.controlsNext.forEach(function(b){b.addEventListener(a,rb,!1)})})}function p(){_b=!1,document.removeEventListener(\"keydown\",db,!1),document.removeEventListener(\"keypress\",cb,!1),window.removeEventListener(\"hashchange\",sb,!1),window.removeEventListener(\"resize\",tb,!1),Xb.wrapper.removeEventListener(\"touchstart\",eb,!1),Xb.wrapper.removeEventListener(\"touchmove\",fb,!1),Xb.wrapper.removeEventListener(\"touchend\",gb,!1),window.navigator.pointerEnabled?(Xb.wrapper.removeEventListener(\"pointerdown\",hb,!1),Xb.wrapper.removeEventListener(\"pointermove\",ib,!1),Xb.wrapper.removeEventListener(\"pointerup\",jb,!1)):window.navigator.msPointerEnabled&&(Xb.wrapper.removeEventListener(\"MSPointerDown\",hb,!1),Xb.wrapper.removeEventListener(\"MSPointerMove\",ib,!1),Xb.wrapper.removeEventListener(\"MSPointerUp\",jb,!1)),Ob.progress&&Xb.progress&&Xb.progress.removeEventListener(\"click\",lb,!1),[\"touchstart\",\"click\"].forEach(function(a){Xb.controlsLeft.forEach(function(b){b.removeEventListener(a,mb,!1)}),Xb.controlsRight.forEach(function(b){b.removeEventListener(a,nb,!1)}),Xb.controlsUp.forEach(function(b){b.removeEventListener(a,ob,!1)}),Xb.controlsDown.forEach(function(b){b.removeEventListener(a,pb,!1)}),Xb.controlsPrev.forEach(function(b){b.removeEventListener(a,qb,!1)}),Xb.controlsNext.forEach(function(b){b.removeEventListener(a,rb,!1)})})}function q(a,b){for(var c in b)a[c]=b[c]}function r(a){return Array.prototype.slice.call(a)}function s(a){if(\"string\"==typeof a){if(\"null\"===a)return null;if(\"true\"===a)return!0;if(\"false\"===a)return!1;if(a.match(/^[\\d\\.]+$/))return parseFloat(a)}return a}function t(a,b){var c=a.x-b.x,d=a.y-b.y;return Math.sqrt(c*c+d*d)}function u(a,b){a.style.WebkitTransform=b,a.style.MozTransform=b,a.style.msTransform=b,a.style.transform=b}function v(a){\"string\"==typeof a.layout&&(Wb.layout=a.layout),\"string\"==typeof a.overview&&(Wb.overview=a.overview),Wb.layout?u(Xb.slides,Wb.layout+\" \"+Wb.overview):u(Xb.slides,Wb.overview)}function w(a){var b=document.createElement(\"style\");b.type=\"text/css\",b.styleSheet?b.styleSheet.cssText=a:b.appendChild(document.createTextNode(a)),document.getElementsByTagName(\"head\")[0].appendChild(b)}function x(a,b){for(var c=a.parentNode;c;){var d=c.matches||c.matchesSelector||c.msMatchesSelector;if(d&&d.call(c,b))return c;c=c.parentNode}return null}function y(a){var b=a.match(/^#([0-9a-f]{3})$/i);if(b&&b[1])return b=b[1],{r:17*parseInt(b.charAt(0),16),g:17*parseInt(b.charAt(1),16),b:17*parseInt(b.charAt(2),16)};var c=a.match(/^#([0-9a-f]{6})$/i);if(c&&c[1])return c=c[1],{r:parseInt(c.substr(0,2),16),g:parseInt(c.substr(2,2),16),b:parseInt(c.substr(4,2),16)};var d=a.match(/^rgb\\s*\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*\\)$/i);if(d)return{r:parseInt(d[1],10),g:parseInt(d[2],10),b:parseInt(d[3],10)};var e=a.match(/^rgba\\s*\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*\\,\\s*([\\d]+|[\\d]*.[\\d]+)\\s*\\)$/i);return e?{r:parseInt(e[1],10),g:parseInt(e[2],10),b:parseInt(e[3],10),a:parseFloat(e[4])}:null}function z(a){return\"string\"==typeof a&&(a=y(a)),a?(299*a.r+587*a.g+114*a.b)/1e3:null}function A(a,b){if(b=b||0,a){var c,d=a.style.height;return a.style.height=\"0px\",c=b-a.parentNode.offsetHeight,a.style.height=d+\"px\",c}return b}function B(){return/print-pdf/gi.test(window.location.search)}function C(){Ob.hideAddressBar&&Fb&&(window.addEventListener(\"load\",D,!1),window.addEventListener(\"orientationchange\",D,!1))}function D(){setTimeout(function(){window.scrollTo(0,1)},10)}function E(a,b){var c=document.createEvent(\"HTMLEvents\",1,2);c.initEvent(a,!0,!0),q(c,b),Xb.wrapper.dispatchEvent(c),Ob.postMessageEvents&&window.parent!==window.self&&window.parent.postMessage(JSON.stringify({namespace:\"reveal\",eventName:a,state:Ma()}),\"*\")}function F(){if(Yb.transforms3d&&!(\"msPerspective\"in document.body.style))for(var a=Xb.wrapper.querySelectorAll(Jb+\" a\"),b=0,c=a.length;b<c;b++){var d=a[b];if(d.textContent&&!d.querySelector(\"*\")&&(!d.className||!d.classList.contains(d,\"roll\"))){var e=document.createElement(\"span\");e.setAttribute(\"data-title\",d.text),e.innerHTML=d.innerHTML,d.classList.add(\"roll\"),d.innerHTML=\"\",d.appendChild(e)}}}function G(){for(var a=Xb.wrapper.querySelectorAll(Jb+\" a.roll\"),b=0,c=a.length;b<c;b++){var d=a[b],e=d.querySelector(\"span\");e&&(d.classList.remove(\"roll\"),d.innerHTML=e.innerHTML)}}function H(a){r(document.querySelectorAll(a||\"a\")).forEach(function(a){/^(http|www)/gi.test(a.getAttribute(\"href\"))&&a.addEventListener(\"click\",wb,!1)})}function I(a){r(document.querySelectorAll(a||\"a\")).forEach(function(a){/^(http|www)/gi.test(a.getAttribute(\"href\"))&&a.removeEventListener(\"click\",wb,!1)})}function J(a){M(),Xb.overlay=document.createElement(\"div\"),Xb.overlay.classList.add(\"overlay\"),Xb.overlay.classList.add(\"overlay-preview\"),Xb.wrapper.appendChild(Xb.overlay),Xb.overlay.innerHTML=[\"<header>\",'<a class=\"close\" href=\"#\"><span class=\"icon\"></span></a>','<a class=\"external\" href=\"'+a+'\" target=\"_blank\"><span class=\"icon\"></span></a>',\"</header>\",'<div class=\"spinner\"></div>','<div class=\"viewport\">','<iframe src=\"'+a+'\"></iframe>','<small class=\"viewport-inner\">','<span class=\"x-frame-error\">Unable to load iframe. This is likely due to the site\\'s policy (x-frame-options).</span>',\"</small>\",\"</div>\"].join(\"\"),Xb.overlay.querySelector(\"iframe\").addEventListener(\"load\",function(a){Xb.overlay.classList.add(\"loaded\")},!1),Xb.overlay.querySelector(\".close\").addEventListener(\"click\",function(a){M(),a.preventDefault()},!1),Xb.overlay.querySelector(\".external\").addEventListener(\"click\",function(a){M()},!1),setTimeout(function(){Xb.overlay.classList.add(\"visible\")},1)}function K(a){\"boolean\"==typeof a?a?L():M():Xb.overlay?M():L()}function L(){if(Ob.help){M(),Xb.overlay=document.createElement(\"div\"),Xb.overlay.classList.add(\"overlay\"),Xb.overlay.classList.add(\"overlay-help\"),Xb.wrapper.appendChild(Xb.overlay);var a='<p class=\"title\">Keyboard Shortcuts</p><br/>';a+=\"<table><th>KEY</th><th>ACTION</th>\";for(var b in fc)a+=\"<tr><td>\"+b+\"</td><td>\"+fc[b]+\"</td></tr>\";a+=\"</table>\",Xb.overlay.innerHTML=[\"<header>\",'<a class=\"close\" href=\"#\"><span class=\"icon\"></span></a>',\"</header>\",'<div class=\"viewport\">','<div class=\"viewport-inner\">'+a+\"</div>\",\"</div>\"].join(\"\"),Xb.overlay.querySelector(\".close\").addEventListener(\"click\",function(a){M(),a.preventDefault()},!1),setTimeout(function(){Xb.overlay.classList.add(\"visible\")},1)}}function M(){Xb.overlay&&(Xb.overlay.parentNode.removeChild(Xb.overlay),Xb.overlay=null)}function N(){if(Xb.wrapper&&!B()){var a=P();O(Ob.width,Ob.height),Xb.slides.style.width=a.width+\"px\",Xb.slides.style.height=a.height+\"px\",Vb=Math.min(a.presentationWidth/a.width,a.presentationHeight/a.height),Vb=Math.max(Vb,Ob.minScale),Vb=Math.min(Vb,Ob.maxScale),1===Vb?(Xb.slides.style.zoom=\"\",Xb.slides.style.left=\"\",Xb.slides.style.top=\"\",Xb.slides.style.bottom=\"\",Xb.slides.style.right=\"\",v({layout:\"\"})):Vb>1&&Yb.zoom?(Xb.slides.style.zoom=Vb,Xb.slides.style.left=\"\",Xb.slides.style.top=\"\",Xb.slides.style.bottom=\"\",Xb.slides.style.right=\"\",v({layout:\"\"})):(Xb.slides.style.zoom=\"\",Xb.slides.style.left=\"50%\",Xb.slides.style.top=\"50%\",Xb.slides.style.bottom=\"auto\",Xb.slides.style.right=\"auto\",v({layout:\"translate(-50%, -50%) scale(\"+Vb+\")\"}));for(var b=r(Xb.wrapper.querySelectorAll(Jb)),c=0,d=b.length;c<d;c++){var e=b[c];\"none\"!==e.style.display&&(Ob.center||e.classList.contains(\"center\")?e.classList.contains(\"stack\")?e.style.top=0:e.style.top=Math.max((a.height-e.scrollHeight)/2,0)+\"px\":e.style.top=\"\")}ma(),ra(),X()&&U()}}function", "domain": "javascript", "lang": "code", "char_count": 20189, "word_count": 7566, "byte_count": 20189}
{"text": "import React from \"react\";\n\nconst EuiIconGlasses = props => <svg width={16} height={16} viewBox=\"0 0 16 16\" xmlns=\"http://www.w3.org/2000/svg\" {...props}><path d=\"M9.035 9A3.5 3.5 0 0 1 15 7.05V4.5c0-1.072-.648-1.72-2.098-2.01a.5.5 0 0 1 .196-.98C14.981 1.886 16 2.905 16 4.5v4.25c0 .072-.015.14-.043.202A3.5 3.5 0 0 1 9.035 10h-2.07A3.5 3.5 0 1 1 .043 8.952.498.498 0 0 1 0 8.75V4.5c0-1.595 1.019-2.614 2.902-2.99a.5.5 0 0 1 .196.98C1.648 2.78 1 3.428 1 4.5v2.55A3.5 3.5 0 0 1 6.965 9h2.07zM3.5 12a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5zm9 0a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5z\" /></svg>;\n\nexport const icon = EuiIconGlasses;", "domain": "javascript", "lang": "code", "char_count": 624, "word_count": 143, "byte_count": 624}
{"text": "'use strict'\n\n\nconst asyncify = require('express-asyncify')\nconst express = require('express')\nconst passport = require('passport')\nconst middlewareAuth = require('../middleware/auth')\n\nconst app = asyncify(express.Router())\n\n\napp.post('/login',passport.authenticate('json'),async (req, res, next) => {\n res.json(Object.assign({success: true}, req.user))\n})\n\napp.post('/isLogin',middlewareAuth ,(req, res) => {\n  res.json({success:true, login: true})\n})\n\napp.post('/logout', function(req, res){\n  req.logout()\n  res.send({})\n})\n\n\nmodule.exports = app", "domain": "javascript", "lang": "code", "char_count": 550, "word_count": 159, "byte_count": 550}
{"text": "import { expect } from '@dimensionalpocket/development'\nimport { JSDOM } from 'jsdom'\nimport { KeyboardInput } from '../src/KeyboardInput.js'\n\nvar events = []\nfunction dispatcher (handler, event) { events.unshift([handler.id, event]) }\n\nvar dom = new JSDOM('', {})\nvar windowInstance = dom.window\n\nfunction event (eventName, code, options) {\n  options = options || {}\n  Object.assign(options, { code })\n  var evt = new windowInstance.KeyboardEvent(eventName, options)\n  return windowInstance.dispatchEvent(evt)\n}\n\ndescribe('KeyboardInput', function () {\n  before(function () {\n    this.input = new KeyboardInput(windowInstance)\n    this.input.dispatch = dispatcher\n  })\n\n  after(function () {\n    windowInstance.close()\n  })\n\n  describe('constructor', function () {\n    it('throws without providing window instance', function () {\n      var fn = () => { return new KeyboardInput() }\n      expect(fn).to.throw('F-KI-WDW')\n    })\n  })\n\n  describe('#capture', function () {\n    it('does not dispatch event for invalid codes', function () {\n      event('keydown', 'DONOTEXIST')\n      expect(events).to.have.length(0)\n      event('keyup', 'DONOTEXIST')\n      expect(events).to.have.length(0)\n      event('keydown', undefined, 0)\n      expect(events).to.have.length(0)\n      event('keyup', undefined, 0)\n      expect(events).to.have.length(0)\n      event('keydown', undefined, undefined, 0)\n      expect(events).to.have.length(0)\n      event('keyup', undefined, undefined, 0)\n      expect(events).to.have.length(0)\n    })\n\n    it('does not emit twice when KeyDown event is spammed', function () {\n      event('keydown', 'KeyW')\n      expect(events).to.have.length(1)\n      event('keydown', 'KeyW')\n      expect(events).to.have.length(1)\n      event('keyup', 'KeyW')\n      expect(events).to.have.length(2)\n      event('keydown', 'KeyW', { repeat: true })\n      expect(events).to.have.length(2)\n    })\n\n    it('captures event.code', function () {\n      event('keydown', 'KeyW')\n      expect(events[0][1]).to.equal('8')\n      event('keyup', 'KeyW')\n      expect(events[0][1]).to.equal('5')\n    })\n\n    it('captures event.which', function () {\n      event('keydown', undefined, { which: 87 })\n      expect(events[0][1]).to.equal('8')\n      event('keyup', undefined, { which: 87 })\n      expect(events[0][1]).to.equal('5')\n    })\n\n    it('captures event.keyCode', function () {\n      event('keydown', undefined, { keyCode: 87 })\n      expect(events[0][1]).to.equal('8')\n      event('keyup', undefined, { keyCode: 87 })\n      expect(events[0][1]).to.equal('5')\n    })\n\n    it('calls preventDefault() on event', function () {\n      var prevented = false\n      var evt = new windowInstance.KeyboardEvent('keydown', { code: 'KeyW' })\n      evt.preventDefault = () => { prevented = true }\n      windowInstance.dispatchEvent(evt)\n      expect(prevented).to.equal(true)\n      event('keyup', 'KeyW') // reset state\n    })\n  })\n\n  describe('#defaults', function () {\n    it('assigns correct directions', function () {\n      event('keydown', 'KeyD')\n      expect(events[0][1]).to.equal('6')\n      event('keydown', 'KeyW')\n      expect(events[0][1]).to.equal('9')\n      event('keyup', 'KeyD')\n      expect(events[0][1]).to.equal('8')\n      event('keydown', 'KeyA')\n      expect(events[0][1]).to.equal('7')\n      event('keyup', 'KeyW')\n      expect(events[0][1]).to.equal('4')\n      event('keydown', 'KeyS')\n      expect(events[0][1]).to.equal('1')\n      event('keyup', 'KeyA')\n      expect(events[0][1]).to.equal('2')\n      event('keydown', 'KeyD')\n      expect(events[0][1]).to.equal('3')\n      event('keyup', 'KeyS')\n      expect(events[0][1]).to.equal('6')\n      event('keyup', 'KeyD')\n      expect(events[0][1]).to.equal('5')\n    })\n\n    it('assigns correct buttons', function () {\n      event('keydown', 'KeyY')\n      expect(events[0][1]).to.equal('X')\n      event('keyup', 'KeyY')\n      expect(events[0][1]).to.equal('x')\n      event('keydown', 'KeyU')\n      expect(events[0][1]).to.equal('Y')\n      event('keyup', 'KeyU')\n      expect(events[0][1]).to.equal('y')\n      event('keydown', 'KeyI')\n      expect(events[0][1]).to.equal('Z')\n      event('keyup', 'KeyI')\n      expect(events[0][1]).to.equal('z')\n      event('keydown', 'KeyO')\n      expect(events[0][1]).to.equal('L')\n      event('keyup', 'KeyO')\n      expect(events[0][1]).to.equal('l')\n      event('keydown', 'KeyH')\n      expect(events[0][1]).to.equal('A')\n      event('keyup', 'KeyH')\n      expect(events[0][1]).to.equal('a')\n      event('keydown', 'KeyJ')\n      expect(events[0][1]).to.equal('B')\n      event('keyup', 'KeyJ')\n      expect(events[0][1]).to.equal('b')\n      event('keydown', 'KeyK')\n      expect(events[0][1]).to.equal('C')\n      event('keyup', 'KeyK')\n      expect(events[0][1]).to.equal('c')\n      event('keydown', 'KeyL')\n      expect(events[0][1]).to.equal('R')\n      event('keyup', 'KeyL')\n      expect(events[0][1]).to.equal('r')\n      event('keydown', 'Enter')\n      expect(events[0][1]).to.equal('S')\n      event('keyup', 'Enter')\n      expect(events[0][1]).to.equal('s')\n      event('keydown', 'Backspace')\n      expect(events[0][1]).to.equal('T')\n      event('keyup', 'Backspace')\n      expect(events[0][1]).to.equal('t')\n    })\n  })\n\n  describe('#onWindowBlur', function () {\n    before(function () {\n      event('keydown', 'KeyW')\n      windowInstance.dispatchEvent(new windowInstance.FocusEvent('blur'))\n    })\n\n    it('resets directional state', function () {\n      expect(events[0][1]).to.equal('5')\n    })\n  })\n\n  describe('#uninstall', function () {\n    before(function () {\n      events.length = 0\n      this.input.uninstall()\n    })\n\n    it('removes listeners', function () {\n      event('keydown', 'KeyW')\n      expect(events).to.have.length(0)\n    })\n  })\n})", "domain": "javascript", "lang": "code", "char_count": 5743, "word_count": 1768, "byte_count": 5743}
{"text": "#!/usr/bin/env nodejs\n// -*- mode: JavaScript; js-indent-level: 2\n\nconst BotKit = require('botkit');\nconst Conf = require('conf');\nconst DocOpt = require('docopt');\nconst Mustache = require('mustache');\nconst ShellQuote = require('shell-quote');\n\nconst config = new Conf({\n  configName: 'pickupthebot',\n});\n\n\nconst controller = BotKit.slackbot({\n  debug: process.env.DEBUG,\n  retry: 10,\n});\n\nfunction getSlackToken() {\n  return config.get('slack.token') || process.env.SLACK_TOKEN;\n}\n\nif (!getSlackToken()) {\n  console.error('Error: Missing SLACK_TOKEN in environment');\n  process.exit(1);\n};\n\nfunction spawnSlackbot(controller, args) {\n  controller.log('Connecting...')\n  const defaults = {\n    token: getSlackToken(),\n  };\n  return controller\n    .spawn(Object.assign(defaults, args))\n    .startRTM();\n}\n\n\nfunction docopt(doc, message, args) {\n  return DocOpt.docopt(doc, {\n    argv: ShellQuote.parse(message.text),\n    exit: false,\n    help: false});\n}\n\nfunction renderUsage(bot, doc, context) {\n  var usage = doc\n      .replace(/^Usage:/i, '*Usage:*')\n      .replace(/^ +/gim, '>')\n      .replace(/\\b([A-Z-]+)\\b/g, '_$1_');\n  return Mustache.render(\n    usage,\n    Object.assign({botname: bot.identity.name}, context || {}));\n}\n\nspawnSlackbot(controller);\n\ncontroller.hears(['^help'], 'direct_message,direct_mention,mention',\n  function onHelp(bot, message) {\n    const USAGE = `\nUsage:\n  @{{botname}} help\n  @{{botname}} info\n  @{{botname}} quit\n  @{{botname}} reconnect\n  @{{botname}} hipchat help\n  @{{botname}} yammer help\n`.trim();\n    var opts = docopt(USAGE, message);\n    if (opts.help) {\n      bot.reply(message, renderUsage(bot, USAGE));\n      return;\n    }\n  });\n\n\ncontroller.hears(['^info'], 'direct_message,direct_mention,mention',\n  function onInfo(bot, message) {\n    // foo\n  });\n\n\ncontroller.hears(['^quit'], 'direct_message,direct_mention,mention',\n  function onQuit(bot, message) {\n    controller.log('Quitting...')\n    process.exit(0);\n  });\n\n\ncontroller.hears(['^reconnect'], 'direct_message,direct_mention,mention',\n  function onReconnect(bot, message) {\n    controller.log('Disconnecting...')\n    bot.destroy();\n    bot = spawnSlackbot(controller);\n  });\n\n\ncontroller.hears(['^hipchat'], 'direct_message,direct_mention,mention',\n  function onHipchat(bot, message) {\n    const USAGE = `\nUsage:\n  @{{botname}} hipchat help\n  @{{botname}} hipchat info\n  @{{botname}} hipchat connect API-KEY\n  @{{botname}} hipchat disconnect\n`.trim();\n    var opts = docopt(USAGE, message);\n    if (opts.help) {\n      bot.reply(message, renderUsage(bot, USAGE));\n      return;\n    }\n  });\n\n\ncontroller.hears(['^yammer'], 'direct_message,direct_mention,mention',\n  function onYammer(bot, message) {\n    const USAGE = `\nUsage:\n  @{{botname}} yammer help\n  @{{botname}} yammer info\n  @{{botname}} yammer connect API-KEY\n  @{{botname}} yammer disconnect\n`.trim();\n    var opts = docopt(USAGE, message);\n    if (opts.help) {\n      bot.reply(message, renderUsage(bot, USAGE));\n      return;\n    }\n  });", "domain": "javascript", "lang": "code", "char_count": 3003, "word_count": 776, "byte_count": 3003}
{"text": "// import routes and models\nconst router = require('express').Router();\nconst { Comment, Pet, Post, User } = require('../models');\n\n// home route\nrouter.get('/', async (req, res) => {\n  try {\n    const postData = await Post.findAll({\n      include: [{ model: User }],\n      order: [[\"id\", \"DESC\"]],\n    });\n\n    // serialize the data\n    const posts = postData.map((post) => post.get({ plain: true }));\n\n    // render home-posts view\n    res.render('home-posts', {\n      layout: 'home',\n      posts,\n      logged_in: req.session.logged_in\n    });\n\n  } catch (err) {\n    res.status(500).json(err);\n  }\n});\n\n// single post route\nrouter.get('/posts/:id', async (req, res) => {\n  try {\n    const postData = await Post.findByPk(req.params.id, {\n      include: [\n        { model: User },\n        { model: Comment, include: { model: User } }\n      ]\n    });\n\n    // serialize the data\n    const post = postData.get({ plain: true });\n\n    // render create-comment view\n    res.render('create-comment', {\n      layout: 'home',\n      ...post,\n      logged_in: req.session.logged_in\n    });\n\n  } catch (err) {\n    res.status(500).json(err);\n  }\n});\n\n// login route\nrouter.get('/login', (req, res) => {\n\n  // if the user is logged in, redirect to home \n  if (req.session.logged_in) {\n    res.redirect('/');\n    return;\n  }\n\n  // render login view\n  res.render('login', {\n    layout: 'home'\n  });\n});\n\n// sign up route\nrouter.get('/signup', (req, res) => {\n\n  // if the user is logged in, redirect to home \n  if (req.session.logged_in) {\n    res.redirect('/');\n    return;\n  }\n\n  // render sign-up view\n  res.render('sign-up', {\n    layout: 'home'\n  });\n});\n\nmodule.exports = router;", "domain": "javascript", "lang": "code", "char_count": 1670, "word_count": 452, "byte_count": 1670}
{"text": "/*! For license information please see 4882.js.LICENSE.txt */\n(self.webpackChunk=self.webpackChunk||[]).push([[4882],{6308:(e,t,n)=>{\"use strict\";n.d(t,{K:()=>a});var a=function(){function e(e){void 0===e&&(e={}),this.adapter=e}return Object.defineProperty(e,\"cssClasses\",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(e,\"strings\",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(e,\"numbers\",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(e,\"defaultAdapter\",{get:function(){return{}},enumerable:!1,configurable:!0}),e.prototype.init=function(){},e.prototype.destroy=function(){},e}()},79397:(e,t,n)=>{\"use strict\";function a(e){return void 0===e&&(e=window),!!function(e){void 0===e&&(e=window);var t=!1;try{var n={get passive(){return t=!0,!1}},a=function(){};e.document.addEventListener(\"test\",a,n),e.document.removeEventListener(\"test\",a,n)}catch(e){t=!1}return t}(e)&&{passive:!0}}n.r(t),n.d(t,{applyPassive:()=>a})},42851:(e,t,n)=>{\"use strict\";function a(e,t){if(e.closest)return e.closest(t);for(var n=e;n;){if(i(n,t))return n;n=n.parentElement}return null}function i(e,t){return(e.matches||e.webkitMatchesSelector||e.msMatchesSelector).call(e,t)}function r(e){var t=e;if(null!==t.offsetParent)return t.scrollWidth;var n=t.cloneNode(!0);n.style.setProperty(\"position\",\"absolute\"),n.style.setProperty(\"transform\",\"translate(-9999px, -9999px)\"),document.documentElement.appendChild(n);var a=n.scrollWidth;return document.documentElement.removeChild(n),a}n.r(t),n.d(t,{closest:()=>a,matches:()=>i,estimateScrollWidth:()=>r})},17211:(e,t,n)=>{\"use strict\";function a(e){var t=e.getBoundingClientRect();return{width:t.width,height:t.height,top:t.top,right:t.right,bottom:t.bottom,left:t.left,x:t.left,y:t.top}}function i(e){if(null==e)return window;if(\"[object Window]\"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function r(e){var t=i(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function o(e){return e instanceof i(e).Element||e instanceof Element}function s(e){return e instanceof i(e).HTMLElement||e instanceof HTMLElement}function l(e){return\"undefined\"!=typeof ShadowRoot&&(e instanceof i(e).ShadowRoot||e instanceof ShadowRoot)}function d(e){return e?(e.nodeName||\"\").toLowerCase():null}function c(e){return((o(e)?e.ownerDocument:e.document)||window.document).documentElement}function u(e){return a(c(e)).left+r(e).scrollLeft}function m(e){return i(e).getComputedStyle(e)}function _(e){var t=m(e),n=t.overflow,a=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+a)}function p(e,t,n){void 0===n&&(n=!1);var o,l=c(t),m=a(e),p=s(t),f={scrollLeft:0,scrollTop:0},h={x:0,y:0};return(p||!p&&!n)&&((\"body\"!==d(t)||_(l))&&(f=(o=t)!==i(o)&&s(o)?function(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}(o):r(o)),s(t)?((h=a(t)).x+=t.clientLeft,h.y+=t.clientTop):l&&(h.x=u(l))),{x:m.left+f.scrollLeft-h.x,y:m.top+f.scrollTop-h.y,width:m.width,height:m.height}}function f(e){var t=a(e),n=e.offsetWidth,i=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:i}}function h(e){return\"html\"===d(e)?e:e.assignedSlot||e.parentNode||(l(e)?e.host:null)||c(e)}function g(e){return[\"html\",\"body\",\"#document\"].indexOf(d(e))>=0?e.ownerDocument.body:s(e)&&_(e)?e:g(h(e))}function v(e,t){var n;void 0===t&&(t=[]);var a=g(e),r=a===(null==(n=e.ownerDocument)?void 0:n.body),o=i(a),s=r?[o].concat(o.visualViewport||[],_(a)?a:[]):a,l=t.concat(s);return r?l:l.concat(v(h(s)))}function b(e){return[\"table\",\"td\",\"th\"].indexOf(d(e))>=0}function L(e){return s(e)&&\"fixed\"!==m(e).position?e.offsetParent:null}function y(e){for(var t=i(e),n=L(e);n&&b(n)&&\"static\"===m(n).position;)n=L(n);return n&&(\"html\"===d(n)||\"body\"===d(n)&&\"static\"===m(n).position)?t:n||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf(\"firefox\");if(-1!==navigator.userAgent.indexOf(\"Trident\")&&s(e)&&\"fixed\"===m(e).position)return null;for(var n=h(e);s(n)&&[\"html\",\"body\"].indexOf(d(n))<0;){var a=m(n);if(\"none\"!==a.transform||\"none\"!==a.perspective||\"paint\"===a.contain||-1!==[\"transform\",\"perspective\"].indexOf(a.willChange)||t&&\"filter\"===a.willChange||t&&a.filter&&\"none\"!==a.filter)return n;n=n.parentNode}return null}(e)||t}n.d(t,{fi:()=>ue});var M=\"top\",Y=\"bottom\",$=\"right\",w=\"left\",j=\"auto\",k=[M,Y,$,w],T=\"start\",D=\"end\",x=\"viewport\",S=\"popper\",H=k.reduce((function(e,t){return e.concat([t+\"-\"+T,t+\"-\"+D])}),[]),C=[].concat(k,[j]).reduce((function(e,t){return e.concat([t,t+\"-\"+T,t+\"-\"+D])}),[]),O=[\"beforeRead\",\"read\",\"afterRead\",\"beforeMain\",\"main\",\"afterMain\",\"beforeWrite\",\"write\",\"afterWrite\"];function R(e){var t=new Map,n=new Set,a=[];function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var a=t.get(e);a&&i(a)}})),a.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||i(e)})),a}var E={placement:\"bottom\",modifiers:[],strategy:\"absolute\"};function A(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&\"function\"==typeof e.getBoundingClientRect)}))}function I(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,a=void 0===n?[]:n,i=t.defaultOptions,r=void 0===i?E:i;return function(e,t,n){void 0===n&&(n=r);var i,s,l={placement:\"bottom\",orderedModifiers:[],options:Object.assign({},E,r),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},d=[],c=!1,u={state:l,setOptions:function(n){m(),l.options=Object.assign({},r,l.options,n),l.scrollParents={reference:o(e)?v(e):e.contextElement?v(e.contextElement):[],popper:v(t)};var i=function(e){var t=R(e);return O.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}(function(e){var t=e.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{});return Object.keys(t).map((function(e){return t[e]}))}([].concat(a,l.options.modifiers)));return l.orderedModifiers=i.filter((function(e){return e.enabled})),l.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,a=void 0===n?{}:n,i=e.effect;if(\"function\"==typeof i){var r=i({state:l,name:t,instance:u,options:a}),o=function(){};d.push(r||o)}})),u.update()},forceUpdate:function(){if(!c){var e=l.elements,t=e.reference,n=e.popper;if(A(t,n)){l.rects={reference:p(t,y(n),\"fixed\"===l.options.strategy),popper:f(n)},l.reset=!1,l.placement=l.options.placement,l.orderedModifiers.forEach((function(e){return l.modifiersData[e.name]=Object.assign({},e.data)}));for(var a=0;a<l.orderedModifiers.length;a++)if(!0!==l.reset){var i=l.orderedModifiers[a],r=i.fn,o=i.options,s=void 0===o?{}:o,d=i.name;\"function\"==typeof r&&(l=r({state:l,options:s,name:d,instance:u})||l)}else l.reset=!1,a=-1}}},update:(i=function(){return new Promise((function(e){u.forceUpdate(),e(l)}))},function(){return s||(s=new Promise((function(e){Promise.resolve().then((function(){s=void 0,e(i())}))}))),s}),destroy:function(){m(),c=!0}};if(!A(e,t))return u;function m(){d.forEach((function(e){return e()})),d=[]}return u.setOptions(n).then((function(e){!c&&n.onFirstUpdate&&n.onFirstUpdate(e)})),u}}var P={passive:!0};const F={name:\"eventListeners\",enabled:!0,phase:\"write\",fn:function(){},effect:function(e){var t=e.state,n=e.instance,a=e.options,r=a.scroll,o=void 0===r||r,s=a.resize,l=void 0===s||s,d=i(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&c.forEach((function(e){e.addEventListener(\"scroll\",n.update,P)})),l&&d.addEventListener(\"resize\",n.update,P),function(){o&&c.forEach((function(e){e.removeEventListener(\"scroll\",n.update,P)})),l&&d.removeEventListener(\"resize\",n.update,P)}},data:{}};function U(e){return e.split(\"-\")[0]}function z(e){return e.split(\"-\")[1]}function N(e){return[\"top\",\"bottom\"].indexOf(e)>=0?\"x\":\"y\"}function q(e){var t,n=e.reference,a=e.element,i=e.placement,r=i?U(i):null,o=i?z(i):null,s=n.x+n.width/2-a.width/2,l=n.y+n.height/2-a.height/2;switch(r){case M:t={x:s,y:n.y-a.height};break;case Y:t={x:s,y:n.y+n.height};break;case $:t={x:n.x+n.width,y:l};break;case w:t={x:n.x-a.width,y:l};break;default:t={x:n.x,y:n.y}}var d=r?N(r):null;if(null!=d){var c=\"y\"===d?\"height\":\"width\";switch(o){case T:t[d]=t[d]-(n[c]/2-a[c]/2);break;case D:t[d]=t[d]+(n[c]/2-a[c]/2)}}return t}const G={name:\"popperOffsets\",enabled:!0,phase:\"read\",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=q({reference:t.rects.reference,element:t.rects.popper,strategy:\"absolute\",placement:t.placement})},data:{}};var W=Math.max,V=Math.min,Z=Math.round,B={top:\"auto\",right:\"auto\",bottom:\"auto\",left:\"auto\"};function J(e){var t,n=e.popper,a=e.popperRect,r=e.placement,o=e.offsets,s=e.position,l=e.gpuAcceleration,d=e.adaptive,u=e.roundOffsets,_=!0===u?function(e){var t=e.x,n=e.y,a=window.devicePixelRatio||1;return{x:Z(Z(t*a)/a)||0,y:Z(Z(n*a)/a)||0}}(o):\"function\"==typeof u?u(o):o,p=_.x,f=void 0===p?0:p,h=_.y,g=void 0===h?0:h,v=o.hasOwnProperty(\"x\"),b=o.hasOwnProperty(\"y\"),L=w,j=M,k=window;if(d){var T=y(n),D=\"clientHeight\",x=\"clientWidth\";T===i(n)&&\"static\"!==m(T=c(n)).position&&(D=\"scrollHeight\",x=\"scrollWidth\"),T=T,r===M&&(j=Y,g-=T[D]-a.height,g*=l?1:-1),r===w&&(L=$,f-=T[x]-a.width,f*=l?1:-1)}var S,H=Object.assign({position:s},d&&B);return l?Object.assign({},H,((S={})[j]=b?\"0\":\"\",S[L]=v?\"0\":\"\",S.transform=(k.devicePixelRatio||1)<2?\"translate(\"+f+\"px, \"+g+\"px)\":\"translate3d(\"+f+\"px, \"+g+\"px, 0)\",S)):Object.assign({},H,((t={})[j]=b?g+\"px\":\"\",t[L]=v?f+\"px\":\"\",t.transform=\"\",t))}var K={left:\"right\",right:\"left\",bottom:\"top\",top:\"bottom\"};function X(e){return e.replace(/left|right|bottom|top/g,(function(e){return K[e]}))}var Q={start:\"end\",end:\"start\"};function ee(e){return e.replace(/start|end/g,(function(e){return Q[e]}))}function te(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&l(n)){var a=t;do{if(a&&e.isSameNode(a))return!0;a=a.parentNode||a.host}while(a)}return!1}function ne(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function ae(e,t){return t===x?ne(function(e){var t=i(e),n=c(e),a=t.visualViewport,r=n.clientWidth,o=n.clientHeight,s=0,l=0;return a&&(r=a.width,o=a.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(s=a.offsetLeft,l=a.offsetTop)),{width:r,height:o,x:s+u(e),y:l}}(e)):s(t)?function(e){var t=a(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):ne(function(e){var t,n=c(e),a=r(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=W(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=W(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),l=-a.scrollLeft+u(e),d=-a.scrollTop;return\"rtl\"===m(i||n).direction&&(l+=W(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:l,y:d}}(c(e)))}function ie(e,t,n){var a=\"clippingParents\"===t?function(e){var t=v(h(e)),n=[\"absolute\",\"fixed\"].indexOf(m(e).position)>=0&&s(e)?y(e):e;return o(n)?t.filter((function(e){return o(e)&&te(e,n)&&\"body\"!==d(e)})):[]}(e):[].concat(t),i=[].concat(a,[n]),r=i[0],l=i.reduce((function(t,n){var a=ae(e,n);return t.top=W(a.top,t.top),t.right=V(a.right,t.right),t.bottom=V(a.bottom,t.bottom),t.left=W(a.left,t.left),t}),ae(e,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function re(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function oe(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function se(e,t){void 0===t&&(t={});var n=t,i=n.placement,r=void 0===i?e.placement:i,s=n.boundary,l=void 0===s?\"clippingParents\":s,d=n.rootBoundary,u=void 0===d?x:d,m=n.elementContext,_=void 0===m?S:m,p=n.altBoundary,f=void 0!==p&&p,h=n.padding,g=void 0===h?0:h,v=re(\"number\"!=typeof g?g:oe(g,k)),b=_===S?\"reference\":S,L=e.elements.reference,y=e.rects.popper,w=e.elements[f?b:_],j=ie(o(w)?w:w.contextElement||c(e.elements.popper),l,u),T=a(L),D=q({reference:T,element:y,strategy:\"absolute\",placement:r}),H=ne(Object.assign({},y,D)),C=_===S?H:T,O={top:j.top-C.top+v.top,bottom:C.bottom-j.bottom+v.bottom,left:j.left-C.left+v.left,right:C.right-j.right+v.right},R=e.modifiersData.offset;if(_===S&&R){var E=R[r];Object.keys(O).forEach((function(e){var t=[$,Y].indexOf(e)>=0?1:-1,n=[M,Y].indexOf(e)>=0?\"y\":\"x\";O[e]+=E[n]*t}))}return O}function le(e,t,n){return W(e,V(t,n))}function de(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function ce(e){return[M,$,Y,w].some((function(t){return e[t]>=0}))}var ue=I({defaultModifiers:[F,G,{name:\"computeStyles\",enabled:!0,phase:\"beforeWrite\",fn:function(e){var t=e.state,n=e.options,a=n.gpuAcceleration,i=void 0===a||a,r=n.adaptive,o=void 0===r||r,s=n.roundOffsets,l=void 0===s||s,d={placement:U(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,J(Object.assign({},d,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,J(Object.assign({},d,{offsets:t.modifiersData.arrow,position:\"absolute\",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{\"data-popper-placement\":t.placement})},data:{}},{name:\"applyStyles\",enabled:!0,phase:\"write\",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},a=t.attributes[e]||{},i=t.elements[e];s(i)&&d(i)&&(Object.assign(i.style,n),Object.keys(a).forEach((function(e){var t=a[e];!1===t?i.removeAttribute(e):i.setAttribute(e,!0===t?\"\":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:\"0\",top:\"0\",margin:\"0\"},arrow:{position:\"absolute\"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var a=t.elements[e],i=t.attributes[e]||{},r=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]=\"\",e}),{});s(a)&&d(a)&&(Object.assign(a.style,r),Object.keys(i).forEach((function(e){a.removeAttribute(e)})))}))}},requires:[\"computeStyles\"]},{name:\"offset\",enabled:!0,phase:\"main\",requires:[\"popperOffsets\"],fn:function(e){var t=e.state,n=e.options,a=e.name,i=n.offset,r=void 0===i?[0,0]:i,o=C.reduce((function(e,n){return e[n]=function(e,t,n){var a=U(e),i=[w,M].indexOf(a)>=0?-1:1,r=\"function\"==typeof n?n(Object.assign({},t,{placement:e})):n,o=r[0],s=r[1];return o=o||0,s=(s||0)*i,[w,$].indexOf(a)>=0?{x:s,y:o}:{x:o,y:s}}(n,t.rects,r),e}),{}),s=o[t.placement],l=s.x,d=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=d),t.modifiersData[a]=o}},{name:\"flip\",enabled:!0,phase:\"main\",fn:function(e){var t=e.state,n=e.options,a=e.name;if(!t.modifiersData[a]._skip){for(var i=n.mainAxis,r=void 0===i||i,o=n.altAxis,s=void 0===o||o,l=n.fallbackPlacements,d=n.padding,c=n.boundary,u=n.rootBoundary,m=n.altBoundary,_=n.flipVariations,p=void 0===_||_,f=n.allowedAutoPlacements,h=t.options.placement,g=U(h),v=l||(g===h||!p?[X(h)]:function(e){if(U(e)===j)return[];var t=X(e);return[ee(e),t,ee(t)]}(h)),b=[h].concat(v).reduce((function(e,n){return e.concat(U(n)===j?function(e,t){void 0===t&&(t={});var n=t,a=n.placement,i=n.boundary,r=n.rootBoundary,o=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,d=void 0===l?C:l,c=z(a),u=c?s?H:H.filter((function(e){return z(e)===c})):k,m=u.filter((function(e){return d.indexOf(e)>=0}));0===m.length&&(m=u);var _=m.reduce((function(t,n){return t[n]=se(e,{placement:n,boundary:i,rootBoundary:r,padding:o})[U(n)],t}),{});return Object.keys(_).sort((function(e,t){return _[e]-_[t]}))}(t,{placement:n,boundary:c,rootBoundary:u,padding:d,flipVariations:p,allowedAutoPlacements:f}):n)}),[]),L=t.rects.reference,y=t.rects.popper,D=new Map,x=!0,S=b[0],O=0;O<b.length;O++){var R=b[O],E=U(R),A=z(R)===T,I=[M,Y].indexOf(E)>=0,P=I?\"width\":\"height\",F=se(t,{placement:R,boundary:c,rootBoundary:u,altBoundary:m,padding:d}),N=I?A?$:w:A?Y:M;L[P]>y[P]&&(N=X(N));var q=X(N),G=[];if(r&&G.push(F[E]<=0),s&&G.push(F[N]<=0,F[q]<=0),G.every((function(e){return e}))){S=R,x=!1;break}D.set(R,G)}if(x)for(var W=function(e){var t=b.find((function(t){var n=D.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return S=t,\"break\"},V=p?3:1;V>0;V--){if(\"break\"===W(V))break}t.placement!==S&&(t.modifiersData[a]._skip=!0,t.placement=S,t.reset=!0)}},requiresIfExists:[\"offset\"],data:{_skip:!1}},{name:\"preventOverflow\",enabled:!0,phase:\"main\",fn:function(e){var t=e.state,n=e.options,a=e.name,i=n.mainAxis,r=void 0===i||i,o=n.altAxis,s=void 0!==o&&o,l=n.boundary,d=n.rootBoundary,c=n.altBoundary,u=n.padding,m=n.tether,_=void 0===m||m,p=n.tetherOffset,h=void 0===p?0:p,g=se(t,{boundary:l,rootBoundary:d,padding:u,altBoundary:c}),v=U(t.placement),b=z(t.placement),L=!b,j=N(v),k=\"x\"===j?\"y\":\"x\",D=t.modifiersData.popperOffsets,x=t.rects.reference,S=t.rects.popper,H=\"function\"==typeof h?h(Object.assign({},t.rects,{placement:t.placement})):h,C={x:0,y:0};if(D){if(r||s){var O=\"y\"===j?M:w,R=\"y\"===j?Y:$,E=\"y\"===j?\"height\":\"width\",A=D[j],I=D[j]+g[O],P=D[j]-g[R],F=_?-S[E]/2:0,q=b===T?x[E]:S[E],G=b===T?-S[E]:-x[E],Z=t.elements.arrow,B=_&&Z?f(Z):{width:0,height:0},J=t.modifiersData[\"arrow#persistent\"]?t.modifiersData[\"arrow#persistent\"].padding:{top:0,right:0,bottom:0,left:0},K=J[O],X=J[R],Q=le(0,x[E],B[E]),ee=L?x[E]/2-F-Q-K-H:q-Q-K-H,te=L?-x[E]/2+F+Q+X+H:G+Q+X+H,ne=t.elements.arrow&&y(t.elements.arrow),ae=ne?\"y\"===j?ne.clientTop||0:ne.clientLeft||0:0,ie=t.modifiersData.offset?t.modifiersData.offset[t.placement][j]:0,re=D[j]+ee-ie-ae,oe=D[j]+te-ie;if(r){var de=le(_?V(I,re):I,A,_?W(P,oe):P);D[j]=de,C[j]=de-A}if(s){var ce=\"x\"===j?M:w,ue=\"x\"===j?Y:$,me=D[k],_e=me+g[ce],pe=me-g[ue],fe=le(_?V(_e,re):_e,me,_?W(pe,oe):pe);D[k]=fe,C[k]=fe-me}}t.modifiersData[a]=C}},requiresIfExists:[\"offset\"]},{name:\"arrow\",enabled:!0,phase:\"main\",fn:function(e){var t,n=e.state,a=e.name,i=e.options,r=n.elements.arrow,o=n.modifiersData.popperOffsets,s=U(n.placement),l=N(s),d=[w,$].indexOf(s)>=0?\"height\":\"width\";if(r&&o){var c=function(e,t){return re(\"number\"!=typeof(e=\"function\"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:oe(e,k))}(i.padding,n),u=f(r),m=\"y\"===l?M:w,_=\"y\"===l?Y:$,p=n.rects.reference[d]+n.rects.reference[l]-o[l]-n.rects.popper[d],h=o[l]-n.rects.reference[l],g=y(r),v=g?\"y\"===l?g.clientHeight||0:g.clientWidth||0:0,b=p/2-h/2,L=c[m],j=v-u[d]-c[_],T=v/2-u[d]/2+b,D=le(L,T,j),x=l;n.modifiersData[a]=((t={})[x]=D,t.centerOffset=D-T,t)}},effect:function(e){var t=e.state,n=e.options.element,a=void 0===n?\"[data-popper-arrow]\":n;null!=a&&(\"string\"!=typeof a||(a=t.elements.popper.querySelector(a)))&&te(t.elements.popper,a)&&(t.elements.arrow=a)},requires:[\"popperOffsets\"],requiresIfExists:[\"preventOverflow\"]},{name:\"hide\",enabled:!0,phase:\"main\",requiresIfExists:[\"preventOverflow\"],fn:function(e){var t=e.state,n=e.name,a=t.rects.reference,i=t.rects.popper,r=t.modifiersData.preventOverflow,o=se(t,{elementContext:\"reference\"}),s=se(t,{altBoundary:!0}),l=de(o,a),d=de(s,i,r),c=ce(l),u=ce(d);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:d,isReferenceHidden:c,hasPopperEscaped:u},t.attributes.popper=Object.assign({},t.attributes.popper,{\"data-popper-reference-hidden\":c,\"data-popper-escaped\":u})}}]})},50942:(e,t,n)=>{\"use strict\";n.d(t,{__:()=>$,ZP:()=>w});var a=n(21379),i=n(90400),r=n(22730),o=n(86551),s=n(41727);function l(e){let t,n,i,o,s,l;const d=e[6].default,c=(0,a.nu)(d,e,e[5],null);let u=[e[3]],m={};for(let e=0;e<u.length;e+=1)m=(0,a.f0)(m,u[e]);return{c(){t=(0,a.bG)(\"button\"),c&&c.c(),(0,a.UF)(t,m)},m(d,u){(0,a.$T)(d,t,u),c&&c.m(t,null),e[7](t),o=!0,s||(l=[(0,a.TV)(n=r.ol.call(null,t,e[0])),(0,a.TV)(i=e[2].call(null,t))],s=!0)},p(e,[i]){c&&c.p&&(!o||32&i)&&(0,a.Tj)(c,d,e,e[5],o?i:-1,null,null),(0,a.UF)(t,m=(0,a.Lo)(u,[8&i&&e[3]])),n&&(0,a.sB)(n.update)&&1&i&&n.update.call(null,e[0])},i(e){o||((0,a.Ui)(c,e),o=!0)},o(e){(0,a.et)(c,e),o=!1},d(n){n&&(0,a.og)(t),c&&c.d(n),e[7](null),s=!1,(0,a.j7)(l)}}}function", "domain": "javascript", "lang": "code", "char_count": 20470, "word_count": 10311, "byte_count": 20470}
{"text": "/*\n * Copyright (c) 2008-2013 The Open Source Geospatial Foundation\n *\n * Published under the BSD license.\n * See https://github.com/geoext/geoext2/blob/master/license.txt for the full\n * text of the license.\n */\n\n/*\n * @include OpenLayers/Symbolizer/Raster.js\n */\n\n/**\n * A specific model for Raster Symbolizer classifications.\n *\n * Preconfigured with an Ajax proxy and a JSON reader.\n *\n * @class GeoExt.data.RasterStyleModel\n */\nExt.define('GeoExt.data.RasterStyleModel',{\n    extend: 'Ext.data.Model',\n    requires : [\n         'Ext.data.JsonReader',\n         'GeoExt.Version'\n    ],\n    idProperty: \"filter\",\n    fields: [\n        {name: \"symbolizers\", mapping: function(v) {\n            return {\n                fillColor: v.color,\n                fillOpacity: v.opacity,\n                stroke: false\n            };\n        }, defaultValue: null},\n        {name: \"filter\", mapping: \"quantity\", type: \"float\", sortType: 'asFloat', sortDir: 'ASC'},\n        {name: \"label\", mapping: function(v) {\n            // fill label with quantity if empty\n            return v.label || v.quantity;\n        }}\n    ],\n    proxy: {\n        type: 'memory',\n        reader: {\n            type: 'json',\n            root: 'colorMap'\n        }\n    },\n    listeners:{\n        idchanged:function(rec){\n            for(var i=0;i<rec.stores.length;i++){\n                var store = rec.stores[i];\n                store.sort();\n            }\n        }\n    }\n});", "domain": "javascript", "lang": "code", "char_count": 1443, "word_count": 286, "byte_count": 1443}
{"text": "import React from \"react\";\nimport { Radio } from \"../../src\";\n\nconst RadioGroup = Radio.Group;\n\nconst plainOptions = [\"Apple\", \"Pear\", \"Orange\"];\nconst defaultCheckedList = [\"Apple\", \"Orange\"];\n\nexport default class Demo2 extends React.Component {\n\tstate = {\n\t\tcheckedList: defaultCheckedList,\n\t\tindeterminate: true,\n\t\tcheckAll: false,\n\t};\n\n\tonChange = (checkedList) => {\n\t\tthis.setState({\n\t\t\tcheckedList,\n\t\t\tindeterminate: !!checkedList.length && checkedList.length < plainOptions.length,\n\t\t\tcheckAll: checkedList.length === plainOptions.length,\n\t\t});\n\t};\n\n\tonCheckAllChange = (checked, e) => {\n\t\tthis.setState({\n\t\t\tcheckedList: checked ? plainOptions : [],\n\t\t\tindeterminate: false,\n\t\t\tcheckAll: checked,\n\t\t});\n\t};\n\n\trender() {\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t<RadioGroup options={plainOptions} />\n\t\t\t</div>\n\t\t);\n\t}\n}", "domain": "javascript", "lang": "code", "char_count": 810, "word_count": 191, "byte_count": 810}
{"text": "\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n    Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n    o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n    if (mod && mod.__esModule) return mod;\n    var result = {};\n    if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n    __setModuleDefault(result, mod);\n    return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n    return new (P || (P = Promise))(function (resolve, reject) {\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\n    });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst core = __importStar(require(\"@actions/core\"));\nconst node_ssh_1 = require(\"node-ssh\");\nconst keyboard_1 = require(\"./keyboard\");\nfunction run() {\n    return __awaiter(this, void 0, void 0, function* () {\n        const command = core.getInput('command');\n        const host = core.getInput('host') || 'localhost';\n        const username = core.getInput('username');\n        const port = +core.getInput('port') || 22;\n        const key = core.getInput('key');\n        const password = core.getInput('password');\n        const passphrase = core.getInput('passphrase');\n        const tryKeyboard = !!core.getInput('tryKeyboard');\n        try {\n            const ssh = yield connect(host, username, port, key, password, passphrase, tryKeyboard);\n            yield executeCommand(ssh, command);\n            ssh.dispose();\n        }\n        catch (err) {\n            core.setFailed(err);\n        }\n    });\n}\nfunction connect(host = 'localhost', username, port = 22, key, password, passphrase, tryKeyboard) {\n    return __awaiter(this, void 0, void 0, function* () {\n        const ssh = new node_ssh_1.NodeSSH();\n        try {\n            const config = {\n                host: host,\n                port: port,\n                username: username,\n                password: password,\n                passphrase: passphrase,\n                tryKeyboard: tryKeyboard,\n                onKeyboardInteractive: tryKeyboard ? keyboard_1.keyboardFunction(password) : null\n            };\n            if (key) {\n                config.privateKey = key;\n            }\n            yield ssh.connect(config);\n        }\n        catch (err) {\n            console.error(`\u26a0\ufe0f GitHub Action couldn't connect to ${host}`, err);\n            core.setFailed(err.message);\n        }\n        return ssh;\n    });\n}\nfunction executeCommand(ssh, command) {\n    var _a;\n    return __awaiter(this, void 0, void 0, function* () {\n        console.log(`${command}`);\n        try {\n            const { code } = yield ssh.exec(command, [], {\n                stream: 'both',\n                onStdout(chunk) {\n                    console.log(chunk.toString('utf8'));\n                },\n                onStderr(chunk) {\n                    console.log(chunk.toString('utf8'));\n                }\n            });\n            if (code > 0) {\n                throw Error(`Command exited with code ${code}`);\n            }\n            console.log('\u2705 SSH Action Finished');\n            if (ssh.isConnected()) {\n                ssh.dispose();\n            }\n        }\n        catch (err) {\n            console.error(`\u26a0\ufe0f An error happened executing command ${command}.`, (_a = err === null || err === void 0 ? void 0 : err.message) !== null && _a !== void 0 ? _a : err);\n            core.setFailed(err.message);\n            process.abort();\n        }\n    });\n}\nprocess.on('uncaughtException', err => {\n    if (err['code'] !== 'ECONNRESET')\n        throw err;\n});\nrun();", "domain": "javascript", "lang": "code", "char_count": 4538, "word_count": 1103, "byte_count": 4548}
{"text": "/*!\n * Vue.js v2.6.11\n * (c) 2014-2020 Evan You\n * Released under the MIT License.\n */\n/*  */\n\nvar emptyObject = Object.freeze({});\n\n// These helpers produce better VM code in JS engines due to their\n// explicitness and function inlining.\nfunction isUndef (v) {\n  return v === undefined || v === null\n}\n\nfunction isDef (v) {\n  return v !== undefined && v !== null\n}\n\nfunction isTrue (v) {\n  return v === true\n}\n\nfunction isFalse (v) {\n  return v === false\n}\n\n/**\n * Check if value is primitive.\n */\nfunction isPrimitive (value) {\n  return (\n    typeof value === 'string' ||\n    typeof value === 'number' ||\n    // $flow-disable-line\n    typeof value === 'symbol' ||\n    typeof value === 'boolean'\n  )\n}\n\n/**\n * Quick object check - this is primarily used to tell\n * Objects from primitive values when we know the value\n * is a JSON-compliant type.\n */\nfunction isObject (obj) {\n  return obj !== null && typeof obj === 'object'\n}\n\n/**\n * Get the raw type string of a value, e.g., [object Object].\n */\nvar _toString = Object.prototype.toString;\n\nfunction toRawType (value) {\n  return _toString.call(value).slice(8, -1)\n}\n\n/**\n * Strict object type check. Only returns true\n * for plain JavaScript objects.\n */\nfunction isPlainObject (obj) {\n  return _toString.call(obj) === '[object Object]'\n}\n\nfunction isRegExp (v) {\n  return _toString.call(v) === '[object RegExp]'\n}\n\n/**\n * Check if val is a valid array index.\n */\nfunction isValidArrayIndex (val) {\n  var n = parseFloat(String(val));\n  return n >= 0 && Math.floor(n) === n && isFinite(val)\n}\n\nfunction isPromise (val) {\n  return (\n    isDef(val) &&\n    typeof val.then === 'function' &&\n    typeof val.catch === 'function'\n  )\n}\n\n/**\n * Convert a value to a string that is actually rendered.\n */\nfunction toString (val) {\n  return val == null\n    ? ''\n    : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)\n      ? JSON.stringify(val, null, 2)\n      : String(val)\n}\n\n/**\n * Convert an input value to a number for persistence.\n * If the conversion fails, return original string.\n */\nfunction toNumber (val) {\n  var n = parseFloat(val);\n  return isNaN(n) ? val : n\n}\n\n/**\n * Make a map and return a function for checking if a key\n * is in that map.\n */\nfunction makeMap (\n  str,\n  expectsLowerCase\n) {\n  var map = Object.create(null);\n  var list = str.split(',');\n  for (var i = 0; i < list.length; i++) {\n    map[list[i]] = true;\n  }\n  return expectsLowerCase\n    ? function (val) { return map[val.toLowerCase()]; }\n    : function (val) { return map[val]; }\n}\n\n/**\n * Check if a tag is a built-in tag.\n */\nvar isBuiltInTag = makeMap('slot,component', true);\n\n/**\n * Check if an attribute is a reserved attribute.\n */\nvar isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');\n\n/**\n * Remove an item from an array.\n */\nfunction remove (arr, item) {\n  if (arr.length) {\n    var index = arr.indexOf(item);\n    if (index > -1) {\n      return arr.splice(index, 1)\n    }\n  }\n}\n\n/**\n * Check whether an object has the property.\n */\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nfunction hasOwn (obj, key) {\n  return hasOwnProperty.call(obj, key)\n}\n\n/**\n * Create a cached version of a pure function.\n */\nfunction cached (fn) {\n  var cache = Object.create(null);\n  return (function cachedFn (str) {\n    var hit = cache[str];\n    return hit || (cache[str] = fn(str))\n  })\n}\n\n/**\n * Camelize a hyphen-delimited string.\n */\nvar camelizeRE = /-(\\w)/g;\nvar camelize = cached(function (str) {\n  return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })\n});\n\n/**\n * Capitalize a string.\n */\nvar capitalize = cached(function (str) {\n  return str.charAt(0).toUpperCase() + str.slice(1)\n});\n\n/**\n * Hyphenate a camelCase string.\n */\nvar hyphenateRE = /\\B([A-Z])/g;\nvar hyphenate = cached(function (str) {\n  return str.replace(hyphenateRE, '-$1').toLowerCase()\n});\n\n/**\n * Simple bind polyfill for environments that do not support it,\n * e.g., PhantomJS 1.x. Technically, we don't need this anymore\n * since native bind is now performant enough in most browsers.\n * But removing it would mean breaking code that was able to run in\n * PhantomJS 1.x, so this must be kept for backward compatibility.\n */\n\n/* istanbul ignore next */\nfunction polyfillBind (fn, ctx) {\n  function boundFn (a) {\n    var l = arguments.length;\n    return l\n      ? l > 1\n        ? fn.apply(ctx, arguments)\n        : fn.call(ctx, a)\n      : fn.call(ctx)\n  }\n\n  boundFn._length = fn.length;\n  return boundFn\n}\n\nfunction nativeBind (fn, ctx) {\n  return fn.bind(ctx)\n}\n\nvar bind = Function.prototype.bind\n  ? nativeBind\n  : polyfillBind;\n\n/**\n * Convert an Array-like object to a real Array.\n */\nfunction toArray (list, start) {\n  start = start || 0;\n  var i = list.length - start;\n  var ret = new Array(i);\n  while (i--) {\n    ret[i] = list[i + start];\n  }\n  return ret\n}\n\n/**\n * Mix properties into target object.\n */\nfunction extend (to, _from) {\n  for (var key in _from) {\n    to[key] = _from[key];\n  }\n  return to\n}\n\n/**\n * Merge an Array of Objects into a single Object.\n */\nfunction toObject (arr) {\n  var res = {};\n  for (var i = 0; i < arr.length; i++) {\n    if (arr[i]) {\n      extend(res, arr[i]);\n    }\n  }\n  return res\n}\n\n/* eslint-disable no-unused-vars */\n\n/**\n * Perform no operation.\n * Stubbing args to make Flow happy without leaving useless transpiled code\n * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).\n */\nfunction noop (a, b, c) {}\n\n/**\n * Always return false.\n */\nvar no = function (a, b, c) { return false; };\n\n/* eslint-enable no-unused-vars */\n\n/**\n * Return the same value.\n */\nvar identity = function (_) { return _; };\n\n/**\n * Generate a string containing static keys from compiler modules.\n */\nfunction genStaticKeys (modules) {\n  return modules.reduce(function (keys, m) {\n    return keys.concat(m.staticKeys || [])\n  }, []).join(',')\n}\n\n/**\n * Check if two values are loosely equal - that is,\n * if they are plain objects, do they have the same shape?\n */\nfunction looseEqual (a, b) {\n  if (a === b) { return true }\n  var isObjectA = isObject(a);\n  var isObjectB = isObject(b);\n  if (isObjectA && isObjectB) {\n    try {\n      var isArrayA = Array.isArray(a);\n      var isArrayB = Array.isArray(b);\n      if (isArrayA && isArrayB) {\n        return a.length === b.length && a.every(function (e, i) {\n          return looseEqual(e, b[i])\n        })\n      } else if (a instanceof Date && b instanceof Date) {\n        return a.getTime() === b.getTime()\n      } else if (!isArrayA && !isArrayB) {\n        var keysA = Object.keys(a);\n        var keysB = Object.keys(b);\n        return keysA.length === keysB.length && keysA.every(function (key) {\n          return looseEqual(a[key], b[key])\n        })\n      } else {\n        /* istanbul ignore next */\n        return false\n      }\n    } catch (e) {\n      /* istanbul ignore next */\n      return false\n    }\n  } else if (!isObjectA && !isObjectB) {\n    return String(a) === String(b)\n  } else {\n    return false\n  }\n}\n\n/**\n * Return the first index at which a loosely equal value can be\n * found in the array (if value is a plain object, the array must\n * contain an object of the same shape), or -1 if it is not present.\n */\nfunction looseIndexOf (arr, val) {\n  for (var i = 0; i < arr.length; i++) {\n    if (looseEqual(arr[i], val)) { return i }\n  }\n  return -1\n}\n\n/**\n * Ensure a function is called only once.\n */\nfunction once (fn) {\n  var called = false;\n  return function () {\n    if (!called) {\n      called = true;\n      fn.apply(this, arguments);\n    }\n  }\n}\n\nvar SSR_ATTR = 'data-server-rendered';\n\nvar ASSET_TYPES = [\n  'component',\n  'directive',\n  'filter'\n];\n\nvar LIFECYCLE_HOOKS = [\n  'beforeCreate',\n  'created',\n  'beforeMount',\n  'mounted',\n  'beforeUpdate',\n  'updated',\n  'beforeDestroy',\n  'destroyed',\n  'activated',\n  'deactivated',\n  'errorCaptured',\n  'serverPrefetch'\n];\n\n/*  */\n\n\n\nvar config = ({\n  /**\n   * Option merge strategies (used in core/util/options)\n   */\n  // $flow-disable-line\n  optionMergeStrategies: Object.create(null),\n\n  /**\n   * Whether to suppress warnings.\n   */\n  silent: false,\n\n  /**\n   * Show production mode tip message on boot?\n   */\n  productionTip: process.env.NODE_ENV !== 'production',\n\n  /**\n   * Whether to enable devtools\n   */\n  devtools: process.env.NODE_ENV !== 'production',\n\n  /**\n   * Whether to record perf\n   */\n  performance: false,\n\n  /**\n   * Error handler for watcher errors\n   */\n  errorHandler: null,\n\n  /**\n   * Warn handler for watcher warns\n   */\n  warnHandler: null,\n\n  /**\n   * Ignore certain custom elements\n   */\n  ignoredElements: [],\n\n  /**\n   * Custom user key aliases for v-on\n   */\n  // $flow-disable-line\n  keyCodes: Object.create(null),\n\n  /**\n   * Check if a tag is reserved so that it cannot be registered as a\n   * component. This is platform-dependent and may be overwritten.\n   */\n  isReservedTag: no,\n\n  /**\n   * Check if an attribute is reserved so that it cannot be used as a component\n   * prop. This is platform-dependent and may be overwritten.\n   */\n  isReservedAttr: no,\n\n  /**\n   * Check if a tag is an unknown element.\n   * Platform-dependent.\n   */\n  isUnknownElement: no,\n\n  /**\n   * Get the namespace of an element\n   */\n  getTagNamespace: noop,\n\n  /**\n   * Parse the real tag name for the specific platform.\n   */\n  parsePlatformTagName: identity,\n\n  /**\n   * Check if an attribute must be bound using property, e.g. value\n   * Platform-dependent.\n   */\n  mustUseProp: no,\n\n  /**\n   * Perform updates asynchronously. Intended to be used by Vue Test Utils\n   * This will significantly reduce performance if set to false.\n   */\n  async: true,\n\n  /**\n   * Exposed for legacy reasons\n   */\n  _lifecycleHooks: LIFECYCLE_HOOKS\n});\n\n/*  */\n\n/**\n * unicode letters used for parsing html tags, component names and property paths.\n * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname\n * skipping \\u10000-\\uEFFFF due to it freezing up PhantomJS\n */\nvar unicodeRegExp = /a-zA-Z\\u00B7\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u203F-\\u2040\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD/;\n\n/**\n * Check if a string starts with $ or _\n */\nfunction isReserved (str) {\n  var c = (str + '').charCodeAt(0);\n  return c === 0x24 || c === 0x5F\n}\n\n/**\n * Define a property.\n */\nfunction def (obj, key, val, enumerable) {\n  Object.defineProperty(obj, key, {\n    value: val,\n    enumerable: !!enumerable,\n    writable: true,\n    configurable: true\n  });\n}\n\n/**\n * Parse simple path.\n */\nvar bailRE = new RegExp((\"[^\" + (unicodeRegExp.source) + \".$_\\\\d]\"));\nfunction parsePath (path) {\n  if (bailRE.test(path)) {\n    return\n  }\n  var segments = path.split('.');\n  return function (obj) {\n    for (var i = 0; i < segments.length; i++) {\n      if (!obj) { return }\n      obj = obj[segments[i]];\n    }\n    return obj\n  }\n}\n\n/*  */\n\n// can we use __proto__?\nvar hasProto = '__proto__' in {};\n\n// Browser environment sniffing\nvar inBrowser = typeof window !== 'undefined';\nvar inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;\nvar weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();\nvar UA = inBrowser && window.navigator.userAgent.toLowerCase();\nvar isIE = UA && /msie|trident/.test(UA);\nvar isIE9 = UA && UA.indexOf('msie 9.0') > 0;\nvar isEdge = UA && UA.indexOf('edge/') > 0;\nvar isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');\nvar isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');\nvar isChrome = UA && /chrome\\/\\d+/.test(UA) && !isEdge;\nvar isPhantomJS = UA && /phantomjs/.test(UA);\nvar isFF = UA && UA.match(/firefox\\/(\\d+)/);\n\n// Firefox has a \"watch\" function on Object.prototype...\nvar nativeWatch = ({}).watch;\n\nvar supportsPassive = false;\nif (inBrowser) {\n  try {\n    var opts = {};\n    Object.defineProperty(opts, 'passive', ({\n      get: function get () {\n        /* istanbul ignore next */\n        supportsPassive = true;\n      }\n    })); // https://github.com/facebook/flow/issues/285\n    window.addEventListener('test-passive', null, opts);\n  } catch (e) {}\n}\n\n// this needs to be lazy-evaled because vue may be required before\n// vue-server-renderer can set VUE_ENV\nvar _isServer;\nvar isServerRendering = function () {\n  if (_isServer === undefined) {\n    /* istanbul ignore if */\n    if (!inBrowser && !inWeex && typeof global !== 'undefined') {\n      // detect presence of vue-server-renderer and avoid\n      // Webpack shimming the process\n      _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';\n    } else {\n      _isServer = false;\n    }\n  }\n  return _isServer\n};\n\n// detect devtools\nvar devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;\n\n/* istanbul ignore next */\nfunction isNative (Ctor) {\n  return typeof Ctor === 'function' && /native code/.test(Ctor.toString())\n}\n\nvar hasSymbol =\n  typeof Symbol !== 'undefined' && isNative(Symbol) &&\n  typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);\n\nvar _Set;\n/* istanbul ignore if */ // $flow-disable-line\nif (typeof Set !== 'undefined' && isNative(Set)) {\n  // use native Set when available.\n  _Set = Set;\n} else {\n  // a non-standard Set polyfill that only works with primitive keys.\n  _Set = /*@__PURE__*/(function () {\n    function Set () {\n      this.set = Object.create(null);\n    }\n    Set.prototype.has = function has (key) {\n      return this.set[key] === true\n    };\n    Set.prototype.add = function add (key) {\n      this.set[key] = true;\n    };\n    Set.prototype.clear = function clear () {\n      this.set = Object.create(null);\n    };\n\n    return Set;\n  }());\n}\n\n/*  */\n\nvar warn = noop;\nvar tip = noop;\nvar generateComponentTrace = (noop); // work around flow check\nvar formatComponentName = (noop);\n\nif (process.env.NODE_ENV !== 'production') {\n  var hasConsole = typeof console !== 'undefined';\n  var classifyRE = /(?:^|[-_])(\\w)/g;\n  var classify = function (str) { return str\n    .replace(classifyRE, function (c) { return c.toUpperCase(); })\n    .replace(/[-_]/g, ''); };\n\n  warn = function (msg, vm) {\n    var trace = vm ? generateComponentTrace(vm) : '';\n\n    if (config.warnHandler) {\n      config.warnHandler.call(null, msg, vm, trace);\n    } else if (hasConsole && (!config.silent)) {\n      console.error((\"[Vue warn]: \" + msg + trace));\n    }\n  };\n\n  tip = function (msg, vm) {\n    if (hasConsole && (!config.silent)) {\n      console.warn(\"[Vue tip]: \" + msg + (\n        vm ? generateComponentTrace(vm) : ''\n      ));\n    }\n  };\n\n  formatComponentName = function (vm, includeFile) {\n    if (vm.$root === vm) {\n      if (vm.$options && vm.$options.__file) { // fixed by xxxxxx\n        return ('at ') + vm.$options.__file\n      }\n      return '<Root>'\n    }\n    var options = typeof vm === 'function' && vm.cid != null\n      ? vm.options\n      : vm._isVue\n        ? vm.$options || vm.constructor.options\n        : vm;\n    var name = options.name || options._componentTag;\n    var file = options.__file;\n    if (!name && file) {\n      var match = file.match(/([^/\\\\]+)\\.vue$/);\n      name = match && match[1];\n    }\n\n    return (\n      (name ? (\"<\" + (classify(name)) + \">\") : \"<Anonymous>\") +\n      (file && includeFile !== false ? (\" at \" + file) : '')\n    )\n  };\n\n  var repeat = function (str, n) {\n    var res = '';\n    while (n) {\n      if (n % 2 === 1) { res += str; }\n      if (n > 1) { str += str; }\n      n >>= 1;\n    }\n    return res\n  };\n\n  generateComponentTrace = function (vm) {\n    if (vm._isVue && vm.$parent) {\n      var tree = [];\n      var currentRecursiveSequence = 0;\n      while (vm && vm.$options.name !== 'PageBody') {\n        if (tree.length > 0) {\n          var last = tree[tree.length - 1];\n          if (last.constructor === vm.constructor) {\n            currentRecursiveSequence++;\n            vm = vm.$parent;\n            continue\n          } else if (currentRecursiveSequence > 0) {\n            tree[tree.length - 1] = [last, currentRecursiveSequence];\n            currentRecursiveSequence = 0;\n          }\n        }\n        !vm.$options.isReserved && tree.push(vm);\n        vm = vm.$parent;\n      }\n      return '\\n\\nfound in\\n\\n' + tree\n        .map(function (vm, i) { return (\"\" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)\n            ? ((formatComponentName(vm[0])) + \"... (\" + (vm[1]) + \" recursive calls)\")\n            : formatComponentName(vm))); })\n        .join('\\n')\n    } else {\n      return (\"\\n\\n(found in \" + (formatComponentName(vm)) + \")\")\n    }\n  };\n}\n\n/*  */\n\nvar uid = 0;\n\n/**\n * A dep is an observable that can have multiple\n * directives subscribing to it.\n */\nvar Dep = function Dep () {\n  // fixed by xxxxxx (nvue vuex)\n  /* eslint-disable no-undef */\n  if(typeof SharedObject !== 'undefined'){\n    this.id = SharedObject.uid++;\n  } else {\n    this.id = uid++;\n  }\n  this.subs = [];\n};\n\nDep.prototype.addSub = function addSub (sub) {\n  this.subs.push(sub);\n};\n\nDep.prototype.removeSub = function removeSub (sub) {\n  remove(this.subs, sub);\n};\n\nDep.prototype.depend = function depend () {\n  if (Dep.SharedObject.target) {\n    Dep.SharedObject.target.addDep(this);\n  }\n};\n\nDep.prototype.notify = function notify () {\n  // stabilize the subscriber list first\n  var subs = this.subs.slice();\n  if (process.env.NODE_ENV !== 'production' && !config.async) {\n    // subs aren't sorted in scheduler if not running async\n    // we need to sort them now to make sure they fire in correct\n    // order\n    subs.sort(function (a, b) { return a.id - b.id; });\n  }\n  for (var i = 0, l = subs.length; i < l; i++) {\n    subs[i].update();\n  }\n};\n\n// The current target watcher being evaluated.\n// This is globally unique because only one watcher\n// can be evaluated at a time.\n// fixed by xxxxxx (nvue shared vuex)\n/* eslint-disable no-undef */\nDep.SharedObject = typeof SharedObject !== 'undefined' ? SharedObject : {};\nDep.SharedObject.target = null;\nDep.SharedObject.targetStack = [];\n\nfunction pushTarget (target) {\n  Dep.SharedObject.targetStack.push(target);\n  Dep.SharedObject.target = target;\n}\n\nfunction popTarget () {\n  Dep.SharedObject.targetStack.pop();\n  Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];\n}\n\n/*  */\n\nvar VNode = function VNode (\n  tag,\n  data,\n  children,\n  text,\n  elm,\n  context,\n  componentOptions,\n  asyncFactory\n) {\n  this.tag = tag;\n  this.data = data;\n  this.children = children;\n  this.text = text;\n  this.elm = elm;\n  this.ns = undefined;\n  this.context = context;\n  this.fnContext = undefined;\n  this.fnOptions = undefined;\n  this.fnScopeId = undefined;\n  this.key = data && data.key;\n  this.componentOptions = componentOptions;\n  this.componentInstance = undefined;\n  this.parent = undefined;\n  this.raw = false;\n  this.isStatic = false;\n  this.isRootInsert = true;\n  this.isComment = false;\n  this.isCloned = false;\n  this.isOnce = false;\n  this.asyncFactory = asyncFactory;\n  this.asyncMeta = undefined;\n  this.isAsyncPlaceholder = false;\n};\n\nvar prototypeAccessors = { child: { configurable: true } };\n\n// DEPRECATED: alias for componentInstance for backwards compat.\n/* istanbul ignore next */\nprototypeAccessors.child.get = function () {\n  return this.componentInstance\n};\n\nObject.defineProperties( VNode.prototype, prototypeAccessors );\n\nvar createEmptyVNode = function (text) {\n  if ( text === void 0 ) text = '';\n\n  var node = new VNode();\n  node.text = text;\n  node.isComment = true;\n  return node\n};\n\nfunction createTextVNode (val) {\n  return new VNode(undefined, undefined, undefined, String(val))\n}\n\n// optimized shallow clone\n// used for static nodes and slot nodes because they may be reused across\n// multiple renders, cloning them avoids errors when DOM manipulations rely\n// on their elm reference.\nfunction cloneVNode (vnode) {\n  var cloned = new VNode(\n    vnode.tag,\n    vnode.data,\n    // #7975\n    // clone children array to avoid mutating original in case of cloning\n    // a child.\n    vnode.children && vnode.children.slice(),\n    vnode.text,\n    vnode.elm,\n    vnode.context,", "domain": "javascript", "lang": "code", "char_count": 20015, "word_count": 4868, "byte_count": 20015}
{"text": "// based on rc-input-number 4.5.5\nimport PropTypes from '../../_util/vue-types';\nimport BaseMixin from '../../_util/BaseMixin';\nimport { initDefaultProps, hasProp, getOptionProps, getListeners } from '../../_util/props-util';\nimport classNames from 'classnames';\nimport KeyCode from '../../_util/KeyCode';\nimport InputHandler from './InputHandler';\n\nfunction noop() {}\n\nfunction preventDefault(e) {\n  e.preventDefault();\n}\n\nfunction defaultParser(input) {\n  return input.replace(/[^\\w\\.-]+/g, '');\n}\n\n/**\n * When click and hold on a button - the speed of auto changin the value.\n */\nconst SPEED = 200;\n\n/**\n * When click and hold on a button - the delay before auto changin the value.\n */\nconst DELAY = 600;\n\n/**\n * Max Safe Integer -- on IE this is not available, so manually set the number in that case.\n * The reason this is used, instead of Infinity is because numbers above the MSI are unstable\n */\nconst MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || Math.pow(2, 53) - 1;\n\nconst isValidProps = value => value !== undefined && value !== null;\n\nconst isEqual = (oldValue, newValue) =>\n  newValue === oldValue ||\n  (typeof newValue === 'number' &&\n    typeof oldValue === 'number' &&\n    isNaN(newValue) &&\n    isNaN(oldValue));\n\nconst inputNumberProps = {\n  value: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n  defaultValue: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n  focusOnUpDown: PropTypes.bool,\n  autoFocus: PropTypes.bool,\n  // onChange: PropTypes.func,\n  // onKeyDown: PropTypes.func,\n  // onKeyUp: PropTypes.func,\n  prefixCls: PropTypes.string,\n  tabIndex: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n  placeholder: PropTypes.string,\n  disabled: PropTypes.bool,\n  // onFocus: PropTypes.func,\n  // onBlur: PropTypes.func,\n  readOnly: PropTypes.bool,\n  max: PropTypes.number,\n  min: PropTypes.number,\n  step: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n  upHandler: PropTypes.any,\n  downHandler: PropTypes.any,\n  useTouch: PropTypes.bool,\n  formatter: PropTypes.func,\n  parser: PropTypes.func,\n  // onMouseEnter: PropTypes.func,\n  // onMouseLeave: PropTypes.func,\n  // onMouseOver: PropTypes.func,\n  // onMouseOut: PropTypes.func,\n  precision: PropTypes.number,\n  required: PropTypes.bool,\n  pattern: PropTypes.string,\n  decimalSeparator: PropTypes.string,\n  autoComplete: PropTypes.string,\n  title: PropTypes.string,\n  name: PropTypes.string,\n  id: PropTypes.string,\n};\n\nexport default {\n  name: 'VCInputNumber',\n  mixins: [BaseMixin],\n  model: {\n    prop: 'value',\n    event: 'change',\n  },\n  props: initDefaultProps(inputNumberProps, {\n    focusOnUpDown: true,\n    useTouch: false,\n    prefixCls: 'rc-input-number',\n    min: -MAX_SAFE_INTEGER,\n    step: 1,\n    parser: defaultParser,\n    required: false,\n    autoComplete: 'off',\n  }),\n  data() {\n    const props = getOptionProps(this);\n    this.prevProps = { ...props };\n    let value;\n    if ('value' in props) {\n      value = this.value;\n    } else {\n      value = this.defaultValue;\n    }\n    const validValue = this.getValidValue(this.toNumber(value));\n    return {\n      inputValue: this.toPrecisionAsStep(validValue),\n      sValue: validValue,\n      focused: this.autoFocus,\n    };\n  },\n  mounted() {\n    this.$nextTick(() => {\n      if (this.autoFocus && !this.disabled) {\n        this.focus();\n      }\n      this.updatedFunc();\n    });\n  },\n  updated() {\n    const { value, max, min } = this.$props;\n    const { focused } = this.$data;\n    const { prevProps } = this;\n    const props = getOptionProps(this);\n    // Don't trigger in componentDidMount\n    if (prevProps) {\n      if (\n        !isEqual(prevProps.value, value) ||\n        !isEqual(prevProps.max, max) ||\n        !isEqual(prevProps.min, min)\n      ) {\n        const validValue = focused ? value : this.getValidValue(value);\n        let nextInputValue;\n        if (this.pressingUpOrDown) {\n          nextInputValue = validValue;\n        } else if (this.inputting) {\n          nextInputValue = this.rawInput;\n        } else {\n          nextInputValue = this.toPrecisionAsStep(validValue);\n        }\n        this.setState({\n          // eslint-disable-line\n          sValue: validValue,\n          inputValue: nextInputValue,\n        });\n      }\n\n      // Trigger onChange when max or min change\n      // https://github.com/ant-design/ant-design/issues/11574\n      const nextValue = 'value' in props ? value : this.sValue;\n      // ref: null < 20 === true\n      // https://github.com/ant-design/ant-design/issues/14277\n      if (\n        'max' in props &&\n        prevProps.max !== max &&\n        typeof nextValue === 'number' &&\n        nextValue > max\n      ) {\n        this.$emit('change', max);\n      }\n      if (\n        'min' in props &&\n        prevProps.min !== min &&\n        typeof nextValue === 'number' &&\n        nextValue < min\n      ) {\n        this.$emit('change', min);\n      }\n    }\n    this.prevProps = { ...props };\n    this.$nextTick(() => {\n      this.updatedFunc();\n    });\n  },\n  beforeDestroy() {\n    this.stop();\n  },\n  methods: {\n    updatedFunc() {\n      const inputElem = this.$refs.inputRef;\n      // Restore cursor\n      try {\n        // Firefox set the input cursor after it get focused.\n        // This caused that if an input didn't init with the selection,\n        // set will cause cursor not correct when first focus.\n        // Safari will focus input if set selection. We need skip this.\n        if (this.cursorStart !== undefined && this.focused) {\n          // In most cases, the string after cursor is stable.\n          // We can move the cursor before it\n\n          if (\n            // If not match full str, try to match part of str\n            !this.partRestoreByAfter(this.cursorAfter) &&\n            this.sValue !== this.value\n          ) {\n            // If not match any of then, let's just keep the position\n            // TODO: Logic should not reach here, need check if happens\n            let pos = this.cursorStart + 1;\n\n            // If not have last string, just position to the end\n            if (!this.cursorAfter) {\n              pos = inputElem.value.length;\n            } else if (this.lastKeyCode === KeyCode.BACKSPACE) {\n              pos = this.cursorStart - 1;\n            } else if (this.lastKeyCode === KeyCode.DELETE) {\n              pos = this.cursorStart;\n            }\n            this.fixCaret(pos, pos);\n          } else if (this.currentValue === inputElem.value) {\n            // Handle some special key code\n            switch (this.lastKeyCode) {\n              case KeyCode.BACKSPACE:\n                this.fixCaret(this.cursorStart - 1, this.cursorStart - 1);\n                break;\n              case KeyCode.DELETE:\n                this.fixCaret(this.cursorStart + 1, this.cursorStart + 1);\n                break;\n              default:\n              // Do nothing\n            }\n          }\n        }\n      } catch (e) {\n        // Do nothing\n      }\n      // Reset last key\n      this.lastKeyCode = null;\n\n      // pressingUpOrDown is true means that someone just click up or down button\n      if (!this.pressingUpOrDown) {\n        return;\n      }\n      if (this.focusOnUpDown && this.focused) {\n        if (document.activeElement !== inputElem) {\n          this.focus();\n        }\n      }\n\n      this.pressingUpOrDown = false;\n    },\n    onKeyDown(e, ...args) {\n      if (e.keyCode === KeyCode.UP) {\n        const ratio = this.getRatio(e);\n        this.up(e, ratio);\n        this.stop();\n      } else if (e.keyCode === KeyCode.DOWN) {\n        const ratio = this.getRatio(e);\n        this.down(e, ratio);\n        this.stop();\n      } else if (e.keyCode === KeyCode.ENTER) {\n        this.$emit('pressEnter', e);\n      }\n      // Trigger user key down\n      this.recordCursorPosition();\n      this.lastKeyCode = e.keyCode;\n      this.$emit('keydown', e, ...args);\n    },\n    onKeyUp(e, ...args) {\n      this.stop();\n\n      this.recordCursorPosition();\n\n      this.$emit('keyup', e, ...args);\n    },\n    onChange(e) {\n      if (this.focused) {\n        this.inputting = true;\n      }\n      this.rawInput = this.parser(this.getValueFromEvent(e));\n      this.setState({ inputValue: this.rawInput });\n      this.$emit('change', this.toNumber(this.rawInput)); // valid number or invalid string\n    },\n    onFocus(...args) {\n      this.setState({\n        focused: true,\n      });\n      this.$emit('focus', ...args);\n    },\n    onBlur(...args) {\n      this.inputting = false;\n      this.setState({\n        focused: false,\n      });\n      const value = this.getCurrentValidValue(this.inputValue);\n      const newValue = this.setValue(value);\n      if (this.$listeners.blur) {\n        const originValue = this.$refs.inputRef.value;\n        const inputValue = this.getInputDisplayValue({ focused: false, sValue: newValue });\n        this.$refs.inputRef.value = inputValue;\n        this.$emit('blur', ...args);\n        this.$refs.inputRef.value = originValue;\n      }\n    },\n    getCurrentValidValue(value) {\n      let val = value;\n      if (val === '') {\n        val = '';\n      } else if (!this.isNotCompleteNumber(parseFloat(val, 10))) {\n        val = this.getValidValue(val);\n      } else {\n        val = this.sValue;\n      }\n      return this.toNumber(val);\n    },\n    getRatio(e) {\n      let ratio = 1;\n      if (e.metaKey || e.ctrlKey) {\n        ratio = 0.1;\n      } else if (e.shiftKey) {\n        ratio = 10;\n      }\n      return ratio;\n    },\n    getValueFromEvent(e) {\n      // optimize for chinese input expierence\n      // https://github.com/ant-design/ant-design/issues/8196\n      let value = e.target.value.trim().replace(/\u3002/g, '.');\n\n      if (isValidProps(this.decimalSeparator)) {\n        value = value.replace(this.decimalSeparator, '.');\n      }\n\n      return value;\n    },\n    getValidValue(value, min = this.min, max = this.max) {\n      let val = parseFloat(value, 10);\n      // https://github.com/ant-design/ant-design/issues/7358\n      if (isNaN(val)) {\n        return value;\n      }\n      if (val < min) {\n        val = min;\n      }\n      if (val > max) {\n        val = max;\n      }\n      return val;\n    },\n    setValue(v, callback) {\n      // trigger onChange\n      const { precision } = this.$props;\n      const newValue = this.isNotCompleteNumber(parseFloat(v, 10)) ? null : parseFloat(v, 10);\n      const { sValue: value = null, inputValue = null } = this.$data;\n      // https://github.com/ant-design/ant-design/issues/7363\n      // https://github.com/ant-design/ant-design/issues/16622\n      const newValueInString =\n        typeof newValue === 'number' ? newValue.toFixed(precision) : `${newValue}`;\n      const changed = newValue !== value || newValueInString !== `${inputValue}`;\n      if (!hasProp(this, 'value')) {\n        this.setState(\n          {\n            sValue: newValue,\n            inputValue: this.toPrecisionAsStep(v),\n          },\n          callback,\n        );\n      } else {\n        // always set input value same as value\n        this.setState(\n          {\n            inputValue: this.toPrecisionAsStep(this.sValue),\n          },\n          callback,\n        );\n      }\n      if (changed) {\n        this.$emit('change', newValue);\n      }\n      return newValue;\n    },\n    getPrecision(value) {\n      if (isValidProps(this.precision)) {\n        return this.precision;\n      }\n      const valueString = value.toString();\n      if (valueString.indexOf('e-') >= 0) {\n        return parseInt(valueString.slice(valueString.indexOf('e-') + 2), 10);\n      }\n      let precision = 0;\n      if (valueString.indexOf('.') >= 0) {\n        precision = valueString.length - valueString.indexOf('.') - 1;\n      }\n      return precision;\n    },\n    // step={1.0} value={1.51}\n    // press +\n    // then value should be 2.51, rather than 2.5\n    // if this.$props.precision is undefined\n    // https://github.com/react-component/input-number/issues/39\n    getMaxPrecision(currentValue, ratio = 1) {\n      if (isValidProps(this.precision)) {\n        return this.precision;\n      }\n      const { step } = this;\n      const ratioPrecision = this.getPrecision(ratio);\n      const stepPrecision = this.getPrecision(step);\n      const currentValuePrecision = this.getPrecision(currentValue);\n      if (!currentValue) {\n        return ratioPrecision + stepPrecision;\n      }\n      return Math.max(currentValuePrecision, ratioPrecision + stepPrecision);\n    },\n    getPrecisionFactor(currentValue, ratio = 1) {\n      const precision = this.getMaxPrecision(currentValue, ratio);\n      return Math.pow(10, precision);\n    },\n    getInputDisplayValue(state) {\n      const { focused, inputValue, sValue } = state || this.$data;\n      let inputDisplayValue;\n      if (focused) {\n        inputDisplayValue = inputValue;\n      } else {\n        inputDisplayValue = this.toPrecisionAsStep(sValue);\n      }\n\n      if (inputDisplayValue === undefined || inputDisplayValue === null) {\n        inputDisplayValue = '';\n      }\n\n      let inputDisplayValueFormat = this.formatWrapper(inputDisplayValue);\n      if (isValidProps(this.$props.decimalSeparator)) {\n        inputDisplayValueFormat = inputDisplayValueFormat\n          .toString()\n          .replace('.', this.$props.decimalSeparator);\n      }\n\n      return inputDisplayValueFormat;\n    },\n    recordCursorPosition() {\n      // Record position\n      try {\n        const inputElem = this.$refs.inputRef;\n        this.cursorStart = inputElem.selectionStart;\n        this.cursorEnd = inputElem.selectionEnd;\n        this.currentValue = inputElem.value;\n        this.cursorBefore = inputElem.value.substring(0, this.cursorStart);\n        this.cursorAfter = inputElem.value.substring(this.cursorEnd);\n      } catch (e) {\n        // Fix error in Chrome:\n        // Failed to read the 'selectionStart' property from 'HTMLInputElement'\n        // http://stackoverflow.com/q/21177489/3040605\n      }\n    },\n    fixCaret(start, end) {\n      if (\n        start === undefined ||\n        end === undefined ||\n        !this.$refs.inputRef ||\n        !this.$refs.inputRef.value\n      ) {\n        return;\n      }\n\n      try {\n        const inputElem = this.$refs.inputRef;\n        const currentStart = inputElem.selectionStart;\n        const currentEnd = inputElem.selectionEnd;\n\n        if (start !== currentStart || end !== currentEnd) {\n          inputElem.setSelectionRange(start, end);\n        }\n      } catch (e) {\n        // Fix error in Chrome:\n        // Failed to read the 'selectionStart' property from 'HTMLInputElement'\n        // http://stackoverflow.com/q/21177489/3040605\n      }\n    },\n    restoreByAfter(str) {\n      if (str === undefined) return false;\n\n      const fullStr = this.$refs.inputRef.value;\n      const index = fullStr.lastIndexOf(str);\n\n      if (index === -1) return false;\n\n      const prevCursorPos = this.cursorBefore.length;\n      if (\n        this.lastKeyCode === KeyCode.DELETE &&\n        this.cursorBefore.charAt(prevCursorPos - 1) === str[0]\n      ) {\n        this.fixCaret(prevCursorPos, prevCursorPos);\n        return true;\n      }\n      if (index + str.length === fullStr.length) {\n        this.fixCaret(index, index);\n\n        return true;\n      }\n      return false;\n    },\n    partRestoreByAfter(str) {\n      if (str === undefined) return false;\n\n      // For loop from full str to the str with last char to map. e.g. 123\n      // -> 123\n      // -> 23\n      // -> 3\n      return Array.prototype.some.call(str, (_, start) => {\n        const partStr = str.substring(start);\n\n        return this.restoreByAfter(partStr);\n      });\n    },\n    focus() {\n      this.$refs.inputRef.focus();\n      this.recordCursorPosition();\n    },\n    blur() {\n      this.$refs.inputRef.blur();\n    },\n    formatWrapper(num) {\n      // http://2ality.com/2012/03/signedzero.html\n      // https://github.com/ant-design/ant-design/issues/9439\n      if (this.formatter) {\n        return this.formatter(num);\n      }\n      return num;\n    },\n    toPrecisionAsStep(num) {\n      if (this.isNotCompleteNumber(num) || num === '') {\n        return num;\n      }\n      const precision = Math.abs(this.getMaxPrecision(num));\n      if (!isNaN(precision)) {\n        return Number(num).toFixed(precision);\n      }\n      return num.toString();\n    },\n    // '1.' '1x' 'xx' '' => are not complete numbers\n    isNotCompleteNumber(num) {\n      return (\n        isNaN(num) ||\n        num === '' ||\n        num === null ||\n        (num && num.toString().indexOf('.') === num.toString().length - 1)\n      );\n    },\n    toNumber(num) {\n      const { precision, autoFocus } = this.$props;\n      const { focused = autoFocus } = this;\n      // num.length > 16 => This is to prevent input of large numbers\n      const numberIsTooLarge = num && num.length > 16 && focused;\n      if (this.isNotCompleteNumber(num) || numberIsTooLarge) {\n        return num;\n      }\n      if (isValidProps(precision)) {\n        return Math.round(num * Math.pow(10, precision)) / Math.pow(10, precision);\n      }\n      return Number(num);\n    },\n    upStep(val, rat) {\n      const { step } = this;\n      const precisionFactor = this.getPrecisionFactor(val, rat);\n      const precision = Math.abs(this.getMaxPrecision(val, rat));\n      const result = (\n        (precisionFactor * val + precisionFactor * step * rat) /\n        precisionFactor\n      ).toFixed(precision);\n      return this.toNumber(result);\n    },\n    downStep(val, rat) {\n      const { step } = this;\n      const precisionFactor = this.getPrecisionFactor(val, rat);\n      const precision = Math.abs(this.getMaxPrecision(val, rat));\n      const result = (\n        (precisionFactor * val - precisionFactor * step * rat) /\n        precisionFactor\n      ).toFixed(precision);\n      return this.toNumber(result);\n    },\n    stepFn(type, e, ratio = 1, recursive) {\n      this.stop();\n      if (e) {\n        // e.persist()\n        e.preventDefault();\n      }\n      if (this.disabled) {\n        return;\n      }\n      const { max, min } = this;\n      const value = this.getCurrentValidValue(this.inputValue) || 0;\n      if (this.isNotCompleteNumber(value)) {\n        return;\n      }\n      let val = this[`${type}Step`](value, ratio);\n      const outOfRange = val > max || val < min;\n      if (val > max) {\n        val = max;\n      } else if (val < min) {\n        val = min;\n      }\n      this.setValue(val);\n      this.setState({\n        focused: true,\n      });\n      if (outOfRange) {\n        return;\n      }\n      this.autoStepTimer = setTimeout(\n        () => {\n          this[type](e, ratio, true);\n        },\n        recursive ? SPEED : DELAY,\n      );\n    },\n    stop() {\n      if (this.autoStepTimer) {\n        clearTimeout(this.autoStepTimer);\n      }\n    },\n    down(e, ratio, recursive) {\n      this.pressingUpOrDown = true;\n      this.stepFn('down', e, ratio, recursive);\n    },\n    up(e, ratio, recursive) {\n      this.pressingUpOrDown = true;\n      this.stepFn('up', e, ratio, recursive);\n    },\n    handleInputClick() {\n      this.$emit('click');\n    },\n  },\n  render() {\n    const {\n      prefixCls,\n      disabled,\n      readOnly,\n      useTouch,\n      autoComplete,\n      upHandler,\n      downHandler,\n    } = this.$props;\n    const classes = classNames({\n      [prefixCls]: true,\n      [`${prefixCls}-disabled`]: disabled,\n      [`${prefixCls}-focused`]: this.focused,\n    });\n    let upDisabledClass = '';\n    let downDisabledClass = '';\n    const { sValue } = this;\n    if (sValue || sValue === 0) {\n      if (!isNaN(sValue)) {\n        const val = Number(sValue);\n        if (val >= this.max) {\n          upDisabledClass = `${prefixCls}-handler-up-disabled`;\n        }\n        if (val <= this.min) {\n          downDisabledClass = `${prefixCls}-handler-down-disabled`;\n        }\n      } else {\n        upDisabledClass = `${prefixCls}-handler-up-disabled`;\n        downDisabledClass = `${prefixCls}-handler-down-disabled`;\n      }\n    }\n\n    const editable = !this.readOnly && !this.disabled;\n\n    // focus state, show input value\n    // unfocus state, show valid value\n    const inputDisplayValue = this.getInputDisplayValue();\n\n    let upEvents;", "domain": "javascript", "lang": "code", "char_count": 20011, "word_count": 4071, "byte_count": 20013}
{"text": "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar isArray_1 = require(\"../util/isArray\");\nvar combineLatest_1 = require(\"../observable/combineLatest\");\nvar from_1 = require(\"../observable/from\");\nvar none = {};\nfunction combineLatest() {\n    var observables = [];\n    for (var _i = 0; _i < arguments.length; _i++) {\n        observables[_i] = arguments[_i];\n    }\n    var project = null;\n    if (typeof observables[observables.length - 1] === 'function') {\n        project = observables.pop();\n    }\n    if (observables.length === 1 && isArray_1.isArray(observables[0])) {\n        observables = observables[0].slice();\n    }\n    return function (source) { return source.lift.call(from_1.from([source].concat(observables)), new combineLatest_1.CombineLatestOperator(project)); };\n}\nexports.combineLatest = combineLatest;\n//# sourceMappingURL=combineLatest.js.map", "domain": "javascript", "lang": "code", "char_count": 891, "word_count": 209, "byte_count": 891}
{"text": "import Ember from \"ember-metal/core\";\nimport DOMHelper from \"dom-helper\";\nimport o_create from 'ember-metal/platform/create';\n\nvar HTMLBarsAttrMorph = DOMHelper.prototype.AttrMorphClass;\n\nexport var styleWarning = '' +\n  'Binding style attributes may introduce cross-site scripting vulnerabilities; ' +\n  'please ensure that values being bound are properly escaped. For more information, ' +\n  'including how to disable this warning, see ' +\n  'http://emberjs.com/deprecations/v1.x/#toc_binding-style-attributes.';\n\nfunction EmberAttrMorph(element, attrName, domHelper, namespace) {\n  HTMLBarsAttrMorph.call(this, element, attrName, domHelper, namespace);\n}\n\nvar proto = EmberAttrMorph.prototype = o_create(HTMLBarsAttrMorph.prototype);\nproto.HTMLBarsAttrMorph$setContent = HTMLBarsAttrMorph.prototype.setContent;\n\nproto._deprecateEscapedStyle = function EmberAttrMorph_deprecateEscapedStyle(value) {\n  Ember.warn(\n    styleWarning,\n    (function(name, value, escaped) {\n      // SafeString\n      if (value && value.toHTML) {\n        return true;\n      }\n\n      if (name !== 'style') {\n        return true;\n      }\n\n      return !escaped;\n    }(this.attrName, value, this.escaped))\n  );\n};\n\nproto.setContent = function EmberAttrMorph_setContent(value) {\n  this._deprecateEscapedStyle(value);\n  this.HTMLBarsAttrMorph$setContent(value);\n};\n\nexport default EmberAttrMorph;", "domain": "javascript", "lang": "code", "char_count": 1370, "word_count": 236, "byte_count": 1370}
{"text": "import * as _        from './utils/utils';\nimport {version}     from '../../package';\nimport {parseToHSVA} from './utils/color';\nimport {HSVaColor}   from './utils/hsvacolor';\nimport Moveable      from './libs/moveable';\nimport Selectable    from './libs/selectable';\nimport Nanopop       from './libs/nanopop';\nimport buildPickr    from './template';\n\nclass Pickr {\n\n    // Expose pickr utils\n    static utils = _;\n\n    // Expose libraries for easier integration in things build on top of it\n    static libs = {\n        HSVaColor,\n        Moveable,\n        Nanopop,\n        Selectable\n    };\n\n    // Assign version and export\n    static version = version;\n\n    // Default strings\n    static I18N_DEFAULTS = {\n\n        // Strings visible in the UI\n        'ui:dialog': 'color picker dialog',\n        'btn:toggle': 'toggle color picker dialog',\n        'btn:swatch': 'color swatch',\n        'btn:last-color': 'use previous color',\n        'btn:save': 'Save',\n        'btn:cancel': 'Cancel',\n        'btn:clear': 'Clear',\n\n        // Strings used for aria-labels\n        'aria:btn:save': 'save and close',\n        'aria:btn:cancel': 'cancel and close',\n        'aria:btn:clear': 'clear and close',\n        'aria:input': 'color input field',\n        'aria:palette': 'color selection area',\n        'aria:hue': 'hue selection slider',\n        'aria:opacity': 'selection slider'\n    };\n\n    // Will be used to prevent specific actions during initilization\n    _initializingActive = true;\n\n    // If the current color value should be recalculated\n    _recalc = true;\n\n    // Positioning engine and DOM-Tree\n    _nanopop = null;\n    _root = null;\n\n    // Current and last color for comparison\n    _color = HSVaColor();\n    _lastColor = HSVaColor();\n    _swatchColors = [];\n\n    // Evenlistener name: [callbacks]\n    _eventListener = {\n        init: [],\n        save: [],\n        hide: [],\n        show: [],\n        clear: [],\n        change: [],\n        changestop: [],\n        cancel: [],\n        swatchselect: []\n    };\n\n    constructor(opt) {\n\n        // Assign default values\n        this.options = opt = Object.assign({\n            appClass: null,\n            theme: 'classic',\n            useAsButton: false,\n            padding: 8,\n            disabled: false,\n            comparison: true,\n            closeOnScroll: false,\n            outputPrecision: 0,\n            lockOpacity: false,\n            autoReposition: true,\n            container: 'body',\n            document,\n            elementInstance: Element,\n\n            components: {\n                interaction: {}\n            },\n\n            i18n: {},\n            swatches: null,\n            inline: false,\n            sliders: null,\n\n            default: '#42445a',\n            defaultRepresentation: null,\n            position: 'bottom-middle',\n            adjustableNumbers: true,\n            showAlways: false,\n\n            closeWithKey: 'Escape'\n        }, opt);\n\n        const {swatches, components, theme, sliders, lockOpacity, padding} = opt;\n\n        if (['nano', 'monolith'].includes(theme) && !sliders) {\n            opt.sliders = 'h';\n        }\n\n        // Check interaction section\n        if (!components.interaction) {\n            components.interaction = {};\n        }\n\n        // Overwrite palette if preview, opacity or hue are true\n        const {preview, opacity, hue, palette} = components;\n        components.opacity = (!lockOpacity && opacity);\n        components.palette = palette || preview || opacity || hue;\n\n        // Initialize picker\n        this._preBuild();\n        this._buildComponents();\n        this._bindEvents();\n        this._finalBuild();\n\n        // Append pre-defined swatch colors\n        if (swatches && swatches.length) {\n            swatches.forEach(color => this.addSwatch(color));\n        }\n\n        // Initialize positioning engine\n        const {button, app} = this._root;\n        this._nanopop = Nanopop({\n            reference: button,\n            padding,\n            el: app\n        });\n\n        // Initialize accessibility\n        button.setAttribute('role', 'button');\n        button.setAttribute('aria-label', this._t('btn:toggle'));\n\n        // Initilization is finish, pickr is visible and ready for usage\n        const that = this;\n        requestAnimationFrame((function cb() {\n\n            if (!app.offsetWidth && app.parentElement !== opt.container) {\n                return requestAnimationFrame(cb);\n            }\n\n            // Apply default color\n            that.setColor(opt.default);\n            that._rePositioningPicker();\n\n            // Initialize color representation\n            if (opt.defaultRepresentation) {\n                that._representation = opt.defaultRepresentation;\n                that.setColorRepresentation(that._representation);\n            }\n\n            // Show pickr if locked\n            if (opt.showAlways) {\n                that.show();\n            }\n\n            // Initialization is done - pickr is usable, fire init event\n            that._initializingActive = false;\n            that._emit('init');\n        }));\n    }\n\n    // Create instance via method\n    static create = options => new Pickr(options);\n\n    // Does only the absolutly basic thing to initialize the components\n    _preBuild() {\n        const {options} = this;\n\n        // Resolve elements\n        for (const type of ['el', 'container']) {\n            options[type] = _.resolveElement(options[type],options.document, options.elementInstance);\n        }\n\n        // Create element and append it to body to\n        // Prevent initialization errors\n        this._root = buildPickr(this);\n\n        // Check if a custom button is used\n        if (options.useAsButton) {\n            this._root.button = options.el; // Replace button with customized button\n        }\n\n        options.container.appendChild(this._root.root);\n    }\n\n    _finalBuild() {\n        const opt = this.options;\n        const root = this._root;\n\n        // Remove from body\n        opt.container.removeChild(root.root);\n\n        if (opt.inline) {\n            const parent = opt.el.parentElement;\n\n            if (opt.el.nextSibling) {\n                parent.insertBefore(root.app, opt.el.nextSibling);\n            } else {\n                parent.appendChild(root.app);\n            }\n        } else {\n            opt.container.appendChild(root.app);\n        }\n\n        // Don't replace the the element if a custom button is used\n        if (!opt.useAsButton) {\n            // Replace element with actual color-picker\n            opt.el.parentNode.replaceChild(root.root, opt.el);\n        } else if (opt.inline) {\n            opt.el.remove();\n        }\n\n        // Check if it should be immediatly disabled\n        if (opt.disabled) {\n            this.disable();\n        }\n\n        // Check if color comparison is disabled, if yes - remove transitions so everything keeps smoothly\n        if (!opt.comparison) {\n            root.button.style.transition = 'none';\n\n            if (!opt.useAsButton) {\n                root.preview.lastColor.style.transition = 'none';\n            }\n        }\n\n        this.hide();\n    }\n\n    _buildComponents() {\n\n        // Instance reference\n        const inst = this;\n        const cs = this.options.components;\n        const sliders = (inst.options.sliders || 'v').repeat(2);\n        const [so, sh] = sliders.match(/^[vh]+$/g) ? sliders : [];\n\n        // Re-assign if null\n        const getColor = () =>\n            this._color || (this._color = this._lastColor.clone());\n\n        const components = {\n\n            palette: Moveable({\n                element: inst._root.palette.picker,\n                wrapper: inst._root.palette.palette,\n                document: this.options.document,\n                onstop: () => inst._emit('changestop', inst),\n                onchange(x, y) {\n                    if (!cs.palette) {\n                        return;\n                    }\n\n                    const color = getColor();\n                    const {_root, options} = inst;\n                    const {lastColor, currentColor} = _root.preview;\n\n                    // Update the input field only if the user is currently not typing\n                    if (inst._recalc) {\n\n                        // Calculate saturation based on the position\n                        color.s = x * 100;\n\n                        // Calculate the value\n                        color.v = 100 - y * 100;\n\n                        // Prevent falling under zero\n                        color.v < 0 ? color.v = 0 : 0;\n                        inst._updateOutput();\n                    }\n\n                    // Set picker and gradient color\n                    const cssRGBaString = color.toRGBA().toString(0);\n                    this.element.style.background = cssRGBaString;\n                    this.wrapper.style.background = `\n                        linear-gradient(to top, rgba(0, 0, 0, ${color.a}), transparent),\n                        linear-gradient(to left, hsla(${color.h}, 100%, 50%, ${color.a}), rgba(255, 255, 255, ${color.a}))\n                    `;\n\n                    // Check if color is locked\n                    if (!options.comparison) {\n                        _root.button.style.color = cssRGBaString;\n\n                        // If the user changes the color, remove the cleared icon\n                        _root.button.classList.remove('clear');\n                    } else if (!options.useAsButton && !inst._lastColor) {\n\n                        // Apply color to both the last and current color since the current state is cleared\n                        lastColor.style.color = cssRGBaString;\n                    }\n\n                    // Check if there's a swatch which color matches the current one\n                    const hexa = color.toHEXA().toString();\n                    for (const {el, color} of inst._swatchColors) {\n                        el.classList[hexa === color.toHEXA().toString() ? 'add' : 'remove']('pcr-active');\n                    }\n\n                    // Change current color\n                    currentColor.style.color = cssRGBaString;\n                }\n            }),\n\n            hue: Moveable({\n                lock: sh === 'v' ? 'h' : 'v',\n                element: inst._root.hue.picker,\n                wrapper: inst._root.hue.slider,\n                document: this.options.document,\n\n                onstop: () => inst._emit('changestop', inst),\n                onchange(v) {\n                    if (!cs.hue || !cs.palette) {\n                        return;\n                    }\n\n                    const color = getColor();\n\n                    // Calculate hue\n                    if (inst._recalc) {\n                        color.h = v * 360;\n                    }\n\n                    // Update color\n                    this.element.style.backgroundColor = `hsl(${color.h}, 100%, 50%)`;\n                    components.palette.trigger();\n                }\n            }),\n\n            opacity: Moveable({\n                lock: so === 'v' ? 'h' : 'v',\n                element: inst._root.opacity.picker,\n                wrapper: inst._root.opacity.slider,\n                document: this.options.document,\n\n                onstop: () => inst._emit('changestop', inst),\n                onchange(v) {\n                    if (!cs.opacity || !cs.palette) {\n                        return;\n                    }\n\n                    const color = getColor();\n\n                    // Calculate opacity\n                    if (inst._recalc) {\n                        color.a = Math.round(v * 1e2) / 100;\n                    }\n\n                    // Update color\n                    this.element.style.background = `rgba(0, 0, 0, ${color.a})`;\n                    components.palette.trigger();\n                }\n            }),\n\n            selectable: Selectable({\n                elements: inst._root.interaction.options,\n                className: 'active',\n\n                onchange(e) {\n                    inst._representation = e.target.getAttribute('data-type').toUpperCase();\n                    inst._recalc && inst._updateOutput();\n                }\n            })\n        };\n\n        this._components = components;\n    }\n\n    _bindEvents() {\n        const {_root, options} = this;\n\n        const eventBindings = [\n\n            // Clear color\n            _.on(_root.interaction.clear, 'click', () => this._clearColor()),\n\n            // Select last color on click\n            _.on([\n                _root.interaction.cancel,\n                _root.preview.lastColor\n            ], 'click', () => {\n                this._emit('cancel', this);\n                this.setHSVA(...(this._lastColor || this._color).toHSVA(), true);\n            }),\n\n            // Save color\n            _.on(_root.interaction.save, 'click', () => {\n                !this.applyColor() && !options.showAlways && this.hide();\n            }),\n\n            // User input\n            _.on(_root.interaction.result, ['keyup', 'input'], e => {\n\n                // Fire listener if initialization is finish and changed color was valid\n                if (this.setColor(e.target.value, true) && !this._initializingActive) {\n                    this._emit('change', this._color);\n                }\n\n                e.stopImmediatePropagation();\n            }),\n\n            // Detect user input and disable auto-recalculation\n            _.on(_root.interaction.result, ['focus', 'blur'], e => {\n                this._recalc = e.type === 'blur';\n                this._recalc && this._updateOutput();\n            }),\n\n            // Cancel input detection on color change\n            _.on([\n                _root.palette.palette,\n                _root.palette.picker,\n                _root.hue.slider,\n                _root.hue.picker,\n                _root.opacity.slider,\n                _root.opacity.picker\n            ], ['mousedown', 'touchstart'], () => this._recalc = true)\n        ];\n\n        // Provide hiding / showing abilities only if showAlways is false\n        if (!options.showAlways) {\n            const ck = options.closeWithKey;\n\n            eventBindings.push(\n                // Save and hide / show picker\n                _.on(_root.button, 'click', () => this.isOpen() ? this.hide() : this.show()),\n\n                // Close with escape key\n                _.on(this.options.document, 'keyup', e => this.isOpen() && (e.key === ck || e.code === ck) && this.hide()),\n\n                // Cancel selecting if the user taps behind the color picker\n                _.on(this.options.document, ['touchstart', 'mousedown'], e => {\n                    if (this.isOpen() && !_.eventPath(e, this.options.document).some(el => el === _root.app || el === _root.button)) {\n                        this.hide();\n                    }\n                }, {capture: true})\n            );\n        }\n\n        // Make input adjustable if enabled\n        if (options.adjustableNumbers) {\n            const ranges = {\n                rgba: [255, 255, 255, 1],\n                hsva: [360, 100, 100, 1],\n                hsla: [360, 100, 100, 1],\n                cmyk: [100, 100, 100, 100]\n            };\n\n            _.adjustableInputNumbers(_root.interaction.result, (o, step, index) => {\n                const range = ranges[this.getColorRepresentation().toLowerCase()];\n\n                if (range) {\n                    const max = range[index];\n\n                    // Calculate next reasonable number\n                    const nv = o + (max >= 100 ? step * 1000 : step);\n\n                    // Apply range of zero up to max, fix floating-point issues\n                    return nv <= 0 ? 0 : Number((nv < max ? nv : max).toPrecision(3));\n                }\n\n                return o;\n            });\n        }\n\n        if (options.autoReposition && !options.inline) {\n            let timeout = null;\n            const that = this;\n\n            // Re-calc position on window resize, scroll and wheel\n            eventBindings.push(\n                _.on(window, ['scroll', 'resize'], () => {\n                    if (that.isOpen()) {\n\n                        if (options.closeOnScroll) {\n                            that.hide();\n                        }\n\n                        if (timeout === null) {\n                            timeout = setTimeout(() => timeout = null, 100);\n\n                            // Update position on every frame\n                            requestAnimationFrame(function rs() {\n                                that._rePositioningPicker();\n                                (timeout !== null) && requestAnimationFrame(rs);\n                            });\n                        } else {\n                            clearTimeout(timeout);\n                            timeout = setTimeout(() => timeout = null, 100);\n                        }\n                    }\n                }, {capture: true})\n            );\n        }\n\n        // Save bindings\n        this._eventBindings = eventBindings;\n    }\n\n    _rePositioningPicker() {\n        const {options} = this;\n\n        // No repositioning needed if inline\n        if (!options.inline) {\n            this._nanopop.update(options.position, !this._recalc);\n        }\n    }\n\n    _updateOutput() {\n        const {_root, _color, options} = this;\n\n        // Check if component is present\n        if (_root.interaction.type()) {\n\n            // Construct function name and call if present\n            const method = `to${_root.interaction.type().getAttribute('data-type')}`;\n            _root.interaction.result.value = typeof _color[method] === 'function' ?\n                _color[method]().toString(options.outputPrecision) : '';\n        }\n\n        // Fire listener if initialization is finish\n        if (!this._initializingActive && this._recalc) {\n            this._emit('change', _color);\n        }\n    }\n\n    _clearColor(silent = false) {\n        const {_root, options} = this;\n\n        // Change only the button color if it isn't customized\n        if (!options.useAsButton) {\n            _root.button.style.color = 'rgba(0, 0, 0, 0.15)';\n        }\n\n        _root.button.classList.add('clear');\n\n        if (!options.showAlways) {\n            this.hide();\n        }\n\n        this._lastColor = null;\n        if (!this._initializingActive && !silent) {\n\n            // Fire listener\n            this._emit('save', null);\n            this._emit('clear', this);\n        }\n    }\n\n    _parseLocalColor(str) {\n        const {values, type, a} = parseToHSVA(str);\n        const {lockOpacity} = this.options;\n        const alphaMakesAChange = a !== undefined && a !== 1;\n\n        // If no opacity is applied, add undefined at the very end which gets\n        // Set to 1 in setHSVA\n        if (values && values.length === 3) {\n            values[3] = undefined;\n        }\n\n        return {\n            values: (!values || (lockOpacity && alphaMakesAChange)) ? null : values,\n            type\n        };\n    }\n\n    _emit(event, ...args) {\n        this._eventListener[event].forEach(cb => cb(...args, this));\n    }\n\n    _t(key) {\n        return this.options.i18n[key] || Pickr.I18N_DEFAULTS[key];\n    }\n\n    on(event, cb) {\n\n        // Validate\n        if (typeof cb === 'function' && typeof event === 'string' && event in this._eventListener) {\n            this._eventListener[event].push(cb);\n        }\n\n        return this;\n    }\n\n    off(event, cb) {\n        const callBacks = this._eventListener[event];\n\n        if (callBacks) {\n            const index = callBacks.indexOf(cb);\n\n            if (~index) {\n                callBacks.splice(index, 1);\n            }\n        }\n\n        return this;\n    }\n\n    /**\n     * Appends a color to the swatch palette\n     * @param color\n     * @returns {boolean}\n     */\n    addSwatch(color) {\n        const {values} = this._parseLocalColor(color);\n\n        if (values) {\n            const {_swatchColors, _root} = this;\n            const color = HSVaColor(...values);\n\n            // Create new swatch HTMLElement\n            const el = _.createElementFromString(", "domain": "javascript", "lang": "code", "char_count": 20016, "word_count": 3756, "byte_count": 20016}
{"text": "\ufeff/*global angular*/\n(function () {\n    'use strict';\n\n    angular\n        .module('giccoAdmin.pricing', [])\n        .config(['$stateProvider',\n            function ($stateProvider) {\n                $stateProvider\n                    .state('app.promotions', {\n                        url: \"/promotions\",\n                        abstract: true,\n                        template: '<ui-view></ui-view>',\n                        ncyBreadcrumb: {\n                            label: 'Promotion'\n                        }\n                    })\n                    .state('app.promotions.cart-rules', {\n                        url: '/cart-rules',\n                        templateUrl: 'modules/pricing/admin/cart-rule/cart-rule-list.html',\n                        controller: 'CartRuleListCtrl as vm',\n                        ncyBreadcrumb: {\n                            label: '{{ ::vm.translate.get(\"Cart Price Rules\")}}'\n                        }\n                    })\n                    .state('app.promotions.cart-rule-create', {\n                        url: '/cart-rule/create',\n                        templateUrl: 'modules/pricing/admin/cart-rule/cart-rule-form.html',\n                        controller: 'CartRuleFormCtrl as vm',\n                        ncyBreadcrumb: {\n                            label: '{{ ::vm.translate.get(\"Create Cart Price Rule\")}}'\n                        }\n                    })\n                    .state('app.promotions.cart-rule-edit', {\n                        url: '/cart-rule/edit/:id',\n                        templateUrl: 'modules/pricing/admin/cart-rule/cart-rule-form.html',\n                        controller: 'CartRuleFormCtrl as vm',\n                        ncyBreadcrumb: {\n                            label: '{{ ::vm.translate.get(\"Edit Cart Price Rule\")}}'\n                        }\n                    })\n                    .state('app.promotions.cart-rule-usages', {\n                        url: '/cart-rule-usages',\n                        templateUrl: 'modules/pricing/admin/cart-rule-usage/cart-rule-usage-list.html',\n                        controller: 'CartRuleUsageListCtrl as vm',\n                        ncyBreadcrumb: {\n                            label: '{{ ::vm.translate.get(\"Usages Cart Price Rule\")}}'\n                        }\n                    });\n            }\n        ]);\n})();", "domain": "javascript", "lang": "code", "char_count": 2348, "word_count": 281, "byte_count": 2350}
{"text": "'use strict';\n\nvar assert = require('assert');\nvar http = require('http');\nvar querystring = require('querystring');\nvar urlutil = require('url');\nvar pedding = require('pedding');\nvar fs = require('fs');\nvar path = require('path');\nvar formstream = require('formstream');\nvar coffee = require('coffee');\nvar tar = require('tar');\nvar zlib = require('zlib');\nvar os = require('os');\nvar through = require('through2');\nvar Stream = require('stream');\nvar muk = require('muk'); // muk support more node versions than mm\nvar dns = require('dns');\nvar server = require('./fixtures/server');\nvar config = require('./config');\nvar urllib = require('../');\n\ndescribe('test/urllib.test.js', function () {\n  var host = 'http://127.0.0.1:';\n  var port = null;\n\n  before(function (done) {\n    server.listen(0, function () {\n      port = server.address().port;\n      host += port;\n      done();\n    });\n  });\n\n  afterEach(muk.restore);\n\n  after(function (done) {\n    setTimeout(function () {\n      server.close();\n      done();\n    }, 1000);\n  });\n\n  it('should assert exports', function() {\n    assert(urllib.USER_AGENT);\n    assert(urllib.agent);\n    assert(urllib.httpsAgent);\n    assert(urllib.TIMEOUT);\n    assert(urllib.TIMEOUTS);\n    assert(urllib.request);\n    assert(urllib.requestWithCallback);\n    assert(urllib.curl);\n    assert(urllib.requestThunk);\n    assert(urllib.HttpClient);\n    assert(urllib.HttpClient2);\n    assert(urllib.create);\n  });\n\n  it('should_mocked_http_service_works_fine', function (done) {\n    urllib.request(host + '/?a=12&code=200', function (error, data, res) {\n      assert(!error);\n      assert(data instanceof Buffer);\n      assert(res.statusCode === 200);\n      assert(res.statusMessage === 'OK');\n      done();\n    });\n  });\n\n  describe('requestThunk()', function() {\n    it('should mock request error', function(done) {\n      urllib.requestThunk('localhost-mock-error:' + (port + 101))(function(err) {\n        assert(err);\n        done();\n      });\n    });\n  });\n\n  describe('request()', function () {\n    it('should request(host-only) work', function(done) {\n      urllib.request('127.0.0.1:' + port, function(err, data, res) {\n        assert(!err);\n        assert(data instanceof Buffer);\n        assert(res.statusCode === 200);\n        done();\n      });\n    });\n\n    it('should request(undefined) thrown', function() {\n      assert.throws(function () {\n        urllib.requestWithCallback(undefined, function() {});\n      }, /expect request url to be a string or a http request options, but got undefined/);\n    });\n\n    it('should request(1) thrown', function() {\n      assert.throws(function () {\n        urllib.requestWithCallback(1, function() {});\n      }, /expect request url to be a string or a http request options, but got 1/);\n    });\n\n    it('should request(localhost:port) work', function(done) {\n      urllib.requestWithCallback('localhost:' + port, function(err, data, res) {\n        assert(!err);\n        assert(data instanceof Buffer);\n        assert(res.statusCode === 200);\n        done();\n      });\n    });\n\n    it('should request https success', function (done) {\n      var headers = {};\n      urllib.request(config.npmRegistry + '/pedding/latest', {\n        timeout: 25000,\n        headers: headers,\n      },\n      function (err, data, res) {\n        assert(!err);\n        assert(Buffer.isBuffer(data));\n        assert(res.statusCode === 200);\n        assert(res.statusMessage === 'OK');\n        // don't touch headers\n        assert.deepEqual(headers, {});\n        done();\n      });\n    });\n\n    it('should request https with port success', function (done) {\n      urllib.request(config.npmRegistry + ':443/pedding/latest', {\n        timeout: 25000,\n      },\n      function (err, data, res) {\n        assert(!err);\n        assert(Buffer.isBuffer(data));\n        assert(res.statusCode === 200);\n        done();\n      });\n    });\n\n    it('should request https with rejectUnauthorized:false success', function (done) {\n      urllib.request(config.npmRegistry + '/pedding/latest', {\n        timeout: 25000,\n        rejectUnauthorized: false,\n      },\n      function (err, data, res) {\n        assert(!err);\n        assert(Buffer.isBuffer(data));\n        assert(res.statusCode === 200);\n        done();\n      });\n    });\n\n    it('should request https disable httpsAgent work', function (done) {\n      done = pedding(2, done);\n      urllib.request(config.npmRegistry + '/pedding/latest', {\n        httpsAgent: false,\n        timeout: 25000,\n      },\n      function (err, data, res) {\n        assert(!err);\n        assert(Buffer.isBuffer(data));\n        assert(res.statusCode === 200);\n        done();\n      });\n\n      urllib.request(config.npmRegistry + '/pedding/latest', {\n        agent: false,\n        timeout: 25000,\n      },\n      function (err, data, res) {\n        assert(!err);\n        assert(Buffer.isBuffer(data));\n        assert(res.statusCode === 200);\n        done();\n      });\n    });\n\n    it('should include res.data', function (done) {\n      urllib.request(config.npmRegistry + '/pedding/latest', {timeout: 25000},\n      function (err, data, res) {\n        assert(!err);\n        assert(Buffer.isBuffer(data));\n        assert(res.statusCode === 200);\n        assert(data === res.data);\n        done();\n      });\n    });\n\n    it('should alias curl() work', function (done) {\n      urllib.curl(config.npmRegistry + '/pedding/1.0.0', {timeout: 25000},\n      function (err, data, res) {\n        assert(!err);\n        assert(Buffer.isBuffer(data));\n        console.log(res.headers);\n        assert(res.statusCode === 200);\n        done();\n      });\n    });\n\n    it('should 301', function (done) {\n      urllib.request(host + '/301', function (err, data, res) {\n        assert(res.statusCode === 301);\n        assert(data.toString() === 'I am 301 body');\n        done();\n      });\n    });\n\n    it('should 302', function (done) {\n      urllib.request(host + '/302', {followRedirect: false}, function (err, data, res) {\n        assert(res.statusCode === 302);\n        assert(res.headers.location === '/204');\n        done();\n      });\n    });\n\n    it('should redirect from 302 to 204', function (done) {\n      urllib.request(host + '/302', {followRedirect: true}, function (err, data, res) {\n        assert(!err);\n        assert(res.statusCode === 204);\n        done();\n      });\n    });\n\n    it('should redirect from 307 to 204', function (done) {\n      urllib.request(host + '/307', {followRedirect: true}, function (err, data, res) {\n        assert(!err);\n        assert(res.statusCode === 204);\n        done();\n      });\n    });\n\n    it('should redirect from 303 to 204', function (done) {\n      urllib.request(host + '/303', {followRedirect: true}, function (err, data, res) {\n        assert(!err);\n        assert(res.statusCode === 204);\n        done();\n      });\n    });\n\n    it('should redirect to a full url and clean up the Host header', function (done) {\n      var hostname = urlutil.parse(config.npmRegistry).hostname;\n      urllib.request(config.npmRegistry + '/pedding/-/pedding-1.0.0.tgz', {\n        followRedirect: true,\n        timeout: 30000,\n        headers: {\n          Host: hostname,\n        }\n      }, function (err, data, res) {\n        assert(!err);\n        assert(res.statusCode === 200);\n        // size should be 2107\n        assert(res.size === 2107);\n        done();\n      });\n    });\n\n    it('should omit any header that is explicitly set to null', function (done) {\n      urllib.request(host + '/headers', {\n        headers: {\n          DNT: null\n        },\n        dataType: 'json'\n      }, function(err, data, res) {\n        assert(!err);\n        assert(res.statusCode === 200);\n        assert(!data.dnt);\n        assert(!data.DNT);\n        done();\n      });\n    });\n\n    it('should omit accept-encoding header that is explicitly set to null even if option gzip is set to true', function (done) {\n      urllib.request(host + '/headers', {\n        headers: {\n          'Accept-Encoding': null\n        },\n        gzip: true,\n        dataType: 'json'\n      }, function(err, data, res) {\n        assert(!err);\n        assert(res.statusCode === 200);\n        assert(!data['accept-encoding']);\n        assert(!data['Accept-Encoding']);\n        done();\n      });\n    });\n\n    if (process.platform !== 'win32') {\n      it('should redirect with writeStream and make sure res resume', function (done) {\n        coffee.fork(path.join(__dirname, 'redirect.js'))\n        .expect('stdout', '404')\n        .expect('code', 0)\n        .end(done);\n      });\n    }\n\n    it('should FollowRedirectError', function (done) {\n      urllib.request(host + '/redirect_no_location', {followRedirect: true}, function (err, data) {\n        assert(err);\n        assert(err.name === 'FollowRedirectError');\n        assert(err.message.indexOf('Got statusCode 302 but cannot resolve next location from headers, GET http://127.0.0.1:') >= 0);\n        assert(data.toString() === 'I am 302 body');\n        done();\n      });\n    });\n\n    it('should MaxRedirectError', function (done) {\n      urllib.request(host + '/loop_redirect', {followRedirect: true}, function (err, data) {\n        assert(err);\n        assert(err.name === 'MaxRedirectError');\n        assert(err.message.indexOf('Exceeded maxRedirects. Probably stuck in a redirect loop ') >= 0);\n        assert(data.toString() === 'Redirect to /loop_redirect');\n        done();\n      });\n    });\n\n    describe('ConnectionTimeoutError and ResponseTimeoutError', function () {\n      it('should connection timeout', function (done) {\n        urllib.request('http://npm.taobao.org', { timeout: 1 }, function (err, data, res) {\n          assert(err);\n          assert(err.name === 'ConnectionTimeoutError');\n          assert(err.message.match(/^Connect timeout for 1ms\\, GET http/));\n          assert(typeof err.requestId === 'number');\n          assert(err.status === -2);\n          assert(!data);\n          assert(res);\n          assert(res.status === -2);\n          done();\n        });\n      });\n\n      it('should response timeout', function (done) {\n        urllib.request(host + '/response_timeout', { timeout: 450 }, function (err, data, res) {\n          assert(err);\n          assert(err.name === 'ResponseTimeoutError');\n          assert(err.message.match(/^Response timeout for 450ms\\, GET http/));\n          assert(typeof err.requestId === 'number');\n          assert(data);\n          assert(data.toString() === 'foo');\n          assert(res);\n          assert(res.statusCode === 200);\n          done();\n        });\n      });\n\n      it('can pass two timeout seperately and get connect error', function (done) {\n        urllib.request('http://npm.taobao.net', { timeout: [1, 10000] }, function (err, data, res) {\n          assert(err);\n          assert(err.name === 'ConnectionTimeoutError');\n          assert(err.message.match(/^Connect timeout for 1ms\\, GET http/));\n          assert(typeof err.requestId === 'number');\n          assert(!data);\n          assert(res);\n          done();\n        });\n      });\n\n      it('can pass two timeout seperately and get response error', function(done) {\n        urllib.request(host + '/response_timeout', { timeout: [1000, 450] }, function (err, data, res) {\n          assert(err);\n          assert(err.name === 'ResponseTimeoutError');\n          assert(err.message.match(/^Response timeout for 450ms\\, GET http/));\n          assert(typeof err.requestId === 'number');\n          assert(data);\n          assert(data.toString() === 'foo');\n          assert(res);\n          assert(res.statusCode === 200);\n          done();\n        });\n      });\n    });\n\n    it('should socket hang up by res.socket.destroy() before `response` event emit', function (done) {\n      urllib.request(host + '/error', function (err, data, res) {\n        assert(err);\n        assert(err.name === 'ResponseError');\n        assert(err.stack.indexOf('socket hang up') >= 0);\n        assert(err.code === 'ECONNRESET');\n        assert(!data);\n        assert(res);\n        done();\n      });\n    });\n\n    it('should socket hang up by req.abort() before `response` event emit', function (done) {\n      var req = urllib.request(host + '/timeout', {timeout: 500}, function (err, data, res) {\n        assert(err);\n        assert(err.stack.indexOf('socket hang up') >= 0);\n        assert(err.code === 'ECONNRESET');\n        assert(!data);\n        assert(res);\n        done();\n      });\n      setTimeout(function () {\n        req.abort();\n      }, 1);\n    });\n\n    it('should handle server socket end(\"balabal\") will error', function (done) {\n      urllib.request(host + '/socket.end.error', function (err, data) {\n        assert(err);\n        assert(err.name === 'ResponseError');\n        err.code && assert(err.code === 'HPE_INVALID_CHUNK_SIZE');\n        assert(err.message.indexOf('Parse Error, GET http://127.0.0.1:') >= 0);\n        assert(err.bytesParsed === 2);\n        assert(!data);\n        done();\n      });\n    });\n\n    it('should get data', function (done) {\n      var params = {\n        type: 'get',\n        data: {\n          sql: 'SELECT * from table',\n          data: '\u5475\u5475',\n        }\n      };\n      urllib.request(host + '/get', params, function (err, data, res) {\n        assert(!err);\n        assert(res.statusCode === 200);\n        var info = urlutil.parse(data.toString(), true);\n        assert(info.pathname === '/get');\n        assert(info.query.sql === params.data.sql);\n        assert(info.query.data === params.data.data);\n        done();\n      });\n    });\n\n    it('should get data with options', function (done) {\n      var params = {\n        data: {\n          sql: 'SELECT * from table',\n          data: '\u5475\u5475',\n        }\n      };\n      var options = {\n        path: '/get',\n        port: port,\n      };\n      urllib.request(options, params, function (err, data, res) {\n        assert(!err);\n        assert(res.statusCode === 200);\n        var info = urlutil.parse(data.toString(), true);\n        assert(info.pathname === '/get');\n        assert(info.query.sql === params.data.sql);\n        assert(info.query.data === params.data.data);\n        done();\n      });\n    });\n\n    it('should get data with args.beforeRequest(options) to change query string', function (done) {\n      var params = {\n        data: {\n          sql: 'SELECT * from table',\n          data: '\u5475\u5475',\n        },\n        beforeRequest: function (options) {\n          options.path += '&foo=bar';\n        }\n      };\n      var options = {\n        path: '/get',\n        port: port,\n      };\n      urllib.request(options, params, function (err, data, res) {\n        assert(!err);\n        assert(res.statusCode === 200);\n        var info = urlutil.parse(data.toString(), true);\n        assert(info.pathname === '/get');\n        assert(info.query.sql === params.data.sql);\n        assert(info.query.data === params.data.data);\n        assert(info.query.foo === 'bar');\n        done();\n      });\n    });\n\n    it('should concat query string and data correctly when GET', function (done) {\n      urllib.request(host + '/get?that=in_path', {\n        type: 'get',\n        data: {\n          'should_not': 'be_covered',\n          'by': 'data',\n        }\n      }, function (err, data, res) {\n        assert(!err);\n        assert(res.statusCode === 200);\n        assert(data.toString() === '/get?that=in_path&should_not=be_covered&by=data');\n        done();\n      });\n    });\n\n    it('should post data with options', function (done) {\n      var params = {\n        data: {\n          sql: 'SELECT * from table',\n          data: '\u54c8\u54c8',\n        }\n      };\n      var options = {\n        path: '/post',\n        method: 'post',\n        port: port,\n      };\n      urllib.request(options, params, function (err, data, res) {\n        assert(!err);\n        assert(res.statusCode === 200);\n        data = querystring.parse(data.toString());\n        assert(data.sql === params.data.sql);\n        assert(data.data === params.data.data);\n        done();\n      });\n    });\n\n    it('should post/put/patch data and auto add \"application/x-www-form-urlencoded\" Content-Type header',\n    function (done) {\n      done = pedding(3, done);\n      var params1 = {\n        type: 'POST',\n        data: {\n          sql: 'SELECT * from table',\n          data: '\u54c8\u54c8',\n        }\n      };\n      var check = function (err, data, res) {\n        assert(!err);\n        assert(res.statusCode === 200);\n        assert(res.headers['x-request-content-type'] === 'application/x-www-form-urlencoded');\n        data = querystring.parse(data.toString());\n        assert(data.sql === params1.data.sql);\n        assert(data.data === params1.data.data);\n        done();\n      };\n\n      urllib.request(host + '/post', params1, check);\n      var params2 = {\n        type: 'put',\n        data: {\n          sql: 'SELECT * from table',\n          data: '\u54c8\u54c8',\n        }\n      };\n      urllib.request(host + '/post', params2, check);\n      var params3 = {\n        type: 'patch',\n        data: {\n          sql: 'SELECT * from table',\n          data: '\u54c8\u54c8',\n        }\n      };\n      urllib.request(host + '/post', params3, check);\n    });\n\n    it('should post data don\\'t support nested object', function (done) {\n      var params = {\n        type: 'POST',\n        data: {\n          foo: { bar: 'foo' },\n        },\n      };\n      urllib.request(host + '/post', params, function (err, data) {\n        assert(!err);\n        assert(data.toString() === 'foo=');\n        done();\n      });\n    });\n\n    it('should post data with form type support nested with nestedQuerystring', function (done) {\n      var params = {\n        type: 'POST',\n        data: {\n          foo: { bar: 'foo' },\n        },\n        nestedQuerystring: true,\n      };\n      urllib.request(host + '/post', params, function (err, data) {\n        assert(!err);\n        assert(data.toString() === 'foo%5Bbar%5D=foo');\n        done();\n      });\n    });\n\n    it('should post data with custom Content-Type \"test-foo-encode\"',\n    function (done) {\n      var params = {\n        type: 'POST',\n        data: {\n          sql: 'SELECT * from table',\n          data: '\u54c8\u54c8',\n        },\n        headers: {\n          'Content-Type': 'test-foo-encode',\n        }\n      };\n      urllib.request(host + '/post', params, function (err, data, res) {\n        assert(!err);\n        assert(res.statusCode === 200);\n        assert(res.headers['x-request-content-type'] === 'test-foo-encode');\n        data = querystring.parse(data.toString());\n        assert(data.sql === params.data.sql);\n        assert(data.data === params.data.data);\n        done();\n      });\n    });\n\n    it('should trust lower-case header keys and not covered by auto-added headers', function (done) {\n      var params = {\n        type: 'POST',\n        data: {\n          sql: 'SELECT * from table',\n          data: '\u54c8\u54c8',\n        },\n        headers: {\n          'content-type': 'test-foo-encode',\n        }\n      };\n      urllib.request(host + '/post', params, function (err, data, res) {\n        assert(!err);\n        assert(res.statusCode === 200);\n        assert(res.headers['x-request-content-type'] === 'test-foo-encode');\n        data = querystring.parse(data.toString());\n        assert(data.sql === params.data.sql);\n        assert(data.data === params.data.data);\n        done();\n      });\n    });\n\n    it('should post big data with params.content', function (done) {\n      var bigdata = new Buffer(1024 * 1024);\n      urllib.request(host + '/post', {\n        type: 'post',\n        content: bigdata,\n      }, function (err, data, res) {\n        assert(!err);\n        assert(res.statusCode === 200);\n        assert(data.length === bigdata.length);\n        done();\n      });\n    });\n\n    it('should post big data with params.data', function (done) {\n      var bigdata = new Buffer(1024 * 1024);\n      urllib.request(host + '/post', {\n        type: 'post',\n        data: bigdata,\n      }, function (err, data, res) {\n        assert(!err);\n        assert(res.statusCode === 200);\n        assert(data.length === bigdata.length);\n        done();\n      });\n    });", "domain": "javascript", "lang": "code", "char_count": 20004, "word_count": 4763, "byte_count": 20040}
{"text": "import React from \"react\";\nimport { Link } from \"react-router-dom\";\nimport { useState } from \"react\";\n\nimport \"./MainNavigation.css\";\nimport MainHeader from \"./MainHeader\";\nimport NavLinks from \"./NavLinks\";\nimport SideDrawer from \"./SideDrawer\";\nimport BackDrop from \"../UIElements/Backdrop/Backdrop\";\nconst MainNavigation = (props) => {\n  const [sideDrawerIsOpen, setSideDrawer] = useState(false);\n\n  const openDrawerHandler = () => {\n    setSideDrawer(true);\n  };\n\n  const closeDrawerHandler = () => {\n    setSideDrawer(false);\n  };\n  return (\n    <React.Fragment>\n      {sideDrawerIsOpen && <BackDrop onClick={closeDrawerHandler} />}\n      <SideDrawer show={sideDrawerIsOpen} onClick={closeDrawerHandler}>\n        <nav className=\"main-navigation__drawer-nav\">\n          <NavLinks accounts={props.accounts} />\n        </nav>\n      </SideDrawer>\n      <MainHeader>\n        <button\n          className=\"main-navigation__menu-btn\"\n          onClick={openDrawerHandler}\n        >\n          <span />\n          <span />\n          <span />\n        </button>\n        <h3 className=\"main-navigation__title\">\n          <Link to=\"/\">Registration</Link>\n        </h3>\n        <nav className=\"main-navigation__header-nav\">\n          <NavLinks accounts={props.accounts} />\n        </nav>\n      </MainHeader>\n    </React.Fragment>\n  );\n};\nexport default MainNavigation;", "domain": "javascript", "lang": "code", "char_count": 1357, "word_count": 307, "byte_count": 1357}
{"text": "\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n    if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n    return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (this && this.__metadata) || function (k, v) {\n    if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\nvar core_1 = require(\"@angular/core\");\nvar router_1 = require(\"@angular/router\");\nvar localstorage_service_1 = require(\"./Servicios/localstorage.service\");\nvar AppComponent = (function () {\n    function AppComponent(localStorageService, router) {\n        var _this = this;\n        this.localStorageService = localStorageService;\n        this.router = router;\n        this.name = 'Angular';\n        this.subscription = localStorageService.loginAnnounced$.subscribe(function (currentUser) {\n            _this.currentUser = currentUser;\n        });\n        this.roleSubscription = localStorageService.roleAnnounced$.subscribe(function (currentRole) {\n            _this.currentRole = currentRole;\n        });\n        this.subscription = localStorageService.logoutAnnounced$.subscribe(function (empty) {\n            _this.currentUser = null;\n        });\n    }\n    AppComponent.prototype.ngOnInit = function () {\n        this.logout();\n    };\n    AppComponent.prototype.logout = function () {\n        this.localStorageService.announceLogout();\n        this.router.navigate(['/login'], {});\n    };\n    return AppComponent;\n}());\nAppComponent = __decorate([\n    core_1.Component({\n        moduleId: module.id,\n        selector: 'my-app',\n        templateUrl: 'views/navbar.html'\n    }),\n    __metadata(\"design:paramtypes\", [localstorage_service_1.LocalStorageService, router_1.Router])\n], AppComponent);\nexports.AppComponent = AppComponent;\n//# sourceMappingURL=app.component.js.map", "domain": "javascript", "lang": "code", "char_count": 2237, "word_count": 493, "byte_count": 2237}
{"text": "const db = require(\"../models\");\n\nmodule.exports = {\n  findByUserID: function (req, res) {\n    db.Holdings\n      .findOne({ userId: req.user.id })\n      .then(holdings => res.json(holdings.holdings))\n      .catch(err => res.json(err));\n  },\n  updateOrCreate: function (req, res) {\n    const newHoldings = req.body;\n    db.Holdings\n      .findOneAndUpdate({ userId: req.user.id }, { \"$push\": { \"holdings\": { \"currency\": newHoldings.currency, \"base\": newHoldings.base, \"exchange\": newHoldings.exchange, \"amount\": newHoldings.amount, \"date\": Date.now() } } }, { upsert: true, new: true, })\n      .then(holdings => res.json(holdings.holdings))\n      .catch(err => res.status(422).json(err));\n  },\n  remove: function (req, res) {\n    const deleteHold = req.params[\"date\"];\n    db.Holdings\n      .findOneAndUpdate({ userId: req.user.id }, { \"$pull\": { \"holdings\": { \"date\": parseInt(deleteHold) } } }, {upsert: true, new: true,})\n      .then(holdings => res.json(holdings.holdings))\n      .catch(err => res.status(422).json(err));\n  }\n};", "domain": "javascript", "lang": "code", "char_count": 1031, "word_count": 311, "byte_count": 1031}
{"text": "import * as React from 'react';\nimport wrapIcon from '../utils/wrapIcon';\nconst rawSvg = (iconProps) => {\n    const { className, primaryFill } = iconProps;\n    return React.createElement(\"svg\", { width: 20, height: 20, viewBox: \"0 0 20 20\", xmlns: \"http://www.w3.org/2000/svg\", className: className },\n        React.createElement(\"path\", { d: \"M2 6c0-1.1.9-2 2-2h12a2 2 0 012 2v8a2 2 0 01-2 2H4a2 2 0 01-2-2V6zm6.5 6a.5.5 0 000 1h3a.5.5 0 000-1h-3z\", fill: primaryFill }));\n};\nconst Tablet20Filled = wrapIcon(rawSvg({}), 'Tablet20Filled');\nexport default Tablet20Filled;", "domain": "javascript", "lang": "code", "char_count": 570, "word_count": 135, "byte_count": 570}
{"text": "import React, {Component} from 'react';\nimport MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';\nimport FloatingActionButton from 'material-ui/FloatingActionButton';\nimport ContentAdd from 'material-ui/svg-icons/content/add';\n\n// App component - represents the whole app\nimport getMuiTheme from 'material-ui/styles/getMuiTheme';\nconst muiTheme = getMuiTheme({\n\n        palette: {\n            primary1Color: \"#149CDB\",\n            primary2Color: \"#304057\",\n            accent1Color: \"#FF8E0B\",\n            textColor: \"#424242\",\n        }\n    });\n\nexport default class AddButton extends Component {\n\n\n    render() {\n        const background={\n            backgroundColor: '#1498D5',\n            height: '50',\n            width: '50'\n        };\n\n        return (\n            <MuiThemeProvider muiTheme={muiTheme}>\n                <FloatingActionButton onClick={this.props.adding} style={background} secondary={true} className=\"floatingButton\" aria-label=\"Button to add participants or actions\">\n                    <ContentAdd/>\n                </FloatingActionButton>\n            </MuiThemeProvider>\n\n        );\n\n    }\n\n}", "domain": "javascript", "lang": "code", "char_count": 1130, "word_count": 215, "byte_count": 1130}
{"text": "import toInteger from '../_lib/toInteger/index.js'\nimport toDate from '../toDate/index.js'\n\n/**\n * @name setSeconds\n * @category Second Helpers\n * @summary Set the seconds to the given date.\n *\n * @description\n * Set the seconds to the given date.\n *\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} seconds - the seconds of the new date\n * @param {Options} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options}\n * @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate}\n * @returns {Date} the new date with the seconds set\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2\n *\n * @example\n * // Set 45 seconds to 1 September 2014 11:30:40:\n * var result = setSeconds(new Date(2014, 8, 1, 11, 30, 40), 45)\n * //=> Mon Sep 01 2014 11:30:45\n */\nexport default function setSeconds (dirtyDate, dirtySeconds, dirtyOptions) {\n  if (arguments.length < 2) {\n    throw new TypeError('2 arguments required, but only ' + arguments.length + ' present')\n  }\n\n  var date = toDate(dirtyDate, dirtyOptions)\n  var seconds = toInteger(dirtySeconds)\n  date.setSeconds(seconds)\n  return date\n}", "domain": "javascript", "lang": "code", "char_count": 1448, "word_count": 317, "byte_count": 1448}
{"text": "/**\n * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/* global Event */\n\nimport preventDefault from '../../src/bindings/preventdefault';\nimport View from '../../src/view';\n\ndescribe( 'preventDefault', () => {\n\tit( 'prevents default of a native DOM event', () => {\n\t\tconst view = new View();\n\n\t\tview.setTemplate( {\n\t\t\ttag: 'div',\n\n\t\t\ton: {\n\t\t\t\tfoo: preventDefault( view )\n\t\t\t}\n\t\t} );\n\n\t\tconst evt = new Event( 'foo', { bubbles: true } );\n\t\tconst spy = sinon.spy( evt, 'preventDefault' );\n\n\t\t// Render to enable bubbling.\n\t\tview.render();\n\n\t\tview.element.dispatchEvent( evt );\n\t\tsinon.assert.calledOnce( spy );\n\t} );\n\n\tit( 'prevents only when target is view#element', () => {\n\t\tconst view = new View();\n\t\tconst child = new View();\n\n\t\tchild.setTemplate( {\n\t\t\ttag: 'a'\n\t\t} );\n\n\t\tview.setTemplate( {\n\t\t\ttag: 'div',\n\n\t\t\ton: {\n\t\t\t\tfoo: preventDefault( view )\n\t\t\t},\n\n\t\t\tchildren: [\n\t\t\t\tchild\n\t\t\t]\n\t\t} );\n\n\t\tconst evt = new Event( 'foo', { bubbles: true } );\n\t\tconst spy = sinon.spy( evt, 'preventDefault' );\n\n\t\t// Render to enable bubbling.\n\t\tview.render();\n\n\t\tchild.element.dispatchEvent( evt );\n\t\tsinon.assert.notCalled( spy );\n\t} );\n} );", "domain": "javascript", "lang": "code", "char_count": 1258, "word_count": 317, "byte_count": 1258}
{"text": "const React = require('react')\n\nconst {\n  default: styled\n} = require('styled-components')\n\nconst BaseComponent = props => {\n  return <svg width='100%' height='100%' viewBox='0 0 16 16' preserveAspectRatio='xMidYMid meet' {...props}><rect width='100%' height='100%' id='icon-bound' fill='none' /><path d='M3,10L3,1L0,1L0,10L3,10ZM15,11C15.265,11 15.52,10.895 15.707,10.707C15.895,10.52 16,10.265 16,10C16,8.833 16,6.975 16,6.277C16,6.096 15.951,5.918 15.857,5.762C15.455,5.092 14.295,3.158 13.583,1.971C13.221,1.369 12.57,1 11.868,1C10.397,1 7.805,1 6,1C5.47,1 4.961,1.211 4.586,1.586C4.211,1.961 4,2.47 4,3C4,5.255 4,8.803 4,10.298C4,10.753 4.155,11.193 4.438,11.548C5.477,12.846 8,16 8,16C8,16 8,16 8,16C8.552,16 9,15.552 9,15L9,11L15,11Z' /></svg>\n}\n\nconst HandThumbsDown = styled(BaseComponent)`\n  display: inline-block;\n  vertical-align: ${props => props.verticalAlign || 'top'};\n  overflow: hidden;\n  width: ${props => props.width || props.size || '1em'};\n`\nmodule.exports = HandThumbsDown", "domain": "javascript", "lang": "code", "char_count": 995, "word_count": 176, "byte_count": 995}
{"text": "import { Set } from 'immutable'\n// import { render } from './d3Render'\nimport * as _ from 'lodash'\nimport $ from 'jquery'\nimport FlatCore from './flatten/core'\nimport BABYLON from 'babylonjs/babylon.max'\nimport { HexGround, HexMarker, TreeGround, UnitBase } from './flatten/entities'\nimport ClientCore from './ClientCore'\nimport { store } from './ServerStore'\nimport dat from 'dat.gui/build/dat.gui'\n\nstore.subscribe(_.debounce(function () {\n//  render(store, store.getState())\n  render(store, store.getState())\n}, 200))\n\nfunction getIdForPosition (x, y) {\n  if (y === undefined) {\n    y = x.y\n    x = x.x\n  }\n  return x + '#' + y\n}\n\nvar $output = $('#output')\nvar core = new FlatCore($output)\nvar clientCore = new ClientCore(store)\nvar renderedLand = {}\nvar renderedUnits = {}\nvar renderedMarkers = {}\nvar positionMarkersSet = Set()\n\nfunction convertPosition (position) {\n  return {\n    x: position.y % 2 === 0 ? position.x * 1.35 : (position.x * 1.35) + 0.675,\n    y: position.y * 0.389711\n  }\n}\n\nfunction render (store, state, clientState) {\n  state.map.forEach(function (land) {\n    land = land.toJS()\n    var hg = renderedLand[land.id]\n    let position = convertPosition(land.position)\n    if (!hg) {\n      hg = new HexGround(\n        core.scene,\n        new BABYLON.Vector3(\n          position.x, 0, position.y\n        )\n      )\n      hg.init()\n      hg.metadata = land\n      var marker = new HexMarker(\n      core.scene,\n        new BABYLON.Vector3(\n          position.x, 0, position.y\n        )\n      )\n      marker.init()\n      marker.color = '#ff0000'\n      marker.metadata = land\n      marker.hide()\n      renderedMarkers[land.id] = marker\n      positionMarkersSet = positionMarkersSet.add(land.id)\n    }\n    hg.color = land.color\n    renderedLand[land.id] = hg\n  })\n\n  state.units.forEach(function (unit) {\n    unit = unit.toJS()\n    let position = convertPosition(\n      state.map.getIn([unit.land, 'position']).toJS()\n    )\n    var unit3d = renderedUnits[unit.id]\n    if (!unit3d) {\n      unit3d = new UnitBase(\n        core.scene,\n        new BABYLON.Vector3(\n          position.x, 0, position.y\n        )\n      )\n      unit3d.init()\n      unit3d.color = unit.color\n    }\n    unit3d.position = new BABYLON.Vector3(\n      position.x, 0, position.y\n    )\n    renderedUnits[unit.id] = unit3d\n  })\n}\n\n$output.on('click', function () {\n  let pickResult = core.scene.pick(\n    core.scene.pointerX,\n    core.scene.pointerY\n  )\n  if (pickResult.hit) {\n    let pickedPoint = pickResult.pickedPoint.clone()\n    let mesh = pickResult.pickedMesh\n    console.log(pickedPoint)\n    while (mesh.parent) {\n      mesh = mesh.parent\n    }\n    if (mesh.metadata) {\n      // let position = convertPosition(mesh.metadata.position)\n      // let land = store.getState().map.get(\n        // getIdForPosition(mesh.metadata.position)\n      // )\n      clientCore.clickPosition(getIdForPosition(mesh.metadata.position))\n      updateClientRender()\n    }\n  }\n})\n\nfunction updateClientRender () {\n  if (clientCore.availableToMoveTo.length > 0) {\n    var hidePositions = positionMarkersSet.subtract(\n      Set(clientCore.availableToMoveTo)\n    )\n    hidePositions.forEach(function (landID) {\n      renderedMarkers[landID].hide()\n    })\n    clientCore.availableToMoveTo.forEach(function (landID) {\n      renderedMarkers[landID].show()\n    })\n  } else {\n    positionMarkersSet.forEach(function (landID) {\n      renderedMarkers[landID].hide()\n    })\n  }\n}\n\n\nvar gui = new dat.GUI()\nvar lightFolder = gui.addFolder('Light Direction')\nlightFolder.add(core.light.direction, 'x', null, { min: -10, max: 10, step: 0.1 })\nlightFolder.add(core.light.direction, 'y', { min: -10, max: 10, step: 0.1 })\nlightFolder.add(core.light.direction, 'z', { min: -10, max: 10, step: 0.1 })\n\n\nvar cameraFolder = gui.addFolder('Camera')\ncameraFolder.add(core.camera.camera.position, 'x', -100, 100).listen()\ncameraFolder.add(core.camera.camera.position, 'y', -100, 100).listen()\ncameraFolder.add(core.camera.camera.position, 'z', -100, 100).listen()\ncameraFolder.add(core.camera.camera.position, 'z', -100, 100).listen()\ncameraFolder.add(core.camera, 'distance', -100, 100).listen()", "domain": "javascript", "lang": "code", "char_count": 4139, "word_count": 984, "byte_count": 4139}
{"text": "const app = require('./app');\nconst { createServer } = require('http');\nconst { Server } = require('socket.io');\nconst { emitTwitchEventsOnSocket } = require('./tau-socket')\nconst { emitChatCommandsOnSocket } = require('./twitch-chat')\n\nconst expressPort = process.env.PORT || 5000;\nconst httpServer = createServer(app);\nconst io = new Server(httpServer);\n\n// socket.io connection used to send events to client\nio.on(\"connection\", async (socket) => {\n  console.log(\"Socket.io Client Connected\", socket.id)\n\n  // import is an esmodule thing\n  const obsOverlaysConfig = await import('./pages/obs-overlays/config/config.mjs');\n\n  emitTwitchEventsOnSocket(obsOverlaysConfig.eventCommands, socket);\n  emitChatCommandsOnSocket(obsOverlaysConfig.chatCommands, socket, obsOverlaysConfig.twitchChatConfig);\n});\n\n// express server\nhttpServer.listen(expressPort, async () => {    \n  console.log(`Express Listening: http://localhost:${expressPort}`);\n});", "domain": "javascript", "lang": "code", "char_count": 942, "word_count": 193, "byte_count": 942}
{"text": "/*!\nCopyright (C) 2013 by WebReflection\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n*/\ndefine({});", "domain": "javascript", "lang": "code", "char_count": 1078, "word_count": 212, "byte_count": 1078}
{"text": "/*\n *\n * \u8bc4\u8bba\u6570\u636e\u72b6\u6001\n *\n */\n\nimport service from '../api';\n\nexport const state = () => {\n  return {\n    fetching: false,\n    posting: false,\n    data: {\n      data: {}\n    }\n  };\n};\n\nexport const mutations = {\n  // \u83b7\u53d6\u8bc4\u8bba\n  REQUEST_LIST(state) {\n    state.fetching = true;\n  },\n\n  // \u6e05\u7a7a\u8bc4\u8bba\n  CLEAR_LIST(state) {\n    state.data = {\n      data: {}\n    };\n  },\n\n  GET_LIST_SUCCESS(state, action) {\n    state.fetching = false;\n    state.data = action;\n  },\n\n  GET_LIST_FAILURE(state) {\n    state.fetching = false;\n    state.data = {\n      data: [],\n      pagination: {}\n    };\n  },\n\n  // \u53d1\u5e03\u8bc4\u8bba\n  POST_ITEM(state) {\n    state.posting = true;\n  },\n\n  POST_ITEM_SUCCESS(state, action) {\n    state.posting = false;\n    state.data.data.size += 1;\n    state.data.data.list.unshift(action);\n  },\n\n  POST_ITEM_FAILURE(state) {\n    state.posting = false;\n  },\n\n  // \u559c\u6b22\u67d0\u6761\u8bc4\u8bba\n  LIKE_ITEM(state, action) {\n    const comment = state.data.data.list.find(comment => Object.is(comment.id, action.id));\n    if (comment) comment.likeCount++;\n  }\n};\n\nexport const actions = {\n  // \u63d0\u4ea4\u7559\u8a00\u5899\n  async postHero({ commit }, data) {\n    commit('POST_ITEM');\n    const res = await service.postHero(data);\n    commit('POST_ITEM_FINAL');\n    return res;\n  },\n\n  // \u53d1\u5e03\u8bc4\u8bba\n  async postComment({ commit }, comment) {\n    commit('POST_ITEM');\n    const res = await service.postComment(comment);\n    if (res && res.status === 1) {\n      commit('POST_ITEM_SUCCESS', res.data);\n      if (!comment.parentId) commit('article/ADD_COMMENT', null, { root: true });\n    } else commit('POST_ITEM_FAILURE');\n    return res;\n  },\n\n  // \u4e3a\u67d0\u6761\u56de\u590d\u70b9\u8d5e\n  async likeComment({ commit }, data) {\n    const res = await service.likeComment(data);\n    if (res && res.status === 1) commit('LIKE_ITEM', data);\n    return res;\n  },\n\n  // \u6839\u636eref-id\u83b7\u53d6\u8bc4\u8bba\u5217\u8868\n  async loadCommentsByRefId({ commit, state }, data) {\n    data.sort = data.sort || -1;\n    data.currentPage = data.currentPage || 1;\n    data.pageSize = data.pageSize || 60;\n    commit('REQUEST_LIST');\n\n    setTimeout(async () => {\n\n      const res = await service.getComments(data);\n      \n      if (res && res.status === 1) {\n        var resultData = res.data\n        if (resultData.pageNum > 1) \n          resultData.list = [...state.data.data.list, ...resultData.list];\n        // if (Object.is(data.sort, -1)) res.result.data.reverse()\n        commit('GET_LIST_SUCCESS', {\n          data: resultData\n        });\n      } else commit('GET_LIST_FAILURE');\n      return res;\n    }, 500);\n  }\n};", "domain": "javascript", "lang": "code", "char_count": 2469, "word_count": 585, "byte_count": 2565}
{"text": "import { moduleFor } from '../../utils/test-case';\nimport { TogglingHelperConditionalsTest } from '../../utils/shared-conditional-tests';\n\nmoduleFor('Helpers test: inline {{if}}', class extends TogglingHelperConditionalsTest {\n\n  templateFor({ cond, truthy, falsy }) {\n    return `{{if ${cond} ${truthy} ${falsy}}}`;\n  }\n\n  ['@test it raises when there are more than three arguments']() {\n    expectAssertion(() => {\n      this.render(`{{if condition 'a' 'b' 'c'}}`, { condition: true });\n    }, /The inline form of the `if` and `unless` helpers expect two or three arguments/);\n  }\n\n  ['@test it raises when there are less than two arguments']() {\n    expectAssertion(() => {\n      this.render(`{{if condition}}`, { condition: true });\n    }, /The inline form of the `if` and `unless` helpers expect two or three arguments/);\n  }\n\n});\n\nmoduleFor('@glimmer Helpers test: nested {{if}} helpers (returning truthy values)', class extends TogglingHelperConditionalsTest {\n\n  templateFor({ cond, truthy, falsy }) {\n    return `{{if (if ${cond} ${cond} false) ${truthy} ${falsy}}}`;\n  }\n\n});\n\nmoduleFor('@glimmer Helpers test: nested {{if}} helpers (returning falsy values)', class extends TogglingHelperConditionalsTest {\n\n  templateFor({ cond, truthy, falsy }) {\n    return `{{if (if ${cond} true ${cond}) ${truthy} ${falsy}}}`;\n  }\n\n});\n\nmoduleFor('@glimmer Helpers test: {{if}} used with another helper', class extends TogglingHelperConditionalsTest {\n\n  wrapperFor(templates) {\n    return `{{concat ${templates.join(' ')}}}`;\n  }\n\n  templateFor({ cond, truthy, falsy }) {\n    return `(if ${cond} ${truthy} ${falsy})`;\n  }\n\n});\n\nmoduleFor('@glimmer Helpers test: {{if}} used in attribute position', class extends TogglingHelperConditionalsTest {\n\n  wrapperFor(templates) {\n    return `<div data-foo=\"${templates.join('')}\" />`;\n  }\n\n  templateFor({ cond, truthy, falsy }) {\n    return `{{if ${cond} ${truthy} ${falsy}}}`;\n  }\n\n  textValue() {\n    return this.$('div').attr('data-foo');\n  }\n\n});\n\nmoduleFor('Helpers test: inline {{if}} and {{unless}} without the inverse argument', class extends TogglingHelperConditionalsTest {\n\n  templateFor({ cond, truthy, falsy }) {\n    return `{{if ${cond} ${truthy}}}{{unless ${cond} ${falsy}}}`;\n  }\n\n});\n\nmoduleFor('Helpers test: inline {{unless}}', class extends TogglingHelperConditionalsTest {\n\n  templateFor({ cond, truthy, falsy }) {\n    return `{{unless ${cond} ${falsy} ${truthy}}}`;\n  }\n\n  ['@test it raises when there are more than three arguments']() {\n    expectAssertion(() => {\n      this.render(`{{unless condition 'a' 'b' 'c'}}`, { condition: true });\n    }, /The inline form of the `if` and `unless` helpers expect two or three arguments/);\n  }\n\n  ['@test it raises when there are less than two arguments']() {\n    expectAssertion(() => {\n      this.render(`{{unless condition}}`, { condition: true });\n    }, /The inline form of the `if` and `unless` helpers expect two or three arguments/);\n  }\n\n});\n\nmoduleFor('@glimmer Helpers test: nested {{unless}} helpers (returning truthy values)', class extends TogglingHelperConditionalsTest {\n\n  templateFor({ cond, truthy, falsy }) {\n    return `{{unless (unless ${cond} false ${cond}) ${falsy} ${truthy}}}`;\n  }\n\n});\n\nmoduleFor('@glimmer Helpers test: nested {{unless}} helpers (returning falsy values)', class extends TogglingHelperConditionalsTest {\n\n  templateFor({ cond, truthy, falsy }) {\n    return `{{unless (unless ${cond} ${cond} true) ${falsy} ${truthy}}}`;\n  }\n\n});\n\nmoduleFor('@glimmer Helpers test: {{unless}} used with another helper', class extends TogglingHelperConditionalsTest {\n\n  wrapperFor(templates) {\n    return `{{concat ${templates.join(' ')}}}`;\n  }\n\n  templateFor({ cond, truthy, falsy }) {\n    return `(unless ${cond} ${falsy} ${truthy})`;\n  }\n\n});\n\nmoduleFor('@glimmer Helpers test: {{unless}} used in attribute position', class extends TogglingHelperConditionalsTest {\n\n  wrapperFor(templates) {\n    return `<div data-foo=\"${templates.join('')}\" />`;\n  }\n\n  templateFor({ cond, truthy, falsy }) {\n    return `{{unless ${cond} ${falsy} ${truthy}}}`;\n  }\n\n  textValue() {\n    return this.$('div').attr('data-foo');\n  }\n\n});", "domain": "javascript", "lang": "code", "char_count": 4153, "word_count": 1142, "byte_count": 4153}
{"text": "import blockToImage from './block-to-image';\nimport jpegThumbnail from './jpeg-thumbnail';\nimport {Base64} from 'js-base64';\n\nconst codePayload = ({blockObjects, topBlockId}) => {\n    const payload = {\n        type: 'script', // Needs to match backpack-server type name\n        name: 'code', // All code currently gets the same name\n        mime: 'application/json',\n        // Backpack expects a base64 encoded string to store. Cannot use btoa because\n        // the code can contain characters outside the 0-255 code-point range supported by btoa\n        body: Base64.encode(JSON.stringify(blockObjects)) // Base64 encode the json\n    };\n\n    return blockToImage(topBlockId)\n        .then(jpegThumbnail)\n        .then(thumbnail => {\n            payload.thumbnail = thumbnail.replace('data:image/jpeg;base64,', '');\n            return payload;\n        });\n};\n\nexport default codePayload;", "domain": "javascript", "lang": "code", "char_count": 888, "word_count": 162, "byte_count": 888}
{"text": "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.matchTemplate = exports.beASupersetOfTemplate = exports.exactlyMatchTemplate = exports.MatchStyle = void 0;\nconst cfnDiff = require(\"@aws-cdk/cloudformation-diff\");\nconst assertion_1 = require(\"../assertion\");\nvar MatchStyle;\n(function (MatchStyle) {\n    /** Requires an exact match */\n    MatchStyle[\"EXACT\"] = \"exactly\";\n    /** Allows any change that does not cause a resource replacement */\n    MatchStyle[\"NO_REPLACES\"] = \"no replaces\";\n    /** Allows additions, but no updates */\n    MatchStyle[\"SUPERSET\"] = \"superset\";\n})(MatchStyle = exports.MatchStyle || (exports.MatchStyle = {}));\nfunction exactlyMatchTemplate(template) {\n    return matchTemplate(template, MatchStyle.EXACT);\n}\nexports.exactlyMatchTemplate = exactlyMatchTemplate;\nfunction beASupersetOfTemplate(template) {\n    return matchTemplate(template, MatchStyle.SUPERSET);\n}\nexports.beASupersetOfTemplate = beASupersetOfTemplate;\nfunction matchTemplate(template, matchStyle = MatchStyle.EXACT) {\n    return new StackMatchesTemplateAssertion(template, matchStyle);\n}\nexports.matchTemplate = matchTemplate;\nclass StackMatchesTemplateAssertion extends assertion_1.Assertion {\n    constructor(template, matchStyle) {\n        super();\n        this.template = template;\n        this.matchStyle = matchStyle;\n    }\n    assertOrThrow(inspector) {\n        if (!this.assertUsing(inspector)) {\n            // The details have already been printed, so don't generate a huge error message\n            throw new Error('Template comparison produced unacceptable match');\n        }\n    }\n    assertUsing(inspector) {\n        const diff = cfnDiff.diffTemplate(this.template, inspector.value);\n        const acceptable = this.isDiffAcceptable(diff);\n        if (!acceptable) {\n            // Print the diff\n            cfnDiff.formatDifferences(process.stderr, diff);\n            // Print the actual template\n            process.stdout.write('--------------------------------------------------------------------------------------\\n');\n            process.stdout.write(JSON.stringify(inspector.value, undefined, 2) + '\\n');\n        }\n        return acceptable;\n    }\n    isDiffAcceptable(diff) {\n        switch (this.matchStyle) {\n            case MatchStyle.EXACT:\n                return diff.differenceCount === 0;\n            case MatchStyle.NO_REPLACES:\n                for (const change of Object.values(diff.resources.changes)) {\n                    if (change.changeImpact === cfnDiff.ResourceImpact.MAY_REPLACE) {\n                        return false;\n                    }\n                    if (change.changeImpact === cfnDiff.ResourceImpact.WILL_REPLACE) {\n                        return false;\n                    }\n                }\n                for (const change of Object.values(diff.parameters.changes)) {\n                    if (change.isUpdate) {\n                        return false;\n                    }\n                }\n                for (const change of Object.values(diff.outputs.changes)) {\n                    if (change.isUpdate) {\n                        return false;\n                    }\n                }\n                return true;\n            case MatchStyle.SUPERSET:\n                for (const change of Object.values(diff.resources.changes)) {\n                    if (change.changeImpact !== cfnDiff.ResourceImpact.WILL_CREATE) {\n                        return false;\n                    }\n                }\n                for (const change of Object.values(diff.parameters.changes)) {\n                    if (change.isAddition) {\n                        return false;\n                    }\n                }\n                for (const change of Object.values(diff.outputs.changes)) {\n                    if (change.isAddition || change.isUpdate) {\n                        return false;\n                    }\n                }\n                return true;\n        }\n        throw new Error(`Unsupported match style: ${this.matchStyle}`);\n    }\n    get description() {\n        return `template (${this.matchStyle}): ${JSON.stringify(this.template, null, 2)}`;\n    }\n}\n//# sourceMappingURL=data:application/json;base64, ", "domain": "javascript", "lang": "code", "char_count": 12724, "word_count": 762, "byte_count": 12724}
{"text": "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nexports.__esModule = true;\nexports[\"default\"] = void 0;\n\nvar _crAdapterRouter = _interopRequireDefault(require(\"../crAdapterRouter\"));\n\nvar _toKline = _interopRequireDefault(require(\"./toKline\"));\n\nvar _toOrderBook = _interopRequireDefault(require(\"./toOrderBook\"));\n\nvar _rAdapter = {\n  DF: _toKline[\"default\"],\n  OB: _toOrderBook[\"default\"]\n},\n    BnAdapter = (0, _crAdapterRouter[\"default\"])(_rAdapter);\nvar _default = BnAdapter;\nexports[\"default\"] = _default;\n//# sourceMappingURL=BnAdapter.js.map", "domain": "javascript", "lang": "code", "char_count": 603, "word_count": 128, "byte_count": 603}
{"text": "/*!\n{\n  \"name\": \"History API\",\n  \"property\": \"history\",\n  \"caniuse\": \"history\",\n  \"tags\": [\"history\"],\n  \"authors\": [\"Hay Kranen\", \"Alexander Farkas\"],\n  \"notes\": [{\n    \"name\": \"W3C Spec\",\n    \"href\": \"http://www.w3.org/TR/html51/browsers.html#the-history-interface\"\n  }, {\n    \"name\": \"MDN documentation\",\n    \"href\": \"https://developer.mozilla.org/en-US/docs/Web/API/window.history\"\n  }],\n  \"polyfills\": [\"historyjs\", \"html5historyapi\"]\n}\n!*/\n/* DOC\n\nDetects support for the History API for manipulating the browser session history.\n\n*/\ndefine(['Modernizr'], function( Modernizr ) {\n  Modernizr.addTest('history', function() {\n    // Issue #733\n    // The stock browser on Android 2.2 & 2.3 returns positive on history support\n    // Unfortunately support is really buggy and there is no clean way to detect\n    // these bugs, so we fall back to a user agent sniff :(\n    var ua = navigator.userAgent;\n\n    // We only want Android 2, stock browser, and not Chrome which identifies\n    // itself as 'Mobile Safari' as well\n    if (ua.indexOf('Android 2') !== -1 &&\n        ua.indexOf('Mobile Safari') !== -1 &&\n          ua.indexOf('Chrome') === -1) {\n      return false;\n    }\n\n    // Return the regular check\n    return (window.history && 'pushState' in history);\n  });\n});", "domain": "javascript", "lang": "code", "char_count": 1277, "word_count": 305, "byte_count": 1277}
{"text": "/*!\n* Bootstrap v5.0.0-beta2 (https://getbootstrap.com/)\n* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)\n* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n*/\n!function(t,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=e(require(\"@popperjs/core\")):\"function\"==typeof define&&define.amd?define([\"@popperjs/core\"],e):(t=\"undefined\"!=typeof globalThis?globalThis:t||self).bootstrap=e(t.Popper)}(this,(function(t){\"use strict\";function e(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if(\"default\"!==n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var n=e(t);function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,\"value\"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function o(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}function s(){return(s=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t}).apply(this,arguments)}function r(t,e){var n,i;t.prototype=Object.create(e.prototype),t.prototype.constructor=t,n=t,i=e,(Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(n,i)}var a,l,c=function(t){do{t+=Math.floor(1e6*Math.random())}while(document.getElementById(t));return t},u=function(t){var e=t.getAttribute(\"data-bs-target\");if(!e||\"#\"===e){var n=t.getAttribute(\"href\");if(!n||!n.includes(\"#\")&&!n.startsWith(\".\"))return null;n.includes(\"#\")&&!n.startsWith(\"#\")&&(n=\"#\"+n.split(\"#\")[1]),e=n&&\"#\"!==n?n.trim():null}return e},h=function(t){var e=u(t);return e&&document.querySelector(e)?e:null},d=function(t){var e=u(t);return e?document.querySelector(e):null},f=function(t){if(!t)return 0;var e=window.getComputedStyle(t),n=e.transitionDuration,i=e.transitionDelay,o=Number.parseFloat(n),s=Number.parseFloat(i);return o||s?(n=n.split(\",\")[0],i=i.split(\",\")[0],1e3*(Number.parseFloat(n)+Number.parseFloat(i))):0},p=function(t){t.dispatchEvent(new Event(\"transitionend\"))},g=function(t){return(t[0]||t).nodeType},m=function(t,e){var n=!1,i=e+5;t.addEventListener(\"transitionend\",(function e(){n=!0,t.removeEventListener(\"transitionend\",e)})),setTimeout((function(){n||p(t)}),i)},_=function(t,e,n){Object.keys(n).forEach((function(i){var o,s=n[i],r=e[i],a=r&&g(r)?\"element\":null==(o=r)?\"\"+o:{}.toString.call(o).match(/\\s([a-z]+)/i)[1].toLowerCase();if(!new RegExp(s).test(a))throw new TypeError(t.toUpperCase()+': Option \"'+i+'\" provided type \"'+a+'\" but expected type \"'+s+'\".')}))},v=function(t){if(!t)return!1;if(t.style&&t.parentNode&&t.parentNode.style){var e=getComputedStyle(t),n=getComputedStyle(t.parentNode);return\"none\"!==e.display&&\"none\"!==n.display&&\"hidden\"!==e.visibility}return!1},b=function(){return function(){}},y=function(t){return t.offsetHeight},w=function(){var t=window.jQuery;return t&&!document.body.hasAttribute(\"data-bs-no-jquery\")?t:null},E=\"rtl\"===document.documentElement.dir,T=function(t,e){var n;n=function(){var n=w();if(n){var i=n.fn[t];n.fn[t]=e.jQueryInterface,n.fn[t].Constructor=e,n.fn[t].noConflict=function(){return n.fn[t]=i,e.jQueryInterface}}},\"loading\"===document.readyState?document.addEventListener(\"DOMContentLoaded\",n):n()},A=(a={},l=1,{set:function(t,e,n){void 0===t.bsKey&&(t.bsKey={key:e,id:l},l++),a[t.bsKey.id]=n},get:function(t,e){if(!t||void 0===t.bsKey)return null;var n=t.bsKey;return n.key===e?a[n.id]:null},delete:function(t,e){if(void 0!==t.bsKey){var n=t.bsKey;n.key===e&&(delete a[n.id],delete t.bsKey)}}}),k=function(t,e,n){A.set(t,e,n)},L=function(t,e){return A.get(t,e)},C=/[^.]*(?=\\..*)\\.|.*/,D=/\\..*/,S=/::\\d+$/,N={},O=1,I={mouseenter:\"mouseover\",mouseleave:\"mouseout\"},j=new Set([\"click\",\"dblclick\",\"mouseup\",\"mousedown\",\"contextmenu\",\"mousewheel\",\"DOMMouseScroll\",\"mouseover\",\"mouseout\",\"mousemove\",\"selectstart\",\"selectend\",\"keydown\",\"keypress\",\"keyup\",\"orientationchange\",\"touchstart\",\"touchmove\",\"touchend\",\"touchcancel\",\"pointerdown\",\"pointermove\",\"pointerup\",\"pointerleave\",\"pointercancel\",\"gesturestart\",\"gesturechange\",\"gestureend\",\"focus\",\"blur\",\"change\",\"reset\",\"select\",\"submit\",\"focusin\",\"focusout\",\"load\",\"unload\",\"beforeunload\",\"resize\",\"move\",\"DOMContentLoaded\",\"readystatechange\",\"error\",\"abort\",\"scroll\"]);function P(t,e){return e&&e+\"::\"+O++||t.uidEvent||O++}function x(t){var e=P(t);return t.uidEvent=e,N[e]=N[e]||{},N[e]}function H(t,e,n){void 0===n&&(n=null);for(var i=Object.keys(t),o=0,s=i.length;o<s;o++){var r=t[i[o]];if(r.originalHandler===e&&r.delegationSelector===n)return r}return null}function B(t,e,n){var i=\"string\"==typeof e,o=i?n:e,s=t.replace(D,\"\"),r=I[s];return r&&(s=r),j.has(s)||(s=t),[i,o,s]}function M(t,e,n,i,o){if(\"string\"==typeof e&&t){n||(n=i,i=null);var s=B(e,n,i),r=s[0],a=s[1],l=s[2],c=x(t),u=c[l]||(c[l]={}),h=H(u,a,r?n:null);if(h)h.oneOff=h.oneOff&&o;else{var d=P(a,e.replace(C,\"\")),f=r?function(t,e,n){return function i(o){for(var s=t.querySelectorAll(e),r=o.target;r&&r!==this;r=r.parentNode)for(var a=s.length;a--;)if(s[a]===r)return o.delegateTarget=r,i.oneOff&&K.off(t,o.type,n),n.apply(r,[o]);return null}}(t,n,i):function(t,e){return function n(i){return i.delegateTarget=t,n.oneOff&&K.off(t,i.type,e),e.apply(t,[i])}}(t,n);f.delegationSelector=r?n:null,f.originalHandler=a,f.oneOff=o,f.uidEvent=d,u[d]=f,t.addEventListener(l,f,r)}}}function R(t,e,n,i,o){var s=H(e[n],i,o);s&&(t.removeEventListener(n,s,Boolean(o)),delete e[n][s.uidEvent])}var K={on:function(t,e,n,i){M(t,e,n,i,!1)},one:function(t,e,n,i){M(t,e,n,i,!0)},off:function(t,e,n,i){if(\"string\"==typeof e&&t){var o=B(e,n,i),s=o[0],r=o[1],a=o[2],l=a!==e,c=x(t),u=e.startsWith(\".\");if(void 0===r){u&&Object.keys(c).forEach((function(n){!function(t,e,n,i){var o=e[n]||{};Object.keys(o).forEach((function(s){if(s.includes(i)){var r=o[s];R(t,e,n,r.originalHandler,r.delegationSelector)}}))}(t,c,n,e.slice(1))}));var h=c[a]||{};Object.keys(h).forEach((function(n){var i=n.replace(S,\"\");if(!l||e.includes(i)){var o=h[n];R(t,c,a,o.originalHandler,o.delegationSelector)}}))}else{if(!c||!c[a])return;R(t,c,a,r,s?n:null)}}},trigger:function(t,e,n){if(\"string\"!=typeof e||!t)return null;var i,o=w(),s=e.replace(D,\"\"),r=e!==s,a=j.has(s),l=!0,c=!0,u=!1,h=null;return r&&o&&(i=o.Event(e,n),o(t).trigger(i),l=!i.isPropagationStopped(),c=!i.isImmediatePropagationStopped(),u=i.isDefaultPrevented()),a?(h=document.createEvent(\"HTMLEvents\")).initEvent(s,l,!0):h=new CustomEvent(e,{bubbles:l,cancelable:!0}),void 0!==n&&Object.keys(n).forEach((function(t){Object.defineProperty(h,t,{get:function(){return n[t]}})})),u&&h.preventDefault(),c&&t.dispatchEvent(h),h.defaultPrevented&&void 0!==i&&i.preventDefault(),h}},W=function(){function t(t){t&&(this._element=t,k(t,this.constructor.DATA_KEY,this))}return t.prototype.dispose=function(){var t,e;t=this._element,e=this.constructor.DATA_KEY,A.delete(t,e),this._element=null},t.getInstance=function(t){return L(t,this.DATA_KEY)},o(t,null,[{key:\"VERSION\",get:function(){return\"5.0.0-beta2\"}}]),t}(),U=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.close=function(t){var e=t?this._getRootElement(t):this._element,n=this._triggerCloseEvent(e);null===n||n.defaultPrevented||this._removeElement(e)},n._getRootElement=function(t){return d(t)||t.closest(\".alert\")},n._triggerCloseEvent=function(t){return K.trigger(t,\"close.bs.alert\")},n._removeElement=function(t){var e=this;if(t.classList.remove(\"show\"),t.classList.contains(\"fade\")){var n=f(t);K.one(t,\"transitionend\",(function(){return e._destroyElement(t)})),m(t,n)}else this._destroyElement(t)},n._destroyElement=function(t){t.parentNode&&t.parentNode.removeChild(t),K.trigger(t,\"closed.bs.alert\")},e.jQueryInterface=function(t){return this.each((function(){var n=L(this,\"bs.alert\");n||(n=new e(this)),\"close\"===t&&n[t](this)}))},e.handleDismiss=function(t){return function(e){e&&e.preventDefault(),t.close(this)}},o(e,null,[{key:\"DATA_KEY\",get:function(){return\"bs.alert\"}}]),e}(W);K.on(document,\"click.bs.alert.data-api\",'[data-bs-dismiss=\"alert\"]',U.handleDismiss(new U)),T(\"alert\",U);var F=function(t){function e(){return t.apply(this,arguments)||this}return r(e,t),e.prototype.toggle=function(){this._element.setAttribute(\"aria-pressed\",this._element.classList.toggle(\"active\"))},e.jQueryInterface=function(t){return this.each((function(){var n=L(this,\"bs.button\");n||(n=new e(this)),\"toggle\"===t&&n[t]()}))},o(e,null,[{key:\"DATA_KEY\",get:function(){return\"bs.button\"}}]),e}(W);function z(t){return\"true\"===t||\"false\"!==t&&(t===Number(t).toString()?Number(t):\"\"===t||\"null\"===t?null:t)}function Y(t){return t.replace(/[A-Z]/g,(function(t){return\"-\"+t.toLowerCase()}))}K.on(document,\"click.bs.button.data-api\",'[data-bs-toggle=\"button\"]',(function(t){t.preventDefault();var e=t.target.closest('[data-bs-toggle=\"button\"]'),n=L(e,\"bs.button\");n||(n=new F(e)),n.toggle()})),T(\"button\",F);var X={setDataAttribute:function(t,e,n){t.setAttribute(\"data-bs-\"+Y(e),n)},removeDataAttribute:function(t,e){t.removeAttribute(\"data-bs-\"+Y(e))},getDataAttributes:function(t){if(!t)return{};var e={};return Object.keys(t.dataset).filter((function(t){return t.startsWith(\"bs\")})).forEach((function(n){var i=n.replace(/^bs/,\"\");i=i.charAt(0).toLowerCase()+i.slice(1,i.length),e[i]=z(t.dataset[n])})),e},getDataAttribute:function(t,e){return z(t.getAttribute(\"data-bs-\"+Y(e)))},offset:function(t){var e=t.getBoundingClientRect();return{top:e.top+document.body.scrollTop,left:e.left+document.body.scrollLeft}},position:function(t){return{top:t.offsetTop,left:t.offsetLeft}}},q=function(t,e){var n;return void 0===e&&(e=document.documentElement),(n=[]).concat.apply(n,Element.prototype.querySelectorAll.call(e,t))},Q=function(t,e){return void 0===e&&(e=document.documentElement),Element.prototype.querySelector.call(e,t)},V=function(t,e){var n;return(n=[]).concat.apply(n,t.children).filter((function(t){return t.matches(e)}))},$=function(t,e){for(var n=t.previousElementSibling;n;){if(n.matches(e))return[n];n=n.previousElementSibling}return[]},G={interval:5e3,keyboard:!0,slide:!1,pause:\"hover\",wrap:!0,touch:!0},Z={interval:\"(number|boolean)\",keyboard:\"boolean\",slide:\"(boolean|string)\",pause:\"(string|boolean)\",wrap:\"boolean\",touch:\"boolean\"},J=function(t){function e(e,n){var i;return(i=t.call(this,e)||this)._items=null,i._interval=null,i._activeElement=null,i._isPaused=!1,i._isSliding=!1,i.touchTimeout=null,i.touchStartX=0,i.touchDeltaX=0,i._config=i._getConfig(n),i._indicatorsElement=Q(\".carousel-indicators\",i._element),i._touchSupported=\"ontouchstart\"in document.documentElement||navigator.maxTouchPoints>0,i._pointerEvent=Boolean(window.PointerEvent),i._addEventListeners(),i}r(e,t);var n=e.prototype;return n.next=function(){this._isSliding||this._slide(\"next\")},n.nextWhenVisible=function(){!document.hidden&&v(this._element)&&this.next()},n.prev=function(){this._isSliding||this._slide(\"prev\")},n.pause=function(t){t||(this._isPaused=!0),Q(\".carousel-item-next, .carousel-item-prev\",this._element)&&(p(this._element),this.cycle(!0)),clearInterval(this._interval),this._interval=null},n.cycle=function(t){t||(this._isPaused=!1),this._interval&&(clearInterval(this._interval),this._interval=null),this._config&&this._config.interval&&!this._isPaused&&(this._updateInterval(),this._interval=setInterval((document.visibilityState?this.nextWhenVisible:this.next).bind(this),this._config.interval))},n.to=function(t){var e=this;this._activeElement=Q(\".active.carousel-item\",this._element);var n=this._getItemIndex(this._activeElement);if(!(t>this._items.length-1||t<0))if(this._isSliding)K.one(this._element,\"slid.bs.carousel\",(function(){return e.to(t)}));else{if(n===t)return this.pause(),void this.cycle();var i=t>n?\"next\":\"prev\";this._slide(i,this._items[t])}},n.dispose=function(){t.prototype.dispose.call(this),K.off(this._element,\".bs.carousel\"),this._items=null,this._config=null,this._interval=null,this._isPaused=null,this._isSliding=null,this._activeElement=null,this._indicatorsElement=null},n._getConfig=function(t){return t=s({},G,t),_(\"carousel\",t,Z),t},n._handleSwipe=function(){var t=Math.abs(this.touchDeltaX);if(!(t<=40)){var e=t/this.touchDeltaX;this.touchDeltaX=0,e>0&&(E?this.next():this.prev()),e<0&&(E?this.prev():this.next())}},n._addEventListeners=function(){var t=this;this._config.keyboard&&K.on(this._element,\"keydown.bs.carousel\",(function(e){return t._keydown(e)})),\"hover\"===this._config.pause&&(K.on(this._element,\"mouseenter.bs.carousel\",(function(e){return t.pause(e)})),K.on(this._element,\"mouseleave.bs.carousel\",(function(e){return t.cycle(e)}))),this._config.touch&&this._touchSupported&&this._addTouchEventListeners()},n._addTouchEventListeners=function(){var t=this,e=function(e){!t._pointerEvent||\"pen\"!==e.pointerType&&\"touch\"!==e.pointerType?t._pointerEvent||(t.touchStartX=e.touches[0].clientX):t.touchStartX=e.clientX},n=function(e){!t._pointerEvent||\"pen\"!==e.pointerType&&\"touch\"!==e.pointerType||(t.touchDeltaX=e.clientX-t.touchStartX),t._handleSwipe(),\"hover\"===t._config.pause&&(t.pause(),t.touchTimeout&&clearTimeout(t.touchTimeout),t.touchTimeout=setTimeout((function(e){return t.cycle(e)}),500+t._config.interval))};q(\".carousel-item img\",this._element).forEach((function(t){K.on(t,\"dragstart.bs.carousel\",(function(t){return t.preventDefault()}))})),this._pointerEvent?(K.on(this._element,\"pointerdown.bs.carousel\",(function(t){return e(t)})),K.on(this._element,\"pointerup.bs.carousel\",(function(t){return n(t)})),this._element.classList.add(\"pointer-event\")):(K.on(this._element,\"touchstart.bs.carousel\",(function(t){return e(t)})),K.on(this._element,\"touchmove.bs.carousel\",(function(e){return function(e){e.touches&&e.touches.length>1?t.touchDeltaX=0:t.touchDeltaX=e.touches[0].clientX-t.touchStartX}(e)})),K.on(this._element,\"touchend.bs.carousel\",(function(t){return n(t)})))},n._keydown=function(t){/input|textarea/i.test(t.target.tagName)||(\"ArrowLeft\"===t.key?(t.preventDefault(),E?this.next():this.prev()):\"ArrowRight\"===t.key&&(t.preventDefault(),E?this.prev():this.next()))},n._getItemIndex=function(t){return this._items=t&&t.parentNode?q(\".carousel-item\",t.parentNode):[],this._items.indexOf(t)},n._getItemByDirection=function(t,e){var n=\"next\"===t,i=\"prev\"===t,o=this._getItemIndex(e),s=this._items.length-1;if((i&&0===o||n&&o===s)&&!this._config.wrap)return e;var r=(o+(\"prev\"===t?-1:1))%this._items.length;return-1===r?this._items[this._items.length-1]:this._items[r]},n._triggerSlideEvent=function(t,e){var n=this._getItemIndex(t),i=this._getItemIndex(Q(\".active.carousel-item\",this._element));return K.trigger(this._element,\"slide.bs.carousel\",{relatedTarget:t,direction:e,from:i,to:n})},n._setActiveIndicatorElement=function(t){if(this._indicatorsElement){var e=Q(\".active\",this._indicatorsElement);e.classList.remove(\"active\"),e.removeAttribute(\"aria-current\");for(var n=q(\"[data-bs-target]\",this._indicatorsElement),i=0;i<n.length;i++)if(Number.parseInt(n[i].getAttribute(\"data-bs-slide-to\"),10)===this._getItemIndex(t)){n[i].classList.add(\"active\"),n[i].setAttribute(\"aria-current\",\"true\");break}}},n._updateInterval=function(){var t=this._activeElement||Q(\".active.carousel-item\",this._element);if(t){var e=Number.parseInt(t.getAttribute(\"data-bs-interval\"),10);e?(this._config.defaultInterval=this._config.defaultInterval||this._config.interval,this._config.interval=e):this._config.interval=this._config.defaultInterval||this._config.interval}},n._slide=function(t,e){var n=this,i=Q(\".active.carousel-item\",this._element),o=this._getItemIndex(i),s=e||i&&this._getItemByDirection(t,i),r=this._getItemIndex(s),a=Boolean(this._interval),l=\"next\"===t?\"carousel-item-start\":\"carousel-item-end\",c=\"next\"===t?\"carousel-item-next\":\"carousel-item-prev\",u=\"next\"===t?\"left\":\"right\";if(s&&s.classList.contains(\"active\"))this._isSliding=!1;else if(!this._triggerSlideEvent(s,u).defaultPrevented&&i&&s){if(this._isSliding=!0,a&&this.pause(),this._setActiveIndicatorElement(s),this._activeElement=s,this._element.classList.contains(\"slide\")){s.classList.add(c),y(s),i.classList.add(l),s.classList.add(l);var h=f(i);K.one(i,\"transitionend\",(function(){s.classList.remove(l,c),s.classList.add(\"active\"),i.classList.remove(\"active\",c,l),n._isSliding=!1,setTimeout((function(){K.trigger(n._element,\"slid.bs.carousel\",{relatedTarget:s,direction:u,from:o,to:r})}),0)})),m(i,h)}else i.classList.remove(\"active\"),s.classList.add(\"active\"),this._isSliding=!1,K.trigger(this._element,\"slid.bs.carousel\",{relatedTarget:s,direction:u,from:o,to:r});a&&this.cycle()}},e.carouselInterface=function(t,n){var i=L(t,\"bs.carousel\"),o=s({},G,X.getDataAttributes(t));\"object\"==typeof n&&(o=s({},o,n));var r=\"string\"==typeof n?n:o.slide;if(i||(i=new e(t,o)),\"number\"==typeof n)i.to(n);else if(\"string\"==typeof r){if(void 0===i[r])throw new TypeError('No method named \"'+r+'\"');i[r]()}else o.interval&&o.ride&&(i.pause(),i.cycle())},e.jQueryInterface=function(t){return this.each((function(){e.carouselInterface(this,t)}))},e.dataApiClickHandler=function(t){var n=d(this);if(n&&n.classList.contains(\"carousel\")){var i=s({},X.getDataAttributes(n),X.getDataAttributes(this)),o=this.getAttribute(\"data-bs-slide-to\");o&&(i.interval=!1),e.carouselInterface(n,i),o&&L(n,\"bs.carousel\").to(o),t.preventDefault()}},o(e,null,[{key:\"Default\",get:function(){return G}},{key:\"DATA_KEY\",get:function(){return\"bs.carousel\"}}]),e}(W);K.on(document,\"click.bs.carousel.data-api\",\"[data-bs-slide], [data-bs-slide-to]\",J.dataApiClickHandler),K.on(window,\"load.bs.carousel.data-api\",(function(){for(var t=q('[data-bs-ride=\"carousel\"]'),e=0,n=t.length;e<n;e++)J.carouselInterface(t[e],L(t[e],\"bs.carousel\"))})),T(\"carousel\",J);var tt={toggle:!0,parent:\"\"},et={toggle:\"boolean\",parent:\"(string|element)\"},nt=function(t){function e(e,n){var i;(i=t.call(this,e)||this)._isTransitioning=!1,i._config=i._getConfig(n),i._triggerArray=q('[data-bs-toggle=\"collapse\"][href=\"#'+e.id+'\"],[data-bs-toggle=\"collapse\"][data-bs-target=\"#'+e.id+'\"]');for(var o=q('[data-bs-toggle=\"collapse\"]'),s=0,r=o.length;s<r;s++){var a=o[s],l=h(a),c=q(l).filter((function(t){return t===e}));null!==l&&c.length&&(i._selector=l,i._triggerArray.push(a))}return i._parent=i._config.parent?i._getParent():null,i._config.parent||i._addAriaAndCollapsedClass(i._element,i._triggerArray),i._config.toggle&&i.toggle(),i}r(e,t);var n=e.prototype;return n.toggle=function(){this._element.classList.contains(\"show\")?this.hide():this.show()},n.show=function(){var t=this;if(!this._isTransitioning&&!this._element.classList.contains(\"show\")){var n,i;this._parent&&0===(n=q(\".show, .collapsing\",this._parent).filter((function(e){return\"string\"==typeof t._config.parent?e.getAttribute(\"data-bs-parent\")===t._config.parent:e.classList.contains(\"collapse\")}))).length&&(n=null);var o=Q(this._selector);if(n){var s=n.find((function(t){return o!==t}));if((i=s?L(s,\"bs.collapse\"):null)&&i._isTransitioning)return}if(!K.trigger(this._element,\"show.bs.collapse\").defaultPrevented){n&&n.forEach((function(t){o!==t&&e.collapseInterface(t,\"hide\"),i||k(t,\"bs.collapse\",null)}));var r=this._getDimension();this._element.classList.remove(\"collapse\"),this._element.classList.add(\"collapsing\"),this._element.style[r]=0,this._triggerArray.length&&this._triggerArray.forEach((function(t){t.classList.remove(\"collapsed\"),t.setAttribute(\"aria-expanded\",!0)})),this.setTransitioning(!0);var a=\"scroll\"+(r[0].toUpperCase()+r.slice(1)),l=f(this._element);K.one(this._element,\"transitionend\",(function(){t._element.classList.remove(\"collapsing\"),t._element.classList.add(\"collapse\",\"show\"),t._element.style[r]=\"\",t.setTransitioning(!1),K.trigger(t._element,\"shown.bs.collapse\")})),m(this._element,l),this._element.style[r]=this._element[a]+\"px\"}}},n.hide=function(){var t=this;if(!this._isTransitioning&&this._element.classList.contains(\"show\")&&!K.trigger(this._element,\"hide.bs.collapse\").defaultPrevented){var", "domain": "javascript", "lang": "code", "char_count": 20010, "word_count": 8244, "byte_count": 20010}
{"text": "layui.config({\n\tbase : \"js/\"\n}).use(['form','layer','jquery'],function(){\n\tvar form = layui.form,\n\t\tlayer = parent.layer === undefined ? layui.layer : parent.layer,\n\t\t$ = layui.jquery;\n\t\tvar url = [\"<?= yii\\helpers\\Url::to(['/tools/ico']); ?>\",'yes'];\n\t\t\n\t\t$('.open-icon').click(function(){\n\t\t\tlayer.open({title:'\u56fe\u6807\u9009\u62e9', type: 2, area: ['580px', '530px'], fix: true, maxmin: false, content: url});\n\t\t});\n\t\t\n});\n\n$('#parent_name').autocomplete({\n    source: function (request, response) {\n        var result = [];\n        var limit = 10;\n        var term = request.term.toLowerCase();\n        $.each(_opts.menus, function () {\n            var menu = this;\n            if (term == '' || menu.name.toLowerCase().indexOf(term) >= 0 ||\n                (menu.parent_name && menu.parent_name.toLowerCase().indexOf(term) >= 0) ||\n                (menu.route && menu.route.toLowerCase().indexOf(term) >= 0)) {\n                result.push(menu);\n                limit--;\n                if (limit <= 0) {\n                    return false;\n                }\n            }\n        });\n        response(result);\n    },\n    focus: function (event, ui) {\n        $('#parent_name').val(ui.item.name);\n        return false;\n    },\n    select: function (event, ui) {\n        $('#parent_name').val(ui.item.name);\n        $('#parent_id').val(ui.item.id);\n        return false;\n    },\n    search: function () {\n        $('#parent_id').val('');\n    }\n}).autocomplete(\"instance\")._renderItem = function (ul, item) {\n    if(item.parent_name == null || item.route == null){\n        return $(\"<li>\").append('<h3>'+item.name+'</h3>').appendTo(ul);\n    }\n    return $(\"<li>\").append('<h3>'+item.name+'</h3><p>'+item.parent_name + ' | ' + item.route+'</p>').appendTo(ul);\n};\n\n$('#route').autocomplete({\n    source: _opts.routes,\n});", "domain": "javascript", "lang": "code", "char_count": 1802, "word_count": 541, "byte_count": 1810}
{"text": "const fs = require('fs');\n\nconst TRAVEL_CODE = 'G0';\nconst MOVE_CODE = 'G1'; \n\nmodule.exports = class Gcode {\n  constructor({laserOnCode, laserOffCode, laserPrecision, laserSpeed, travelSpeed, xOffset, yOffset, zOffset}) {\n    this.code = [];\n    this.laserOnCode = laserOnCode;\n    this.laserOffCode = laserOffCode;\n    this.laserPrecision = laserPrecision;\n    this.laserSpeed = laserSpeed * 60;\n    this.travelSpeed = travelSpeed * 60;\n    this.xOffset = xOffset;\n    this.yOffset = yOffset;\n    this.zOffset = zOffset;\n    this.currentXPosition = 0;\n    this.laserStatus = undefined;\n  }\n\n  async initialise() {\n    this.turnLaserOff();\n    this.autoHome();\n    this.setUnitMM();\n    this.relativePositioning();\n    this.initialPosition();\n    return Promise.resolve();\n  }\n\n  autoHome() {\n    this.append('G28');\n  }\n\n  relativePositioning() {\n    this.append('G91');\n  }\n\n  initialPosition() {\n    this.move(TRAVEL_CODE, { x: this.xOffset, y: this.yOffset, z: this.zOffset });\n  }\n\n  move(code, {x, y, z, fr}) {\n    let params = '';\n    \n    if (x !== undefined) { \n      this.currentXPosition = this.currentXPosition + x;\n      params = params + ` X${x}`; \n    }\n    \n    if (y) { params = params + ` Y${y}`; }\n    if (z) { params = params + ` Z${z}`; }\n\n    if (!fr) { \n      if (code === TRAVEL_CODE) {\n        fr = this.travelSpeed;\n      } else if (code === MOVE_CODE) {\n        fr = this.laserSpeed;\n      }\n    }\n    \n    params = params + ` F${fr}`; \n\n    this.append(`${code}${params}`); \n  }\n\n  setUnitMM() {\n    this.append(`G21`);\n  }\n\n  movePixels(n) {\n    if (!this.laserStatus) {\n      this.move(TRAVEL_CODE,  { x: this.laserPrecision * n } );\n    } else {\n      this.move(MOVE_CODE,  { x: this.laserPrecision * n } )\n    }\n  }\n\n  moveLine(n, reset) {\n    const params = { y: this.laserPrecision * n }\n    if (reset) {\n      params.x = (-1 * this.currentXPosition) + this.xOffset;\n    }\n    this.move(TRAVEL_CODE, params);\n  }\n\n  append(line) {\n    this.code.push(line);\n  }\n  \n  getLaserStatus() {\n    return this.laserStatus;\n  }\n  \n  turnLaser(status) {\n    if (status) {\n      this.turnLaserOn();\n    } else {\n      this.turnLaserOff();\n    }\n  }\n\n  turnLaserOn() {\n    if (!this.laserStatus || this.laserStatus === undefined) {\n      this.laserStatus = true;\n      this.code.push(`${this.laserOnCode} S255`);\n    }\n  }\n\n  turnLaserOff() {\n    if (this.laserStatus || this.laserStatus === undefined) {\n      this.laserStatus = false;\n      this.code.push(`${this.laserOffCode} S0`);\n    }\n  }\n\n  async build({outputFilename, filename}) {\n    const file = outputFilename ? outputFilename : `./${filename}.gcode`;\n    fs.writeFileSync(file, this.code.join(\"\\n\"));\n    return Promise.resolve();\n  }\n};", "domain": "javascript", "lang": "code", "char_count": 2723, "word_count": 681, "byte_count": 2723}
{"text": "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\n\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\n\nvar _jsxRuntime = require(\"react/jsx-runtime\");\n\nvar _default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)(\"path\", {\n  d: \"M1.94 11.79c-.6.57-.94 1.35-.94 2.18V20c0 1.66 1.34 3 3 3h13.68c.65 0 1.25-.47 1.32-1.12.08-.75-.51-1.38-1.24-1.38H12.5c-.28 0-.5-.22-.5-.5s.22-.5.5-.5h7.18c.65 0 1.25-.47 1.32-1.12.08-.75-.51-1.38-1.24-1.38H12.5c-.28 0-.5-.22-.5-.5s.22-.5.5-.5h8.18c.65 0 1.25-.47 1.32-1.12.08-.75-.51-1.38-1.24-1.38H12.5c-.28 0-.5-.22-.5-.5s.22-.5.5-.5h6.18c.65 0 1.25-.47 1.32-1.12.08-.75-.51-1.38-1.24-1.38h-9.9l1.49-2.61c.09-.16.14-.33.14-.53 0-.26-.09-.5-.26-.7l-.42-.45c-.38-.39-1.01-.41-1.41-.03l-6.46 6.11zm15.05-3.72c0 .52-.42.93-.93.93-.52 0-.93-.42-.93-.93.03-.67-.22-1.33-.71-1.86l-.07-.06c-.9-.89-1.38-2.03-1.34-3.22-.01-.51.41-.93.92-.93s.93.42.93.93c-.03.67.22 1.33.71 1.86l.07.07c.91.88 1.39 2.02 1.35 3.21zm4.01 0c0 .51-.42.93-.94.93s-.93-.42-.93-.93c.03-.67-.22-1.33-.71-1.86l-.07-.06c-.9-.89-1.38-2.03-1.34-3.22 0-.51.42-.93.93-.93s.93.42.93.93c-.03.67.22 1.33.71 1.86l.07.07c.9.88 1.38 2.02 1.35 3.21z\"\n}), 'DryRounded');\n\nexports.default = _default;", "domain": "javascript", "lang": "code", "char_count": 1371, "word_count": 153, "byte_count": 1371}
{"text": "/*!\n * headroom.js v0.9.4 - Give your page some headroom. Hide your header until you need it\n * Copyright (c) 2017 Nick Williams - http://wicky.nillia.ms/headroom.js\n * License: MIT\n */\n\n(function(root, factory) {\n  'use strict';\n\n  if (typeof define === 'function' && define.amd) {\n    // AMD. Register as an anonymous module.\n    define([], factory);\n  }\n  else if (typeof exports === 'object') {\n    // COMMONJS\n    module.exports = factory();\n  }\n  else {\n    // BROWSER\n    root.Headroom = factory();\n  }\n}(this, function() {\n  'use strict';\n\n  /* exported features */\n  \n  var features = {\n    bind : !!(function(){}.bind),\n    classList : 'classList' in document.documentElement,\n    rAF : !!(window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame)\n  };\n  window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame;\n  \n  /**\n   * Handles debouncing of events via requestAnimationFrame\n   * @see http://www.html5rocks.com/en/tutorials/speed/animations/\n   * @param {Function} callback The callback to handle whichever event\n   */\n  function Debouncer (callback) {\n    this.callback = callback;\n    this.ticking = false;\n  }\n  Debouncer.prototype = {\n    constructor : Debouncer,\n  \n    /**\n     * dispatches the event to the supplied callback\n     * @private\n     */\n    update : function() {\n      this.callback && this.callback();\n      this.ticking = false;\n    },\n  \n    /**\n     * ensures events don't get stacked\n     * @private\n     */\n    requestTick : function() {\n      if(!this.ticking) {\n        requestAnimationFrame(this.rafCallback || (this.rafCallback = this.update.bind(this)));\n        this.ticking = true;\n      }\n    },\n  \n    /**\n     * Attach this as the event listeners\n     */\n    handleEvent : function() {\n      this.requestTick();\n    }\n  };\n  /**\n   * Check if object is part of the DOM\n   * @constructor\n   * @param {Object} obj element to check\n   */\n  function isDOMElement(obj) {\n    return obj && typeof window !== 'undefined' && (obj === window || obj.nodeType);\n  }\n  \n  /**\n   * Helper function for extending objects\n   */\n  function extend (object /*, objectN ... */) {\n    if(arguments.length <= 0) {\n      throw new Error('Missing arguments in extend function');\n    }\n  \n    var result = object || {},\n        key,\n        i;\n  \n    for (i = 1; i < arguments.length; i++) {\n      var replacement = arguments[i] || {};\n  \n      for (key in replacement) {\n        // Recurse into object except if the object is a DOM element\n        if(typeof result[key] === 'object' && ! isDOMElement(result[key])) {\n          result[key] = extend(result[key], replacement[key]);\n        }\n        else {\n          result[key] = result[key] || replacement[key];\n        }\n      }\n    }\n  \n    return result;\n  }\n  \n  /**\n   * Helper function for normalizing tolerance option to object format\n   */\n  function normalizeTolerance (t) {\n    return t === Object(t) ? t : { down : t, up : t };\n  }\n  \n  /**\n   * UI enhancement for fixed headers.\n   * Hides header when scrolling down\n   * Shows header when scrolling up\n   * @constructor\n   * @param {DOMElement} elem the header element\n   * @param {Object} options options for the widget\n   */\n  function Headroom (elem, options) {\n    options = extend(options, Headroom.options);\n  \n    this.lastKnownScrollY = 0;\n    this.elem             = elem;\n    this.tolerance        = normalizeTolerance(options.tolerance);\n    this.classes          = options.classes;\n    this.offset           = options.offset;\n    this.scroller         = options.scroller;\n    this.initialised      = false;\n    this.onPin            = options.onPin;\n    this.onUnpin          = options.onUnpin;\n    this.onTop            = options.onTop;\n    this.onNotTop         = options.onNotTop;\n    this.onBottom         = options.onBottom;\n    this.onNotBottom      = options.onNotBottom;\n  }\n  Headroom.prototype = {\n    constructor : Headroom,\n  \n    /**\n     * Initialises the widget\n     */\n    init : function() {\n      if(!Headroom.cutsTheMustard) {\n        return;\n      }\n  \n      this.debouncer = new Debouncer(this.update.bind(this));\n      this.elem.classList.add(this.classes.initial);\n  \n      // defer event registration to handle browser\n      // potentially restoring previous scroll position\n      setTimeout(this.attachEvent.bind(this), 100);\n  \n      return this;\n    },\n  \n    /**\n     * Unattaches events and removes any classes that were added\n     */\n    destroy : function() {\n      var classes = this.classes;\n  \n      this.initialised = false;\n  \n      for (var key in classes) {\n        if(classes.hasOwnProperty(key)) {\n          this.elem.classList.remove(classes[key]);\n        }\n      }\n  \n      this.scroller.removeEventListener('scroll', this.debouncer, false);\n    },\n  \n    /**\n     * Attaches the scroll event\n     * @private\n     */\n    attachEvent : function() {\n      if(!this.initialised){\n        this.lastKnownScrollY = this.getScrollY();\n        this.initialised = true;\n        this.scroller.addEventListener('scroll', this.debouncer, false);\n  \n        this.debouncer.handleEvent();\n      }\n    },\n  \n    /**\n     * Unpins the header if it's currently pinned\n     */\n    unpin : function() {\n      var classList = this.elem.classList,\n        classes = this.classes;\n  \n      if(classList.contains(classes.pinned) || !classList.contains(classes.unpinned)) {\n        classList.add(classes.unpinned);\n        classList.remove(classes.pinned);\n        this.onUnpin && this.onUnpin.call(this);\n      }\n    },\n  \n    /**\n     * Pins the header if it's currently unpinned\n     */\n    pin : function() {\n      var classList = this.elem.classList,\n        classes = this.classes;\n  \n      if(classList.contains(classes.unpinned)) {\n        classList.remove(classes.unpinned);\n        classList.add(classes.pinned);\n        this.onPin && this.onPin.call(this);\n      }\n    },\n  \n    /**\n     * Handles the top states\n     */\n    top : function() {\n      var classList = this.elem.classList,\n        classes = this.classes;\n  \n      if(!classList.contains(classes.top)) {\n        classList.add(classes.top);\n        classList.remove(classes.notTop);\n        this.onTop && this.onTop.call(this);\n      }\n    },\n  \n    /**\n     * Handles the not top state\n     */\n    notTop : function() {\n      var classList = this.elem.classList,\n        classes = this.classes;\n  \n      if(!classList.contains(classes.notTop)) {\n        classList.add(classes.notTop);\n        classList.remove(classes.top);\n        this.onNotTop && this.onNotTop.call(this);\n      }\n    },\n  \n    bottom : function() {\n      var classList = this.elem.classList,\n        classes = this.classes;\n  \n      if(!classList.contains(classes.bottom)) {\n        classList.add(classes.bottom);\n        classList.remove(classes.notBottom);\n        this.onBottom && this.onBottom.call(this);\n      }\n    },\n  \n    /**\n     * Handles the not top state\n     */\n    notBottom : function() {\n      var classList = this.elem.classList,\n        classes = this.classes;\n  \n      if(!classList.contains(classes.notBottom)) {\n        classList.add(classes.notBottom);\n        classList.remove(classes.bottom);\n        this.onNotBottom && this.onNotBottom.call(this);\n      }\n    },\n  \n    /**\n     * Gets the Y scroll position\n     * @see https://developer.mozilla.org/en-US/docs/Web/API/Window.scrollY\n     * @return {Number} pixels the page has scrolled along the Y-axis\n     */\n    getScrollY : function() {\n      return (this.scroller.pageYOffset !== undefined)\n        ? this.scroller.pageYOffset\n        : (this.scroller.scrollTop !== undefined)\n          ? this.scroller.scrollTop\n          : (document.documentElement || document.body.parentNode || document.body).scrollTop;\n    },\n  \n    /**\n     * Gets the height of the viewport\n     * @see http://andylangton.co.uk/blog/development/get-viewport-size-width-and-height-javascript\n     * @return {int} the height of the viewport in pixels\n     */\n    getViewportHeight : function () {\n      return window.innerHeight\n        || document.documentElement.clientHeight\n        || document.body.clientHeight;\n    },\n  \n    /**\n     * Gets the physical height of the DOM element\n     * @param  {Object}  elm the element to calculate the physical height of which\n     * @return {int}     the physical height of the element in pixels\n     */\n    getElementPhysicalHeight : function (elm) {\n      return Math.max(\n        elm.offsetHeight,\n        elm.clientHeight\n      );\n    },\n  \n    /**\n     * Gets the physical height of the scroller element\n     * @return {int} the physical height of the scroller element in pixels\n     */\n    getScrollerPhysicalHeight : function () {\n      return (this.scroller === window || this.scroller === document.body)\n        ? this.getViewportHeight()\n        : this.getElementPhysicalHeight(this.scroller);\n    },\n  \n    /**\n     * Gets the height of the document\n     * @see http://james.padolsey.com/javascript/get-document-height-cross-browser/\n     * @return {int} the height of the document in pixels\n     */\n    getDocumentHeight : function () {\n      var body = document.body,\n        documentElement = document.documentElement;\n  \n      return Math.max(\n        body.scrollHeight, documentElement.scrollHeight,\n        body.offsetHeight, documentElement.offsetHeight,\n        body.clientHeight, documentElement.clientHeight\n      );\n    },\n  \n    /**\n     * Gets the height of the DOM element\n     * @param  {Object}  elm the element to calculate the height of which\n     * @return {int}     the height of the element in pixels\n     */\n    getElementHeight : function (elm) {\n      return Math.max(\n        elm.scrollHeight,\n        elm.offsetHeight,\n        elm.clientHeight\n      );\n    },\n  \n    /**\n     * Gets the height of the scroller element\n     * @return {int} the height of the scroller element in pixels\n     */\n    getScrollerHeight : function () {\n      return (this.scroller === window || this.scroller === document.body)\n        ? this.getDocumentHeight()\n        : this.getElementHeight(this.scroller);\n    },\n  \n    /**\n     * determines if the scroll position is outside of document boundaries\n     * @param  {int}  currentScrollY the current y scroll position\n     * @return {bool} true if out of bounds, false otherwise\n     */\n    isOutOfBounds : function (currentScrollY) {\n      var pastTop  = currentScrollY < 0,\n        pastBottom = currentScrollY + this.getScrollerPhysicalHeight() > this.getScrollerHeight();\n  \n      return pastTop || pastBottom;\n    },\n  \n    /**\n     * determines if the tolerance has been exceeded\n     * @param  {int} currentScrollY the current scroll y position\n     * @return {bool} true if tolerance exceeded, false otherwise\n     */\n    toleranceExceeded : function (currentScrollY, direction) {\n      return Math.abs(currentScrollY-this.lastKnownScrollY) >= this.tolerance[direction];\n    },\n  \n    /**\n     * determine if it is appropriate to unpin\n     * @param  {int} currentScrollY the current y scroll position\n     * @param  {bool} toleranceExceeded has the tolerance been exceeded?\n     * @return {bool} true if should unpin, false otherwise\n     */\n    shouldUnpin : function (currentScrollY, toleranceExceeded) {\n      var scrollingDown = currentScrollY > this.lastKnownScrollY,\n        pastOffset = currentScrollY >= this.offset;\n  \n      return scrollingDown && pastOffset && toleranceExceeded;\n    },\n  \n    /**\n     * determine if it is appropriate to pin\n     * @param  {int} currentScrollY the current y scroll position\n     * @param  {bool} toleranceExceeded has the tolerance been exceeded?\n     * @return {bool} true if should pin, false otherwise\n     */\n    shouldPin : function (currentScrollY, toleranceExceeded) {\n      var scrollingUp  = currentScrollY < this.lastKnownScrollY,\n        pastOffset = currentScrollY <= this.offset;\n  \n      return (scrollingUp && toleranceExceeded) || pastOffset;\n    },\n  \n    /**\n     * Handles updating the state of the widget\n     */\n    update : function() {\n      var currentScrollY  = this.getScrollY(),\n        scrollDirection = currentScrollY > this.lastKnownScrollY ? 'down' : 'up',\n        toleranceExceeded = this.toleranceExceeded(currentScrollY, scrollDirection);\n  \n      if(this.isOutOfBounds(currentScrollY)) { // Ignore bouncy scrolling in OSX\n        return;\n      }\n  \n      if (currentScrollY <= this.offset ) {\n        this.top();\n      } else {\n        this.notTop();\n      }\n  \n      if(currentScrollY + this.getViewportHeight() >= this.getScrollerHeight()) {\n        this.bottom();\n      }\n      else {\n        this.notBottom();\n      }\n  \n      if(this.shouldUnpin(currentScrollY, toleranceExceeded)) {\n        this.unpin();\n      }\n      else if(this.shouldPin(currentScrollY, toleranceExceeded)) {\n        this.pin();\n      }\n  \n      this.lastKnownScrollY = currentScrollY;\n    }\n  };\n  /**\n   * Default options\n   * @type {Object}\n   */\n  Headroom.options = {\n    tolerance : {\n      up : 0,\n      down : 0\n    },\n    offset : 0,\n    scroller: window,\n    classes : {\n      pinned : 'headroom--pinned',\n      unpinned : 'headroom--unpinned',\n      top : 'headroom--top',\n      notTop : 'headroom--not-top',\n      bottom : 'headroom--bottom',\n      notBottom : 'headroom--not-bottom',\n      initial : 'headroom'\n    }\n  };\n  Headroom.cutsTheMustard = typeof features !== 'undefined' && features.rAF && features.bind && features.classList;\n\n  return Headroom;\n}));\n\n\n       /* headroom */ \n        var myElement = document.querySelector(\".headroom\");\n        var headroom  = new Headroom(myElement);\n        headroom.init();", "domain": "javascript", "lang": "code", "char_count": 13705, "word_count": 2694, "byte_count": 13705}
{"text": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\n\nvar _sliceAnsi = _interopRequireDefault(require(\"slice-ansi\"));\n\nvar _stringWidth = _interopRequireDefault(require(\"string-width\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * @param {string} input\n * @param {number} size\n * @returns {Array}\n */\nconst wrapWord = (input, size) => {\n  let subject;\n  subject = input;\n  const chunks = []; // https://regex101.com/r/gY5kZ1/1\n\n  const re = new RegExp('(^.{1,' + size + '}(\\\\s+|$))|(^.{1,' + (size - 1) + '}(\\\\\\\\|/|_|\\\\.|,|;|-))');\n\n  do {\n    let chunk;\n    chunk = subject.match(re);\n\n    if (chunk) {\n      chunk = chunk[0];\n      subject = (0, _sliceAnsi.default)(subject, (0, _stringWidth.default)(chunk));\n      chunk = chunk.trim();\n    } else {\n      chunk = (0, _sliceAnsi.default)(subject, 0, size);\n      subject = (0, _sliceAnsi.default)(subject, size);\n    }\n\n    chunks.push(chunk);\n  } while ((0, _stringWidth.default)(subject));\n\n  return chunks;\n};\n\nvar _default = wrapWord;\nexports.default = _default;\n//# sourceMappingURL=wrapWord.js.map", "domain": "javascript", "lang": "code", "char_count": 1170, "word_count": 316, "byte_count": 1170}
{"text": "(window.webpackJsonp=window.webpackJsonp||[]).push([[315],{367:function(n,e,t){\"use strict\";t.r(e),t.d(e,\"frontMatter\",(function(){return i})),t.d(e,\"metadata\",(function(){return r})),t.d(e,\"rightToc\",(function(){return l})),t.d(e,\"default\",(function(){return S}));var o=t(2),a=t(6),s=(t(0),t(431)),i={id:\"configuration\",title:\"Configuration\"},r={unversionedId:\"reference/configuration\",id:\"version-v0.5/reference/configuration\",isDocsHomePage:!1,title:\"Configuration\",description:\"\\x3c!-- THIS FILE IS BEING AUTO-GENERATED. DO NOT MODIFY IT AS ALL CHANGES WILL BE OVERWRITTEN.\",source:\"@site/versioned_docs/version-v0.5/reference/configuration.md\",slug:\"/reference/configuration\",permalink:\"/kratos/docs/reference/configuration\",editUrl:\"https://github.com/ory/kratos/edit/master/docs/versioned_docs/version-v0.5/reference/configuration.md\",version:\"v0.5\",lastUpdatedBy:\"aeneasr\",lastUpdatedAt:1603806907,sidebar:\"version-v0.5/docs\",previous:{title:\"Setting up Password Hashing Parameters\",permalink:\"/kratos/docs/guides/setting-up-password-hashing-parameters\"},next:{title:\"JSON Schema and JSON Paths\",permalink:\"/kratos/docs/reference/json-schema-json-paths\"}},l=[],u={rightToc:l};function S(n){var e=n.components,t=Object(a.a)(n,[\"components\"]);return Object(s.b)(\"wrapper\",Object(o.a)({},u,t,{components:e,mdxType:\"MDXLayout\"}),Object(s.b)(\"p\",null,\"If file \",Object(s.b)(\"inlineCode\",{parentName:\"p\"},\"$HOME/.kratos.yaml\"),\" exists, it will be used as a configuration file which supports all\\nconfiguration settings listed below.\"),Object(s.b)(\"p\",null,\"You can load the config file from another source using the \",Object(s.b)(\"inlineCode\",{parentName:\"p\"},\"-c path/to/config.yaml\"),\" or \",Object(s.b)(\"inlineCode\",{parentName:\"p\"},\"--config path/to/config.yaml\"),\"\\nflag: \",Object(s.b)(\"inlineCode\",{parentName:\"p\"},\"kratos --config path/to/config.yaml\"),\".\"),Object(s.b)(\"p\",null,\"Config files can be formatted as JSON, YAML and TOML. Some configuration values support reloading without server restart.\\nAll configuration values can be set using environment variables, as documented below.\"),Object(s.b)(\"p\",null,\"This reference configuration documents all keys, also deprecated ones!\\nIt is a reference for all possible configuration values.\"),Object(s.b)(\"p\",null,\"If you are looking for an example configuration, it is better to try out the quickstart.\"),Object(s.b)(\"p\",null,\"To find out more about edge cases like setting string array values through environmental variables head to the\\n\",Object(s.b)(\"a\",Object(o.a)({parentName:\"p\"},{href:\"https://www.ory.sh/docs/ecosystem/configuring\"}),\"Configuring ORY services\"),\" section.\"),Object(s.b)(\"pre\",null,Object(s.b)(\"code\",Object(o.a)({parentName:\"pre\"},{className:\"language-yaml\"}),\"## ORY Kratos Configuration\\n#\\n\\n\\n## identity ##\\n#\\nidentity:\\n  \\n  ## JSON Schema URL for default identity traits ##\\n  #\\n  # Path to the JSON Schema which describes a default identity's traits.\\n  #\\n  # Examples:\\n  # - file://path/to/identity.traits.schema.json\\n  # - https://foo.bar.com/path/to/identity.traits.schema.json\\n  # \\n  # Set this value using environment variables on\\n  # - Linux/macOS:\\n  #    $ export IDENTITY_DEFAULT_SCHEMA_URL=<value>\\n  # - Windows Command Line (CMD):\\n  #    > set IDENTITY_DEFAULT_SCHEMA_URL=<value>\\n  #\\n  default_schema_url: https://foo.bar.com/path/to/identity.traits.schema.json\\n\\n  ## Additional JSON Schemas for Identity Traits ##\\n  #\\n  # Examples:\\n  # - - id: customer\\n  #     url: https://foo.bar.com/path/to/customer.traits.schema.json\\n  #   - id: employee\\n  #     url: https://foo.bar.com/path/to/employee.traits.schema.json\\n  #   - id: employee-v2\\n  #     url: https://foo.bar.com/path/to/employee.v2.traits.schema.json\\n  # \\n  # Set this value using environment variables on\\n  # - Linux/macOS:\\n  #    $ export IDENTITY_SCHEMAS=<value>\\n  # - Windows Command Line (CMD):\\n  #    > set IDENTITY_SCHEMAS=<value>\\n  #\\n  schemas:\\n    - id: customer\\n      url: https://foo.bar.com/path/to/customer.traits.schema.json\\n    - id: employee\\n      url: https://foo.bar.com/path/to/employee.traits.schema.json\\n    - id: employee-v2\\n      url: https://foo.bar.com/path/to/employee.v2.traits.schema.json\\n\\n## Data Source Name ##\\n#\\n# DSN is used to specify the database credentials as a connection URI.\\n#\\n# Examples:\\n# - \\\"postgres://user:\\n#   password@postgresd:5432/database?sslmode=disable&max_conns=20&max_idle_conns=\\\\\\n#   4\\\"\\n# - mysql://user:secret@tcp(mysqld:3306)/database?max_conns=20&max_idle_conns=4\\n# - cockroach://user@cockroachdb:26257/database?sslmode=disable&max_conns=20&max_idle_conns=4\\n# - sqlite:///var/lib/sqlite/db.sqlite?_fk=true&mode=rwc\\n# \\n# Set this value using environment variables on\\n# - Linux/macOS:\\n#    $ export DSN=<value>\\n# - Windows Command Line (CMD):\\n#    > set DSN=<value>\\n#\\ndsn: cockroach://user@cockroachdb:26257/database?sslmode=disable&max_conns=20&max_idle_conns=4\\n\\n## selfservice ##\\n#\\nselfservice:\\n  \\n  ## Redirect browsers to set URL per default ##\\n  #\\n  # ORY Kratos redirects to this URL per default on completion of self-service flows and other browser interaction. Read this [article for more information on browser redirects](https://www.ory.sh/kratos/docs/concepts/browser-redirect-flow-completion).\\n  #\\n  # Examples:\\n  # - https://my-app.com/dashboard\\n  # - /dashboard\\n  # \\n  # Set this value using environment variables on\\n  # - Linux/macOS:\\n  #    $ export SELFSERVICE_DEFAULT_BROWSER_RETURN_URL=<value>\\n  # - Windows Command Line (CMD):\\n  #    > set SELFSERVICE_DEFAULT_BROWSER_RETURN_URL=<value>\\n  #\\n  default_browser_return_url: https://my-app.com/dashboard\\n\\n  ## Whitelisted Return To URLs ##\\n  #\\n  # List of URLs that are allowed to be redirected to. A redirection request is made by appending `?return_to=...` to Login, Registration, and other self-service flows.\\n  #\\n  # Examples:\\n  # - - https://app.my-app.com/dashboard\\n  #   - /dashboard\\n  #   - https://www.my-app.com/\\n  # \\n  # Set this value using environment variables on\\n  # - Linux/macOS:\\n  #    $ export SELFSERVICE_WHITELISTED_RETURN_URLS=<value>\\n  # - Windows Command Line (CMD):\\n  #    > set SELFSERVICE_WHITELISTED_RETURN_URLS=<value>\\n  #\\n  whitelisted_return_urls:\\n    - https://app.my-app.com/dashboard\\n    - /dashboard\\n    - https://www.my-app.com/\\n\\n  ## flows ##\\n  #\\n  flows:\\n    \\n    ## settings ##\\n    #\\n    settings:\\n      \\n      ## URL of the Settings page. ##\\n      #\\n      # URL where the Settings UI is hosted. Check the [reference implementation](https://github.com/ory/kratos-selfservice-ui-node).\\n      #\\n      # Default value: https://www.ory.sh/kratos/docs/fallback/settings\\n      #\\n      # Examples:\\n      # - https://my-app.com/user/settings\\n      # \\n      # Set this value using environment variables on\\n      # - Linux/macOS:\\n      #    $ export SELFSERVICE_FLOWS_SETTINGS_UI_URL=<value>\\n      # - Windows Command Line (CMD):\\n      #    > set SELFSERVICE_FLOWS_SETTINGS_UI_URL=<value>\\n      #\\n      ui_url: https://www.ory.sh/kratos/docs/fallback/settings\\n\\n      ## lifespan ##\\n      #\\n      # Default value: 1h\\n      #\\n      # Examples:\\n      # - 1h\\n      # - 1m\\n      # - 1s\\n      # \\n      # Set this value using environment variables on\\n      # - Linux/macOS:\\n      #    $ export SELFSERVICE_FLOWS_SETTINGS_LIFESPAN=<value>\\n      # - Windows Command Line (CMD):\\n      #    > set SELFSERVICE_FLOWS_SETTINGS_LIFESPAN=<value>\\n      #\\n      lifespan: 1h\\n\\n      ## privileged_session_max_age ##\\n      #\\n      # Default value: 1h\\n      #\\n      # Examples:\\n      # - 1h\\n      # - 1m\\n      # - 1s\\n      # \\n      # Set this value using environment variables on\\n      # - Linux/macOS:\\n      #    $ export SELFSERVICE_FLOWS_SETTINGS_PRIVILEGED_SESSION_MAX_AGE=<value>\\n      # - Windows Command Line (CMD):\\n      #    > set SELFSERVICE_FLOWS_SETTINGS_PRIVILEGED_SESSION_MAX_AGE=<value>\\n      #\\n      privileged_session_max_age: 1h\\n\\n      ## after ##\\n      #\\n      after:\\n        \\n        ## Redirect browsers to set URL per default ##\\n        #\\n        # ORY Kratos redirects to this URL per default on completion of self-service flows and other browser interaction. Read this [article for more information on browser redirects](https://www.ory.sh/kratos/docs/concepts/browser-redirect-flow-completion).\\n        #\\n        # Examples:\\n        # - https://my-app.com/dashboard\\n        # - /dashboard\\n        # \\n        # Set this value using environment variables on\\n        # - Linux/macOS:\\n        #    $ export SELFSERVICE_FLOWS_SETTINGS_AFTER_DEFAULT_BROWSER_RETURN_URL=<value>\\n        # - Windows Command Line (CMD):\\n        #    > set SELFSERVICE_FLOWS_SETTINGS_AFTER_DEFAULT_BROWSER_RETURN_URL=<value>\\n        #\\n        default_browser_return_url: https://my-app.com/dashboard\\n\\n        ## password ##\\n        #\\n        password:\\n          \\n          ## Redirect browsers to set URL per default ##\\n          #\\n          # ORY Kratos redirects to this URL per default on completion of self-service flows and other browser interaction. Read this [article for more information on browser redirects](https://www.ory.sh/kratos/docs/concepts/browser-redirect-flow-completion).\\n          #\\n          # Examples:\\n          # - https://my-app.com/dashboard\\n          # - /dashboard\\n          # \\n          # Set this value using environment variables on\\n          # - Linux/macOS:\\n          #    $ export SELFSERVICE_FLOWS_SETTINGS_AFTER_PASSWORD_DEFAULT_BROWSER_RETURN_URL=<value>\\n          # - Windows Command Line (CMD):\\n          #    > set SELFSERVICE_FLOWS_SETTINGS_AFTER_PASSWORD_DEFAULT_BROWSER_RETURN_URL=<value>\\n          #\\n          default_browser_return_url: https://my-app.com/dashboard\\n\\n          ## hooks ##\\n          #\\n          # Set this value using environment variables on\\n          # - Linux/macOS:\\n          #    $ export SELFSERVICE_FLOWS_SETTINGS_AFTER_PASSWORD_HOOKS=<value>\\n          # - Windows Command Line (CMD):\\n          #    > set SELFSERVICE_FLOWS_SETTINGS_AFTER_PASSWORD_HOOKS=<value>\\n          #\\n          hooks:\\n            - hook: verify\\n\\n        ## profile ##\\n        #\\n        profile:\\n          \\n          ## Redirect browsers to set URL per default ##\\n          #\\n          # ORY Kratos redirects to this URL per default on completion of self-service flows and other browser interaction. Read this [article for more information on browser redirects](https://www.ory.sh/kratos/docs/concepts/browser-redirect-flow-completion).\\n          #\\n          # Examples:\\n          # - https://my-app.com/dashboard\\n          # - /dashboard\\n          # \\n          # Set this value using environment variables on\\n          # - Linux/macOS:\\n          #    $ export SELFSERVICE_FLOWS_SETTINGS_AFTER_PROFILE_DEFAULT_BROWSER_RETURN_URL=<value>\\n          # - Windows Command Line (CMD):\\n          #    > set SELFSERVICE_FLOWS_SETTINGS_AFTER_PROFILE_DEFAULT_BROWSER_RETURN_URL=<value>\\n          #\\n          default_browser_return_url: /dashboard\\n\\n          ## hooks ##\\n          #\\n          # Set this value using environment variables on\\n          # - Linux/macOS:\\n          #    $ export SELFSERVICE_FLOWS_SETTINGS_AFTER_PROFILE_HOOKS=<value>\\n          # - Windows Command Line (CMD):\\n          #    > set SELFSERVICE_FLOWS_SETTINGS_AFTER_PROFILE_HOOKS=<value>\\n          #\\n          hooks:\\n            - hook: verify\\n\\n    ## logout ##\\n    #\\n    logout:\\n      \\n      ## after ##\\n      #\\n      after:\\n        \\n        ## Redirect browsers to set URL per default ##\\n        #\\n        # ORY Kratos redirects to this URL per default on completion of self-service flows and other browser interaction. Read this [article for more information on browser redirects](https://www.ory.sh/kratos/docs/concepts/browser-redirect-flow-completion).\\n        #\\n        # Examples:\\n        # - https://my-app.com/dashboard\\n        # - /dashboard\\n        # \\n        # Set this value using environment variables on\\n        # - Linux/macOS:\\n        #    $ export SELFSERVICE_FLOWS_LOGOUT_AFTER_DEFAULT_BROWSER_RETURN_URL=<value>\\n        # - Windows Command Line (CMD):\\n        #    > set SELFSERVICE_FLOWS_LOGOUT_AFTER_DEFAULT_BROWSER_RETURN_URL=<value>\\n        #\\n        default_browser_return_url: /dashboard\\n\\n    ## registration ##\\n    #\\n    registration:\\n      \\n      ## Registration UI URL ##\\n      #\\n      # URL where the Registration UI is hosted. Check the [reference implementation](https://github.com/ory/kratos-selfservice-ui-node).\\n      #\\n      # Default value: https://www.ory.sh/kratos/docs/fallback/registration\\n      #\\n      # Examples:\\n      # - https://my-app.com/signup\\n      # \\n      # Set this value using environment variables on\\n      # - Linux/macOS:\\n      #    $ export SELFSERVICE_FLOWS_REGISTRATION_UI_URL=<value>\\n      # - Windows Command Line (CMD):\\n      #    > set SELFSERVICE_FLOWS_REGISTRATION_UI_URL=<value>\\n      #\\n      ui_url: https://www.ory.sh/kratos/docs/fallback/registration\\n\\n      ## lifespan ##\\n      #\\n      # Default value: 1h\\n      #\\n      # Examples:\\n      # - 1h\\n      # - 1m\\n      # - 1s\\n      # \\n      # Set this value using environment variables on\\n      # - Linux/macOS:\\n      #    $ export SELFSERVICE_FLOWS_REGISTRATION_LIFESPAN=<value>\\n      # - Windows Command Line (CMD):\\n      #    > set SELFSERVICE_FLOWS_REGISTRATION_LIFESPAN=<value>\\n      #\\n      lifespan: 1s\\n\\n      ## after ##\\n      #\\n      after:\\n        \\n        ## Redirect browsers to set URL per default ##\\n        #\\n        # ORY Kratos redirects to this URL per default on completion of self-service flows and other browser interaction. Read this [article for more information on browser redirects](https://www.ory.sh/kratos/docs/concepts/browser-redirect-flow-completion).\\n        #\\n        # Examples:\\n        # - https://my-app.com/dashboard\\n        # - /dashboard\\n        # \\n        # Set this value using environment variables on\\n        # - Linux/macOS:\\n        #    $ export SELFSERVICE_FLOWS_REGISTRATION_AFTER_DEFAULT_BROWSER_RETURN_URL=<value>\\n        # - Windows Command Line (CMD):\\n        #    > set SELFSERVICE_FLOWS_REGISTRATION_AFTER_DEFAULT_BROWSER_RETURN_URL=<value>\\n        #\\n        default_browser_return_url: https://my-app.com/dashboard\\n\\n        ## password ##\\n        #\\n        password:\\n          \\n          ## Redirect browsers to set URL per default ##\\n          #\\n          # ORY Kratos redirects to this URL per default on completion of self-service flows and other browser interaction. Read this [article for more information on browser redirects](https://www.ory.sh/kratos/docs/concepts/browser-redirect-flow-completion).\\n          #\\n          # Examples:\\n          # - https://my-app.com/dashboard\\n          # - /dashboard\\n          # \\n          # Set this value using environment variables on\\n          # - Linux/macOS:\\n          #    $ export SELFSERVICE_FLOWS_REGISTRATION_AFTER_PASSWORD_DEFAULT_BROWSER_RETURN_URL=<value>\\n          # - Windows Command Line (CMD):\\n          #    > set SELFSERVICE_FLOWS_REGISTRATION_AFTER_PASSWORD_DEFAULT_BROWSER_RETURN_URL=<value>\\n          #\\n          default_browser_return_url: /dashboard\\n\\n          ## hooks ##\\n          #\\n          # Set this value using environment variables on\\n          # - Linux/macOS:\\n          #    $ export SELFSERVICE_FLOWS_REGISTRATION_AFTER_PASSWORD_HOOKS=<value>\\n          # - Windows Command Line (CMD):\\n          #    > set SELFSERVICE_FLOWS_REGISTRATION_AFTER_PASSWORD_HOOKS=<value>\\n          #\\n          hooks:\\n            - hook: session\\n\\n        ## oidc ##\\n        #\\n        oidc:\\n          \\n          ## Redirect browsers to set URL per default ##\\n          #\\n          # ORY Kratos redirects to this URL per default on completion of self-service flows and other browser interaction. Read this [article for more information on browser redirects](https://www.ory.sh/kratos/docs/concepts/browser-redirect-flow-completion).\\n          #\\n          # Examples:\\n          # - https://my-app.com/dashboard\\n          # - /dashboard\\n          # \\n          # Set this value using environment variables on\\n          # - Linux/macOS:\\n          #    $ export SELFSERVICE_FLOWS_REGISTRATION_AFTER_OIDC_DEFAULT_BROWSER_RETURN_URL=<value>\\n          # - Windows Command Line (CMD):\\n          #    > set SELFSERVICE_FLOWS_REGISTRATION_AFTER_OIDC_DEFAULT_BROWSER_RETURN_URL=<value>\\n          #\\n          default_browser_return_url: https://my-app.com/dashboard\\n\\n          ## hooks ##\\n          #\\n          # Set this value using environment variables on\\n          # - Linux/macOS:\\n          #    $ export SELFSERVICE_FLOWS_REGISTRATION_AFTER_OIDC_HOOKS=<value>\\n          # - Windows Command Line (CMD):\\n          #    > set SELFSERVICE_FLOWS_REGISTRATION_AFTER_OIDC_HOOKS=<value>\\n          #\\n          hooks:\\n            - hook: session\\n\\n    ## login ##\\n    #\\n    login:\\n      \\n      ## Login UI URL ##\\n      #\\n      # URL where the Login UI is hosted. Check the [reference implementation](https://github.com/ory/kratos-selfservice-ui-node).\\n      #\\n      # Default value: https://www.ory.sh/kratos/docs/fallback/login\\n      #\\n      # Examples:\\n      # - https://my-app.com/login\\n      # \\n      # Set this value using environment variables on\\n      # - Linux/macOS:\\n      #    $ export SELFSERVICE_FLOWS_LOGIN_UI_URL=<value>\\n      # - Windows Command Line (CMD):\\n      #    > set SELFSERVICE_FLOWS_LOGIN_UI_URL=<value>\\n      #\\n      ui_url: https://www.ory.sh/kratos/docs/fallback/login\\n\\n      ## lifespan ##\\n      #\\n      # Default value: 1h\\n      #\\n      # Examples:\\n      # - 1h\\n      # - 1m\\n      # - 1s\\n      # \\n      # Set this value using environment variables on\\n      # - Linux/macOS:\\n      #    $ export SELFSERVICE_FLOWS_LOGIN_LIFESPAN=<value>\\n      # - Windows Command Line (CMD):\\n      #    > set SELFSERVICE_FLOWS_LOGIN_LIFESPAN=<value>\\n      #\\n      lifespan: 1h\\n\\n      ## after ##\\n      #\\n      after:\\n        \\n        ## Redirect browsers to set URL per default ##\\n        #\\n        # ORY Kratos redirects to this URL per default on completion of self-service flows and other browser interaction. Read this [article for more information on browser redirects](https://www.ory.sh/kratos/docs/concepts/browser-redirect-flow-completion).\\n        #\\n        # Examples:\\n        # - https://my-app.com/dashboard\\n        # - /dashboard\\n        # \\n        # Set this value using environment variables on\\n        # - Linux/macOS:\\n        #    $ export SELFSERVICE_FLOWS_LOGIN_AFTER_DEFAULT_BROWSER_RETURN_URL=<value>\\n        # - Windows Command Line (CMD):\\n        #    > set SELFSERVICE_FLOWS_LOGIN_AFTER_DEFAULT_BROWSER_RETURN_URL=<value>\\n        #\\n        default_browser_return_url: /dashboard\\n\\n        ## password ##\\n        #\\n        password:\\n          \\n          ## Redirect browsers to set URL per default ##\\n          #\\n          # ORY Kratos redirects to this URL per default on completion of self-service flows and other browser interaction. Read this [article for more information on browser redirects](https://www.ory.sh/kratos/docs/concepts/browser-redirect-flow-completion).\\n          #\\n          # Examples:\\n          # - https://my-app.com/dashboard\\n          # - /dashboard\\n          # \\n          # Set this value using environment variables on\\n          # - Linux/macOS:\\n          #    $ export SELFSERVICE_FLOWS_LOGIN_AFTER_PASSWORD_DEFAULT_BROWSER_RETURN_URL=<value>\\n          # - Windows Command Line (CMD):\\n          #    > set SELFSERVICE_FLOWS_LOGIN_AFTER_PASSWORD_DEFAULT_BROWSER_RETURN_URL=<value>\\n          #\\n          default_browser_return_url: /dashboard\\n\\n          ## hooks ##\\n          #\\n          # Set this value using environment variables on\\n          # - Linux/macOS:\\n", "domain": "javascript", "lang": "code", "char_count": 19997, "word_count": 3484, "byte_count": 19997}
{"text": "import React from 'react';\nimport { BrowserRouter as Router, Link, Match, Miss } from 'react-router';\n\nimport Home from './Home';\nimport Show from './show/Show';\n//import KanbanApp from './kanban/KanbanApp';\nimport Kanban from './kanban2/Kanban';\nimport About from './About';\n\nimport NotFound from './NotFound';\n\nimport './App.css';\n\nconst App = () => {\n  return (\n    <Router>\n      <div>\n        <ul>\n          <li><Link to='/myreact-demo'>Home</Link></li>\n          <li><Link to='/myreact-demo/show'>Show</Link></li>\n          <li><Link to='/myreact-demo/kanban'>Kanban</Link></li>\n          <li><Link to='/myreact-demo/about'>About</Link></li>\n        </ul>\n        <hr/>\n          <Match exactly pattern='/myreact-demo' component={Home}/>\n          <Match pattern='/myreact-demo/show' component={Show}/>\n          <Match pattern='/myreact-demo/kanban' component={Kanban}/>\n          <Match pattern='/myreact-demo/about' component={About}/>\n          <Miss component={NotFound}/>\n      </div>\n    </Router>\n  );\n};\n\nexport default App;", "domain": "javascript", "lang": "code", "char_count": 1039, "word_count": 266, "byte_count": 1039}
{"text": "describe('$.fn.serviceStatus', function() {\n  var subject,\n      $serviceStatus;\n\n  var serviceResponse = {\n    'status': 'foo',\n    'sub_state': 'bar',\n    'active_state': 'baz',\n    'load_state': 'buzz'\n  };\n\n  beforeEach(function() {\n    jasmine.Ajax.useMock();\n    spyOn(window, 'setTimeout');\n\n    fixture.load('service-status.html');\n    $serviceStatus = $('#teaspoon-fixtures').find('.service-status');\n\n    subject = new $.PMX.ServiceStatus($serviceStatus);\n  });\n\n  describe('init', function() {\n\n    it('queries the service endpoint', function() {\n      subject.init();\n      var request = mostRecentAjaxRequest();\n      expect(request.url).toBe('/foo/bar');\n    });\n\n    it('displays the sub state', function() {\n      subject.init();\n      mockAjaxResponse();\n\n      expect($('.sub-state').text()).toEqual(\n        subject.formatPanamaxState(serviceResponse.sub_state));\n    });\n\n    it('displays the loading state', function() {\n      subject.init();\n      mockAjaxResponse();\n\n      expect($('.load-state').text()).toEqual(\n        subject.formatPanamaxState(serviceResponse.load_state));\n    });\n\n    it('displays the active state', function() {\n      subject.init();\n      mockAjaxResponse();\n\n      expect($('.active-state').text()).toEqual(\n        subject.formatPanamaxState(serviceResponse.active_state));\n    });\n\n    it('displays the Panamax state', function() {\n      subject.init();\n      mockAjaxResponse();\n\n      expect($('.panamax-state').text()).toEqual(\n        subject.formatPanamaxState(serviceResponse.status));\n    });\n\n    it('adds a CSS class matching the service status', function() {\n      subject.init();\n      mockAjaxResponse();\n\n      expect($serviceStatus.attr('class')).toContain('service-status');\n      expect($serviceStatus.attr('class')).toContain(serviceResponse.status);\n    });\n\n    it('calls window.setTimeout', function() {\n      subject.init();\n      mockAjaxResponse();\n\n      expect(window.setTimeout).toHaveBeenCalledWith(\n        subject.fetchStatus, subject.options.refreshInterval);\n    });\n\n    describe('hovering on the panamax-state element', function() {\n      var mouseenter = $.Event('mouseenter');\n      var mouseleave = $.Event('mouseleave');\n\n      it('displays the tooltip on mouseenter', function() {\n        subject.init();\n        $('.panamax-state').trigger(mouseenter);\n        expect($('.tooltip').css('display')).toBe('block');\n      });\n\n      it('hides the tooltip on mouseleave', function() {\n        subject.init();\n        $('.panamax-state').trigger(mouseleave);\n        expect($('.tooltip').css('display')).toBe('none');\n      });\n    });\n\n    describe('when a request is already in-progress', function() {\n\n      var fakeAjax = {\n        abort: function() {},\n        done: function() { return fakeAjax; }\n      };\n\n      beforeEach(function() {\n        subject.xhr = fakeAjax;\n        spyOn(fakeAjax, 'abort');\n      });\n\n      it('aborts previous requests', function() {\n        subject.init();\n        expect(fakeAjax.abort.calls.length).toEqual(1);\n      });\n    });\n  });\n\n  var mockAjaxResponse = function() {\n    mostRecentAjaxRequest().response({\n      status: 200,\n      responseText: JSON.stringify(serviceResponse)\n    });\n  };\n});", "domain": "javascript", "lang": "code", "char_count": 3227, "word_count": 746, "byte_count": 3227}
{"text": "//////////////// mock database ////////////\n export default {\n    parent:'projects/dialogflow-web-v2',\n    displayName: 'MIMIC',\n    defaultLanguageCode: 'en',\n    supportedLanguageCodes: ['ru'],\n    timeZone: 'Europe/Madrid',\n    description: 'Strategic Machines delivers compelling feature-rich conversational experiences Choose your language and send \\\"Hello\\\" to get started',\n    avatarUri: 'https://storage.googleapis.com/cloudprod-apiai/409650f9-9ecb-4ba7-af33-d95bd5190931_x.png',\n    enableLogging: true,\n    matchMode: 'MATCH_MODE_HYBRID',\n    classificationThreshold: 0.3,\n    apiVersion: 'API_VERSION_V2',\n    tier: 'TIER_STANDARD'\n}", "domain": "javascript", "lang": "code", "char_count": 645, "word_count": 87, "byte_count": 645}
{"text": "/*\n ** Util functions which are dependent on ApexCharts instance\n */\n\nclass CoreUtils {\n  constructor(ctx) {\n    this.ctx = ctx\n    this.w = ctx.w\n  }\n\n  static checkComboSeries(series) {\n    let comboCharts = false\n    let comboBarCount = 0\n\n    // if user specified a type in series too, turn on comboCharts flag\n    if (series.length && typeof series[0].type !== 'undefined') {\n      comboCharts = true\n      series.forEach((s) => {\n        if (\n          s.type === 'bar' ||\n          s.type === 'column' ||\n          s.type === 'candlestick'\n        ) {\n          comboBarCount++\n        }\n      })\n    }\n\n    return {\n      comboBarCount,\n      comboCharts\n    }\n  }\n\n  /**\n   * @memberof CoreUtils\n   * returns the sum of all individual values in a multiple stacked series\n   * Eg. w.globals.series = [[32,33,43,12], [2,3,5,1]]\n   *  @return [34,36,48,13]\n   **/\n  getStackedSeriesTotals() {\n    const w = this.w\n    let total = []\n\n    if (w.globals.series.length === 0) return total\n\n    for (\n      let i = 0;\n      i < w.globals.series[w.globals.maxValsInArrayIndex].length;\n      i++\n    ) {\n      let t = 0\n      for (let j = 0; j < w.globals.series.length; j++) {\n        if (typeof w.globals.series[j][i] !== 'undefined') {\n          t += w.globals.series[j][i]\n        }\n      }\n      total.push(t)\n    }\n    w.globals.stackedSeriesTotals = total\n    return total\n  }\n\n  // get total of the all values inside all series\n  getSeriesTotalByIndex(index = null) {\n    if (index === null) {\n      // non-plot chart types - pie / donut / circle\n      return this.w.config.series.reduce((acc, cur) => acc + cur, 0)\n    } else {\n      // axis charts - supporting multiple series\n      return this.w.globals.series[index].reduce((acc, cur) => acc + cur, 0)\n    }\n  }\n\n  isSeriesNull(index = null) {\n    let r = []\n    if (index === null) {\n      // non-plot chart types - pie / donut / circle\n      r = this.w.config.series.filter((d) => d !== null)\n    } else {\n      // axis charts - supporting multiple series\n      r = this.w.config.series[index].data.filter((d) => d !== null)\n    }\n\n    return r.length === 0\n  }\n\n  seriesHaveSameValues(index) {\n    console.log('coreUtils.js', this.w.globals.series)\n    return (\n      this.w.globals.series &&\n      this.w.globals.series[index] &&\n      this.w.globals.series[index].every((val, i, arr) => val === arr[0])\n    )\n  }\n\n  getCategoryLabels(labels) {\n    const w = this.w\n    let catLabels = labels.slice()\n    if (w.config.xaxis.convertedCatToNumeric) {\n      catLabels = labels.map((i, li) => {\n        return w.config.xaxis.labels.formatter(i - w.globals.minX + 1)\n      })\n    }\n    return catLabels\n  }\n  // maxValsInArrayIndex is the index of series[] which has the largest number of items\n  getLargestSeries() {\n    const w = this.w\n    w.globals.maxValsInArrayIndex = w.globals.series\n      .map((a) => a.length)\n      .indexOf(\n        Math.max.apply(\n          Math,\n          w.globals.series.map((a) => a.length)\n        )\n      )\n  }\n\n  getLargestMarkerSize() {\n    const w = this.w\n    let size = 0\n\n    w.globals.markers.size.forEach((m) => {\n      size = Math.max(size, m)\n    })\n\n    w.globals.markers.largestSize = size\n\n    return size\n  }\n\n  /**\n   * @memberof Core\n   * returns the sum of all values in a series\n   * Eg. w.globals.series = [[32,33,43,12], [2,3,5,1]]\n   *  @return [120, 11]\n   **/\n  getSeriesTotals() {\n    const w = this.w\n\n    w.globals.seriesTotals = w.globals.series.map((ser, index) => {\n      let total = 0\n\n      if (Array.isArray(ser)) {\n        for (let j = 0; j < ser.length; j++) {\n          total += ser[j]\n        }\n      } else {\n        // for pie/donuts/gauges\n        total += ser\n      }\n\n      return total\n    })\n  }\n\n  getSeriesTotalsXRange(minX, maxX) {\n    const w = this.w\n\n    const seriesTotalsXRange = w.globals.series.map((ser, index) => {\n      let total = 0\n\n      for (let j = 0; j < ser.length; j++) {\n        if (\n          w.globals.seriesX[index][j] > minX &&\n          w.globals.seriesX[index][j] < maxX\n        ) {\n          total += ser[j]\n        }\n      }\n\n      return total\n    })\n\n    return seriesTotalsXRange\n  }\n\n  /**\n   * @memberof CoreUtils\n   * returns the percentage value of all individual values which can be used in a 100% stacked series\n   * Eg. w.globals.series = [[32, 33, 43, 12], [2, 3, 5, 1]]\n   *  @return [[94.11, 91.66, 89.58, 92.30], [5.88, 8.33, 10.41, 7.7]]\n   **/\n  getPercentSeries() {\n    const w = this.w\n\n    w.globals.seriesPercent = w.globals.series.map((ser, index) => {\n      let seriesPercent = []\n      if (Array.isArray(ser)) {\n        for (let j = 0; j < ser.length; j++) {\n          let total = w.globals.stackedSeriesTotals[j]\n          let percent = 0\n          if (total) {\n            percent = (100 * ser[j]) / total\n          }\n          seriesPercent.push(percent)\n        }\n      } else {\n        const total = w.globals.seriesTotals.reduce((acc, val) => acc + val, 0)\n        let percent = (100 * ser) / total\n        seriesPercent.push(percent)\n      }\n\n      return seriesPercent\n    })\n  }\n\n  getCalculatedRatios() {\n    let gl = this.w.globals\n\n    let yRatio = []\n    let invertedYRatio = 0\n    let xRatio = 0\n    let initialXRatio = 0\n    let invertedXRatio = 0\n    let zRatio = 0\n    let baseLineY = []\n    let baseLineInvertedY = 0.1\n    let baseLineX = 0\n\n    gl.yRange = []\n    if (gl.isMultipleYAxis) {\n      for (let i = 0; i < gl.minYArr.length; i++) {\n        gl.yRange.push(Math.abs(gl.minYArr[i] - gl.maxYArr[i]))\n        baseLineY.push(0)\n      }\n    } else {\n      gl.yRange.push(Math.abs(gl.minY - gl.maxY))\n    }\n    gl.xRange = Math.abs(gl.maxX - gl.minX)\n    gl.zRange = Math.abs(gl.maxZ - gl.minZ)\n\n    // multiple y axis\n    for (let i = 0; i < gl.yRange.length; i++) {\n      yRatio.push(gl.yRange[i] / gl.gridHeight)\n    }\n\n    xRatio = gl.xRange / gl.gridWidth\n\n    initialXRatio = Math.abs(gl.initialMaxX - gl.initialMinX) / gl.gridWidth\n\n    invertedYRatio = gl.yRange / gl.gridWidth\n    invertedXRatio = gl.xRange / gl.gridHeight\n    zRatio = (gl.zRange / gl.gridHeight) * 16\n\n    if (!zRatio) {\n      zRatio = 1\n    }\n\n    if (gl.minY !== Number.MIN_VALUE && Math.abs(gl.minY) !== 0) {\n      // Negative numbers present in series\n      gl.hasNegs = true\n    }\n\n    if (gl.isMultipleYAxis) {\n      baseLineY = []\n\n      // baseline variables is the 0 of the yaxis which will be needed when there are negatives\n      for (let i = 0; i < yRatio.length; i++) {\n        baseLineY.push(-gl.minYArr[i] / yRatio[i])\n      }\n    } else {\n      baseLineY.push(-gl.minY / yRatio[0])\n\n      if (gl.minY !== Number.MIN_VALUE && Math.abs(gl.minY) !== 0) {\n        baseLineInvertedY = -gl.minY / invertedYRatio // this is for bar chart\n        baseLineX = gl.minX / xRatio\n      }\n    }\n\n    return {\n      yRatio,\n      invertedYRatio,\n      zRatio,\n      xRatio,\n      initialXRatio,\n      invertedXRatio,\n      baseLineInvertedY,\n      baseLineY,\n      baseLineX\n    }\n  }\n\n  getLogSeries(series) {\n    const w = this.w\n\n    w.globals.seriesLog = series.map((s, i) => {\n      if (w.config.yaxis[i] && w.config.yaxis[i].logarithmic) {\n        return s.map((d) => {\n          if (d === null) return null\n\n          return this.getLogVal(d, i)\n        })\n      } else {\n        return s\n      }\n    })\n\n    return w.globals.invalidLogScale ? series : w.globals.seriesLog\n  }\n\n  getLogVal(d, yIndex) {\n    const w = this.w\n    return (\n      (Math.log(d) - Math.log(w.globals.minYArr[yIndex])) /\n      (Math.log(w.globals.maxYArr[yIndex]) -\n        Math.log(w.globals.minYArr[yIndex]))\n    )\n  }\n\n  getLogYRatios(yRatio) {\n    const w = this.w\n    const gl = this.w.globals\n\n    gl.yLogRatio = yRatio.slice()\n\n    gl.logYRange = gl.yRange.map((yRange, i) => {\n      if (w.config.yaxis[i] && this.w.config.yaxis[i].logarithmic) {\n        let maxY = -Number.MAX_VALUE\n        let minY = Number.MIN_VALUE\n        let range = 1\n        gl.seriesLog.forEach((s, si) => {\n          s.forEach((v) => {\n            if (w.config.yaxis[si] && w.config.yaxis[si].logarithmic) {\n              maxY = Math.max(v, maxY)\n              minY = Math.min(v, minY)\n            }\n          })\n        })\n\n        range = Math.pow(gl.yRange[i], Math.abs(minY - maxY) / gl.yRange[i])\n\n        gl.yLogRatio[i] = range / gl.gridHeight\n        return range\n      }\n    })\n\n    return gl.invalidLogScale ? yRatio.slice() : gl.yLogRatio\n  }\n\n  // Some config objects can be array - and we need to extend them correctly\n  static extendArrayProps(configInstance, options, w) {\n    if (options.yaxis) {\n      options = configInstance.extendYAxis(options, w)\n    }\n    if (options.annotations) {\n      if (options.annotations.yaxis) {\n        options = configInstance.extendYAxisAnnotations(options)\n      }\n      if (options.annotations.xaxis) {\n        options = configInstance.extendXAxisAnnotations(options)\n      }\n      if (options.annotations.points) {\n        options = configInstance.extendPointAnnotations(options)\n      }\n    }\n\n    return options\n  }\n}\n\nexport default CoreUtils", "domain": "javascript", "lang": "code", "char_count": 9059, "word_count": 2177, "byte_count": 9059}
