text
stringlengths
2
1.05M
/******************************************************************************* Write a function snakeToCamel(str) that takes in a snake_cased string and returns the string CamelCased. snake_case is a string where each word is separated with underscores (_). CamelCase is a string where the first char of each word is capitalized, all other characters lowercase. Examples: snakeToCamel('snakes_go_hiss'); // => 'SnakesGoHiss' snakeToCamel('say_hello_world'); // => 'SayHelloWorld' snakeToCamel('bootcamp_prep_is_cool'); // => 'BootcampPrepIsCool' snakeToCamel('BOOtcamp_PREP_iS_cOol'); // => 'BootcampPrepIsCool' *******************************************************************************/ function snakeToCamel(str) { var answer = [] var seperated = str.split('_') for (var i = 0; i < seperated.length; i++) { var word = seperated[i] // answer.push(word[0].toUpperCase() + word.slice(1).toLowerCase()) for (var j = 0; j < word.length; j++) { var letter = word[j] if (j === 0){ answer.push(letter.toUpperCase()) } else { answer.push(letter.toLowerCase()) } } } return answer.join('') } /**************DO NOT MODIFY ANYTHING UNDER THIS LINE*************************/ module.exports = snakeToCamel;
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.generateData = generateData; exports.calcTotal = calcTotal; exports.filterParentPosition = filterParentPosition; exports.getFilterExpandedKeys = getFilterExpandedKeys; exports.getRadioSelectKeys = getRadioSelectKeys; /* eslint no-loop-func: 0*/ /* eslint no-console:0 */ function generateData() { var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 3; var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2; var z = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1; var gData = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : []; // x:每一级下的节点总数。y:每级节点里有y个节点、存在子节点。z:树的level层级数(0表示一级) function _loop(_level, _preKey, _tns) { var preKey = _preKey || '0'; var tns = _tns || gData; var children = []; for (var i = 0; i < x; i++) { var key = preKey + '-' + i; tns.push({ title: key + '-label', key: key + '-key' }); if (i < y) { children.push(key); } } if (_level < 0) { return tns; } var __level = _level - 1; children.forEach(function (key, index) { tns[index].children = []; return _loop(__level, key, tns[index].children); }); } _loop(z); return gData; } function calcTotal() { var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 3; var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2; var z = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1; /* eslint no-param-reassign:0*/ var rec = function rec(n) { return n >= 0 ? x * Math.pow(y, n--) + rec(n) : 0; }; return rec(z + 1); } console.log('总节点数(单个tree):', calcTotal()); // 性能测试:总节点数超过 2000(z要小)明显感觉慢。z 变大时,递归多,会卡死。 var gData = exports.gData = generateData(); function isPositionPrefix(smallPos, bigPos) { if (bigPos.length < smallPos.length) { return false; } // attention: "0-0-1" "0-0-10" if (bigPos.length > smallPos.length && bigPos.charAt(smallPos.length) !== '-') { return false; } return bigPos.substr(0, smallPos.length) === smallPos; } // console.log(isPositionPrefix("0-1", "0-10-1")); // arr.length === 628, use time: ~20ms function filterParentPosition(arr) { var levelObj = {}; arr.forEach(function (item) { var posLen = item.split('-').length; if (!levelObj[posLen]) { levelObj[posLen] = []; } levelObj[posLen].push(item); }); var levelArr = Object.keys(levelObj).sort(); var _loop2 = function _loop2(i) { if (levelArr[i + 1]) { levelObj[levelArr[i]].forEach(function (ii) { var _loop3 = function _loop3(j) { levelObj[levelArr[j]].forEach(function (_i, index) { if (isPositionPrefix(ii, _i)) { levelObj[levelArr[j]][index] = null; } }); levelObj[levelArr[j]] = levelObj[levelArr[j]].filter(function (p) { return p; }); }; for (var j = i + 1; j < levelArr.length; j++) { _loop3(j); } }); } }; for (var i = 0; i < levelArr.length; i++) { _loop2(i); } var nArr = []; levelArr.forEach(function (i) { nArr = nArr.concat(levelObj[i]); }); return nArr; } // console.log(filterParentPosition( // ['0-2', '0-3-3', '0-10', '0-10-0', '0-0-1', '0-0', '0-1-1', '0-1'] // )); function loopData(data, callback) { var loop = function loop(d) { var level = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; d.forEach(function (item, index) { var pos = level + '-' + index; if (item.children) { loop(item.children, pos); } callback(item, index, pos); }); }; loop(data); } function spl(str) { return str.split('-'); } function splitLen(str) { return str.split('-').length; } function getFilterExpandedKeys(data, expandedKeys) { var expandedPosArr = []; loopData(data, function (item, index, pos) { if (expandedKeys.indexOf(item.key) > -1) { expandedPosArr.push(pos); } }); var filterExpandedKeys = []; loopData(data, function (item, index, pos) { expandedPosArr.forEach(function (p) { if ((splitLen(pos) < splitLen(p) && p.indexOf(pos) === 0 || pos === p) && filterExpandedKeys.indexOf(item.key) === -1) { filterExpandedKeys.push(item.key); } }); }); return filterExpandedKeys; } function isSibling(pos, pos1) { pos.pop(); pos1.pop(); return pos.join(',') === pos1.join(','); } function getRadioSelectKeys(data, selectedKeys, key) { var res = []; var pkObjArr = []; var selPkObjArr = []; loopData(data, function (item, index, pos) { if (selectedKeys.indexOf(item.key) > -1) { pkObjArr.push([pos, item.key]); } if (key && key === item.key) { selPkObjArr.push(pos, item.key); } }); var lenObj = {}; var getPosKey = function getPosKey(pos, k) { var posLen = splitLen(pos); if (!lenObj[posLen]) { lenObj[posLen] = [[pos, k]]; } else { lenObj[posLen].forEach(function (pkArr, i) { if (isSibling(spl(pkArr[0]), spl(pos))) { // 后来覆盖前者 lenObj[posLen][i] = [pos, k]; } else if (spl(pkArr[0]) !== spl(pos)) { lenObj[posLen].push([pos, k]); } }); } }; pkObjArr.forEach(function (pk) { getPosKey(pk[0], pk[1]); }); if (key) { getPosKey(selPkObjArr[0], selPkObjArr[1]); } Object.keys(lenObj).forEach(function (item) { lenObj[item].forEach(function (i) { if (res.indexOf(i[1]) === -1) { res.push(i[1]); } }); }); return res; }
define("StandardViewMatrices", ["./StandardView"], function (e) { var t = [e.Top, e.Bottom, e.Left, e.Right, e.Front, e.Back, e.Iso, e.RightIso]; return t })
"use strict"; /* * Created with @iobroker/create-adapter v1.29.1 */ // The adapter-core module gives you access to the core ioBroker functions // you need to create an adapter const utils = require("@iobroker/adapter-core"); // Load your modules here, e.g.: // const fs = require("fs"); class Homemode extends utils.Adapter { /** * @param {Partial<utils.AdapterOptions>} [options={}] */ constructor(options) { super({ ...options, name: "homemode", }); this.on("ready", this.onReady.bind(this)); this.on("stateChange", this.onStateChange.bind(this)); // this.on("objectChange", this.onObjectChange.bind(this)); // this.on("message", this.onMessage.bind(this)); this.on("unload", this.onUnload.bind(this)); } /** * Is called when databases are connected and adapter received configuration. */ async onReady() { // Initialize your adapter here // The adapters config (in the instance object everything under the attribute "native") is accessible via // this.config: this.log.info("config option1: " + this.config.option1); this.log.info("config option2: " + this.config.option2); /* For every state in the system there has to be also an object of type state Here a simple template for a boolean variable named "testVariable" Because every adapter instance uses its own unique namespace variable names can't collide with other adapters variables */ await this.setObjectNotExistsAsync("testVariable", { type: "state", common: { name: "testVariable", type: "boolean", role: "indicator", read: true, write: true, }, native: {}, }); // In order to get state updates, you need to subscribe to them. The following line adds a subscription for our variable we have created above. this.subscribeStates("testVariable"); // You can also add a subscription for multiple states. The following line watches all states starting with "lights." // this.subscribeStates("lights.*"); // Or, if you really must, you can also watch all states. Don't do this if you don't need to. Otherwise this will cause a lot of unnecessary load on the system: // this.subscribeStates("*"); /* setState examples you will notice that each setState will cause the stateChange event to fire (because of above subscribeStates cmd) */ // the variable testVariable is set to true as command (ack=false) await this.setStateAsync("testVariable", true); // same thing, but the value is flagged "ack" // ack should be always set to true if the value is received from or acknowledged from the target system await this.setStateAsync("testVariable", { val: true, ack: true }); // same thing, but the state is deleted after 30s (getState will return null afterwards) await this.setStateAsync("testVariable", { val: true, ack: true, expire: 30 }); // examples for the checkPassword/checkGroup functions let result = await this.checkPasswordAsync("admin", "iobroker"); this.log.info("check user admin pw iobroker: " + result); result = await this.checkGroupAsync("admin", "admin"); this.log.info("check group user admin group admin: " + result); } /** * Is called when adapter shuts down - callback has to be called under any circumstances! * @param {() => void} callback */ onUnload(callback) { try { // Here you must clear all timeouts or intervals that may still be active // clearTimeout(timeout1); // clearTimeout(timeout2); // ... // clearInterval(interval1); callback(); } catch (e) { callback(); } } // If you need to react to object changes, uncomment the following block and the corresponding line in the constructor. // You also need to subscribe to the objects with `this.subscribeObjects`, similar to `this.subscribeStates`. // /** // * Is called if a subscribed object changes // * @param {string} id // * @param {ioBroker.Object | null | undefined} obj // */ // onObjectChange(id, obj) { // if (obj) { // // The object was changed // this.log.info(`object ${id} changed: ${JSON.stringify(obj)}`); // } else { // // The object was deleted // this.log.info(`object ${id} deleted`); // } // } /** * Is called if a subscribed state changes * @param {string} id * @param {ioBroker.State | null | undefined} state */ onStateChange(id, state) { if (state) { // The state was changed this.log.info(`state ${id} changed: ${state.val} (ack = ${state.ack})`); } else { // The state was deleted this.log.info(`state ${id} deleted`); } } // If you need to accept messages in your adapter, uncomment the following block and the corresponding line in the constructor. // /** // * Some message was sent to this instance over message box. Used by email, pushover, text2speech, ... // * Using this method requires "common.message" property to be set to true in io-package.json // * @param {ioBroker.Message} obj // */ // onMessage(obj) { // if (typeof obj === "object" && obj.message) { // if (obj.command === "send") { // // e.g. send email or pushover or whatever // this.log.info("send command"); // // Send response in callback if required // if (obj.callback) this.sendTo(obj.from, obj.command, "Message received", obj.callback); // } // } // } } // @ts-ignore parent is a valid property on module if (module.parent) { // Export the constructor in compact mode /** * @param {Partial<utils.AdapterOptions>} [options={}] */ module.exports = (options) => new Homemode(options); } else { // otherwise start the instance directly new Homemode(); }
//----------------------------------------------------------------------------- // Imports //----------------------------------------------------------------------------- import React from 'react' import styled from 'styled-components' import Divider from '../../lib/EditorDivider' import EditorImage from '../../lib/EditorImage' import EditorInput from '../../lib/EditorInput' import EditorListActions from '../../lib/EditorListActions' import EditorSegment from '../../lib/EditorSegment' import EditorTextArea from '../../lib/EditorTextArea' import HorizontalContainer from '../../lib/EditorHorizontalContainer' import VerticalContainer from '../../lib/EditorVerticalContainer' //----------------------------------------------------------------------------- // Component //----------------------------------------------------------------------------- const AboutEditor = ({about, update, ...props}) => { return ( <EditorSegment {...props} header="About"> <EditorImage label="Background Image" name="seed.pages.home.about.backgroundImage" src={about.backgroundImage} onChange={update}/> {about.details.map((detail, index) => { return ( <VerticalContainer key={index}> <Divider /> <HorizontalContainer> <VerticalContainer> <EditorInput label={"Header"} name={"seed.pages.home.about.details." + index + ".header"} value={detail.header} width="98%" onChange={update}/> <EditorTextArea label={"Blurb"} name={"seed.pages.home.about.details." + index + ".blurb"} value={detail.blurb} width="98%" onChange={update}/> </VerticalContainer> <EditorListActions index={index} itemTemplate={{header: "", blurb: ""}} list={about.details} name="seed.pages.home.about.details" onChange={update}/> </HorizontalContainer> </VerticalContainer> ) })} </EditorSegment> ) } export default AboutEditor
import React from 'react'; const Component = () => <div>Will be implemented soon</div>; export default Component;
document.addEventListener("DOMContentLoaded", function(event) { var mediaLibraryContainer = document.querySelector('.clodinary-media-library'); var mloptions = JSON.parse(mediaLibraryContainer.dataset.cloudinaryml); mloptions.inline_container = '.clodinary-media-library'; mloptions.insert_caption = ''; if (typeof cloudinary !== 'undefined') { window.ml = cloudinary.createMediaLibrary(mloptions, {}); window.ml.show(); } });
const fs = require("fs"); const path = require("path"); async function callContract(name, method, from, confirmations) { console.log(`Calling method ${method._method.name} on ${name}`); const tx = method.send({ /* * Add a buffer for changes made by transactions that are executed before this transaction but after * gas estimation has taken place (e.g. a submitBlock of ETH Relay changes gas costs of a claim transaction) */ "gas": Math.floor(1.3 * (await method.estimateGas({from}))), from, }); const inclusionPromise = tx.then(receipt => { console.log(`New transaction on ${name} with hash ${receipt.transactionHash}`); return receipt; }); if (typeof confirmations === "number") { return { "inclusion": inclusionPromise, "confirmation": new Promise((resolve, reject) => { tx .once("error", reject) .on("confirmation", (confNumber, receipt) => { if (confNumber === confirmations) { resolve(receipt); tx.off("confirmation"); } }) }), }; } return inclusionPromise; }; async function deployContract(jsonConfig, contract, constructorArguments) { console.log(`Deploying contract ${contract.name} on ${jsonConfig.name}...`); const from = jsonConfig.accounts.user.address; contract.instance.options.from = from; const tx = contract.instance.deploy({ data: contract.bytecode, arguments: constructorArguments, }); const address = (await tx.send({ "gas": await tx.estimateGas({from}), from, })).options.address; contract.instance.options.address = address; console.log(`Contract ${contract.name} deployed at ${address} on ${jsonConfig.name}`); return address; } function updateConfigJson(config, dirname) { const jsonString = JSON.stringify(config, null, 2); fs.writeFileSync(path.resolve(dirname, "config.json"), jsonString); } async function registerTokenContract(networkName, networkInstance, contractAddrToRegister, from) { return await callContract( networkName, networkInstance.contracts.protocol.instance.methods.registerTokenContract(contractAddrToRegister), from, ); } function sleep(ms) { return new Promise(resolve => { setTimeout(resolve, ms); }); }; function burn(networkFrom, networkTo) { return callContract( networkFrom.name, networkFrom.contracts.protocol.instance.methods.burn( networkTo.accounts.user.address, networkTo.contracts.protocol.instance.options.address, 1, 0, ), networkFrom.accounts.user.address, networkFrom.confirmations, ); } function claim(network, rlpHeader, rlpEncodedTx, rlpEncodedReceipt, rlpMerkleProofTx, rlpMerkleProofReceipt, path) { return callContract( network.name, network.contracts.protocol.instance.methods.claim(rlpHeader, rlpEncodedTx, rlpEncodedReceipt, rlpMerkleProofTx, rlpMerkleProofReceipt, path), network.accounts.user.address, network.confirmations, ); } function confirm(network, rlpHeader, rlpEncodedTx, rlpEncodedReceipt, rlpMerkleProofTx, rlpMerkleProofReceipt, path) { return callContract( network.name, network.contracts.protocol.instance.methods.confirm(rlpHeader, rlpEncodedTx, rlpEncodedReceipt, rlpMerkleProofTx, rlpMerkleProofReceipt, path), network.accounts.user.address, network.confirmations, ); } module.exports = { callContract, deployContract, updateConfigJson, registerTokenContract, sleep, burn, claim, confirm, };
/*! * Fine Uploader * * Copyright 2015, Widen Enterprises, Inc. info@fineuploader.com * * Version: 5.1.3 * * Homepage: http://fineuploader.com * * Repository: git://github.com/Widen/fine-uploader.git * * Licensed only under the Widen Commercial License (http://fineuploader.com/licensing). */ /*globals window, navigator, document, FormData, File, HTMLInputElement, XMLHttpRequest, Blob, Storage, ActiveXObject */ /* jshint -W079 */ var qq = function(element) { "use strict"; return { hide: function() { element.style.display = "none"; return this; }, /** Returns the function which detaches attached event */ attach: function(type, fn) { if (element.addEventListener) { element.addEventListener(type, fn, false); } else if (element.attachEvent) { element.attachEvent("on" + type, fn); } return function() { qq(element).detach(type, fn); }; }, detach: function(type, fn) { if (element.removeEventListener) { element.removeEventListener(type, fn, false); } else if (element.attachEvent) { element.detachEvent("on" + type, fn); } return this; }, contains: function(descendant) { // The [W3C spec](http://www.w3.org/TR/domcore/#dom-node-contains) // says a `null` (or ostensibly `undefined`) parameter // passed into `Node.contains` should result in a false return value. // IE7 throws an exception if the parameter is `undefined` though. if (!descendant) { return false; } // compareposition returns false in this case if (element === descendant) { return true; } if (element.contains) { return element.contains(descendant); } else { /*jslint bitwise: true*/ return !!(descendant.compareDocumentPosition(element) & 8); } }, /** * Insert this element before elementB. */ insertBefore: function(elementB) { elementB.parentNode.insertBefore(element, elementB); return this; }, remove: function() { element.parentNode.removeChild(element); return this; }, /** * Sets styles for an element. * Fixes opacity in IE6-8. */ css: function(styles) { /*jshint eqnull: true*/ if (element.style == null) { throw new qq.Error("Can't apply style to node as it is not on the HTMLElement prototype chain!"); } /*jshint -W116*/ if (styles.opacity != null) { if (typeof element.style.opacity !== "string" && typeof (element.filters) !== "undefined") { styles.filter = "alpha(opacity=" + Math.round(100 * styles.opacity) + ")"; } } qq.extend(element.style, styles); return this; }, hasClass: function(name) { var re = new RegExp("(^| )" + name + "( |$)"); return re.test(element.className); }, addClass: function(name) { if (!qq(element).hasClass(name)) { element.className += " " + name; } return this; }, removeClass: function(name) { var re = new RegExp("(^| )" + name + "( |$)"); element.className = element.className.replace(re, " ").replace(/^\s+|\s+$/g, ""); return this; }, getByClass: function(className) { var candidates, result = []; if (element.querySelectorAll) { return element.querySelectorAll("." + className); } candidates = element.getElementsByTagName("*"); qq.each(candidates, function(idx, val) { if (qq(val).hasClass(className)) { result.push(val); } }); return result; }, children: function() { var children = [], child = element.firstChild; while (child) { if (child.nodeType === 1) { children.push(child); } child = child.nextSibling; } return children; }, setText: function(text) { element.innerText = text; element.textContent = text; return this; }, clearText: function() { return qq(element).setText(""); }, // Returns true if the attribute exists on the element // AND the value of the attribute is NOT "false" (case-insensitive) hasAttribute: function(attrName) { var attrVal; if (element.hasAttribute) { if (!element.hasAttribute(attrName)) { return false; } /*jshint -W116*/ return (/^false$/i).exec(element.getAttribute(attrName)) == null; } else { attrVal = element[attrName]; if (attrVal === undefined) { return false; } /*jshint -W116*/ return (/^false$/i).exec(attrVal) == null; } } }; }; (function() { "use strict"; qq.canvasToBlob = function(canvas, mime, quality) { return qq.dataUriToBlob(canvas.toDataURL(mime, quality)); }; qq.dataUriToBlob = function(dataUri) { var arrayBuffer, byteString, createBlob = function(data, mime) { var BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder || window.MSBlobBuilder, blobBuilder = BlobBuilder && new BlobBuilder(); if (blobBuilder) { blobBuilder.append(data); return blobBuilder.getBlob(mime); } else { return new Blob([data], {type: mime}); } }, intArray, mimeString; // convert base64 to raw binary data held in a string if (dataUri.split(",")[0].indexOf("base64") >= 0) { byteString = atob(dataUri.split(",")[1]); } else { byteString = decodeURI(dataUri.split(",")[1]); } // extract the MIME mimeString = dataUri.split(",")[0] .split(":")[1] .split(";")[0]; // write the bytes of the binary string to an ArrayBuffer arrayBuffer = new ArrayBuffer(byteString.length); intArray = new Uint8Array(arrayBuffer); qq.each(byteString, function(idx, character) { intArray[idx] = character.charCodeAt(0); }); return createBlob(arrayBuffer, mimeString); }; qq.log = function(message, level) { if (window.console) { if (!level || level === "info") { window.console.log(message); } else { if (window.console[level]) { window.console[level](message); } else { window.console.log("<" + level + "> " + message); } } } }; qq.isObject = function(variable) { return variable && !variable.nodeType && Object.prototype.toString.call(variable) === "[object Object]"; }; qq.isFunction = function(variable) { return typeof (variable) === "function"; }; /** * Check the type of a value. Is it an "array"? * * @param value value to test. * @returns true if the value is an array or associated with an `ArrayBuffer` */ qq.isArray = function(value) { return Object.prototype.toString.call(value) === "[object Array]" || (value && window.ArrayBuffer && value.buffer && value.buffer.constructor === ArrayBuffer); }; // Looks for an object on a `DataTransfer` object that is associated with drop events when utilizing the Filesystem API. qq.isItemList = function(maybeItemList) { return Object.prototype.toString.call(maybeItemList) === "[object DataTransferItemList]"; }; // Looks for an object on a `NodeList` or an `HTMLCollection`|`HTMLFormElement`|`HTMLSelectElement` // object that is associated with collections of Nodes. qq.isNodeList = function(maybeNodeList) { return Object.prototype.toString.call(maybeNodeList) === "[object NodeList]" || // If `HTMLCollection` is the actual type of the object, we must determine this // by checking for expected properties/methods on the object (maybeNodeList.item && maybeNodeList.namedItem); }; qq.isString = function(maybeString) { return Object.prototype.toString.call(maybeString) === "[object String]"; }; qq.trimStr = function(string) { if (String.prototype.trim) { return string.trim(); } return string.replace(/^\s+|\s+$/g, ""); }; /** * @param str String to format. * @returns {string} A string, swapping argument values with the associated occurrence of {} in the passed string. */ qq.format = function(str) { var args = Array.prototype.slice.call(arguments, 1), newStr = str, nextIdxToReplace = newStr.indexOf("{}"); qq.each(args, function(idx, val) { var strBefore = newStr.substring(0, nextIdxToReplace), strAfter = newStr.substring(nextIdxToReplace + 2); newStr = strBefore + val + strAfter; nextIdxToReplace = newStr.indexOf("{}", nextIdxToReplace + val.length); // End the loop if we have run out of tokens (when the arguments exceed the # of tokens) if (nextIdxToReplace < 0) { return false; } }); return newStr; }; qq.isFile = function(maybeFile) { return window.File && Object.prototype.toString.call(maybeFile) === "[object File]"; }; qq.isFileList = function(maybeFileList) { return window.FileList && Object.prototype.toString.call(maybeFileList) === "[object FileList]"; }; qq.isFileOrInput = function(maybeFileOrInput) { return qq.isFile(maybeFileOrInput) || qq.isInput(maybeFileOrInput); }; qq.isInput = function(maybeInput, notFile) { var evaluateType = function(type) { var normalizedType = type.toLowerCase(); if (notFile) { return normalizedType !== "file"; } return normalizedType === "file"; }; if (window.HTMLInputElement) { if (Object.prototype.toString.call(maybeInput) === "[object HTMLInputElement]") { if (maybeInput.type && evaluateType(maybeInput.type)) { return true; } } } if (maybeInput.tagName) { if (maybeInput.tagName.toLowerCase() === "input") { if (maybeInput.type && evaluateType(maybeInput.type)) { return true; } } } return false; }; qq.isBlob = function(maybeBlob) { if (window.Blob && Object.prototype.toString.call(maybeBlob) === "[object Blob]") { return true; } }; qq.isXhrUploadSupported = function() { var input = document.createElement("input"); input.type = "file"; return ( input.multiple !== undefined && typeof File !== "undefined" && typeof FormData !== "undefined" && typeof (qq.createXhrInstance()).upload !== "undefined"); }; // Fall back to ActiveX is native XHR is disabled (possible in any version of IE). qq.createXhrInstance = function() { if (window.XMLHttpRequest) { return new XMLHttpRequest(); } try { return new ActiveXObject("MSXML2.XMLHTTP.3.0"); } catch (error) { qq.log("Neither XHR or ActiveX are supported!", "error"); return null; } }; qq.isFolderDropSupported = function(dataTransfer) { return dataTransfer.items && dataTransfer.items.length > 0 && dataTransfer.items[0].webkitGetAsEntry; }; qq.isFileChunkingSupported = function() { return !qq.androidStock() && //Android's stock browser cannot upload Blobs correctly qq.isXhrUploadSupported() && (File.prototype.slice !== undefined || File.prototype.webkitSlice !== undefined || File.prototype.mozSlice !== undefined); }; qq.sliceBlob = function(fileOrBlob, start, end) { var slicer = fileOrBlob.slice || fileOrBlob.mozSlice || fileOrBlob.webkitSlice; return slicer.call(fileOrBlob, start, end); }; qq.arrayBufferToHex = function(buffer) { var bytesAsHex = "", bytes = new Uint8Array(buffer); qq.each(bytes, function(idx, byt) { var byteAsHexStr = byt.toString(16); if (byteAsHexStr.length < 2) { byteAsHexStr = "0" + byteAsHexStr; } bytesAsHex += byteAsHexStr; }); return bytesAsHex; }; qq.readBlobToHex = function(blob, startOffset, length) { var initialBlob = qq.sliceBlob(blob, startOffset, startOffset + length), fileReader = new FileReader(), promise = new qq.Promise(); fileReader.onload = function() { promise.success(qq.arrayBufferToHex(fileReader.result)); }; fileReader.onerror = promise.failure; fileReader.readAsArrayBuffer(initialBlob); return promise; }; qq.extend = function(first, second, extendNested) { qq.each(second, function(prop, val) { if (extendNested && qq.isObject(val)) { if (first[prop] === undefined) { first[prop] = {}; } qq.extend(first[prop], val, true); } else { first[prop] = val; } }); return first; }; /** * Allow properties in one object to override properties in another, * keeping track of the original values from the target object. * * Album that the pre-overriden properties to be overriden by the source will be passed into the `sourceFn` when it is invoked. * * @param target Update properties in this object from some source * @param sourceFn A function that, when invoked, will return properties that will replace properties with the same name in the target. * @returns {object} The target object */ qq.override = function(target, sourceFn) { var super_ = {}, source = sourceFn(super_); qq.each(source, function(srcPropName, srcPropVal) { if (target[srcPropName] !== undefined) { super_[srcPropName] = target[srcPropName]; } target[srcPropName] = srcPropVal; }); return target; }; /** * Searches for a given element in the array, returns -1 if it is not present. * @param {Number} [from] The index at which to begin the search */ qq.indexOf = function(arr, elt, from) { if (arr.indexOf) { return arr.indexOf(elt, from); } from = from || 0; var len = arr.length; if (from < 0) { from += len; } for (; from < len; from += 1) { if (arr.hasOwnProperty(from) && arr[from] === elt) { return from; } } return -1; }; //this is a version 4 UUID qq.getUniqueId = function() { return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) { /*jslint eqeq: true, bitwise: true*/ var r = Math.random() * 16 | 0, v = c == "x" ? r : (r & 0x3 | 0x8); return v.toString(16); }); }; // // Browsers and platforms detection qq.ie = function() { return navigator.userAgent.indexOf("MSIE") !== -1 || navigator.userAgent.indexOf("Trident") !== -1; }; qq.ie7 = function() { return navigator.userAgent.indexOf("MSIE 7") !== -1; }; qq.ie8 = function() { return navigator.userAgent.indexOf("MSIE 8") !== -1; }; qq.ie10 = function() { return navigator.userAgent.indexOf("MSIE 10") !== -1; }; qq.ie11 = function() { return qq.ie() && navigator.userAgent.indexOf("rv:11") !== -1; }; qq.safari = function() { return navigator.vendor !== undefined && navigator.vendor.indexOf("Apple") !== -1; }; qq.chrome = function() { return navigator.vendor !== undefined && navigator.vendor.indexOf("Google") !== -1; }; qq.opera = function() { return navigator.vendor !== undefined && navigator.vendor.indexOf("Opera") !== -1; }; qq.firefox = function() { return (!qq.ie11() && navigator.userAgent.indexOf("Mozilla") !== -1 && navigator.vendor !== undefined && navigator.vendor === ""); }; qq.windows = function() { return navigator.platform === "Win32"; }; qq.android = function() { return navigator.userAgent.toLowerCase().indexOf("android") !== -1; }; // We need to identify the Android stock browser via the UA string to work around various bugs in this browser, // such as the one that prevents a `Blob` from being uploaded. qq.androidStock = function() { return qq.android() && navigator.userAgent.toLowerCase().indexOf("chrome") < 0; }; qq.ios6 = function() { return qq.ios() && navigator.userAgent.indexOf(" OS 6_") !== -1; }; qq.ios7 = function() { return qq.ios() && navigator.userAgent.indexOf(" OS 7_") !== -1; }; qq.ios8 = function() { return qq.ios() && navigator.userAgent.indexOf(" OS 8_") !== -1; }; // iOS 8.0.0 qq.ios800 = function() { return qq.ios() && navigator.userAgent.indexOf(" OS 8_0 ") !== -1; }; qq.ios = function() { /*jshint -W014 */ return navigator.userAgent.indexOf("iPad") !== -1 || navigator.userAgent.indexOf("iPod") !== -1 || navigator.userAgent.indexOf("iPhone") !== -1; }; qq.iosChrome = function() { return qq.ios() && navigator.userAgent.indexOf("CriOS") !== -1; }; qq.iosSafari = function() { return qq.ios() && !qq.iosChrome() && navigator.userAgent.indexOf("Safari") !== -1; }; qq.iosSafariWebView = function() { return qq.ios() && !qq.iosChrome() && !qq.iosSafari(); }; // // Events qq.preventDefault = function(e) { if (e.preventDefault) { e.preventDefault(); } else { e.returnValue = false; } }; /** * Creates and returns element from html string * Uses innerHTML to create an element */ qq.toElement = (function() { var div = document.createElement("div"); return function(html) { div.innerHTML = html; var element = div.firstChild; div.removeChild(element); return element; }; }()); //key and value are passed to callback for each entry in the iterable item qq.each = function(iterableItem, callback) { var keyOrIndex, retVal; if (iterableItem) { // Iterate through [`Storage`](http://www.w3.org/TR/webstorage/#the-storage-interface) items if (window.Storage && iterableItem.constructor === window.Storage) { for (keyOrIndex = 0; keyOrIndex < iterableItem.length; keyOrIndex++) { retVal = callback(iterableItem.key(keyOrIndex), iterableItem.getItem(iterableItem.key(keyOrIndex))); if (retVal === false) { break; } } } // `DataTransferItemList` & `NodeList` objects are array-like and should be treated as arrays // when iterating over items inside the object. else if (qq.isArray(iterableItem) || qq.isItemList(iterableItem) || qq.isNodeList(iterableItem)) { for (keyOrIndex = 0; keyOrIndex < iterableItem.length; keyOrIndex++) { retVal = callback(keyOrIndex, iterableItem[keyOrIndex]); if (retVal === false) { break; } } } else if (qq.isString(iterableItem)) { for (keyOrIndex = 0; keyOrIndex < iterableItem.length; keyOrIndex++) { retVal = callback(keyOrIndex, iterableItem.charAt(keyOrIndex)); if (retVal === false) { break; } } } else { for (keyOrIndex in iterableItem) { if (Object.prototype.hasOwnProperty.call(iterableItem, keyOrIndex)) { retVal = callback(keyOrIndex, iterableItem[keyOrIndex]); if (retVal === false) { break; } } } } } }; //include any args that should be passed to the new function after the context arg qq.bind = function(oldFunc, context) { if (qq.isFunction(oldFunc)) { var args = Array.prototype.slice.call(arguments, 2); return function() { var newArgs = qq.extend([], args); if (arguments.length) { newArgs = newArgs.concat(Array.prototype.slice.call(arguments)); } return oldFunc.apply(context, newArgs); }; } throw new Error("first parameter must be a function!"); }; /** * obj2url() takes a json-object as argument and generates * a querystring. pretty much like jQuery.param() * * how to use: * * `qq.obj2url({a:'b',c:'d'},'http://any.url/upload?otherParam=value');` * * will result in: * * `http://any.url/upload?otherParam=value&a=b&c=d` * * @param Object JSON-Object * @param String current querystring-part * @return String encoded querystring */ qq.obj2url = function(obj, temp, prefixDone) { /*jshint laxbreak: true*/ var uristrings = [], prefix = "&", add = function(nextObj, i) { var nextTemp = temp ? (/\[\]$/.test(temp)) // prevent double-encoding ? temp : temp + "[" + i + "]" : i; if ((nextTemp !== "undefined") && (i !== "undefined")) { uristrings.push( (typeof nextObj === "object") ? qq.obj2url(nextObj, nextTemp, true) : (Object.prototype.toString.call(nextObj) === "[object Function]") ? encodeURIComponent(nextTemp) + "=" + encodeURIComponent(nextObj()) : encodeURIComponent(nextTemp) + "=" + encodeURIComponent(nextObj) ); } }; if (!prefixDone && temp) { prefix = (/\?/.test(temp)) ? (/\?$/.test(temp)) ? "" : "&" : "?"; uristrings.push(temp); uristrings.push(qq.obj2url(obj)); } else if ((Object.prototype.toString.call(obj) === "[object Array]") && (typeof obj !== "undefined")) { qq.each(obj, function(idx, val) { add(val, idx); }); } else if ((typeof obj !== "undefined") && (obj !== null) && (typeof obj === "object")) { qq.each(obj, function(prop, val) { add(val, prop); }); } else { uristrings.push(encodeURIComponent(temp) + "=" + encodeURIComponent(obj)); } if (temp) { return uristrings.join(prefix); } else { return uristrings.join(prefix) .replace(/^&/, "") .replace(/%20/g, "+"); } }; qq.obj2FormData = function(obj, formData, arrayKeyName) { if (!formData) { formData = new FormData(); } qq.each(obj, function(key, val) { key = arrayKeyName ? arrayKeyName + "[" + key + "]" : key; if (qq.isObject(val)) { qq.obj2FormData(val, formData, key); } else if (qq.isFunction(val)) { formData.append(key, val()); } else { formData.append(key, val); } }); return formData; }; qq.obj2Inputs = function(obj, form) { var input; if (!form) { form = document.createElement("form"); } qq.obj2FormData(obj, { append: function(key, val) { input = document.createElement("input"); input.setAttribute("name", key); input.setAttribute("value", val); form.appendChild(input); } }); return form; }; /** * Not recommended for use outside of Fine Uploader since this falls back to an unchecked eval if JSON.parse is not * implemented. For a more secure JSON.parse polyfill, use Douglas Crockford's json2.js. */ qq.parseJson = function(json) { /*jshint evil: true*/ if (window.JSON && qq.isFunction(JSON.parse)) { return JSON.parse(json); } else { return eval("(" + json + ")"); } }; /** * Retrieve the extension of a file, if it exists. * * @param filename * @returns {string || undefined} */ qq.getExtension = function(filename) { var extIdx = filename.lastIndexOf(".") + 1; if (extIdx > 0) { return filename.substr(extIdx, filename.length - extIdx); } }; qq.getFilename = function(blobOrFileInput) { /*jslint regexp: true*/ if (qq.isInput(blobOrFileInput)) { // get input value and remove path to normalize return blobOrFileInput.value.replace(/.*(\/|\\)/, ""); } else if (qq.isFile(blobOrFileInput)) { if (blobOrFileInput.fileName !== null && blobOrFileInput.fileName !== undefined) { return blobOrFileInput.fileName; } } return blobOrFileInput.name; }; /** * A generic module which supports object disposing in dispose() method. * */ qq.DisposeSupport = function() { var disposers = []; return { /** Run all registered disposers */ dispose: function() { var disposer; do { disposer = disposers.shift(); if (disposer) { disposer(); } } while (disposer); }, /** Attach event handler and register de-attacher as a disposer */ attach: function() { var args = arguments; /*jslint undef:true*/ this.addDisposer(qq(args[0]).attach.apply(this, Array.prototype.slice.call(arguments, 1))); }, /** Add disposer to the collection */ addDisposer: function(disposeFunction) { disposers.push(disposeFunction); } }; }; }()); /* globals qq */ /** * Fine Uploader top-level Error container. Inherits from `Error`. */ (function() { "use strict"; qq.Error = function(message) { this.message = "[Fine Uploader " + qq.version + "] " + message; }; qq.Error.prototype = new Error(); }()); /*global qq */ qq.version = "5.1.3"; /* globals qq */ qq.supportedFeatures = (function() { "use strict"; var supportsUploading, supportsUploadingBlobs, supportsAjaxFileUploading, supportsFolderDrop, supportsChunking, supportsResume, supportsUploadViaPaste, supportsUploadCors, supportsDeleteFileXdr, supportsDeleteFileCorsXhr, supportsDeleteFileCors, supportsFolderSelection, supportsImagePreviews, supportsUploadProgress; function testSupportsFileInputElement() { var supported = true, tempInput; try { tempInput = document.createElement("input"); tempInput.type = "file"; qq(tempInput).hide(); if (tempInput.disabled) { supported = false; } } catch (ex) { supported = false; } return supported; } //only way to test for Filesystem API support since webkit does not expose the DataTransfer interface function isChrome21OrHigher() { return (qq.chrome() || qq.opera()) && navigator.userAgent.match(/Chrome\/[2][1-9]|Chrome\/[3-9][0-9]/) !== undefined; } //only way to test for complete Clipboard API support at this time function isChrome14OrHigher() { return (qq.chrome() || qq.opera()) && navigator.userAgent.match(/Chrome\/[1][4-9]|Chrome\/[2-9][0-9]/) !== undefined; } //Ensure we can send cross-origin `XMLHttpRequest`s function isCrossOriginXhrSupported() { if (window.XMLHttpRequest) { var xhr = qq.createXhrInstance(); //Commonly accepted test for XHR CORS support. return xhr.withCredentials !== undefined; } return false; } //Test for (terrible) cross-origin ajax transport fallback for IE9 and IE8 function isXdrSupported() { return window.XDomainRequest !== undefined; } // CORS Ajax requests are supported if it is either possible to send credentialed `XMLHttpRequest`s, // or if `XDomainRequest` is an available alternative. function isCrossOriginAjaxSupported() { if (isCrossOriginXhrSupported()) { return true; } return isXdrSupported(); } function isFolderSelectionSupported() { // We know that folder selection is only supported in Chrome via this proprietary attribute for now return document.createElement("input").webkitdirectory !== undefined; } function isLocalStorageSupported() { try { return !!window.localStorage; } catch (error) { // probably caught a security exception, so no localStorage for you return false; } } supportsUploading = testSupportsFileInputElement(); supportsAjaxFileUploading = supportsUploading && qq.isXhrUploadSupported(); supportsUploadingBlobs = supportsAjaxFileUploading && !qq.androidStock(); supportsFolderDrop = supportsAjaxFileUploading && isChrome21OrHigher(); supportsChunking = supportsAjaxFileUploading && qq.isFileChunkingSupported(); supportsResume = supportsAjaxFileUploading && supportsChunking && isLocalStorageSupported(); supportsUploadViaPaste = supportsAjaxFileUploading && isChrome14OrHigher(); supportsUploadCors = supportsUploading && (window.postMessage !== undefined || supportsAjaxFileUploading); supportsDeleteFileCorsXhr = isCrossOriginXhrSupported(); supportsDeleteFileXdr = isXdrSupported(); supportsDeleteFileCors = isCrossOriginAjaxSupported(); supportsFolderSelection = isFolderSelectionSupported(); supportsImagePreviews = supportsAjaxFileUploading && window.FileReader !== undefined; supportsUploadProgress = (function() { if (supportsAjaxFileUploading) { return !qq.androidStock() && !qq.iosChrome(); } return false; }()); return { ajaxUploading: supportsAjaxFileUploading, blobUploading: supportsUploadingBlobs, canDetermineSize: supportsAjaxFileUploading, chunking: supportsChunking, deleteFileCors: supportsDeleteFileCors, deleteFileCorsXdr: supportsDeleteFileXdr, //NOTE: will also return true in IE10, where XDR is also supported deleteFileCorsXhr: supportsDeleteFileCorsXhr, fileDrop: supportsAjaxFileUploading, //NOTE: will also return true for touch-only devices. It's not currently possible to accurately test for touch-only devices folderDrop: supportsFolderDrop, folderSelection: supportsFolderSelection, imagePreviews: supportsImagePreviews, imageValidation: supportsImagePreviews, itemSizeValidation: supportsAjaxFileUploading, pause: supportsChunking, progressBar: supportsUploadProgress, resume: supportsResume, scaling: supportsImagePreviews && supportsUploadingBlobs, tiffPreviews: qq.safari(), // Not the best solution, but simple and probably accurate enough (for now) unlimitedScaledImageSize: !qq.ios(), // false simply indicates that there is some known limit uploading: supportsUploading, uploadCors: supportsUploadCors, uploadCustomHeaders: supportsAjaxFileUploading, uploadNonMultipart: supportsAjaxFileUploading, uploadViaPaste: supportsUploadViaPaste }; }()); /*globals qq*/ // Is the passed object a promise instance? qq.isGenericPromise = function(maybePromise) { "use strict"; return !!(maybePromise && maybePromise.then && qq.isFunction(maybePromise.then)); }; qq.Promise = function() { "use strict"; var successArgs, failureArgs, successCallbacks = [], failureCallbacks = [], doneCallbacks = [], state = 0; qq.extend(this, { then: function(onSuccess, onFailure) { if (state === 0) { if (onSuccess) { successCallbacks.push(onSuccess); } if (onFailure) { failureCallbacks.push(onFailure); } } else if (state === -1) { onFailure && onFailure.apply(null, failureArgs); } else if (onSuccess) { onSuccess.apply(null, successArgs); } return this; }, done: function(callback) { if (state === 0) { doneCallbacks.push(callback); } else { callback.apply(null, failureArgs === undefined ? successArgs : failureArgs); } return this; }, success: function() { state = 1; successArgs = arguments; if (successCallbacks.length) { qq.each(successCallbacks, function(idx, callback) { callback.apply(null, successArgs); }); } if (doneCallbacks.length) { qq.each(doneCallbacks, function(idx, callback) { callback.apply(null, successArgs); }); } return this; }, failure: function() { state = -1; failureArgs = arguments; if (failureCallbacks.length) { qq.each(failureCallbacks, function(idx, callback) { callback.apply(null, failureArgs); }); } if (doneCallbacks.length) { qq.each(doneCallbacks, function(idx, callback) { callback.apply(null, failureArgs); }); } return this; } }); }; /* globals qq */ /** * Placeholder for a Blob that will be generated on-demand. * * @param referenceBlob Parent of the generated blob * @param onCreate Function to invoke when the blob must be created. Must be promissory. * @constructor */ qq.BlobProxy = function(referenceBlob, onCreate) { "use strict"; qq.extend(this, { referenceBlob: referenceBlob, create: function() { return onCreate(referenceBlob); } }); }; /*globals qq*/ /** * This module represents an upload or "Select File(s)" button. It's job is to embed an opaque `<input type="file">` * element as a child of a provided "container" element. This "container" element (`options.element`) is used to provide * a custom style for the `<input type="file">` element. The ability to change the style of the container element is also * provided here by adding CSS classes to the container on hover/focus. * * TODO Eliminate the mouseover and mouseout event handlers since the :hover CSS pseudo-class should now be * available on all supported browsers. * * @param o Options to override the default values */ qq.UploadButton = function(o) { "use strict"; var self = this, disposeSupport = new qq.DisposeSupport(), options = { // "Container" element element: null, // If true adds `multiple` attribute to `<input type="file">` multiple: false, // Corresponds to the `accept` attribute on the associated `<input type="file">` acceptFiles: null, // A true value allows folders to be selected, if supported by the UA folders: false, // `name` attribute of `<input type="file">` name: "qqfile", // Called when the browser invokes the onchange handler on the `<input type="file">` onChange: function(input) {}, ios8BrowserCrashWorkaround: true, // **This option will be removed** in the future as the :hover CSS pseudo-class is available on all supported browsers hoverClass: "qq-upload-button-hover", focusClass: "qq-upload-button-focus" }, input, buttonId; // Overrides any of the default option values with any option values passed in during construction. qq.extend(options, o); buttonId = qq.getUniqueId(); // Embed an opaque `<input type="file">` element as a child of `options.element`. function createInput() { var input = document.createElement("input"); input.setAttribute(qq.UploadButton.BUTTON_ID_ATTR_NAME, buttonId); self.setMultiple(options.multiple, input); if (options.folders && qq.supportedFeatures.folderSelection) { // selecting directories is only possible in Chrome now, via a vendor-specific prefixed attribute input.setAttribute("webkitdirectory", ""); } if (options.acceptFiles) { input.setAttribute("accept", options.acceptFiles); } input.setAttribute("type", "file"); input.setAttribute("name", options.name); qq(input).css({ position: "absolute", // in Opera only 'browse' button // is clickable and it is located at // the right side of the input right: 0, top: 0, fontFamily: "Arial", // It's especially important to make this an arbitrarily large value // to ensure the rendered input button in IE takes up the entire // space of the container element. Otherwise, the left side of the // button will require a double-click to invoke the file chooser. // In other browsers, this might cause other issues, so a large font-size // is only used in IE. There is a bug in IE8 where the opacity style is ignored // in some cases when the font-size is large. So, this workaround is not applied // to IE8. fontSize: qq.ie() && !qq.ie8() ? "3500px" : "118px", margin: 0, padding: 0, cursor: "pointer", opacity: 0 }); // Setting the file input's height to 100% in IE7 causes // most of the visible button to be unclickable. !qq.ie7() && qq(input).css({height: "100%"}); options.element.appendChild(input); disposeSupport.attach(input, "change", function() { options.onChange(input); }); // **These event handlers will be removed** in the future as the :hover CSS pseudo-class is available on all supported browsers disposeSupport.attach(input, "mouseover", function() { qq(options.element).addClass(options.hoverClass); }); disposeSupport.attach(input, "mouseout", function() { qq(options.element).removeClass(options.hoverClass); }); disposeSupport.attach(input, "focus", function() { qq(options.element).addClass(options.focusClass); }); disposeSupport.attach(input, "blur", function() { qq(options.element).removeClass(options.focusClass); }); // IE and Opera, unfortunately have 2 tab stops on file input // which is unacceptable in our case, disable keyboard access if (window.attachEvent) { // it is IE or Opera input.setAttribute("tabIndex", "-1"); } return input; } // Make button suitable container for input qq(options.element).css({ position: "relative", overflow: "hidden", // Make sure browse button is in the right side in Internet Explorer direction: "ltr" }); // Exposed API qq.extend(this, { getInput: function() { return input; }, getButtonId: function() { return buttonId; }, setMultiple: function(isMultiple, optInput) { var input = optInput || this.getInput(); // Temporary workaround for bug in in iOS8 UIWebView that causes the browser to crash // before the file chooser appears if the file input doesn't contain a multiple attribute. // See #1283. if (options.ios8BrowserCrashWorkaround && qq.ios8() && (qq.iosChrome() || qq.iosSafariWebView())) { input.setAttribute("multiple", ""); } else { if (isMultiple) { input.setAttribute("multiple", ""); } else { input.removeAttribute("multiple"); } } }, setAcceptFiles: function(acceptFiles) { if (acceptFiles !== options.acceptFiles) { input.setAttribute("accept", acceptFiles); } }, reset: function() { if (input.parentNode) { qq(input).remove(); } qq(options.element).removeClass(options.focusClass); input = null; input = createInput(); } }); input = createInput(); }; qq.UploadButton.BUTTON_ID_ATTR_NAME = "qq-button-id"; /*globals qq */ qq.UploadData = function(uploaderProxy) { "use strict"; var data = [], byUuid = {}, byStatus = {}, byProxyGroupId = {}, byBatchId = {}; function getDataByIds(idOrIds) { if (qq.isArray(idOrIds)) { var entries = []; qq.each(idOrIds, function(idx, id) { entries.push(data[id]); }); return entries; } return data[idOrIds]; } function getDataByUuids(uuids) { if (qq.isArray(uuids)) { var entries = []; qq.each(uuids, function(idx, uuid) { entries.push(data[byUuid[uuid]]); }); return entries; } return data[byUuid[uuids]]; } function getDataByStatus(status) { var statusResults = [], statuses = [].concat(status); qq.each(statuses, function(index, statusEnum) { var statusResultIndexes = byStatus[statusEnum]; if (statusResultIndexes !== undefined) { qq.each(statusResultIndexes, function(i, dataIndex) { statusResults.push(data[dataIndex]); }); } }); return statusResults; } qq.extend(this, { /** * Adds a new file to the data cache for tracking purposes. * * @param spec Data that describes this file. Possible properties are: * * - uuid: Initial UUID for this file. * - name: Initial name of this file. * - size: Size of this file, omit if this cannot be determined * - status: Initial `qq.status` for this file. Omit for `qq.status.SUBMITTING`. * - batchId: ID of the batch this file belongs to * - proxyGroupId: ID of the proxy group associated with this file * * @returns {number} Internal ID for this file. */ addFile: function(spec) { var status = spec.status || qq.status.SUBMITTING, id = data.push({ name: spec.name, originalName: spec.name, uuid: spec.uuid, size: spec.size || -1, status: status }) - 1; if (spec.batchId) { data[id].batchId = spec.batchId; if (byBatchId[spec.batchId] === undefined) { byBatchId[spec.batchId] = []; } byBatchId[spec.batchId].push(id); } if (spec.proxyGroupId) { data[id].proxyGroupId = spec.proxyGroupId; if (byProxyGroupId[spec.proxyGroupId] === undefined) { byProxyGroupId[spec.proxyGroupId] = []; } byProxyGroupId[spec.proxyGroupId].push(id); } data[id].id = id; byUuid[spec.uuid] = id; if (byStatus[status] === undefined) { byStatus[status] = []; } byStatus[status].push(id); uploaderProxy.onStatusChange(id, null, status); return id; }, retrieve: function(optionalFilter) { if (qq.isObject(optionalFilter) && data.length) { if (optionalFilter.id !== undefined) { return getDataByIds(optionalFilter.id); } else if (optionalFilter.uuid !== undefined) { return getDataByUuids(optionalFilter.uuid); } else if (optionalFilter.status) { return getDataByStatus(optionalFilter.status); } } else { return qq.extend([], data, true); } }, reset: function() { data = []; byUuid = {}; byStatus = {}; byBatchId = {}; }, setStatus: function(id, newStatus) { var oldStatus = data[id].status, byStatusOldStatusIndex = qq.indexOf(byStatus[oldStatus], id); byStatus[oldStatus].splice(byStatusOldStatusIndex, 1); data[id].status = newStatus; if (byStatus[newStatus] === undefined) { byStatus[newStatus] = []; } byStatus[newStatus].push(id); uploaderProxy.onStatusChange(id, oldStatus, newStatus); }, uuidChanged: function(id, newUuid) { var oldUuid = data[id].uuid; data[id].uuid = newUuid; byUuid[newUuid] = id; delete byUuid[oldUuid]; }, updateName: function(id, newName) { data[id].name = newName; }, updateSize: function(id, newSize) { data[id].size = newSize; }, // Only applicable if this file has a parent that we may want to reference later. setParentId: function(targetId, parentId) { data[targetId].parentId = parentId; }, getIdsInProxyGroup: function(id) { var proxyGroupId = data[id].proxyGroupId; if (proxyGroupId) { return byProxyGroupId[proxyGroupId]; } return []; }, getIdsInBatch: function(id) { var batchId = data[id].batchId; return byBatchId[batchId]; } }); }; qq.status = { SUBMITTING: "submitting", SUBMITTED: "submitted", REJECTED: "rejected", QUEUED: "queued", CANCELED: "canceled", PAUSED: "paused", UPLOADING: "uploading", UPLOAD_RETRYING: "retrying upload", UPLOAD_SUCCESSFUL: "upload successful", UPLOAD_FAILED: "upload failed", DELETE_FAILED: "delete failed", DELETING: "deleting", DELETED: "deleted" }; /*globals qq*/ /** * Defines the public API for FineUploaderBasic mode. */ (function() { "use strict"; qq.basePublicApi = { // DEPRECATED - TODO REMOVE IN NEXT MAJOR RELEASE (replaced by addFiles) addBlobs: function(blobDataOrArray, params, endpoint) { this.addFiles(blobDataOrArray, params, endpoint); }, addFiles: function(data, params, endpoint) { this._maybeHandleIos8SafariWorkaround(); var batchId = this._storedIds.length === 0 ? qq.getUniqueId() : this._currentBatchId, processBlob = qq.bind(function(blob) { this._handleNewFile({ blob: blob, name: this._options.blobs.defaultName }, batchId, verifiedFiles); }, this), processBlobData = qq.bind(function(blobData) { this._handleNewFile(blobData, batchId, verifiedFiles); }, this), processCanvas = qq.bind(function(canvas) { var blob = qq.canvasToBlob(canvas); this._handleNewFile({ blob: blob, name: this._options.blobs.defaultName + ".png" }, batchId, verifiedFiles); }, this), processCanvasData = qq.bind(function(canvasData) { var normalizedQuality = canvasData.quality && canvasData.quality / 100, blob = qq.canvasToBlob(canvasData.canvas, canvasData.type, normalizedQuality); this._handleNewFile({ blob: blob, name: canvasData.name }, batchId, verifiedFiles); }, this), processFileOrInput = qq.bind(function(fileOrInput) { if (qq.isInput(fileOrInput) && qq.supportedFeatures.ajaxUploading) { var files = Array.prototype.slice.call(fileOrInput.files); qq.each(files, function(idx, file) { this._handleNewFile(file, batchId, verifiedFiles); }); } else { this._handleNewFile(fileOrInput, batchId, verifiedFiles); } }, this), normalizeData = function() { if (qq.isFileList(data)) { data = Array.prototype.slice.call(data); } data = [].concat(data); }, self = this, verifiedFiles = []; this._currentBatchId = batchId; if (data) { normalizeData(); qq.each(data, function(idx, fileContainer) { if (qq.isFileOrInput(fileContainer)) { processFileOrInput(fileContainer); } else if (qq.isBlob(fileContainer)) { processBlob(fileContainer); } else if (qq.isObject(fileContainer)) { if (fileContainer.blob && fileContainer.name) { processBlobData(fileContainer); } else if (fileContainer.canvas && fileContainer.name) { processCanvasData(fileContainer); } } else if (fileContainer.tagName && fileContainer.tagName.toLowerCase() === "canvas") { processCanvas(fileContainer); } else { self.log(fileContainer + " is not a valid file container! Ignoring!", "warn"); } }); this.log("Received " + verifiedFiles.length + " files."); this._prepareItemsForUpload(verifiedFiles, params, endpoint); } }, cancel: function(id) { this._handler.cancel(id); }, cancelAll: function() { var storedIdsCopy = [], self = this; qq.extend(storedIdsCopy, this._storedIds); qq.each(storedIdsCopy, function(idx, storedFileId) { self.cancel(storedFileId); }); this._handler.cancelAll(); }, clearStoredFiles: function() { this._storedIds = []; }, continueUpload: function(id) { var uploadData = this._uploadData.retrieve({id: id}); if (!qq.supportedFeatures.pause || !this._options.chunking.enabled) { return false; } if (uploadData.status === qq.status.PAUSED) { this.log(qq.format("Paused file ID {} ({}) will be continued. Not paused.", id, this.getName(id))); this._uploadFile(id); return true; } else { this.log(qq.format("Ignoring continue for file ID {} ({}). Not paused.", id, this.getName(id)), "error"); } return false; }, deleteFile: function(id) { return this._onSubmitDelete(id); }, // TODO document? doesExist: function(fileOrBlobId) { return this._handler.isValid(fileOrBlobId); }, // Generate a variable size thumbnail on an img or canvas, // returning a promise that is fulfilled when the attempt completes. // Thumbnail can either be based off of a URL for an image returned // by the server in the upload response, or the associated `Blob`. drawThumbnail: function(fileId, imgOrCanvas, maxSize, fromServer) { var promiseToReturn = new qq.Promise(), fileOrUrl, options; if (this._imageGenerator) { fileOrUrl = this._thumbnailUrls[fileId]; options = { scale: maxSize > 0, maxSize: maxSize > 0 ? maxSize : null }; // If client-side preview generation is possible // and we are not specifically looking for the image URl returned by the server... if (!fromServer && qq.supportedFeatures.imagePreviews) { fileOrUrl = this.getFile(fileId); } /* jshint eqeqeq:false,eqnull:true */ if (fileOrUrl == null) { promiseToReturn.failure({container: imgOrCanvas, error: "File or URL not found."}); } else { this._imageGenerator.generate(fileOrUrl, imgOrCanvas, options).then( function success(modifiedContainer) { promiseToReturn.success(modifiedContainer); }, function failure(container, reason) { promiseToReturn.failure({container: container, error: reason || "Problem generating thumbnail"}); } ); } } else { promiseToReturn.failure({container: imgOrCanvas, error: "Missing image generator module"}); } return promiseToReturn; }, getButton: function(fileId) { return this._getButton(this._buttonIdsForFileIds[fileId]); }, getEndpoint: function(fileId) { return this._endpointStore.get(fileId); }, getFile: function(fileOrBlobId) { return this._handler.getFile(fileOrBlobId) || null; }, getInProgress: function() { return this._uploadData.retrieve({ status: [ qq.status.UPLOADING, qq.status.UPLOAD_RETRYING, qq.status.QUEUED ] }).length; }, getName: function(id) { return this._uploadData.retrieve({id: id}).name; }, // Parent ID for a specific file, or null if this is the parent, or if it has no parent. getParentId: function(id) { var uploadDataEntry = this.getUploads({id: id}), parentId = null; if (uploadDataEntry) { if (uploadDataEntry.parentId !== undefined) { parentId = uploadDataEntry.parentId; } } return parentId; }, getResumableFilesData: function() { return this._handler.getResumableFilesData(); }, getSize: function(id) { return this._uploadData.retrieve({id: id}).size; }, getNetUploads: function() { return this._netUploaded; }, getRemainingAllowedItems: function() { var allowedItems = this._currentItemLimit; if (allowedItems > 0) { return allowedItems - this._netUploadedOrQueued; } return null; }, getUploads: function(optionalFilter) { return this._uploadData.retrieve(optionalFilter); }, getUuid: function(id) { return this._uploadData.retrieve({id: id}).uuid; }, log: function(str, level) { if (this._options.debug && (!level || level === "info")) { qq.log("[Fine Uploader " + qq.version + "] " + str); } else if (level && level !== "info") { qq.log("[Fine Uploader " + qq.version + "] " + str, level); } }, pauseUpload: function(id) { var uploadData = this._uploadData.retrieve({id: id}); if (!qq.supportedFeatures.pause || !this._options.chunking.enabled) { return false; } // Pause only really makes sense if the file is uploading or retrying if (qq.indexOf([qq.status.UPLOADING, qq.status.UPLOAD_RETRYING], uploadData.status) >= 0) { if (this._handler.pause(id)) { this._uploadData.setStatus(id, qq.status.PAUSED); return true; } else { this.log(qq.format("Unable to pause file ID {} ({}).", id, this.getName(id)), "error"); } } else { this.log(qq.format("Ignoring pause for file ID {} ({}). Not in progress.", id, this.getName(id)), "error"); } return false; }, reset: function() { this.log("Resetting uploader..."); this._handler.reset(); this._storedIds = []; this._autoRetries = []; this._retryTimeouts = []; this._preventRetries = []; this._thumbnailUrls = []; qq.each(this._buttons, function(idx, button) { button.reset(); }); this._paramsStore.reset(); this._endpointStore.reset(); this._netUploadedOrQueued = 0; this._netUploaded = 0; this._uploadData.reset(); this._buttonIdsForFileIds = []; this._pasteHandler && this._pasteHandler.reset(); this._options.session.refreshOnReset && this._refreshSessionData(); this._succeededSinceLastAllComplete = []; this._failedSinceLastAllComplete = []; this._totalProgress && this._totalProgress.reset(); }, retry: function(id) { return this._manualRetry(id); }, scaleImage: function(id, specs) { var self = this; return qq.Scaler.prototype.scaleImage(id, specs, { log: qq.bind(self.log, self), getFile: qq.bind(self.getFile, self), uploadData: self._uploadData }); }, setCustomHeaders: function(headers, id) { this._customHeadersStore.set(headers, id); }, setDeleteFileCustomHeaders: function(headers, id) { this._deleteFileCustomHeadersStore.set(headers, id); }, setDeleteFileEndpoint: function(endpoint, id) { this._deleteFileEndpointStore.set(endpoint, id); }, setDeleteFileParams: function(params, id) { this._deleteFileParamsStore.set(params, id); }, // Re-sets the default endpoint, an endpoint for a specific file, or an endpoint for a specific button setEndpoint: function(endpoint, id) { this._endpointStore.set(endpoint, id); }, setItemLimit: function(newItemLimit) { this._currentItemLimit = newItemLimit; }, setName: function(id, newName) { this._uploadData.updateName(id, newName); }, setParams: function(params, id) { this._paramsStore.set(params, id); }, setUuid: function(id, newUuid) { return this._uploadData.uuidChanged(id, newUuid); }, uploadStoredFiles: function() { var idToUpload; if (this._storedIds.length === 0) { this._itemError("noFilesError"); } else { while (this._storedIds.length) { idToUpload = this._storedIds.shift(); this._uploadFile(idToUpload); } } } }; /** * Defines the private (internal) API for FineUploaderBasic mode. */ qq.basePrivateApi = { // Updates internal state with a file record (not backed by a live file). Returns the assigned ID. _addCannedFile: function(sessionData) { var id = this._uploadData.addFile({ uuid: sessionData.uuid, name: sessionData.name, size: sessionData.size, status: qq.status.UPLOAD_SUCCESSFUL }); sessionData.deleteFileEndpoint && this.setDeleteFileEndpoint(sessionData.deleteFileEndpoint, id); sessionData.deleteFileParams && this.setDeleteFileParams(sessionData.deleteFileParams, id); if (sessionData.thumbnailUrl) { this._thumbnailUrls[id] = sessionData.thumbnailUrl; } this._netUploaded++; this._netUploadedOrQueued++; return id; }, _annotateWithButtonId: function(file, associatedInput) { if (qq.isFile(file)) { file.qqButtonId = this._getButtonId(associatedInput); } }, _batchError: function(message) { this._options.callbacks.onError(null, null, message, undefined); }, _createDeleteHandler: function() { var self = this; return new qq.DeleteFileAjaxRequester({ method: this._options.deleteFile.method.toUpperCase(), maxConnections: this._options.maxConnections, uuidParamName: this._options.request.uuidName, customHeaders: this._deleteFileCustomHeadersStore, paramsStore: this._deleteFileParamsStore, endpointStore: this._deleteFileEndpointStore, demoMode: this._options.demoMode, cors: this._options.cors, log: qq.bind(self.log, self), onDelete: function(id) { self._onDelete(id); self._options.callbacks.onDelete(id); }, onDeleteComplete: function(id, xhrOrXdr, isError) { self._onDeleteComplete(id, xhrOrXdr, isError); self._options.callbacks.onDeleteComplete(id, xhrOrXdr, isError); } }); }, _createPasteHandler: function() { var self = this; return new qq.PasteSupport({ targetElement: this._options.paste.targetElement, callbacks: { log: qq.bind(self.log, self), pasteReceived: function(blob) { self._handleCheckedCallback({ name: "onPasteReceived", callback: qq.bind(self._options.callbacks.onPasteReceived, self, blob), onSuccess: qq.bind(self._handlePasteSuccess, self, blob), identifier: "pasted image" }); } } }); }, _createStore: function(initialValue, readOnlyValues) { var store = {}, catchall = initialValue, perIdReadOnlyValues = {}, copy = function(orig) { if (qq.isObject(orig)) { return qq.extend({}, orig); } return orig; }, getReadOnlyValues = function() { if (qq.isFunction(readOnlyValues)) { return readOnlyValues(); } return readOnlyValues; }, includeReadOnlyValues = function(id, existing) { if (readOnlyValues && qq.isObject(existing)) { qq.extend(existing, getReadOnlyValues()); } if (perIdReadOnlyValues[id]) { qq.extend(existing, perIdReadOnlyValues[id]); } }; return { set: function(val, id) { /*jshint eqeqeq: true, eqnull: true*/ if (id == null) { store = {}; catchall = copy(val); } else { store[id] = copy(val); } }, get: function(id) { var values; /*jshint eqeqeq: true, eqnull: true*/ if (id != null && store[id]) { values = store[id]; } else { values = copy(catchall); } includeReadOnlyValues(id, values); return copy(values); }, addReadOnly: function(id, values) { // Only applicable to Object stores if (qq.isObject(store)) { perIdReadOnlyValues[id] = perIdReadOnlyValues[id] || {}; qq.extend(perIdReadOnlyValues[id], values); } }, remove: function(fileId) { return delete store[fileId]; }, reset: function() { store = {}; perIdReadOnlyValues = {}; catchall = initialValue; } }; }, _createUploadDataTracker: function() { var self = this; return new qq.UploadData({ getName: function(id) { return self.getName(id); }, getUuid: function(id) { return self.getUuid(id); }, getSize: function(id) { return self.getSize(id); }, onStatusChange: function(id, oldStatus, newStatus) { self._onUploadStatusChange(id, oldStatus, newStatus); self._options.callbacks.onStatusChange(id, oldStatus, newStatus); self._maybeAllComplete(id, newStatus); if (self._totalProgress) { setTimeout(function() { self._totalProgress.onStatusChange(id, oldStatus, newStatus); }, 0); } } }); }, /** * Generate a tracked upload button. * * @param spec Object containing a required `element` property * along with optional `multiple`, `accept`, and `folders`. * @returns {qq.UploadButton} * @private */ _createUploadButton: function(spec) { var self = this, acceptFiles = spec.accept || this._options.validation.acceptFiles, allowedExtensions = spec.allowedExtensions || this._options.validation.allowedExtensions, button; function allowMultiple() { if (qq.supportedFeatures.ajaxUploading) { // Workaround for bug in iOS7+ (see #1039) if (self._options.workarounds.iosEmptyVideos && qq.ios() && !qq.ios6() && self._isAllowedExtension(allowedExtensions, ".mov")) { return false; } if (spec.multiple === undefined) { return self._options.multiple; } return spec.multiple; } return false; } button = new qq.UploadButton({ element: spec.element, folders: spec.folders, name: this._options.request.inputName, multiple: allowMultiple(), acceptFiles: acceptFiles, onChange: function(input) { self._onInputChange(input); }, hoverClass: this._options.classes.buttonHover, focusClass: this._options.classes.buttonFocus, ios8BrowserCrashWorkaround: this._options.workarounds.ios8BrowserCrash }); this._disposeSupport.addDisposer(function() { button.dispose(); }); self._buttons.push(button); return button; }, _createUploadHandler: function(additionalOptions, namespace) { var self = this, lastOnProgress = {}, options = { debug: this._options.debug, maxConnections: this._options.maxConnections, cors: this._options.cors, demoMode: this._options.demoMode, paramsStore: this._paramsStore, endpointStore: this._endpointStore, chunking: this._options.chunking, resume: this._options.resume, blobs: this._options.blobs, log: qq.bind(self.log, self), preventRetryParam: this._options.retry.preventRetryResponseProperty, onProgress: function(id, name, loaded, total) { if (loaded < 0 || total < 0) { return; } if (lastOnProgress[id]) { if (lastOnProgress[id].loaded !== loaded || lastOnProgress[id].total !== total) { self._onProgress(id, name, loaded, total); self._options.callbacks.onProgress(id, name, loaded, total); } } else { self._onProgress(id, name, loaded, total); self._options.callbacks.onProgress(id, name, loaded, total); } lastOnProgress[id] = {loaded: loaded, total: total}; }, onComplete: function(id, name, result, xhr) { delete lastOnProgress[id]; var status = self.getUploads({id: id}).status, retVal; // This is to deal with some observed cases where the XHR readyStateChange handler is // invoked by the browser multiple times for the same XHR instance with the same state // readyState value. Higher level: don't invoke complete-related code if we've already // done this. if (status === qq.status.UPLOAD_SUCCESSFUL || status === qq.status.UPLOAD_FAILED) { return; } retVal = self._onComplete(id, name, result, xhr); // If the internal `_onComplete` handler returns a promise, don't invoke the `onComplete` callback // until the promise has been fulfilled. if (retVal instanceof qq.Promise) { retVal.done(function() { self._options.callbacks.onComplete(id, name, result, xhr); }); } else { self._options.callbacks.onComplete(id, name, result, xhr); } }, onCancel: function(id, name, cancelFinalizationEffort) { var promise = new qq.Promise(); self._handleCheckedCallback({ name: "onCancel", callback: qq.bind(self._options.callbacks.onCancel, self, id, name), onFailure: promise.failure, onSuccess: function() { cancelFinalizationEffort.then(function() { self._onCancel(id, name); }); promise.success(); }, identifier: id }); return promise; }, onUploadPrep: qq.bind(this._onUploadPrep, this), onUpload: function(id, name) { self._onUpload(id, name); self._options.callbacks.onUpload(id, name); }, onUploadChunk: function(id, name, chunkData) { self._onUploadChunk(id, chunkData); self._options.callbacks.onUploadChunk(id, name, chunkData); }, onUploadChunkSuccess: function(id, chunkData, result, xhr) { self._options.callbacks.onUploadChunkSuccess.apply(self, arguments); }, onResume: function(id, name, chunkData) { return self._options.callbacks.onResume(id, name, chunkData); }, onAutoRetry: function(id, name, responseJSON, xhr) { return self._onAutoRetry.apply(self, arguments); }, onUuidChanged: function(id, newUuid) { self.log("Server requested UUID change from '" + self.getUuid(id) + "' to '" + newUuid + "'"); self.setUuid(id, newUuid); }, getName: qq.bind(self.getName, self), getUuid: qq.bind(self.getUuid, self), getSize: qq.bind(self.getSize, self), setSize: qq.bind(self._setSize, self), getDataByUuid: function(uuid) { return self.getUploads({uuid: uuid}); }, isQueued: function(id) { var status = self.getUploads({id: id}).status; return status === qq.status.QUEUED || status === qq.status.SUBMITTED || status === qq.status.UPLOAD_RETRYING || status === qq.status.PAUSED; }, getIdsInProxyGroup: self._uploadData.getIdsInProxyGroup, getIdsInBatch: self._uploadData.getIdsInBatch }; qq.each(this._options.request, function(prop, val) { options[prop] = val; }); options.customHeaders = this._customHeadersStore; if (additionalOptions) { qq.each(additionalOptions, function(key, val) { options[key] = val; }); } return new qq.UploadHandlerController(options, namespace); }, _fileOrBlobRejected: function(id) { this._netUploadedOrQueued--; this._uploadData.setStatus(id, qq.status.REJECTED); }, _formatSize: function(bytes) { var i = -1; do { bytes = bytes / 1000; i++; } while (bytes > 999); return Math.max(bytes, 0.1).toFixed(1) + this._options.text.sizeSymbols[i]; }, // Creates an internal object that tracks various properties of each extra button, // and then actually creates the extra button. _generateExtraButtonSpecs: function() { var self = this; this._extraButtonSpecs = {}; qq.each(this._options.extraButtons, function(idx, extraButtonOptionEntry) { var multiple = extraButtonOptionEntry.multiple, validation = qq.extend({}, self._options.validation, true), extraButtonSpec = qq.extend({}, extraButtonOptionEntry); if (multiple === undefined) { multiple = self._options.multiple; } if (extraButtonSpec.validation) { qq.extend(validation, extraButtonOptionEntry.validation, true); } qq.extend(extraButtonSpec, { multiple: multiple, validation: validation }, true); self._initExtraButton(extraButtonSpec); }); }, _getButton: function(buttonId) { var extraButtonsSpec = this._extraButtonSpecs[buttonId]; if (extraButtonsSpec) { return extraButtonsSpec.element; } else if (buttonId === this._defaultButtonId) { return this._options.button; } }, /** * Gets the internally used tracking ID for a button. * * @param buttonOrFileInputOrFile `File`, `<input type="file">`, or a button container element * @returns {*} The button's ID, or undefined if no ID is recoverable * @private */ _getButtonId: function(buttonOrFileInputOrFile) { var inputs, fileInput, fileBlobOrInput = buttonOrFileInputOrFile; // We want the reference file/blob here if this is a proxy (a file that will be generated on-demand later) if (fileBlobOrInput instanceof qq.BlobProxy) { fileBlobOrInput = fileBlobOrInput.referenceBlob; } // If the item is a `Blob` it will never be associated with a button or drop zone. if (fileBlobOrInput && !qq.isBlob(fileBlobOrInput)) { if (qq.isFile(fileBlobOrInput)) { return fileBlobOrInput.qqButtonId; } else if (fileBlobOrInput.tagName.toLowerCase() === "input" && fileBlobOrInput.type.toLowerCase() === "file") { return fileBlobOrInput.getAttribute(qq.UploadButton.BUTTON_ID_ATTR_NAME); } inputs = fileBlobOrInput.getElementsByTagName("input"); qq.each(inputs, function(idx, input) { if (input.getAttribute("type") === "file") { fileInput = input; return false; } }); if (fileInput) { return fileInput.getAttribute(qq.UploadButton.BUTTON_ID_ATTR_NAME); } } }, _getNotFinished: function() { return this._uploadData.retrieve({ status: [ qq.status.UPLOADING, qq.status.UPLOAD_RETRYING, qq.status.QUEUED, qq.status.SUBMITTING, qq.status.SUBMITTED, qq.status.PAUSED ] }).length; }, // Get the validation options for this button. Could be the default validation option // or a specific one assigned to this particular button. _getValidationBase: function(buttonId) { var extraButtonSpec = this._extraButtonSpecs[buttonId]; return extraButtonSpec ? extraButtonSpec.validation : this._options.validation; }, _getValidationDescriptor: function(fileWrapper) { if (fileWrapper.file instanceof qq.BlobProxy) { return { name: qq.getFilename(fileWrapper.file.referenceBlob), size: fileWrapper.file.referenceBlob.size }; } return { name: this.getUploads({id: fileWrapper.id}).name, size: this.getUploads({id: fileWrapper.id}).size }; }, _getValidationDescriptors: function(fileWrappers) { var self = this, fileDescriptors = []; qq.each(fileWrappers, function(idx, fileWrapper) { fileDescriptors.push(self._getValidationDescriptor(fileWrapper)); }); return fileDescriptors; }, // Allows camera access on either the default or an extra button for iOS devices. _handleCameraAccess: function() { if (this._options.camera.ios && qq.ios()) { var acceptIosCamera = "image/*;capture=camera", button = this._options.camera.button, buttonId = button ? this._getButtonId(button) : this._defaultButtonId, optionRoot = this._options; // If we are not targeting the default button, it is an "extra" button if (buttonId && buttonId !== this._defaultButtonId) { optionRoot = this._extraButtonSpecs[buttonId]; } // Camera access won't work in iOS if the `multiple` attribute is present on the file input optionRoot.multiple = false; // update the options if (optionRoot.validation.acceptFiles === null) { optionRoot.validation.acceptFiles = acceptIosCamera; } else { optionRoot.validation.acceptFiles += "," + acceptIosCamera; } // update the already-created button qq.each(this._buttons, function(idx, button) { if (button.getButtonId() === buttonId) { button.setMultiple(optionRoot.multiple); button.setAcceptFiles(optionRoot.acceptFiles); return false; } }); } }, _handleCheckedCallback: function(details) { var self = this, callbackRetVal = details.callback(); if (qq.isGenericPromise(callbackRetVal)) { this.log(details.name + " - waiting for " + details.name + " promise to be fulfilled for " + details.identifier); return callbackRetVal.then( function(successParam) { self.log(details.name + " promise success for " + details.identifier); details.onSuccess(successParam); }, function() { if (details.onFailure) { self.log(details.name + " promise failure for " + details.identifier); details.onFailure(); } else { self.log(details.name + " promise failure for " + details.identifier); } }); } if (callbackRetVal !== false) { details.onSuccess(callbackRetVal); } else { if (details.onFailure) { this.log(details.name + " - return value was 'false' for " + details.identifier + ". Invoking failure callback."); details.onFailure(); } else { this.log(details.name + " - return value was 'false' for " + details.identifier + ". Will not proceed."); } } return callbackRetVal; }, // Updates internal state when a new file has been received, and adds it along with its ID to a passed array. _handleNewFile: function(file, batchId, newFileWrapperList) { var self = this, uuid = qq.getUniqueId(), size = -1, name = qq.getFilename(file), actualFile = file.blob || file, handler = this._customNewFileHandler ? this._customNewFileHandler : qq.bind(self._handleNewFileGeneric, self); if (!qq.isInput(actualFile) && actualFile.size >= 0) { size = actualFile.size; } handler(actualFile, name, uuid, size, newFileWrapperList, batchId, this._options.request.uuidName, { uploadData: self._uploadData, paramsStore: self._paramsStore, addFileToHandler: function(id, file) { self._handler.add(id, file); self._netUploadedOrQueued++; self._trackButton(id); } }); }, _handleNewFileGeneric: function(file, name, uuid, size, fileList, batchId) { var id = this._uploadData.addFile({uuid: uuid, name: name, size: size, batchId: batchId}); this._handler.add(id, file); this._trackButton(id); this._netUploadedOrQueued++; fileList.push({id: id, file: file}); }, _handlePasteSuccess: function(blob, extSuppliedName) { var extension = blob.type.split("/")[1], name = extSuppliedName; /*jshint eqeqeq: true, eqnull: true*/ if (name == null) { name = this._options.paste.defaultName; } name += "." + extension; this.addFiles({ name: name, blob: blob }); }, // Creates an extra button element _initExtraButton: function(spec) { var button = this._createUploadButton({ element: spec.element, multiple: spec.multiple, accept: spec.validation.acceptFiles, folders: spec.folders, allowedExtensions: spec.validation.allowedExtensions }); this._extraButtonSpecs[button.getButtonId()] = spec; }, _initFormSupportAndParams: function() { this._formSupport = qq.FormSupport && new qq.FormSupport( this._options.form, qq.bind(this.uploadStoredFiles, this), qq.bind(this.log, this) ); if (this._formSupport && this._formSupport.attachedToForm) { this._paramsStore = this._createStore( this._options.request.params, this._formSupport.getFormInputsAsObject ); this._options.autoUpload = this._formSupport.newAutoUpload; if (this._formSupport.newEndpoint) { this._options.request.endpoint = this._formSupport.newEndpoint; } } else { this._paramsStore = this._createStore(this._options.request.params); } }, _isDeletePossible: function() { if (!qq.DeleteFileAjaxRequester || !this._options.deleteFile.enabled) { return false; } if (this._options.cors.expected) { if (qq.supportedFeatures.deleteFileCorsXhr) { return true; } if (qq.supportedFeatures.deleteFileCorsXdr && this._options.cors.allowXdr) { return true; } return false; } return true; }, _isAllowedExtension: function(allowed, fileName) { var valid = false; if (!allowed.length) { return true; } qq.each(allowed, function(idx, allowedExt) { /** * If an argument is not a string, ignore it. Added when a possible issue with MooTools hijacking the * `allowedExtensions` array was discovered. See case #735 in the issue tracker for more details. */ if (qq.isString(allowedExt)) { /*jshint eqeqeq: true, eqnull: true*/ var extRegex = new RegExp("\\." + allowedExt + "$", "i"); if (fileName.match(extRegex) != null) { valid = true; return false; } } }); return valid; }, /** * Constructs and returns a message that describes an item/file error. Also calls `onError` callback. * * @param code REQUIRED - a code that corresponds to a stock message describing this type of error * @param maybeNameOrNames names of the items that have failed, if applicable * @param item `File`, `Blob`, or `<input type="file">` * @private */ _itemError: function(code, maybeNameOrNames, item) { var message = this._options.messages[code], allowedExtensions = [], names = [].concat(maybeNameOrNames), name = names[0], buttonId = this._getButtonId(item), validationBase = this._getValidationBase(buttonId), extensionsForMessage, placeholderMatch; function r(name, replacement) { message = message.replace(name, replacement); } qq.each(validationBase.allowedExtensions, function(idx, allowedExtension) { /** * If an argument is not a string, ignore it. Added when a possible issue with MooTools hijacking the * `allowedExtensions` array was discovered. See case #735 in the issue tracker for more details. */ if (qq.isString(allowedExtension)) { allowedExtensions.push(allowedExtension); } }); extensionsForMessage = allowedExtensions.join(", ").toLowerCase(); r("{file}", this._options.formatFileName(name)); r("{extensions}", extensionsForMessage); r("{sizeLimit}", this._formatSize(validationBase.sizeLimit)); r("{minSizeLimit}", this._formatSize(validationBase.minSizeLimit)); placeholderMatch = message.match(/(\{\w+\})/g); if (placeholderMatch !== null) { qq.each(placeholderMatch, function(idx, placeholder) { r(placeholder, names[idx]); }); } this._options.callbacks.onError(null, name, message, undefined); return message; }, /** * Conditionally orders a manual retry of a failed upload. * * @param id File ID of the failed upload * @param callback Optional callback to invoke if a retry is prudent. * In lieu of asking the upload handler to retry. * @returns {boolean} true if a manual retry will occur * @private */ _manualRetry: function(id, callback) { if (this._onBeforeManualRetry(id)) { this._netUploadedOrQueued++; this._uploadData.setStatus(id, qq.status.UPLOAD_RETRYING); if (callback) { callback(id); } else { this._handler.retry(id); } return true; } }, _maybeAllComplete: function(id, status) { var self = this, notFinished = this._getNotFinished(); if (status === qq.status.UPLOAD_SUCCESSFUL) { this._succeededSinceLastAllComplete.push(id); } else if (status === qq.status.UPLOAD_FAILED) { this._failedSinceLastAllComplete.push(id); } if (notFinished === 0 && (this._succeededSinceLastAllComplete.length || this._failedSinceLastAllComplete.length)) { // Attempt to ensure onAllComplete is not invoked before other callbacks, such as onCancel & onComplete setTimeout(function() { self._onAllComplete(self._succeededSinceLastAllComplete, self._failedSinceLastAllComplete); }, 0); } }, _maybeHandleIos8SafariWorkaround: function() { var self = this; if (this._options.workarounds.ios8SafariUploads && qq.ios800() && qq.iosSafari()) { setTimeout(function() { window.alert(self._options.messages.unsupportedBrowserIos8Safari); }, 0); throw new qq.Error(this._options.messages.unsupportedBrowserIos8Safari); } }, _maybeParseAndSendUploadError: function(id, name, response, xhr) { // Assuming no one will actually set the response code to something other than 200 // and still set 'success' to true... if (!response.success) { if (xhr && xhr.status !== 200 && !response.error) { this._options.callbacks.onError(id, name, "XHR returned response code " + xhr.status, xhr); } else { var errorReason = response.error ? response.error : this._options.text.defaultResponseError; this._options.callbacks.onError(id, name, errorReason, xhr); } } }, _maybeProcessNextItemAfterOnValidateCallback: function(validItem, items, index, params, endpoint) { var self = this; if (items.length > index) { if (validItem || !this._options.validation.stopOnFirstInvalidFile) { //use setTimeout to prevent a stack overflow with a large number of files in the batch & non-promissory callbacks setTimeout(function() { var validationDescriptor = self._getValidationDescriptor(items[index]), buttonId = self._getButtonId(items[index].file), button = self._getButton(buttonId); self._handleCheckedCallback({ name: "onValidate", callback: qq.bind(self._options.callbacks.onValidate, self, validationDescriptor, button), onSuccess: qq.bind(self._onValidateCallbackSuccess, self, items, index, params, endpoint), onFailure: qq.bind(self._onValidateCallbackFailure, self, items, index, params, endpoint), identifier: "Item '" + validationDescriptor.name + "', size: " + validationDescriptor.size }); }, 0); } else if (!validItem) { for (; index < items.length; index++) { self._fileOrBlobRejected(items[index].id); } } } }, _onAllComplete: function(successful, failed) { this._totalProgress && this._totalProgress.onAllComplete(successful, failed, this._preventRetries); this._options.callbacks.onAllComplete(qq.extend([], successful), qq.extend([], failed)); this._succeededSinceLastAllComplete = []; this._failedSinceLastAllComplete = []; }, /** * Attempt to automatically retry a failed upload. * * @param id The file ID of the failed upload * @param name The name of the file associated with the failed upload * @param responseJSON Response from the server, parsed into a javascript object * @param xhr Ajax transport used to send the failed request * @param callback Optional callback to be invoked if a retry is prudent. * Invoked in lieu of asking the upload handler to retry. * @returns {boolean} true if an auto-retry will occur * @private */ _onAutoRetry: function(id, name, responseJSON, xhr, callback) { var self = this; self._preventRetries[id] = responseJSON[self._options.retry.preventRetryResponseProperty]; if (self._shouldAutoRetry(id, name, responseJSON)) { self._maybeParseAndSendUploadError.apply(self, arguments); self._options.callbacks.onAutoRetry(id, name, self._autoRetries[id]); self._onBeforeAutoRetry(id, name); self._retryTimeouts[id] = setTimeout(function() { self.log("Retrying " + name + "..."); self._uploadData.setStatus(id, qq.status.UPLOAD_RETRYING); if (callback) { callback(id); } else { self._handler.retry(id); } }, self._options.retry.autoAttemptDelay * 1000); return true; } }, _onBeforeAutoRetry: function(id, name) { this.log("Waiting " + this._options.retry.autoAttemptDelay + " seconds before retrying " + name + "..."); }, //return false if we should not attempt the requested retry _onBeforeManualRetry: function(id) { var itemLimit = this._currentItemLimit, fileName; if (this._preventRetries[id]) { this.log("Retries are forbidden for id " + id, "warn"); return false; } else if (this._handler.isValid(id)) { fileName = this.getName(id); if (this._options.callbacks.onManualRetry(id, fileName) === false) { return false; } if (itemLimit > 0 && this._netUploadedOrQueued + 1 > itemLimit) { this._itemError("retryFailTooManyItems"); return false; } this.log("Retrying upload for '" + fileName + "' (id: " + id + ")..."); return true; } else { this.log("'" + id + "' is not a valid file ID", "error"); return false; } }, _onCancel: function(id, name) { this._netUploadedOrQueued--; clearTimeout(this._retryTimeouts[id]); var storedItemIndex = qq.indexOf(this._storedIds, id); if (!this._options.autoUpload && storedItemIndex >= 0) { this._storedIds.splice(storedItemIndex, 1); } this._uploadData.setStatus(id, qq.status.CANCELED); }, _onComplete: function(id, name, result, xhr) { if (!result.success) { this._netUploadedOrQueued--; this._uploadData.setStatus(id, qq.status.UPLOAD_FAILED); if (result[this._options.retry.preventRetryResponseProperty] === true) { this._preventRetries[id] = true; } } else { if (result.thumbnailUrl) { this._thumbnailUrls[id] = result.thumbnailUrl; } this._netUploaded++; this._uploadData.setStatus(id, qq.status.UPLOAD_SUCCESSFUL); } this._maybeParseAndSendUploadError(id, name, result, xhr); return result.success ? true : false; }, _onDelete: function(id) { this._uploadData.setStatus(id, qq.status.DELETING); }, _onDeleteComplete: function(id, xhrOrXdr, isError) { var name = this.getName(id); if (isError) { this._uploadData.setStatus(id, qq.status.DELETE_FAILED); this.log("Delete request for '" + name + "' has failed.", "error"); // For error reporing, we only have accesss to the response status if this is not // an `XDomainRequest`. if (xhrOrXdr.withCredentials === undefined) { this._options.callbacks.onError(id, name, "Delete request failed", xhrOrXdr); } else { this._options.callbacks.onError(id, name, "Delete request failed with response code " + xhrOrXdr.status, xhrOrXdr); } } else { this._netUploadedOrQueued--; this._netUploaded--; this._handler.expunge(id); this._uploadData.setStatus(id, qq.status.DELETED); this.log("Delete request for '" + name + "' has succeeded."); } }, _onInputChange: function(input) { var fileIndex; if (qq.supportedFeatures.ajaxUploading) { for (fileIndex = 0; fileIndex < input.files.length; fileIndex++) { this._annotateWithButtonId(input.files[fileIndex], input); } this.addFiles(input.files); } // Android 2.3.x will fire `onchange` even if no file has been selected else if (input.value.length > 0) { this.addFiles(input); } qq.each(this._buttons, function(idx, button) { button.reset(); }); }, _onProgress: function(id, name, loaded, total) { this._totalProgress && this._totalProgress.onIndividualProgress(id, loaded, total); }, _onSubmit: function(id, name) { //nothing to do yet in core uploader }, _onSubmitCallbackSuccess: function(id, name) { this._onSubmit.apply(this, arguments); this._uploadData.setStatus(id, qq.status.SUBMITTED); this._onSubmitted.apply(this, arguments); this._options.callbacks.onSubmitted.apply(this, arguments); if (this._options.autoUpload) { this._uploadFile(id); } else { this._storeForLater(id); } }, _onSubmitDelete: function(id, onSuccessCallback, additionalMandatedParams) { var uuid = this.getUuid(id), adjustedOnSuccessCallback; if (onSuccessCallback) { adjustedOnSuccessCallback = qq.bind(onSuccessCallback, this, id, uuid, additionalMandatedParams); } if (this._isDeletePossible()) { this._handleCheckedCallback({ name: "onSubmitDelete", callback: qq.bind(this._options.callbacks.onSubmitDelete, this, id), onSuccess: adjustedOnSuccessCallback || qq.bind(this._deleteHandler.sendDelete, this, id, uuid, additionalMandatedParams), identifier: id }); return true; } else { this.log("Delete request ignored for ID " + id + ", delete feature is disabled or request not possible " + "due to CORS on a user agent that does not support pre-flighting.", "warn"); return false; } }, _onSubmitted: function(id) { //nothing to do in the base uploader }, _onTotalProgress: function(loaded, total) { this._options.callbacks.onTotalProgress(loaded, total); }, _onUploadPrep: function(id) { // nothing to do in the core uploader for now }, _onUpload: function(id, name) { this._uploadData.setStatus(id, qq.status.UPLOADING); }, _onUploadChunk: function(id, chunkData) { //nothing to do in the base uploader }, _onUploadStatusChange: function(id, oldStatus, newStatus) { // Make sure a "queued" retry attempt is canceled if the upload has been paused if (newStatus === qq.status.PAUSED) { clearTimeout(this._retryTimeouts[id]); } }, _onValidateBatchCallbackFailure: function(fileWrappers) { var self = this; qq.each(fileWrappers, function(idx, fileWrapper) { self._fileOrBlobRejected(fileWrapper.id); }); }, _onValidateBatchCallbackSuccess: function(validationDescriptors, items, params, endpoint, button) { var errorMessage, itemLimit = this._currentItemLimit, proposedNetFilesUploadedOrQueued = this._netUploadedOrQueued; if (itemLimit === 0 || proposedNetFilesUploadedOrQueued <= itemLimit) { if (items.length > 0) { this._handleCheckedCallback({ name: "onValidate", callback: qq.bind(this._options.callbacks.onValidate, this, validationDescriptors[0], button), onSuccess: qq.bind(this._onValidateCallbackSuccess, this, items, 0, params, endpoint), onFailure: qq.bind(this._onValidateCallbackFailure, this, items, 0, params, endpoint), identifier: "Item '" + items[0].file.name + "', size: " + items[0].file.size }); } else { this._itemError("noFilesError"); } } else { this._onValidateBatchCallbackFailure(items); errorMessage = this._options.messages.tooManyItemsError .replace(/\{netItems\}/g, proposedNetFilesUploadedOrQueued) .replace(/\{itemLimit\}/g, itemLimit); this._batchError(errorMessage); } }, _onValidateCallbackFailure: function(items, index, params, endpoint) { var nextIndex = index + 1; this._fileOrBlobRejected(items[index].id, items[index].file.name); this._maybeProcessNextItemAfterOnValidateCallback(false, items, nextIndex, params, endpoint); }, _onValidateCallbackSuccess: function(items, index, params, endpoint) { var self = this, nextIndex = index + 1, validationDescriptor = this._getValidationDescriptor(items[index]); this._validateFileOrBlobData(items[index], validationDescriptor) .then( function() { self._upload(items[index].id, params, endpoint); self._maybeProcessNextItemAfterOnValidateCallback(true, items, nextIndex, params, endpoint); }, function() { self._maybeProcessNextItemAfterOnValidateCallback(false, items, nextIndex, params, endpoint); } ); }, _prepareItemsForUpload: function(items, params, endpoint) { if (items.length === 0) { this._itemError("noFilesError"); return; } var validationDescriptors = this._getValidationDescriptors(items), buttonId = this._getButtonId(items[0].file), button = this._getButton(buttonId); this._handleCheckedCallback({ name: "onValidateBatch", callback: qq.bind(this._options.callbacks.onValidateBatch, this, validationDescriptors, button), onSuccess: qq.bind(this._onValidateBatchCallbackSuccess, this, validationDescriptors, items, params, endpoint, button), onFailure: qq.bind(this._onValidateBatchCallbackFailure, this, items), identifier: "batch validation" }); }, _preventLeaveInProgress: function() { var self = this; this._disposeSupport.attach(window, "beforeunload", function(e) { if (self.getInProgress()) { e = e || window.event; // for ie, ff e.returnValue = self._options.messages.onLeave; // for webkit return self._options.messages.onLeave; } }); }, // Attempts to refresh session data only if the `qq.Session` module exists // and a session endpoint has been specified. The `onSessionRequestComplete` // callback will be invoked once the refresh is complete. _refreshSessionData: function() { var self = this, options = this._options.session; /* jshint eqnull:true */ if (qq.Session && this._options.session.endpoint != null) { if (!this._session) { qq.extend(options, this._options.cors); options.log = qq.bind(this.log, this); options.addFileRecord = qq.bind(this._addCannedFile, this); this._session = new qq.Session(options); } setTimeout(function() { self._session.refresh().then(function(response, xhrOrXdr) { self._options.callbacks.onSessionRequestComplete(response, true, xhrOrXdr); }, function(response, xhrOrXdr) { self._options.callbacks.onSessionRequestComplete(response, false, xhrOrXdr); }); }, 0); } }, _setSize: function(id, newSize) { this._uploadData.updateSize(id, newSize); this._totalProgress && this._totalProgress.onNewSize(id); }, _shouldAutoRetry: function(id, name, responseJSON) { var uploadData = this._uploadData.retrieve({id: id}); /*jshint laxbreak: true */ if (!this._preventRetries[id] && this._options.retry.enableAuto && uploadData.status !== qq.status.PAUSED) { if (this._autoRetries[id] === undefined) { this._autoRetries[id] = 0; } if (this._autoRetries[id] < this._options.retry.maxAutoAttempts) { this._autoRetries[id] += 1; return true; } } return false; }, _storeForLater: function(id) { this._storedIds.push(id); }, // Maps a file with the button that was used to select it. _trackButton: function(id) { var buttonId; if (qq.supportedFeatures.ajaxUploading) { buttonId = this._handler.getFile(id).qqButtonId; } else { buttonId = this._getButtonId(this._handler.getInput(id)); } if (buttonId) { this._buttonIdsForFileIds[id] = buttonId; } }, _upload: function(id, params, endpoint) { var name = this.getName(id); if (params) { this.setParams(params, id); } if (endpoint) { this.setEndpoint(endpoint, id); } this._handleCheckedCallback({ name: "onSubmit", callback: qq.bind(this._options.callbacks.onSubmit, this, id, name), onSuccess: qq.bind(this._onSubmitCallbackSuccess, this, id, name), onFailure: qq.bind(this._fileOrBlobRejected, this, id, name), identifier: id }); }, _uploadFile: function(id) { if (!this._handler.upload(id)) { this._uploadData.setStatus(id, qq.status.QUEUED); } }, /** * Performs some internal validation checks on an item, defined in the `validation` option. * * @param fileWrapper Wrapper containing a `file` along with an `id` * @param validationDescriptor Normalized information about the item (`size`, `name`). * @returns qq.Promise with appropriate callbacks invoked depending on the validity of the file * @private */ _validateFileOrBlobData: function(fileWrapper, validationDescriptor) { var self = this, file = (function() { if (fileWrapper.file instanceof qq.BlobProxy) { return fileWrapper.file.referenceBlob; } return fileWrapper.file; }()), name = validationDescriptor.name, size = validationDescriptor.size, buttonId = this._getButtonId(fileWrapper.file), validationBase = this._getValidationBase(buttonId), validityChecker = new qq.Promise(); validityChecker.then( function() {}, function() { self._fileOrBlobRejected(fileWrapper.id, name); }); if (qq.isFileOrInput(file) && !this._isAllowedExtension(validationBase.allowedExtensions, name)) { this._itemError("typeError", name, file); return validityChecker.failure(); } if (size === 0) { this._itemError("emptyError", name, file); return validityChecker.failure(); } if (size > 0 && validationBase.sizeLimit && size > validationBase.sizeLimit) { this._itemError("sizeError", name, file); return validityChecker.failure(); } if (size > 0 && size < validationBase.minSizeLimit) { this._itemError("minSizeError", name, file); return validityChecker.failure(); } if (qq.ImageValidation && qq.supportedFeatures.imagePreviews && qq.isFile(file)) { new qq.ImageValidation(file, qq.bind(self.log, self)).validate(validationBase.image).then( validityChecker.success, function(errorCode) { self._itemError(errorCode + "ImageError", name, file); validityChecker.failure(); } ); } else { validityChecker.success(); } return validityChecker; }, _wrapCallbacks: function() { var self, safeCallback, prop; self = this; safeCallback = function(name, callback, args) { var errorMsg; try { return callback.apply(self, args); } catch (exception) { errorMsg = exception.message || exception.toString(); self.log("Caught exception in '" + name + "' callback - " + errorMsg, "error"); } }; /* jshint forin: false, loopfunc: true */ for (prop in this._options.callbacks) { (function() { var callbackName, callbackFunc; callbackName = prop; callbackFunc = self._options.callbacks[callbackName]; self._options.callbacks[callbackName] = function() { return safeCallback(callbackName, callbackFunc, arguments); }; }()); } } }; }()); /*globals qq*/ (function() { "use strict"; qq.FineUploaderBasic = function(o) { var self = this; // These options define FineUploaderBasic mode. this._options = { debug: false, button: null, multiple: true, maxConnections: 3, disableCancelForFormUploads: false, autoUpload: true, request: { endpoint: "/server/upload", params: {}, paramsInBody: true, customHeaders: {}, forceMultipart: true, inputName: "qqfile", uuidName: "qquuid", totalFileSizeName: "qqtotalfilesize", filenameParam: "qqfilename" }, validation: { allowedExtensions: [], sizeLimit: 0, minSizeLimit: 0, itemLimit: 0, stopOnFirstInvalidFile: true, acceptFiles: null, image: { maxHeight: 0, maxWidth: 0, minHeight: 0, minWidth: 0 } }, callbacks: { onSubmit: function(id, name) {}, onSubmitted: function(id, name) {}, onComplete: function(id, name, responseJSON, maybeXhr) {}, onAllComplete: function(successful, failed) {}, onCancel: function(id, name) {}, onUpload: function(id, name) {}, onUploadChunk: function(id, name, chunkData) {}, onUploadChunkSuccess: function(id, chunkData, responseJSON, xhr) {}, onResume: function(id, fileName, chunkData) {}, onProgress: function(id, name, loaded, total) {}, onTotalProgress: function(loaded, total) {}, onError: function(id, name, reason, maybeXhrOrXdr) {}, onAutoRetry: function(id, name, attemptNumber) {}, onManualRetry: function(id, name) {}, onValidateBatch: function(fileOrBlobData) {}, onValidate: function(fileOrBlobData) {}, onSubmitDelete: function(id) {}, onDelete: function(id) {}, onDeleteComplete: function(id, xhrOrXdr, isError) {}, onPasteReceived: function(blob) {}, onStatusChange: function(id, oldStatus, newStatus) {}, onSessionRequestComplete: function(response, success, xhrOrXdr) {} }, messages: { typeError: "{file} has an invalid extension. Valid extension(s): {extensions}.", sizeError: "{file} is too large, maximum file size is {sizeLimit}.", minSizeError: "{file} is too small, minimum file size is {minSizeLimit}.", emptyError: "{file} is empty, please select files again without it.", noFilesError: "No files to upload.", tooManyItemsError: "Too many items ({netItems}) would be uploaded. Item limit is {itemLimit}.", maxHeightImageError: "Image is too tall.", maxWidthImageError: "Image is too wide.", minHeightImageError: "Image is not tall enough.", minWidthImageError: "Image is not wide enough.", retryFailTooManyItems: "Retry failed - you have reached your file limit.", onLeave: "The files are being uploaded, if you leave now the upload will be canceled.", unsupportedBrowserIos8Safari: "Unrecoverable error - this browser does not permit file uploading of any kind due to serious bugs in iOS8 Safari. Please use iOS8 Chrome until Apple fixes these issues." }, retry: { enableAuto: false, maxAutoAttempts: 3, autoAttemptDelay: 5, preventRetryResponseProperty: "preventRetry" }, classes: { buttonHover: "qq-upload-button-hover", buttonFocus: "qq-upload-button-focus" }, chunking: { enabled: false, concurrent: { enabled: false }, mandatory: false, paramNames: { partIndex: "qqpartindex", partByteOffset: "qqpartbyteoffset", chunkSize: "qqchunksize", totalFileSize: "qqtotalfilesize", totalParts: "qqtotalparts" }, partSize: 2000000, // only relevant for traditional endpoints, only required when concurrent.enabled === true success: { endpoint: null } }, resume: { enabled: false, recordsExpireIn: 7, //days paramNames: { resuming: "qqresume" } }, formatFileName: function(fileOrBlobName) { if (fileOrBlobName !== undefined && fileOrBlobName.length > 33) { fileOrBlobName = fileOrBlobName.slice(0, 19) + "..." + fileOrBlobName.slice(-14); } return fileOrBlobName; }, text: { defaultResponseError: "Upload failure reason unknown", sizeSymbols: ["kB", "MB", "GB", "TB", "PB", "EB"] }, deleteFile: { enabled: false, method: "DELETE", endpoint: "/server/upload", customHeaders: {}, params: {} }, cors: { expected: false, sendCredentials: false, allowXdr: false }, blobs: { defaultName: "misc_data" }, paste: { targetElement: null, defaultName: "pasted_image" }, camera: { ios: false, // if ios is true: button is null means target the default button, otherwise target the button specified button: null }, // This refers to additional upload buttons to be handled by Fine Uploader. // Each element is an object, containing `element` as the only required // property. The `element` must be a container that will ultimately // contain an invisible `<input type="file">` created by Fine Uploader. // Optional properties of each object include `multiple`, `validation`, // and `folders`. extraButtons: [], // Depends on the session module. Used to query the server for an initial file list // during initialization and optionally after a `reset`. session: { endpoint: null, params: {}, customHeaders: {}, refreshOnReset: true }, // Send parameters associated with an existing form along with the files form: { // Element ID, HTMLElement, or null element: "qq-form", // Overrides the base `autoUpload`, unless `element` is null. autoUpload: false, // true = upload files on form submission (and squelch submit event) interceptSubmit: true }, // scale images client side, upload a new file for each scaled version scaling: { // send the original file as well sendOriginal: true, // fox orientation for scaled images orient: true, // If null, scaled image type will match reference image type. This value will be referred to // for any size record that does not specific a type. defaultType: null, defaultQuality: 80, failureText: "Failed to scale", includeExif: false, // metadata about each requested scaled version sizes: [] }, workarounds: { iosEmptyVideos: true, ios8SafariUploads: true, ios8BrowserCrash: true } }; // Replace any default options with user defined ones qq.extend(this._options, o, true); this._buttons = []; this._extraButtonSpecs = {}; this._buttonIdsForFileIds = []; this._wrapCallbacks(); this._disposeSupport = new qq.DisposeSupport(); this._storedIds = []; this._autoRetries = []; this._retryTimeouts = []; this._preventRetries = []; this._thumbnailUrls = []; this._netUploadedOrQueued = 0; this._netUploaded = 0; this._uploadData = this._createUploadDataTracker(); this._initFormSupportAndParams(); this._customHeadersStore = this._createStore(this._options.request.customHeaders); this._deleteFileCustomHeadersStore = this._createStore(this._options.deleteFile.customHeaders); this._deleteFileParamsStore = this._createStore(this._options.deleteFile.params); this._endpointStore = this._createStore(this._options.request.endpoint); this._deleteFileEndpointStore = this._createStore(this._options.deleteFile.endpoint); this._handler = this._createUploadHandler(); this._deleteHandler = qq.DeleteFileAjaxRequester && this._createDeleteHandler(); if (this._options.button) { this._defaultButtonId = this._createUploadButton({element: this._options.button}).getButtonId(); } this._generateExtraButtonSpecs(); this._handleCameraAccess(); if (this._options.paste.targetElement) { if (qq.PasteSupport) { this._pasteHandler = this._createPasteHandler(); } else { this.log("Paste support module not found", "error"); } } this._preventLeaveInProgress(); this._imageGenerator = qq.ImageGenerator && new qq.ImageGenerator(qq.bind(this.log, this)); this._refreshSessionData(); this._succeededSinceLastAllComplete = []; this._failedSinceLastAllComplete = []; this._scaler = (qq.Scaler && new qq.Scaler(this._options.scaling, qq.bind(this.log, this))) || {}; if (this._scaler.enabled) { this._customNewFileHandler = qq.bind(this._scaler.handleNewFile, this._scaler); } if (qq.TotalProgress && qq.supportedFeatures.progressBar) { this._totalProgress = new qq.TotalProgress( qq.bind(this._onTotalProgress, this), function(id) { var entry = self._uploadData.retrieve({id: id}); return (entry && entry.size) || 0; } ); } this._currentItemLimit = this._options.validation.itemLimit; }; // Define the private & public API methods. qq.FineUploaderBasic.prototype = qq.basePublicApi; qq.extend(qq.FineUploaderBasic.prototype, qq.basePrivateApi); }()); /*globals qq, XDomainRequest*/ /** Generic class for sending non-upload ajax requests and handling the associated responses **/ qq.AjaxRequester = function(o) { "use strict"; var log, shouldParamsBeInQueryString, queue = [], requestData = {}, options = { acceptHeader: null, validMethods: ["POST"], method: "POST", contentType: "application/x-www-form-urlencoded", maxConnections: 3, customHeaders: {}, endpointStore: {}, paramsStore: {}, mandatedParams: {}, allowXRequestedWithAndCacheControl: true, successfulResponseCodes: { DELETE: [200, 202, 204], POST: [200, 204], GET: [200] }, cors: { expected: false, sendCredentials: false }, log: function(str, level) {}, onSend: function(id) {}, onComplete: function(id, xhrOrXdr, isError) {}, onProgress: null }; qq.extend(options, o); log = options.log; if (qq.indexOf(options.validMethods, options.method) < 0) { throw new Error("'" + options.method + "' is not a supported method for this type of request!"); } // [Simple methods](http://www.w3.org/TR/cors/#simple-method) // are defined by the W3C in the CORS spec as a list of methods that, in part, // make a CORS request eligible to be exempt from preflighting. function isSimpleMethod() { return qq.indexOf(["GET", "POST", "HEAD"], options.method) >= 0; } // [Simple headers](http://www.w3.org/TR/cors/#simple-header) // are defined by the W3C in the CORS spec as a list of headers that, in part, // make a CORS request eligible to be exempt from preflighting. function containsNonSimpleHeaders(headers) { var containsNonSimple = false; qq.each(containsNonSimple, function(idx, header) { if (qq.indexOf(["Accept", "Accept-Language", "Content-Language", "Content-Type"], header) < 0) { containsNonSimple = true; return false; } }); return containsNonSimple; } function isXdr(xhr) { //The `withCredentials` test is a commonly accepted way to determine if XHR supports CORS. return options.cors.expected && xhr.withCredentials === undefined; } // Returns either a new `XMLHttpRequest` or `XDomainRequest` instance. function getCorsAjaxTransport() { var xhrOrXdr; if (window.XMLHttpRequest || window.ActiveXObject) { xhrOrXdr = qq.createXhrInstance(); if (xhrOrXdr.withCredentials === undefined) { xhrOrXdr = new XDomainRequest(); } } return xhrOrXdr; } // Returns either a new XHR/XDR instance, or an existing one for the associated `File` or `Blob`. function getXhrOrXdr(id, suppliedXhr) { var xhrOrXdr = requestData[id].xhr; if (!xhrOrXdr) { if (suppliedXhr) { xhrOrXdr = suppliedXhr; } else { if (options.cors.expected) { xhrOrXdr = getCorsAjaxTransport(); } else { xhrOrXdr = qq.createXhrInstance(); } } requestData[id].xhr = xhrOrXdr; } return xhrOrXdr; } // Removes element from queue, sends next request function dequeue(id) { var i = qq.indexOf(queue, id), max = options.maxConnections, nextId; delete requestData[id]; queue.splice(i, 1); if (queue.length >= max && i < max) { nextId = queue[max - 1]; sendRequest(nextId); } } function onComplete(id, xdrError) { var xhr = getXhrOrXdr(id), method = options.method, isError = xdrError === true; dequeue(id); if (isError) { log(method + " request for " + id + " has failed", "error"); } else if (!isXdr(xhr) && !isResponseSuccessful(xhr.status)) { isError = true; log(method + " request for " + id + " has failed - response code " + xhr.status, "error"); } options.onComplete(id, xhr, isError); } function getParams(id) { var onDemandParams = requestData[id].additionalParams, mandatedParams = options.mandatedParams, params; if (options.paramsStore.get) { params = options.paramsStore.get(id); } if (onDemandParams) { qq.each(onDemandParams, function(name, val) { params = params || {}; params[name] = val; }); } if (mandatedParams) { qq.each(mandatedParams, function(name, val) { params = params || {}; params[name] = val; }); } return params; } function sendRequest(id, optXhr) { var xhr = getXhrOrXdr(id, optXhr), method = options.method, params = getParams(id), payload = requestData[id].payload, url; options.onSend(id); url = createUrl(id, params); // XDR and XHR status detection APIs differ a bit. if (isXdr(xhr)) { xhr.onload = getXdrLoadHandler(id); xhr.onerror = getXdrErrorHandler(id); } else { xhr.onreadystatechange = getXhrReadyStateChangeHandler(id); } registerForUploadProgress(id); // The last parameter is assumed to be ignored if we are actually using `XDomainRequest`. xhr.open(method, url, true); // Instruct the transport to send cookies along with the CORS request, // unless we are using `XDomainRequest`, which is not capable of this. if (options.cors.expected && options.cors.sendCredentials && !isXdr(xhr)) { xhr.withCredentials = true; } setHeaders(id); log("Sending " + method + " request for " + id); if (payload) { xhr.send(payload); } else if (shouldParamsBeInQueryString || !params) { xhr.send(); } else if (params && options.contentType && options.contentType.toLowerCase().indexOf("application/x-www-form-urlencoded") >= 0) { xhr.send(qq.obj2url(params, "")); } else if (params && options.contentType && options.contentType.toLowerCase().indexOf("application/json") >= 0) { xhr.send(JSON.stringify(params)); } else { xhr.send(params); } return xhr; } function createUrl(id, params) { var endpoint = options.endpointStore.get(id), addToPath = requestData[id].addToPath; /*jshint -W116,-W041 */ if (addToPath != undefined) { endpoint += "/" + addToPath; } if (shouldParamsBeInQueryString && params) { return qq.obj2url(params, endpoint); } else { return endpoint; } } // Invoked by the UA to indicate a number of possible states that describe // a live `XMLHttpRequest` transport. function getXhrReadyStateChangeHandler(id) { return function() { if (getXhrOrXdr(id).readyState === 4) { onComplete(id); } }; } function registerForUploadProgress(id) { var onProgress = options.onProgress; if (onProgress) { getXhrOrXdr(id).upload.onprogress = function(e) { if (e.lengthComputable) { onProgress(id, e.loaded, e.total); } }; } } // This will be called by IE to indicate **success** for an associated // `XDomainRequest` transported request. function getXdrLoadHandler(id) { return function() { onComplete(id); }; } // This will be called by IE to indicate **failure** for an associated // `XDomainRequest` transported request. function getXdrErrorHandler(id) { return function() { onComplete(id, true); }; } function setHeaders(id) { var xhr = getXhrOrXdr(id), customHeaders = options.customHeaders, onDemandHeaders = requestData[id].additionalHeaders || {}, method = options.method, allHeaders = {}; // If XDomainRequest is being used, we can't set headers, so just ignore this block. if (!isXdr(xhr)) { options.acceptHeader && xhr.setRequestHeader("Accept", options.acceptHeader); // Only attempt to add X-Requested-With & Cache-Control if permitted if (options.allowXRequestedWithAndCacheControl) { // Do not add X-Requested-With & Cache-Control if this is a cross-origin request // OR the cross-origin request contains a non-simple method or header. // This is done to ensure a preflight is not triggered exclusively based on the // addition of these 2 non-simple headers. if (!options.cors.expected || (!isSimpleMethod() || containsNonSimpleHeaders(customHeaders))) { xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest"); xhr.setRequestHeader("Cache-Control", "no-cache"); } } if (options.contentType && (method === "POST" || method === "PUT")) { xhr.setRequestHeader("Content-Type", options.contentType); } qq.extend(allHeaders, qq.isFunction(customHeaders) ? customHeaders(id) : customHeaders); qq.extend(allHeaders, onDemandHeaders); qq.each(allHeaders, function(name, val) { xhr.setRequestHeader(name, val); }); } } function isResponseSuccessful(responseCode) { return qq.indexOf(options.successfulResponseCodes[options.method], responseCode) >= 0; } function prepareToSend(id, optXhr, addToPath, additionalParams, additionalHeaders, payload) { requestData[id] = { addToPath: addToPath, additionalParams: additionalParams, additionalHeaders: additionalHeaders, payload: payload }; var len = queue.push(id); // if too many active connections, wait... if (len <= options.maxConnections) { return sendRequest(id, optXhr); } } shouldParamsBeInQueryString = options.method === "GET" || options.method === "DELETE"; qq.extend(this, { // Start the process of sending the request. The ID refers to the file associated with the request. initTransport: function(id) { var path, params, headers, payload, cacheBuster; return { // Optionally specify the end of the endpoint path for the request. withPath: function(appendToPath) { path = appendToPath; return this; }, // Optionally specify additional parameters to send along with the request. // These will be added to the query string for GET/DELETE requests or the payload // for POST/PUT requests. The Content-Type of the request will be used to determine // how these parameters should be formatted as well. withParams: function(additionalParams) { params = additionalParams; return this; }, // Optionally specify additional headers to send along with the request. withHeaders: function(additionalHeaders) { headers = additionalHeaders; return this; }, // Optionally specify a payload/body for the request. withPayload: function(thePayload) { payload = thePayload; return this; }, // Appends a cache buster (timestamp) to the request URL as a query parameter (only if GET or DELETE) withCacheBuster: function() { cacheBuster = true; return this; }, // Send the constructed request. send: function(optXhr) { if (cacheBuster && qq.indexOf(["GET", "DELETE"], options.method) >= 0) { params.qqtimestamp = new Date().getTime(); } return prepareToSend(id, optXhr, path, params, headers, payload); } }; }, canceled: function(id) { dequeue(id); } }); }; /* globals qq */ /** * Common upload handler functions. * * @constructor */ qq.UploadHandler = function(spec) { "use strict"; var proxy = spec.proxy, fileState = {}, onCancel = proxy.onCancel, getName = proxy.getName; qq.extend(this, { add: function(id, fileItem) { fileState[id] = fileItem; fileState[id].temp = {}; }, cancel: function(id) { var self = this, cancelFinalizationEffort = new qq.Promise(), onCancelRetVal = onCancel(id, getName(id), cancelFinalizationEffort); onCancelRetVal.then(function() { if (self.isValid(id)) { fileState[id].canceled = true; self.expunge(id); } cancelFinalizationEffort.success(); }); }, expunge: function(id) { delete fileState[id]; }, getThirdPartyFileId: function(id) { return fileState[id].key; }, isValid: function(id) { return fileState[id] !== undefined; }, reset: function() { fileState = {}; }, _getFileState: function(id) { return fileState[id]; }, _setThirdPartyFileId: function(id, thirdPartyFileId) { fileState[id].key = thirdPartyFileId; }, _wasCanceled: function(id) { return !!fileState[id].canceled; } }); }; /*globals qq*/ /** * Base upload handler module. Controls more specific handlers. * * @param o Options. Passed along to the specific handler submodule as well. * @param namespace [optional] Namespace for the specific handler. */ qq.UploadHandlerController = function(o, namespace) { "use strict"; var controller = this, chunkingPossible = false, concurrentChunkingPossible = false, chunking, preventRetryResponse, log, handler, options = { paramsStore: {}, maxConnections: 3, // maximum number of concurrent uploads chunking: { enabled: false, multiple: { enabled: false } }, log: function(str, level) {}, onProgress: function(id, fileName, loaded, total) {}, onComplete: function(id, fileName, response, xhr) {}, onCancel: function(id, fileName) {}, onUploadPrep: function(id) {}, // Called if non-trivial operations will be performed before onUpload onUpload: function(id, fileName) {}, onUploadChunk: function(id, fileName, chunkData) {}, onUploadChunkSuccess: function(id, chunkData, response, xhr) {}, onAutoRetry: function(id, fileName, response, xhr) {}, onResume: function(id, fileName, chunkData) {}, onUuidChanged: function(id, newUuid) {}, getName: function(id) {}, setSize: function(id, newSize) {}, isQueued: function(id) {}, getIdsInProxyGroup: function(id) {}, getIdsInBatch: function(id) {} }, chunked = { // Called when each chunk has uploaded successfully done: function(id, chunkIdx, response, xhr) { var chunkData = handler._getChunkData(id, chunkIdx); handler._getFileState(id).attemptingResume = false; delete handler._getFileState(id).temp.chunkProgress[chunkIdx]; handler._getFileState(id).loaded += chunkData.size; options.onUploadChunkSuccess(id, handler._getChunkDataForCallback(chunkData), response, xhr); }, // Called when all chunks have been successfully uploaded and we want to ask the handler to perform any // logic associated with closing out the file, such as combining the chunks. finalize: function(id) { var size = options.getSize(id), name = options.getName(id); log("All chunks have been uploaded for " + id + " - finalizing...."); handler.finalizeChunks(id).then( function(response, xhr) { log("Finalize successful for " + id); var normaizedResponse = upload.normalizeResponse(response, true); options.onProgress(id, name, size, size); handler._maybeDeletePersistedChunkData(id); upload.cleanup(id, normaizedResponse, xhr); }, function(response, xhr) { var normaizedResponse = upload.normalizeResponse(response, false); log("Problem finalizing chunks for file ID " + id + " - " + normaizedResponse.error, "error"); if (normaizedResponse.reset) { chunked.reset(id); } if (!options.onAutoRetry(id, name, normaizedResponse, xhr)) { upload.cleanup(id, normaizedResponse, xhr); } } ); }, hasMoreParts: function(id) { return !!handler._getFileState(id).chunking.remaining.length; }, nextPart: function(id) { var nextIdx = handler._getFileState(id).chunking.remaining.shift(); if (nextIdx >= handler._getTotalChunks(id)) { nextIdx = null; } return nextIdx; }, reset: function(id) { log("Server or callback has ordered chunking effort to be restarted on next attempt for item ID " + id, "error"); handler._maybeDeletePersistedChunkData(id); handler.reevaluateChunking(id); handler._getFileState(id).loaded = 0; }, sendNext: function(id) { var size = options.getSize(id), name = options.getName(id), chunkIdx = chunked.nextPart(id), chunkData = handler._getChunkData(id, chunkIdx), resuming = handler._getFileState(id).attemptingResume, inProgressChunks = handler._getFileState(id).chunking.inProgress || []; if (handler._getFileState(id).loaded == null) { handler._getFileState(id).loaded = 0; } // Don't follow-through with the resume attempt if the integrator returns false from onResume if (resuming && options.onResume(id, name, chunkData) === false) { chunked.reset(id); chunkIdx = chunked.nextPart(id); chunkData = handler._getChunkData(id, chunkIdx); resuming = false; } // If all chunks have already uploaded successfully, we must be re-attempting the finalize step. if (chunkIdx == null && inProgressChunks.length === 0) { chunked.finalize(id); } // Send the next chunk else { log("Sending chunked upload request for item " + id + ": bytes " + (chunkData.start + 1) + "-" + chunkData.end + " of " + size); options.onUploadChunk(id, name, handler._getChunkDataForCallback(chunkData)); inProgressChunks.push(chunkIdx); handler._getFileState(id).chunking.inProgress = inProgressChunks; if (concurrentChunkingPossible) { connectionManager.open(id, chunkIdx); } if (concurrentChunkingPossible && connectionManager.available() && handler._getFileState(id).chunking.remaining.length) { chunked.sendNext(id); } handler.uploadChunk(id, chunkIdx, resuming).then( // upload chunk success function success(response, xhr) { log("Chunked upload request succeeded for " + id + ", chunk " + chunkIdx); handler.clearCachedChunk(id, chunkIdx); var inProgressChunks = handler._getFileState(id).chunking.inProgress || [], responseToReport = upload.normalizeResponse(response, true), inProgressChunkIdx = qq.indexOf(inProgressChunks, chunkIdx); log(qq.format("Chunk {} for file {} uploaded successfully.", chunkIdx, id)); chunked.done(id, chunkIdx, responseToReport, xhr); if (inProgressChunkIdx >= 0) { inProgressChunks.splice(inProgressChunkIdx, 1); } handler._maybePersistChunkedState(id); if (!chunked.hasMoreParts(id) && inProgressChunks.length === 0) { chunked.finalize(id); } else if (chunked.hasMoreParts(id)) { chunked.sendNext(id); } }, // upload chunk failure function failure(response, xhr) { log("Chunked upload request failed for " + id + ", chunk " + chunkIdx); handler.clearCachedChunk(id, chunkIdx); var responseToReport = upload.normalizeResponse(response, false), inProgressIdx; if (responseToReport.reset) { chunked.reset(id); } else { inProgressIdx = qq.indexOf(handler._getFileState(id).chunking.inProgress, chunkIdx); if (inProgressIdx >= 0) { handler._getFileState(id).chunking.inProgress.splice(inProgressIdx, 1); handler._getFileState(id).chunking.remaining.unshift(chunkIdx); } } // We may have aborted all other in-progress chunks for this file due to a failure. // If so, ignore the failures associated with those aborts. if (!handler._getFileState(id).temp.ignoreFailure) { // If this chunk has failed, we want to ignore all other failures of currently in-progress // chunks since they will be explicitly aborted if (concurrentChunkingPossible) { handler._getFileState(id).temp.ignoreFailure = true; qq.each(handler._getXhrs(id), function(ckid, ckXhr) { ckXhr.abort(); }); // We must indicate that all aborted chunks are no longer in progress handler.moveInProgressToRemaining(id); // Free up any connections used by these chunks, but don't allow any // other files to take up the connections (until we have exhausted all auto-retries) connectionManager.free(id, true); } if (!options.onAutoRetry(id, name, responseToReport, xhr)) { // If one chunk fails, abort all of the others to avoid odd race conditions that occur // if a chunk succeeds immediately after one fails before we have determined if the upload // is a failure or not. upload.cleanup(id, responseToReport, xhr); } } } ) .done(function() { handler.clearXhr(id, chunkIdx); }) ; } } }, connectionManager = { _open: [], _openChunks: {}, _waiting: [], available: function() { var max = options.maxConnections, openChunkEntriesCount = 0, openChunksCount = 0; qq.each(connectionManager._openChunks, function(fileId, openChunkIndexes) { openChunkEntriesCount++; openChunksCount += openChunkIndexes.length; }); return max - (connectionManager._open.length - openChunkEntriesCount + openChunksCount); }, /** * Removes element from queue, starts upload of next */ free: function(id, dontAllowNext) { var allowNext = !dontAllowNext, waitingIndex = qq.indexOf(connectionManager._waiting, id), connectionsIndex = qq.indexOf(connectionManager._open, id), nextId; delete connectionManager._openChunks[id]; if (upload.getProxyOrBlob(id) instanceof qq.BlobProxy) { log("Generated blob upload has ended for " + id + ", disposing generated blob."); delete handler._getFileState(id).file; } // If this file was not consuming a connection, it was just waiting, so remove it from the waiting array if (waitingIndex >= 0) { connectionManager._waiting.splice(waitingIndex, 1); } // If this file was consuming a connection, allow the next file to be uploaded else if (allowNext && connectionsIndex >= 0) { connectionManager._open.splice(connectionsIndex, 1); nextId = connectionManager._waiting.shift(); if (nextId >= 0) { connectionManager._open.push(nextId); upload.start(nextId); } } }, getWaitingOrConnected: function() { var waitingOrConnected = []; // Chunked files may have multiple connections open per chunk (if concurrent chunking is enabled) // We need to grab the file ID of any file that has at least one chunk consuming a connection. qq.each(connectionManager._openChunks, function(fileId, chunks) { if (chunks && chunks.length) { waitingOrConnected.push(parseInt(fileId)); } }); // For non-chunked files, only one connection will be consumed per file. // This is where we aggregate those file IDs. qq.each(connectionManager._open, function(idx, fileId) { if (!connectionManager._openChunks[fileId]) { waitingOrConnected.push(parseInt(fileId)); } }); // There may be files waiting for a connection. waitingOrConnected = waitingOrConnected.concat(connectionManager._waiting); return waitingOrConnected; }, isUsingConnection: function(id) { return qq.indexOf(connectionManager._open, id) >= 0; }, open: function(id, chunkIdx) { if (chunkIdx == null) { connectionManager._waiting.push(id); } if (connectionManager.available()) { if (chunkIdx == null) { connectionManager._waiting.pop(); connectionManager._open.push(id); } else { (function() { var openChunksEntry = connectionManager._openChunks[id] || []; openChunksEntry.push(chunkIdx); connectionManager._openChunks[id] = openChunksEntry; }()); } return true; } return false; }, reset: function() { connectionManager._waiting = []; connectionManager._open = []; } }, simple = { send: function(id, name) { handler._getFileState(id).loaded = 0; log("Sending simple upload request for " + id); handler.uploadFile(id).then( function(response, optXhr) { log("Simple upload request succeeded for " + id); var responseToReport = upload.normalizeResponse(response, true), size = options.getSize(id); options.onProgress(id, name, size, size); upload.maybeNewUuid(id, responseToReport); upload.cleanup(id, responseToReport, optXhr); }, function(response, optXhr) { log("Simple upload request failed for " + id); var responseToReport = upload.normalizeResponse(response, false); if (!options.onAutoRetry(id, name, responseToReport, optXhr)) { upload.cleanup(id, responseToReport, optXhr); } } ); } }, upload = { cancel: function(id) { log("Cancelling " + id); options.paramsStore.remove(id); connectionManager.free(id); }, cleanup: function(id, response, optXhr) { var name = options.getName(id); options.onComplete(id, name, response, optXhr); if (handler._getFileState(id)) { handler._clearXhrs && handler._clearXhrs(id); } connectionManager.free(id); }, // Returns a qq.BlobProxy, or an actual File/Blob if no proxy is involved, or undefined // if none of these are available for the ID getProxyOrBlob: function(id) { return (handler.getProxy && handler.getProxy(id)) || (handler.getFile && handler.getFile(id)); }, initHandler: function() { var handlerType = namespace ? qq[namespace] : qq.traditional, handlerModuleSubtype = qq.supportedFeatures.ajaxUploading ? "Xhr" : "Form"; handler = new handlerType[handlerModuleSubtype + "UploadHandler"]( options, { getDataByUuid: options.getDataByUuid, getName: options.getName, getSize: options.getSize, getUuid: options.getUuid, log: log, onCancel: options.onCancel, onProgress: options.onProgress, onUuidChanged: options.onUuidChanged } ); if (handler._removeExpiredChunkingRecords) { handler._removeExpiredChunkingRecords(); } }, isDeferredEligibleForUpload: function(id) { return options.isQueued(id); }, // For Blobs that are part of a group of generated images, along with a reference image, // this will ensure the blobs in the group are uploaded in the order they were triggered, // even if some async processing must be completed on one or more Blobs first. maybeDefer: function(id, blob) { // If we don't have a file/blob yet & no file/blob exists for this item, request it, // and then submit the upload to the specific handler once the blob is available. // ASSUMPTION: This condition will only ever be true if XHR uploading is supported. if (blob && !handler.getFile(id) && blob instanceof qq.BlobProxy) { // Blob creation may take some time, so the caller may want to update the // UI to indicate that an operation is in progress, even before the actual // upload begins and an onUpload callback is invoked. options.onUploadPrep(id); log("Attempting to generate a blob on-demand for " + id); blob.create().then(function(generatedBlob) { log("Generated an on-demand blob for " + id); // Update record associated with this file by providing the generated Blob handler.updateBlob(id, generatedBlob); // Propagate the size for this generated Blob options.setSize(id, generatedBlob.size); // Order handler to recalculate chunking possibility, if applicable handler.reevaluateChunking(id); upload.maybeSendDeferredFiles(id); }, // Blob could not be generated. Fail the upload & attempt to prevent retries. Also bubble error message. function(errorMessage) { var errorResponse = {}; if (errorMessage) { errorResponse.error = errorMessage; } log(qq.format("Failed to generate blob for ID {}. Error message: {}.", id, errorMessage), "error"); options.onComplete(id, options.getName(id), qq.extend(errorResponse, preventRetryResponse), null); upload.maybeSendDeferredFiles(id); connectionManager.free(id); }); } else { return upload.maybeSendDeferredFiles(id); } return false; }, // Upload any grouped blobs, in the proper order, that are ready to be uploaded maybeSendDeferredFiles: function(id) { var idsInGroup = options.getIdsInProxyGroup(id), uploadedThisId = false; if (idsInGroup && idsInGroup.length) { log("Maybe ready to upload proxy group file " + id); qq.each(idsInGroup, function(idx, idInGroup) { if (upload.isDeferredEligibleForUpload(idInGroup) && !!handler.getFile(idInGroup)) { uploadedThisId = idInGroup === id; upload.now(idInGroup); } else if (upload.isDeferredEligibleForUpload(idInGroup)) { return false; } }); } else { uploadedThisId = true; upload.now(id); } return uploadedThisId; }, maybeNewUuid: function(id, response) { if (response.newUuid !== undefined) { options.onUuidChanged(id, response.newUuid); } }, // The response coming from handler implementations may be in various formats. // Instead of hoping a promise nested 5 levels deep will always return an object // as its first param, let's just normalize the response here. normalizeResponse: function(originalResponse, successful) { var response = originalResponse; // The passed "response" param may not be a response at all. // It could be a string, detailing the error, for example. if (!qq.isObject(originalResponse)) { response = {}; if (qq.isString(originalResponse) && !successful) { response.error = originalResponse; } } response.success = successful; return response; }, now: function(id) { var name = options.getName(id); if (!controller.isValid(id)) { throw new qq.Error(id + " is not a valid file ID to upload!"); } options.onUpload(id, name); if (chunkingPossible && handler._shouldChunkThisFile(id)) { chunked.sendNext(id); } else { simple.send(id, name); } }, start: function(id) { var blobToUpload = upload.getProxyOrBlob(id); if (blobToUpload) { return upload.maybeDefer(id, blobToUpload); } else { upload.now(id); return true; } } }; qq.extend(this, { /** * Adds file or file input to the queue **/ add: function(id, file) { handler.add.apply(this, arguments); }, /** * Sends the file identified by id */ upload: function(id) { if (connectionManager.open(id)) { return upload.start(id); } return false; }, retry: function(id) { // On retry, if concurrent chunking has been enabled, we may have aborted all other in-progress chunks // for a file when encountering a failed chunk upload. We then signaled the controller to ignore // all failures associated with these aborts. We are now retrying, so we don't want to ignore // any more failures at this point. if (concurrentChunkingPossible) { handler._getFileState(id).temp.ignoreFailure = false; } // If we are attempting to retry a file that is already consuming a connection, this is likely an auto-retry. // Just go ahead and ask the handler to upload again. if (connectionManager.isUsingConnection(id)) { return upload.start(id); } // If we are attempting to retry a file that is not currently consuming a connection, // this is likely a manual retry attempt. We will need to ensure a connection is available // before the retry commences. else { return controller.upload(id); } }, /** * Cancels file upload by id */ cancel: function(id) { var cancelRetVal = handler.cancel(id); if (qq.isGenericPromise(cancelRetVal)) { cancelRetVal.then(function() { upload.cancel(id); }); } else if (cancelRetVal !== false) { upload.cancel(id); } }, /** * Cancels all queued or in-progress uploads */ cancelAll: function() { var waitingOrConnected = connectionManager.getWaitingOrConnected(), i; // ensure files are cancelled in reverse order which they were added // to avoid a flash of time where a queued file begins to upload before it is canceled if (waitingOrConnected.length) { for (i = waitingOrConnected.length - 1; i >= 0; i--) { controller.cancel(waitingOrConnected[i]); } } connectionManager.reset(); }, // Returns a File, Blob, or the Blob/File for the reference/parent file if the targeted blob is a proxy. // Undefined if no file record is available. getFile: function(id) { if (handler.getProxy && handler.getProxy(id)) { return handler.getProxy(id).referenceBlob; } return handler.getFile && handler.getFile(id); }, // Returns true if the Blob associated with the ID is related to a proxy s isProxied: function(id) { return !!(handler.getProxy && handler.getProxy(id)); }, getInput: function(id) { if (handler.getInput) { return handler.getInput(id); } }, reset: function() { log("Resetting upload handler"); controller.cancelAll(); connectionManager.reset(); handler.reset(); }, expunge: function(id) { if (controller.isValid(id)) { return handler.expunge(id); } }, /** * Determine if the file exists. */ isValid: function(id) { return handler.isValid(id); }, getResumableFilesData: function() { if (handler.getResumableFilesData) { return handler.getResumableFilesData(); } return []; }, /** * This may or may not be implemented, depending on the handler. For handlers where a third-party ID is * available (such as the "key" for Amazon S3), this will return that value. Otherwise, the return value * will be undefined. * * @param id Internal file ID * @returns {*} Some identifier used by a 3rd-party service involved in the upload process */ getThirdPartyFileId: function(id) { if (controller.isValid(id)) { return handler.getThirdPartyFileId(id); } }, /** * Attempts to pause the associated upload if the specific handler supports this and the file is "valid". * @param id ID of the upload/file to pause * @returns {boolean} true if the upload was paused */ pause: function(id) { if (controller.isResumable(id) && handler.pause && controller.isValid(id) && handler.pause(id)) { connectionManager.free(id); handler.moveInProgressToRemaining(id); return true; } return false; }, // True if the file is eligible for pause/resume. isResumable: function(id) { return !!handler.isResumable && handler.isResumable(id); } }); qq.extend(options, o); log = options.log; chunkingPossible = options.chunking.enabled && qq.supportedFeatures.chunking; concurrentChunkingPossible = chunkingPossible && options.chunking.concurrent.enabled; preventRetryResponse = (function() { var response = {}; response[options.preventRetryParam] = true; return response; }()); upload.initHandler(); }; /* globals qq */ /** * Common APIs exposed to creators of upload via form/iframe handlers. This is reused and possibly overridden * in some cases by specific form upload handlers. * * @constructor */ qq.FormUploadHandler = function(spec) { "use strict"; var options = spec.options, handler = this, proxy = spec.proxy, formHandlerInstanceId = qq.getUniqueId(), onloadCallbacks = {}, detachLoadEvents = {}, postMessageCallbackTimers = {}, isCors = options.isCors, inputName = options.inputName, getUuid = proxy.getUuid, log = proxy.log, corsMessageReceiver = new qq.WindowReceiveMessage({log: log}); /** * Remove any trace of the file from the handler. * * @param id ID of the associated file */ function expungeFile(id) { delete detachLoadEvents[id]; // If we are dealing with CORS, we might still be waiting for a response from a loaded iframe. // In that case, terminate the timer waiting for a message from the loaded iframe // and stop listening for any more messages coming from this iframe. if (isCors) { clearTimeout(postMessageCallbackTimers[id]); delete postMessageCallbackTimers[id]; corsMessageReceiver.stopReceivingMessages(id); } var iframe = document.getElementById(handler._getIframeName(id)); if (iframe) { // To cancel request set src to something else. We use src="javascript:false;" // because it doesn't trigger ie6 prompt on https /* jshint scripturl:true */ iframe.setAttribute("src", "javascript:false;"); qq(iframe).remove(); } } /** * @param iframeName `document`-unique Name of the associated iframe * @returns {*} ID of the associated file */ function getFileIdForIframeName(iframeName) { return iframeName.split("_")[0]; } /** * Generates an iframe to be used as a target for upload-related form submits. This also adds the iframe * to the current `document`. Album that the iframe is hidden from view. * * @param name Name of the iframe. * @returns {HTMLIFrameElement} The created iframe */ function initIframeForUpload(name) { var iframe = qq.toElement("<iframe src='javascript:false;' name='" + name + "' />"); iframe.setAttribute("id", name); iframe.style.display = "none"; document.body.appendChild(iframe); return iframe; } /** * If we are in CORS mode, we must listen for messages (containing the server response) from the associated * iframe, since we cannot directly parse the content of the iframe due to cross-origin restrictions. * * @param iframe Listen for messages on this iframe. * @param callback Invoke this callback with the message from the iframe. */ function registerPostMessageCallback(iframe, callback) { var iframeName = iframe.id, fileId = getFileIdForIframeName(iframeName), uuid = getUuid(fileId); onloadCallbacks[uuid] = callback; // When the iframe has loaded (after the server responds to an upload request) // declare the attempt a failure if we don't receive a valid message shortly after the response comes in. detachLoadEvents[fileId] = qq(iframe).attach("load", function() { if (handler.getInput(fileId)) { log("Received iframe load event for CORS upload request (iframe name " + iframeName + ")"); postMessageCallbackTimers[iframeName] = setTimeout(function() { var errorMessage = "No valid message received from loaded iframe for iframe name " + iframeName; log(errorMessage, "error"); callback({ error: errorMessage }); }, 1000); } }); // Listen for messages coming from this iframe. When a message has been received, cancel the timer // that declares the upload a failure if a message is not received within a reasonable amount of time. corsMessageReceiver.receiveMessage(iframeName, function(message) { log("Received the following window message: '" + message + "'"); var fileId = getFileIdForIframeName(iframeName), response = handler._parseJsonResponse(message), uuid = response.uuid, onloadCallback; if (uuid && onloadCallbacks[uuid]) { log("Handling response for iframe name " + iframeName); clearTimeout(postMessageCallbackTimers[iframeName]); delete postMessageCallbackTimers[iframeName]; handler._detachLoadEvent(iframeName); onloadCallback = onloadCallbacks[uuid]; delete onloadCallbacks[uuid]; corsMessageReceiver.stopReceivingMessages(iframeName); onloadCallback(response); } else if (!uuid) { log("'" + message + "' does not contain a UUID - ignoring."); } }); } qq.extend(this, new qq.UploadHandler(spec)); qq.override(this, function(super_) { return { /** * Adds File or Blob to the queue **/ add: function(id, fileInput) { super_.add(id, {input: fileInput}); fileInput.setAttribute("name", inputName); // remove file input from DOM if (fileInput.parentNode) { qq(fileInput).remove(); } }, expunge: function(id) { expungeFile(id); super_.expunge(id); }, isValid: function(id) { return super_.isValid(id) && handler._getFileState(id).input !== undefined; } }; }); qq.extend(this, { getInput: function(id) { return handler._getFileState(id).input; }, /** * This function either delegates to a more specific message handler if CORS is involved, * or simply registers a callback when the iframe has been loaded that invokes the passed callback * after determining if the content of the iframe is accessible. * * @param iframe Associated iframe * @param callback Callback to invoke after we have determined if the iframe content is accessible. */ _attachLoadEvent: function(iframe, callback) { /*jslint eqeq: true*/ var responseDescriptor; if (isCors) { registerPostMessageCallback(iframe, callback); } else { detachLoadEvents[iframe.id] = qq(iframe).attach("load", function() { log("Received response for " + iframe.id); // when we remove iframe from dom // the request stops, but in IE load // event fires if (!iframe.parentNode) { return; } try { // fixing Opera 10.53 if (iframe.contentDocument && iframe.contentDocument.body && iframe.contentDocument.body.innerHTML == "false") { // In Opera event is fired second time // when body.innerHTML changed from false // to server response approx. after 1 sec // when we upload file with iframe return; } } catch (error) { //IE may throw an "access is denied" error when attempting to access contentDocument on the iframe in some cases log("Error when attempting to access iframe during handling of upload response (" + error.message + ")", "error"); responseDescriptor = {success: false}; } callback(responseDescriptor); }); } }, /** * Creates an iframe with a specific document-unique name. * * @param id ID of the associated file * @returns {HTMLIFrameElement} */ _createIframe: function(id) { var iframeName = handler._getIframeName(id); return initIframeForUpload(iframeName); }, /** * Called when we are no longer interested in being notified when an iframe has loaded. * * @param id Associated file ID */ _detachLoadEvent: function(id) { if (detachLoadEvents[id] !== undefined) { detachLoadEvents[id](); delete detachLoadEvents[id]; } }, /** * @param fileId ID of the associated file * @returns {string} The `document`-unique name of the iframe */ _getIframeName: function(fileId) { return fileId + "_" + formHandlerInstanceId; }, /** * Generates a form element and appends it to the `document`. When the form is submitted, a specific iframe is targeted. * The name of the iframe is passed in as a property of the spec parameter, and must be unique in the `document`. Album * that the form is hidden from view. * * @param spec An object containing various properties to be used when constructing the form. Required properties are * currently: `method`, `endpoint`, `params`, `paramsInBody`, and `targetName`. * @returns {HTMLFormElement} The created form */ _initFormForUpload: function(spec) { var method = spec.method, endpoint = spec.endpoint, params = spec.params, paramsInBody = spec.paramsInBody, targetName = spec.targetName, form = qq.toElement("<form method='" + method + "' enctype='multipart/form-data'></form>"), url = endpoint; if (paramsInBody) { qq.obj2Inputs(params, form); } else { url = qq.obj2url(params, endpoint); } form.setAttribute("action", url); form.setAttribute("target", targetName); form.style.display = "none"; document.body.appendChild(form); return form; }, /** * @param innerHtmlOrMessage JSON message * @returns {*} The parsed response, or an empty object if the response could not be parsed */ _parseJsonResponse: function(innerHtmlOrMessage) { var response = {}; try { response = qq.parseJson(innerHtmlOrMessage); } catch (error) { log("Error when attempting to parse iframe upload response (" + error.message + ")", "error"); } return response; } }); }; /* globals qq */ /** * Common API exposed to creators of XHR handlers. This is reused and possibly overriding in some cases by specific * XHR upload handlers. * * @constructor */ qq.XhrUploadHandler = function(spec) { "use strict"; var handler = this, namespace = spec.options.namespace, proxy = spec.proxy, chunking = spec.options.chunking, resume = spec.options.resume, chunkFiles = chunking && spec.options.chunking.enabled && qq.supportedFeatures.chunking, resumeEnabled = resume && spec.options.resume.enabled && chunkFiles && qq.supportedFeatures.resume, getName = proxy.getName, getSize = proxy.getSize, getUuid = proxy.getUuid, getEndpoint = proxy.getEndpoint, getDataByUuid = proxy.getDataByUuid, onUuidChanged = proxy.onUuidChanged, onProgress = proxy.onProgress, log = proxy.log; function abort(id) { qq.each(handler._getXhrs(id), function(xhrId, xhr) { var ajaxRequester = handler._getAjaxRequester(id, xhrId); xhr.onreadystatechange = null; xhr.upload.onprogress = null; xhr.abort(); ajaxRequester && ajaxRequester.canceled && ajaxRequester.canceled(id); }); } qq.extend(this, new qq.UploadHandler(spec)); qq.override(this, function(super_) { return { /** * Adds File or Blob to the queue **/ add: function(id, blobOrProxy) { if (qq.isFile(blobOrProxy) || qq.isBlob(blobOrProxy)) { super_.add(id, {file: blobOrProxy}); } else if (blobOrProxy instanceof qq.BlobProxy) { super_.add(id, {proxy: blobOrProxy}); } else { throw new Error("Passed obj is not a File, Blob, or proxy"); } handler._initTempState(id); resumeEnabled && handler._maybePrepareForResume(id); }, expunge: function(id) { abort(id); handler._maybeDeletePersistedChunkData(id); handler._clearXhrs(id); super_.expunge(id); } }; }); qq.extend(this, { // Clear the cached chunk `Blob` after we are done with it, just in case the `Blob` bytes are stored in memory. clearCachedChunk: function(id, chunkIdx) { delete handler._getFileState(id).temp.cachedChunks[chunkIdx]; }, clearXhr: function(id, chunkIdx) { var tempState = handler._getFileState(id).temp; if (tempState.xhrs) { delete tempState.xhrs[chunkIdx]; } if (tempState.ajaxRequesters) { delete tempState.ajaxRequesters[chunkIdx]; } }, // Called when all chunks have been successfully uploaded. Expected promissory return type. // This defines the default behavior if nothing further is required when all chunks have been uploaded. finalizeChunks: function(id, responseParser) { var lastChunkIdx = handler._getTotalChunks(id) - 1, xhr = handler._getXhr(id, lastChunkIdx); if (responseParser) { return new qq.Promise().success(responseParser(xhr), xhr); } return new qq.Promise().success({}, xhr); }, getFile: function(id) { return handler.isValid(id) && handler._getFileState(id).file; }, getProxy: function(id) { return handler.isValid(id) && handler._getFileState(id).proxy; }, /** * @returns {Array} Array of objects containing properties useful to integrators * when it is important to determine which files are potentially resumable. */ getResumableFilesData: function() { var resumableFilesData = []; handler._iterateResumeRecords(function(key, uploadData) { handler.moveInProgressToRemaining(null, uploadData.chunking.inProgress, uploadData.chunking.remaining); var data = { name: uploadData.name, remaining: uploadData.chunking.remaining, size: uploadData.size, uuid: uploadData.uuid }; if (uploadData.key) { data.key = uploadData.key; } resumableFilesData.push(data); }); return resumableFilesData; }, isResumable: function(id) { return !!chunking && handler.isValid(id) && !handler._getFileState(id).notResumable; }, moveInProgressToRemaining: function(id, optInProgress, optRemaining) { var inProgress = optInProgress || handler._getFileState(id).chunking.inProgress, remaining = optRemaining || handler._getFileState(id).chunking.remaining; if (inProgress) { inProgress.reverse(); qq.each(inProgress, function(idx, chunkIdx) { remaining.unshift(chunkIdx); }); inProgress.length = 0; } }, pause: function(id) { if (handler.isValid(id)) { log(qq.format("Aborting XHR upload for {} '{}' due to pause instruction.", id, getName(id))); handler._getFileState(id).paused = true; abort(id); return true; } }, reevaluateChunking: function(id) { if (chunking && handler.isValid(id)) { var state = handler._getFileState(id), totalChunks, i; delete state.chunking; state.chunking = {}; totalChunks = handler._getTotalChunks(id); if (totalChunks > 1 || chunking.mandatory) { state.chunking.enabled = true; state.chunking.parts = totalChunks; state.chunking.remaining = []; for (i = 0; i < totalChunks; i++) { state.chunking.remaining.push(i); } handler._initTempState(id); } else { state.chunking.enabled = false; } } }, updateBlob: function(id, newBlob) { if (handler.isValid(id)) { handler._getFileState(id).file = newBlob; } }, _clearXhrs: function(id) { var tempState = handler._getFileState(id).temp; qq.each(tempState.ajaxRequesters, function(chunkId) { delete tempState.ajaxRequesters[chunkId]; }); qq.each(tempState.xhrs, function(chunkId) { delete tempState.xhrs[chunkId]; }); }, /** * Creates an XHR instance for this file and stores it in the fileState. * * @param id File ID * @param optChunkIdx The chunk index associated with this XHR, if applicable * @returns {XMLHttpRequest} */ _createXhr: function(id, optChunkIdx) { return handler._registerXhr(id, optChunkIdx, qq.createXhrInstance()); }, _getAjaxRequester: function(id, optChunkIdx) { var chunkIdx = optChunkIdx == null ? -1 : optChunkIdx; return handler._getFileState(id).temp.ajaxRequesters[chunkIdx]; }, _getChunkData: function(id, chunkIndex) { var chunkSize = chunking.partSize, fileSize = getSize(id), fileOrBlob = handler.getFile(id), startBytes = chunkSize * chunkIndex, endBytes = startBytes + chunkSize >= fileSize ? fileSize : startBytes + chunkSize, totalChunks = handler._getTotalChunks(id), cachedChunks = this._getFileState(id).temp.cachedChunks, // To work around a Webkit GC bug, we must keep each chunk `Blob` in scope until we are done with it. // See https://github.com/Widen/fine-uploader/issues/937#issuecomment-41418760 blob = cachedChunks[chunkIndex] || qq.sliceBlob(fileOrBlob, startBytes, endBytes); cachedChunks[chunkIndex] = blob; return { part: chunkIndex, start: startBytes, end: endBytes, count: totalChunks, blob: blob, size: endBytes - startBytes }; }, _getChunkDataForCallback: function(chunkData) { return { partIndex: chunkData.part, startByte: chunkData.start + 1, endByte: chunkData.end, totalParts: chunkData.count }; }, /** * @param id File ID * @returns {string} Identifier for this item that may appear in the browser's local storage */ _getLocalStorageId: function(id) { var formatVersion = "5.0", name = getName(id), size = getSize(id), chunkSize = chunking.partSize, endpoint = getEndpoint(id); return qq.format("qq{}resume{}-{}-{}-{}-{}", namespace, formatVersion, name, size, chunkSize, endpoint); }, _getMimeType: function(id) { return handler.getFile(id).type; }, _getPersistableData: function(id) { return handler._getFileState(id).chunking; }, /** * @param id ID of the associated file * @returns {number} Number of parts this file can be divided into, or undefined if chunking is not supported in this UA */ _getTotalChunks: function(id) { if (chunking) { var fileSize = getSize(id), chunkSize = chunking.partSize; return Math.ceil(fileSize / chunkSize); } }, _getXhr: function(id, optChunkIdx) { var chunkIdx = optChunkIdx == null ? -1 : optChunkIdx; return handler._getFileState(id).temp.xhrs[chunkIdx]; }, _getXhrs: function(id) { return handler._getFileState(id).temp.xhrs; }, // Iterates through all XHR handler-created resume records (in local storage), // invoking the passed callback and passing in the key and value of each local storage record. _iterateResumeRecords: function(callback) { if (resumeEnabled) { qq.each(localStorage, function(key, item) { if (key.indexOf(qq.format("qq{}resume-", namespace)) === 0) { var uploadData = JSON.parse(item); callback(key, uploadData); } }); } }, _initTempState: function(id) { handler._getFileState(id).temp = { ajaxRequesters: {}, chunkProgress: {}, xhrs: {}, cachedChunks: {} }; }, _markNotResumable: function(id) { handler._getFileState(id).notResumable = true; }, // Removes a chunked upload record from local storage, if possible. // Returns true if the item was removed, false otherwise. _maybeDeletePersistedChunkData: function(id) { var localStorageId; if (resumeEnabled && handler.isResumable(id)) { localStorageId = handler._getLocalStorageId(id); if (localStorageId && localStorage.getItem(localStorageId)) { localStorage.removeItem(localStorageId); return true; } } return false; }, // If this is a resumable upload, grab the relevant data from storage and items in memory that track this upload // so we can pick up from where we left off. _maybePrepareForResume: function(id) { var state = handler._getFileState(id), localStorageId, persistedData; // Resume is enabled and possible and this is the first time we've tried to upload this file in this session, // so prepare for a resume attempt. if (resumeEnabled && state.key === undefined) { localStorageId = handler._getLocalStorageId(id); persistedData = localStorage.getItem(localStorageId); // If we found this item in local storage, maybe we should resume it. if (persistedData) { persistedData = JSON.parse(persistedData); // If we found a resume record but we have already handled this file in this session, // don't try to resume it & ensure we don't persist future check data if (getDataByUuid(persistedData.uuid)) { handler._markNotResumable(id); } else { log(qq.format("Identified file with ID {} and name of {} as resumable.", id, getName(id))); onUuidChanged(id, persistedData.uuid); state.key = persistedData.key; state.chunking = persistedData.chunking; state.loaded = persistedData.loaded; state.attemptingResume = true; handler.moveInProgressToRemaining(id); } } } }, // Persist any data needed to resume this upload in a new session. _maybePersistChunkedState: function(id) { var state = handler._getFileState(id), localStorageId, persistedData; // If local storage isn't supported by the browser, or if resume isn't enabled or possible, give up if (resumeEnabled && handler.isResumable(id)) { localStorageId = handler._getLocalStorageId(id); persistedData = { name: getName(id), size: getSize(id), uuid: getUuid(id), key: state.key, chunking: state.chunking, loaded: state.loaded, lastUpdated: Date.now() }; localStorage.setItem(localStorageId, JSON.stringify(persistedData)); } }, _registerProgressHandler: function(id, chunkIdx, chunkSize) { var xhr = handler._getXhr(id, chunkIdx), name = getName(id), progressCalculator = { simple: function(loaded, total) { var fileSize = getSize(id); if (loaded === total) { onProgress(id, name, fileSize, fileSize); } else { onProgress(id, name, (loaded >= fileSize ? fileSize - 1 : loaded), fileSize); } }, chunked: function(loaded, total) { var chunkProgress = handler._getFileState(id).temp.chunkProgress, totalSuccessfullyLoadedForFile = handler._getFileState(id).loaded, loadedForRequest = loaded, totalForRequest = total, totalFileSize = getSize(id), estActualChunkLoaded = loadedForRequest - (totalForRequest - chunkSize), totalLoadedForFile = totalSuccessfullyLoadedForFile; chunkProgress[chunkIdx] = estActualChunkLoaded; qq.each(chunkProgress, function(chunkIdx, chunkLoaded) { totalLoadedForFile += chunkLoaded; }); onProgress(id, name, totalLoadedForFile, totalFileSize); } }; xhr.upload.onprogress = function(e) { if (e.lengthComputable) { /* jshint eqnull: true */ var type = chunkSize == null ? "simple" : "chunked"; progressCalculator[type](e.loaded, e.total); } }; }, /** * Registers an XHR transport instance created elsewhere. * * @param id ID of the associated file * @param optChunkIdx The chunk index associated with this XHR, if applicable * @param xhr XMLHttpRequest object instance * @param optAjaxRequester `qq.AjaxRequester` associated with this request, if applicable. * @returns {XMLHttpRequest} */ _registerXhr: function(id, optChunkIdx, xhr, optAjaxRequester) { var xhrsId = optChunkIdx == null ? -1 : optChunkIdx, tempState = handler._getFileState(id).temp; tempState.xhrs = tempState.xhrs || {}; tempState.ajaxRequesters = tempState.ajaxRequesters || {}; tempState.xhrs[xhrsId] = xhr; if (optAjaxRequester) { tempState.ajaxRequesters[xhrsId] = optAjaxRequester; } return xhr; }, // Deletes any local storage records that are "expired". _removeExpiredChunkingRecords: function() { var expirationDays = resume.recordsExpireIn; handler._iterateResumeRecords(function(key, uploadData) { var expirationDate = new Date(uploadData.lastUpdated); // transform updated date into expiration date expirationDate.setDate(expirationDate.getDate() + expirationDays); if (expirationDate.getTime() <= Date.now()) { log("Removing expired resume record with key " + key); localStorage.removeItem(key); } }); }, /** * Determine if the associated file should be chunked. * * @param id ID of the associated file * @returns {*} true if chunking is enabled, possible, and the file can be split into more than 1 part */ _shouldChunkThisFile: function(id) { var state = handler._getFileState(id); if (!state.chunking) { handler.reevaluateChunking(id); } return state.chunking.enabled; } }); }; /*globals qq */ /*jshint -W117 */ qq.WindowReceiveMessage = function(o) { "use strict"; var options = { log: function(message, level) {} }, callbackWrapperDetachers = {}; qq.extend(options, o); qq.extend(this, { receiveMessage: function(id, callback) { var onMessageCallbackWrapper = function(event) { callback(event.data); }; if (window.postMessage) { callbackWrapperDetachers[id] = qq(window).attach("message", onMessageCallbackWrapper); } else { log("iframe message passing not supported in this browser!", "error"); } }, stopReceivingMessages: function(id) { if (window.postMessage) { var detacher = callbackWrapperDetachers[id]; if (detacher) { detacher(); } } } }); }; /*globals qq */ /** * Defines the public API for FineUploader mode. */ (function() { "use strict"; qq.uiPublicApi = { clearStoredFiles: function() { this._parent.prototype.clearStoredFiles.apply(this, arguments); this._templating.clearFiles(); }, addExtraDropzone: function(element) { this._dnd && this._dnd.setupExtraDropzone(element); }, removeExtraDropzone: function(element) { if (this._dnd) { return this._dnd.removeDropzone(element); } }, getItemByFileId: function(id) { return this._templating.getFileContainer(id); }, reset: function() { this._parent.prototype.reset.apply(this, arguments); this._templating.reset(); if (!this._options.button && this._templating.getButton()) { this._defaultButtonId = this._createUploadButton({element: this._templating.getButton()}).getButtonId(); } if (this._dnd) { this._dnd.dispose(); this._dnd = this._setupDragAndDrop(); } this._totalFilesInBatch = 0; this._filesInBatchAddedToUi = 0; this._setupClickAndEditEventHandlers(); }, setName: function(id, newName) { var formattedFilename = this._options.formatFileName(newName); this._parent.prototype.setName.apply(this, arguments); this._templating.updateFilename(id, formattedFilename); }, pauseUpload: function(id) { var paused = this._parent.prototype.pauseUpload.apply(this, arguments); paused && this._templating.uploadPaused(id); return paused; }, continueUpload: function(id) { var continued = this._parent.prototype.continueUpload.apply(this, arguments); continued && this._templating.uploadContinued(id); return continued; }, getId: function(fileContainerOrChildEl) { return this._templating.getFileId(fileContainerOrChildEl); }, getDropTarget: function(fileId) { var file = this.getFile(fileId); return file.qqDropTarget; } }; /** * Defines the private (internal) API for FineUploader mode. */ qq.uiPrivateApi = { _getButton: function(buttonId) { var button = this._parent.prototype._getButton.apply(this, arguments); if (!button) { if (buttonId === this._defaultButtonId) { button = this._templating.getButton(); } } return button; }, _removeFileItem: function(fileId) { this._templating.removeFile(fileId); }, _setupClickAndEditEventHandlers: function() { this._fileButtonsClickHandler = qq.FileButtonsClickHandler && this._bindFileButtonsClickEvent(); // A better approach would be to check specifically for focusin event support by querying the DOM API, // but the DOMFocusIn event is not exposed as a property, so we have to resort to UA string sniffing. this._focusinEventSupported = !qq.firefox(); if (this._isEditFilenameEnabled()) { this._filenameClickHandler = this._bindFilenameClickEvent(); this._filenameInputFocusInHandler = this._bindFilenameInputFocusInEvent(); this._filenameInputFocusHandler = this._bindFilenameInputFocusEvent(); } }, _setupDragAndDrop: function() { var self = this, dropZoneElements = this._options.dragAndDrop.extraDropzones, templating = this._templating, defaultDropZone = templating.getDropZone(); defaultDropZone && dropZoneElements.push(defaultDropZone); return new qq.DragAndDrop({ dropZoneElements: dropZoneElements, allowMultipleItems: this._options.multiple, classes: { dropActive: this._options.classes.dropActive }, callbacks: { processingDroppedFiles: function() { templating.showDropProcessing(); }, processingDroppedFilesComplete: function(files, targetEl) { templating.hideDropProcessing(); qq.each(files, function(idx, file) { file.qqDropTarget = targetEl; }); if (files.length) { self.addFiles(files, null, null); } }, dropError: function(code, errorData) { self._itemError(code, errorData); }, dropLog: function(message, level) { self.log(message, level); } } }); }, _bindFileButtonsClickEvent: function() { var self = this; return new qq.FileButtonsClickHandler({ templating: this._templating, log: function(message, lvl) { self.log(message, lvl); }, onDeleteFile: function(fileId) { self.deleteFile(fileId); }, onCancel: function(fileId) { self.cancel(fileId); }, onRetry: function(fileId) { qq(self._templating.getFileContainer(fileId)).removeClass(self._classes.retryable); self._templating.hideRetry(fileId); self.retry(fileId); }, onPause: function(fileId) { self.pauseUpload(fileId); }, onContinue: function(fileId) { self.continueUpload(fileId); }, onGetName: function(fileId) { return self.getName(fileId); } }); }, _isEditFilenameEnabled: function() { /*jshint -W014 */ return this._templating.isEditFilenamePossible() && !this._options.autoUpload && qq.FilenameClickHandler && qq.FilenameInputFocusHandler && qq.FilenameInputFocusHandler; }, _filenameEditHandler: function() { var self = this, templating = this._templating; return { templating: templating, log: function(message, lvl) { self.log(message, lvl); }, onGetUploadStatus: function(fileId) { return self.getUploads({id: fileId}).status; }, onGetName: function(fileId) { return self.getName(fileId); }, onSetName: function(id, newName) { self.setName(id, newName); }, onEditingStatusChange: function(id, isEditing) { var qqInput = qq(templating.getEditInput(id)), qqFileContainer = qq(templating.getFileContainer(id)); if (isEditing) { qqInput.addClass("qq-editing"); templating.hideFilename(id); templating.hideEditIcon(id); } else { qqInput.removeClass("qq-editing"); templating.showFilename(id); templating.showEditIcon(id); } // Force IE8 and older to repaint qqFileContainer.addClass("qq-temp").removeClass("qq-temp"); } }; }, _onUploadStatusChange: function(id, oldStatus, newStatus) { this._parent.prototype._onUploadStatusChange.apply(this, arguments); if (this._isEditFilenameEnabled()) { // Status for a file exists before it has been added to the DOM, so we must be careful here. if (this._templating.getFileContainer(id) && newStatus !== qq.status.SUBMITTED) { this._templating.markFilenameEditable(id); this._templating.hideEditIcon(id); } } }, _bindFilenameInputFocusInEvent: function() { var spec = qq.extend({}, this._filenameEditHandler()); return new qq.FilenameInputFocusInHandler(spec); }, _bindFilenameInputFocusEvent: function() { var spec = qq.extend({}, this._filenameEditHandler()); return new qq.FilenameInputFocusHandler(spec); }, _bindFilenameClickEvent: function() { var spec = qq.extend({}, this._filenameEditHandler()); return new qq.FilenameClickHandler(spec); }, _storeForLater: function(id) { this._parent.prototype._storeForLater.apply(this, arguments); this._templating.hideSpinner(id); }, _onAllComplete: function(successful, failed) { this._parent.prototype._onAllComplete.apply(this, arguments); this._templating.resetTotalProgress(); }, _onSubmit: function(id, name) { var file = this.getFile(id); if (file && file.qqPath && this._options.dragAndDrop.reportDirectoryPaths) { this._paramsStore.addReadOnly(id, { qqpath: file.qqPath }); } this._parent.prototype._onSubmit.apply(this, arguments); this._addToList(id, name); }, // The file item has been added to the DOM. _onSubmitted: function(id) { // If the edit filename feature is enabled, mark the filename element as "editable" and the associated edit icon if (this._isEditFilenameEnabled()) { this._templating.markFilenameEditable(id); this._templating.showEditIcon(id); // If the focusin event is not supported, we must add a focus handler to the newly create edit filename text input if (!this._focusinEventSupported) { this._filenameInputFocusHandler.addHandler(this._templating.getEditInput(id)); } } }, // Update the progress bar & percentage as the file is uploaded _onProgress: function(id, name, loaded, total) { this._parent.prototype._onProgress.apply(this, arguments); this._templating.updateProgress(id, loaded, total); if (Math.round(loaded / total * 100) === 100) { this._templating.hideCancel(id); this._templating.hidePause(id); this._templating.hideProgress(id); this._templating.setStatusText(id, this._options.text.waitingForResponse); // If ~last byte was sent, display total file size this._displayFileSize(id); } else { // If still uploading, display percentage - total size is actually the total request(s) size this._displayFileSize(id, loaded, total); } }, _onTotalProgress: function(loaded, total) { this._parent.prototype._onTotalProgress.apply(this, arguments); this._templating.updateTotalProgress(loaded, total); }, _onComplete: function(id, name, result, xhr) { var parentRetVal = this._parent.prototype._onComplete.apply(this, arguments), templating = this._templating, fileContainer = templating.getFileContainer(id), self = this; function completeUpload(result) { // If this file is not represented in the templating module, perhaps it was hidden intentionally. // If so, don't perform any UI-related tasks related to this file. if (!fileContainer) { return; } templating.setStatusText(id); qq(fileContainer).removeClass(self._classes.retrying); templating.hideProgress(id); if (!self._options.disableCancelForFormUploads || qq.supportedFeatures.ajaxUploading) { templating.hideCancel(id); } templating.hideSpinner(id); if (result.success) { self._markFileAsSuccessful(id); } else { qq(fileContainer).addClass(self._classes.fail); if (templating.isRetryPossible() && !self._preventRetries[id]) { qq(fileContainer).addClass(self._classes.retryable); templating.showRetry(id); } self._controlFailureTextDisplay(id, result); } } // The parent may need to perform some async operation before we can accurately determine the status of the upload. if (parentRetVal instanceof qq.Promise) { parentRetVal.done(function(newResult) { completeUpload(newResult); }); } else { completeUpload(result); } return parentRetVal; }, _markFileAsSuccessful: function(id) { var templating = this._templating; if (this._isDeletePossible()) { templating.showDeleteButton(id); } qq(templating.getFileContainer(id)).addClass(this._classes.success); this._maybeUpdateThumbnail(id); }, _onUploadPrep: function(id) { this._parent.prototype._onUploadPrep.apply(this, arguments); this._templating.showSpinner(id); }, _onUpload: function(id, name) { var parentRetVal = this._parent.prototype._onUpload.apply(this, arguments); this._templating.showSpinner(id); return parentRetVal; }, _onUploadChunk: function(id, chunkData) { this._parent.prototype._onUploadChunk.apply(this, arguments); // Only display the pause button if we have finished uploading at least one chunk // & this file can be resumed if (chunkData.partIndex > 0 && this._handler.isResumable(id)) { this._templating.allowPause(id); } }, _onCancel: function(id, name) { this._parent.prototype._onCancel.apply(this, arguments); this._removeFileItem(id); if (this._getNotFinished() === 0) { this._templating.resetTotalProgress(); } }, _onBeforeAutoRetry: function(id) { var retryNumForDisplay, maxAuto, retryAlbum; this._parent.prototype._onBeforeAutoRetry.apply(this, arguments); this._showCancelLink(id); if (this._options.retry.showAutoRetryAlbum) { retryNumForDisplay = this._autoRetries[id]; maxAuto = this._options.retry.maxAutoAttempts; retryAlbum = this._options.retry.autoRetryAlbum.replace(/\{retryNum\}/g, retryNumForDisplay); retryAlbum = retryAlbum.replace(/\{maxAuto\}/g, maxAuto); this._templating.setStatusText(id, retryAlbum); qq(this._templating.getFileContainer(id)).addClass(this._classes.retrying); } }, //return false if we should not attempt the requested retry _onBeforeManualRetry: function(id) { if (this._parent.prototype._onBeforeManualRetry.apply(this, arguments)) { this._templating.resetProgress(id); qq(this._templating.getFileContainer(id)).removeClass(this._classes.fail); this._templating.setStatusText(id); this._templating.showSpinner(id); this._showCancelLink(id); return true; } else { qq(this._templating.getFileContainer(id)).addClass(this._classes.retryable); this._templating.showRetry(id); return false; } }, _onSubmitDelete: function(id) { var onSuccessCallback = qq.bind(this._onSubmitDeleteSuccess, this); this._parent.prototype._onSubmitDelete.call(this, id, onSuccessCallback); }, _onSubmitDeleteSuccess: function(id, uuid, additionalMandatedParams) { if (this._options.deleteFile.forceConfirm) { this._showDeleteConfirm.apply(this, arguments); } else { this._sendDeleteRequest.apply(this, arguments); } }, _onDeleteComplete: function(id, xhr, isError) { this._parent.prototype._onDeleteComplete.apply(this, arguments); this._templating.hideSpinner(id); if (isError) { this._templating.setStatusText(id, this._options.deleteFile.deletingFailedText); this._templating.showDeleteButton(id); } else { this._removeFileItem(id); } }, _sendDeleteRequest: function(id, uuid, additionalMandatedParams) { this._templating.hideDeleteButton(id); this._templating.showSpinner(id); this._templating.setStatusText(id, this._options.deleteFile.deletingStatusText); this._deleteHandler.sendDelete.apply(this, arguments); }, _showDeleteConfirm: function(id, uuid, mandatedParams) { /*jshint -W004 */ var fileName = this.getName(id), confirmMessage = this._options.deleteFile.confirmMessage.replace(/\{filename\}/g, fileName), uuid = this.getUuid(id), deleteRequestArgs = arguments, self = this, retVal; retVal = this._options.showConfirm(confirmMessage); if (qq.isGenericPromise(retVal)) { retVal.then(function() { self._sendDeleteRequest.apply(self, deleteRequestArgs); }); } else if (retVal !== false) { self._sendDeleteRequest.apply(self, deleteRequestArgs); } }, _addToList: function(id, name, canned) { var prependData, prependIndex = 0, dontDisplay = this._handler.isProxied(id) && this._options.scaling.hideScaled, record; // If we don't want this file to appear in the UI, skip all of this UI-related logic. if (dontDisplay) { return; } if (this._options.display.prependFiles) { if (this._totalFilesInBatch > 1 && this._filesInBatchAddedToUi > 0) { prependIndex = this._filesInBatchAddedToUi - 1; } prependData = { index: prependIndex }; } if (!canned) { if (this._options.disableCancelForFormUploads && !qq.supportedFeatures.ajaxUploading) { this._templating.disableCancel(); } // Cancel all existing (previous) files and clear the list if this file is not part of // a scaled file group that has already been accepted, or if this file is not part of // a scaled file group at all. if (!this._options.multiple) { record = this.getUploads({id: id}); this._handledProxyGroup = this._handledProxyGroup || record.proxyGroupId; if (record.proxyGroupId !== this._handledProxyGroup || !record.proxyGroupId) { this._handler.cancelAll(); this._clearList(); this._handledProxyGroup = null; } } } this._templating.addFile(id, this._options.formatFileName(name), prependData); if (canned) { this._thumbnailUrls[id] && this._templating.updateThumbnail(id, this._thumbnailUrls[id], true); } else { this._templating.generatePreview(id, this.getFile(id)); } this._filesInBatchAddedToUi += 1; if (canned || (this._options.display.fileSizeOnSubmit && qq.supportedFeatures.ajaxUploading)) { this._displayFileSize(id); } }, _clearList: function() { this._templating.clearFiles(); this.clearStoredFiles(); }, _displayFileSize: function(id, loadedSize, totalSize) { var size = this.getSize(id), sizeForDisplay = this._formatSize(size); if (size >= 0) { if (loadedSize !== undefined && totalSize !== undefined) { sizeForDisplay = this._formatProgress(loadedSize, totalSize); } this._templating.updateSize(id, sizeForDisplay); } }, _formatProgress: function(uploadedSize, totalSize) { var message = this._options.text.formatProgress; function r(name, replacement) { message = message.replace(name, replacement); } r("{percent}", Math.round(uploadedSize / totalSize * 100)); r("{total_size}", this._formatSize(totalSize)); return message; }, _controlFailureTextDisplay: function(id, response) { var mode, maxChars, responseProperty, failureReason, shortFailureReason; mode = this._options.failedUploadTextDisplay.mode; maxChars = this._options.failedUploadTextDisplay.maxChars; responseProperty = this._options.failedUploadTextDisplay.responseProperty; if (mode === "custom") { failureReason = response[responseProperty]; if (failureReason) { if (failureReason.length > maxChars) { shortFailureReason = failureReason.substring(0, maxChars) + "..."; } } else { failureReason = this._options.text.failUpload; } this._templating.setStatusText(id, shortFailureReason || failureReason); if (this._options.failedUploadTextDisplay.enableTooltip) { this._showTooltip(id, failureReason); } } else if (mode === "default") { this._templating.setStatusText(id, this._options.text.failUpload); } else if (mode !== "none") { this.log("failedUploadTextDisplay.mode value of '" + mode + "' is not valid", "warn"); } }, _showTooltip: function(id, text) { this._templating.getFileContainer(id).title = text; }, _showCancelLink: function(id) { if (!this._options.disableCancelForFormUploads || qq.supportedFeatures.ajaxUploading) { this._templating.showCancel(id); } }, _itemError: function(code, name, item) { var message = this._parent.prototype._itemError.apply(this, arguments); this._options.showMessage(message); }, _batchError: function(message) { this._parent.prototype._batchError.apply(this, arguments); this._options.showMessage(message); }, _setupPastePrompt: function() { var self = this; this._options.callbacks.onPasteReceived = function() { var message = self._options.paste.namePromptMessage, defaultVal = self._options.paste.defaultName; return self._options.showPrompt(message, defaultVal); }; }, _fileOrBlobRejected: function(id, name) { this._totalFilesInBatch -= 1; this._parent.prototype._fileOrBlobRejected.apply(this, arguments); }, _prepareItemsForUpload: function(items, params, endpoint) { this._totalFilesInBatch = items.length; this._filesInBatchAddedToUi = 0; this._parent.prototype._prepareItemsForUpload.apply(this, arguments); }, _maybeUpdateThumbnail: function(fileId) { var thumbnailUrl = this._thumbnailUrls[fileId]; this._templating.updateThumbnail(fileId, thumbnailUrl); }, _addCannedFile: function(sessionData) { var id = this._parent.prototype._addCannedFile.apply(this, arguments); this._addToList(id, this.getName(id), true); this._templating.hideSpinner(id); this._templating.hideCancel(id); this._markFileAsSuccessful(id); return id; }, _setSize: function(id, newSize) { this._parent.prototype._setSize.apply(this, arguments); this._templating.updateSize(id, this._formatSize(newSize)); } }; }()); /*globals qq */ /** * This defines FineUploader mode, which is a default UI w/ drag & drop uploading. */ qq.FineUploader = function(o, namespace) { "use strict"; // By default this should inherit instance data from FineUploaderBasic, but this can be overridden // if the (internal) caller defines a different parent. The parent is also used by // the private and public API functions that need to delegate to a parent function. this._parent = namespace ? qq[namespace].FineUploaderBasic : qq.FineUploaderBasic; this._parent.apply(this, arguments); // Options provided by FineUploader mode qq.extend(this._options, { element: null, button: null, listElement: null, dragAndDrop: { extraDropzones: [], reportDirectoryPaths: false }, text: { formatProgress: "{percent}% of {total_size}", failUpload: "Upload failed", waitingForResponse: "Processing...", paused: "Paused" }, template: "qq-template", classes: { retrying: "qq-upload-retrying", retryable: "qq-upload-retryable", success: "qq-upload-success", fail: "qq-upload-fail", editable: "qq-editable", hide: "qq-hide", dropActive: "qq-upload-drop-area-active" }, failedUploadTextDisplay: { mode: "default", //default, custom, or none maxChars: 50, responseProperty: "error", enableTooltip: true }, messages: { tooManyFilesError: "You may only drop one file", unsupportedBrowser: "Unrecoverable error - this browser does not permit file uploading of any kind." }, retry: { showAutoRetryAlbum: true, autoRetryAlbum: "Retrying {retryNum}/{maxAuto}..." }, deleteFile: { forceConfirm: false, confirmMessage: "Are you sure you want to delete {filename}?", deletingStatusText: "Deleting...", deletingFailedText: "Delete failed" }, display: { fileSizeOnSubmit: false, prependFiles: false }, paste: { promptForName: false, namePromptMessage: "Please name this image" }, thumbnails: { maxCount: 0, placeholders: { waitUntilResponse: false, notAvailablePath: null, waitingPath: null }, timeBetweenThumbs: 750 }, scaling: { hideScaled: false }, showMessage: function(message) { setTimeout(function() { window.alert(message); }, 0); }, showConfirm: function(message) { return window.confirm(message); }, showPrompt: function(message, defaultValue) { return window.prompt(message, defaultValue); } }, true); // Replace any default options with user defined ones qq.extend(this._options, o, true); this._templating = new qq.Templating({ log: qq.bind(this.log, this), templateIdOrEl: this._options.template, containerEl: this._options.element, fileContainerEl: this._options.listElement, button: this._options.button, imageGenerator: this._imageGenerator, classes: { hide: this._options.classes.hide, editable: this._options.classes.editable }, limits: { maxThumbs: this._options.thumbnails.maxCount, timeBetweenThumbs: this._options.thumbnails.timeBetweenThumbs }, placeholders: { waitUntilUpdate: this._options.thumbnails.placeholders.waitUntilResponse, thumbnailNotAvailable: this._options.thumbnails.placeholders.notAvailablePath, waitingForThumbnail: this._options.thumbnails.placeholders.waitingPath }, text: this._options.text }); if (this._options.workarounds.ios8SafariUploads && qq.ios800() && qq.iosSafari()) { this._templating.renderFailure(this._options.messages.unsupportedBrowserIos8Safari); } else if (!qq.supportedFeatures.uploading || (this._options.cors.expected && !qq.supportedFeatures.uploadCors)) { this._templating.renderFailure(this._options.messages.unsupportedBrowser); } else { this._wrapCallbacks(); this._templating.render(); this._classes = this._options.classes; if (!this._options.button && this._templating.getButton()) { this._defaultButtonId = this._createUploadButton({element: this._templating.getButton()}).getButtonId(); } this._setupClickAndEditEventHandlers(); if (qq.DragAndDrop && qq.supportedFeatures.fileDrop) { this._dnd = this._setupDragAndDrop(); } if (this._options.paste.targetElement && this._options.paste.promptForName) { if (qq.PasteSupport) { this._setupPastePrompt(); } else { this.log("Paste support module not found.", "error"); } } this._totalFilesInBatch = 0; this._filesInBatchAddedToUi = 0; } }; // Inherit the base public & private API methods qq.extend(qq.FineUploader.prototype, qq.basePublicApi); qq.extend(qq.FineUploader.prototype, qq.basePrivateApi); // Add the FineUploader/default UI public & private UI methods, which may override some base methods. qq.extend(qq.FineUploader.prototype, qq.uiPublicApi); qq.extend(qq.FineUploader.prototype, qq.uiPrivateApi); /* globals qq */ /* jshint -W065 */ /** * Module responsible for rendering all Fine Uploader UI templates. This module also asserts at least * a limited amount of control over the template elements after they are added to the DOM. * Wherever possible, this module asserts total control over template elements present in the DOM. * * @param spec Specification object used to control various templating behaviors * @constructor */ qq.Templating = function(spec) { "use strict"; var FILE_ID_ATTR = "qq-file-id", FILE_CLASS_PREFIX = "qq-file-id-", THUMBNAIL_MAX_SIZE_ATTR = "qq-max-size", THUMBNAIL_SERVER_SCALE_ATTR = "qq-server-scale", // This variable is duplicated in the DnD module since it can function as a standalone as well HIDE_DROPZONE_ATTR = "qq-hide-dropzone", isCancelDisabled = false, generatedThumbnails = 0, thumbnailQueueMonitorRunning = false, thumbGenerationQueue = [], thumbnailMaxSize = -1, options = { log: null, limits: { maxThumbs: 0, timeBetweenThumbs: 750 }, templateIdOrEl: "qq-template", containerEl: null, fileContainerEl: null, button: null, imageGenerator: null, classes: { hide: "qq-hide", editable: "qq-editable" }, placeholders: { waitUntilUpdate: false, thumbnailNotAvailable: null, waitingForThumbnail: null }, text: { paused: "Paused" } }, selectorClasses = { button: "qq-upload-button-selector", drop: "qq-upload-drop-area-selector", list: "qq-upload-list-selector", progressBarContainer: "qq-progress-bar-container-selector", progressBar: "qq-progress-bar-selector", totalProgressBarContainer: "qq-total-progress-bar-container-selector", totalProgressBar: "qq-total-progress-bar-selector", file: "qq-upload-file-selector", spinner: "qq-upload-spinner-selector", size: "qq-upload-size-selector", cancel: "qq-upload-cancel-selector", pause: "qq-upload-pause-selector", continueButton: "qq-upload-continue-selector", deleteButton: "qq-upload-delete-selector", retry: "qq-upload-retry-selector", statusText: "qq-upload-status-text-selector", editFilenameInput: "qq-edit-filename-selector", editNameIcon: "qq-edit-filename-icon-selector", dropProcessing: "qq-drop-processing-selector", dropProcessingSpinner: "qq-drop-processing-spinner-selector", thumbnail: "qq-thumbnail-selector" }, previewGeneration = {}, cachedThumbnailNotAvailableImg = new qq.Promise(), cachedWaitingForThumbnailImg = new qq.Promise(), log, isEditElementsExist, isRetryElementExist, templateHtml, container, fileList, showThumbnails, serverScale, // During initialization of the templating module we should cache any // placeholder images so we can quickly swap them into the file list on demand. // Any placeholder images that cannot be loaded/found are simply ignored. cacheThumbnailPlaceholders = function() { var notAvailableUrl = options.placeholders.thumbnailNotAvailable, waitingUrl = options.placeholders.waitingForThumbnail, spec = { maxSize: thumbnailMaxSize, scale: serverScale }; if (showThumbnails) { if (notAvailableUrl) { options.imageGenerator.generate(notAvailableUrl, new Image(), spec).then( function(updatedImg) { cachedThumbnailNotAvailableImg.success(updatedImg); }, function() { cachedThumbnailNotAvailableImg.failure(); log("Problem loading 'not available' placeholder image at " + notAvailableUrl, "error"); } ); } else { cachedThumbnailNotAvailableImg.failure(); } if (waitingUrl) { options.imageGenerator.generate(waitingUrl, new Image(), spec).then( function(updatedImg) { cachedWaitingForThumbnailImg.success(updatedImg); }, function() { cachedWaitingForThumbnailImg.failure(); log("Problem loading 'waiting for thumbnail' placeholder image at " + waitingUrl, "error"); } ); } else { cachedWaitingForThumbnailImg.failure(); } } }, // Displays a "waiting for thumbnail" type placeholder image // iff we were able to load it during initialization of the templating module. displayWaitingImg = function(thumbnail) { var waitingImgPlacement = new qq.Promise(); cachedWaitingForThumbnailImg.then(function(img) { maybeScalePlaceholderViaCss(img, thumbnail); /* jshint eqnull:true */ if (!thumbnail.src) { thumbnail.src = img.src; thumbnail.onload = function() { thumbnail.onload = null; show(thumbnail); waitingImgPlacement.success(); }; } else { waitingImgPlacement.success(); } }, function() { // In some browsers (such as IE9 and older) an img w/out a src attribute // are displayed as "broken" images, so we should just hide the img tag // if we aren't going to display the "waiting" placeholder. hide(thumbnail); waitingImgPlacement.success(); }); return waitingImgPlacement; }, generateNewPreview = function(id, blob, spec) { var thumbnail = getThumbnail(id); log("Generating new thumbnail for " + id); blob.qqThumbnailId = id; return options.imageGenerator.generate(blob, thumbnail, spec).then( function() { generatedThumbnails++; show(thumbnail); previewGeneration[id].success(); }, function() { previewGeneration[id].failure(); // Display the "not available" placeholder img only if we are // not expecting a thumbnail at a later point, such as in a server response. if (!options.placeholders.waitUntilUpdate) { maybeSetDisplayNotAvailableImg(id, thumbnail); } }); }, generateNextQueuedPreview = function() { if (thumbGenerationQueue.length) { thumbnailQueueMonitorRunning = true; var queuedThumbRequest = thumbGenerationQueue.shift(); if (queuedThumbRequest.update) { processUpdateQueuedPreviewRequest(queuedThumbRequest); } else { processNewQueuedPreviewRequest(queuedThumbRequest); } } else { thumbnailQueueMonitorRunning = false; } }, getCancel = function(id) { return getTemplateEl(getFile(id), selectorClasses.cancel); }, getContinue = function(id) { return getTemplateEl(getFile(id), selectorClasses.continueButton); }, getDelete = function(id) { return getTemplateEl(getFile(id), selectorClasses.deleteButton); }, getDropProcessing = function() { return getTemplateEl(container, selectorClasses.dropProcessing); }, getEditIcon = function(id) { return getTemplateEl(getFile(id), selectorClasses.editNameIcon); }, getFile = function(id) { return qq(fileList).getByClass(FILE_CLASS_PREFIX + id)[0]; }, getFilename = function(id) { return getTemplateEl(getFile(id), selectorClasses.file); }, getPause = function(id) { return getTemplateEl(getFile(id), selectorClasses.pause); }, getProgress = function(id) { /* jshint eqnull:true */ // Total progress bar if (id == null) { return getTemplateEl(container, selectorClasses.totalProgressBarContainer) || getTemplateEl(container, selectorClasses.totalProgressBar); } // Per-file progress bar return getTemplateEl(getFile(id), selectorClasses.progressBarContainer) || getTemplateEl(getFile(id), selectorClasses.progressBar); }, getRetry = function(id) { return getTemplateEl(getFile(id), selectorClasses.retry); }, getSize = function(id) { return getTemplateEl(getFile(id), selectorClasses.size); }, getSpinner = function(id) { return getTemplateEl(getFile(id), selectorClasses.spinner); }, getTemplateEl = function(context, cssClass) { return context && qq(context).getByClass(cssClass)[0]; }, getThumbnail = function(id) { return showThumbnails && getTemplateEl(getFile(id), selectorClasses.thumbnail); }, hide = function(el) { el && qq(el).addClass(options.classes.hide); }, // Ensures a placeholder image does not exceed any max size specified // via `style` attribute properties iff <canvas> was not used to scale // the placeholder AND the target <img> doesn't already have these `style` attribute properties set. maybeScalePlaceholderViaCss = function(placeholder, thumbnail) { var maxWidth = placeholder.style.maxWidth, maxHeight = placeholder.style.maxHeight; if (maxHeight && maxWidth && !thumbnail.style.maxWidth && !thumbnail.style.maxHeight) { qq(thumbnail).css({ maxWidth: maxWidth, maxHeight: maxHeight }); } }, // Displays a "thumbnail not available" type placeholder image // iff we were able to load this placeholder during initialization // of the templating module or after preview generation has failed. maybeSetDisplayNotAvailableImg = function(id, thumbnail) { var previewing = previewGeneration[id] || new qq.Promise().failure(), notAvailableImgPlacement = new qq.Promise(); cachedThumbnailNotAvailableImg.then(function(img) { previewing.then( function() { notAvailableImgPlacement.success(); }, function() { maybeScalePlaceholderViaCss(img, thumbnail); thumbnail.onload = function() { thumbnail.onload = null; notAvailableImgPlacement.success(); }; thumbnail.src = img.src; show(thumbnail); } ); }); return notAvailableImgPlacement; }, /** * Grabs the HTML from the script tag holding the template markup. This function will also adjust * some internally-tracked state variables based on the contents of the template. * The template is filtered so that irrelevant elements (such as the drop zone if DnD is not supported) * are omitted from the DOM. Useful errors will be thrown if the template cannot be parsed. * * @returns {{template: *, fileTemplate: *}} HTML for the top-level file items templates */ parseAndGetTemplate = function() { var scriptEl, scriptHtml, fileListNode, tempTemplateEl, fileListHtml, defaultButton, dropArea, thumbnail, dropProcessing; log("Parsing template"); /*jshint -W116*/ if (options.templateIdOrEl == null) { throw new Error("You MUST specify either a template element or ID!"); } // Grab the contents of the script tag holding the template. if (qq.isString(options.templateIdOrEl)) { scriptEl = document.getElementById(options.templateIdOrEl); if (scriptEl === null) { throw new Error(qq.format("Cannot find template script at ID '{}'!", options.templateIdOrEl)); } scriptHtml = scriptEl.innerHTML; } else { if (options.templateIdOrEl.innerHTML === undefined) { throw new Error("You have specified an invalid value for the template option! " + "It must be an ID or an Element."); } scriptHtml = options.templateIdOrEl.innerHTML; } scriptHtml = qq.trimStr(scriptHtml); tempTemplateEl = document.createElement("div"); tempTemplateEl.appendChild(qq.toElement(scriptHtml)); // Don't include the default template button in the DOM // if an alternate button container has been specified. if (options.button) { defaultButton = qq(tempTemplateEl).getByClass(selectorClasses.button)[0]; if (defaultButton) { qq(defaultButton).remove(); } } // Omit the drop processing element from the DOM if DnD is not supported by the UA, // or the drag and drop module is not found. // NOTE: We are consciously not removing the drop zone if the UA doesn't support DnD // to support layouts where the drop zone is also a container for visible elements, // such as the file list. if (!qq.DragAndDrop || !qq.supportedFeatures.fileDrop) { dropProcessing = qq(tempTemplateEl).getByClass(selectorClasses.dropProcessing)[0]; if (dropProcessing) { qq(dropProcessing).remove(); } } dropArea = qq(tempTemplateEl).getByClass(selectorClasses.drop)[0]; // If DnD is not available then remove // it from the DOM as well. if (dropArea && !qq.DragAndDrop) { log("DnD module unavailable.", "info"); qq(dropArea).remove(); } // If there is a drop area defined in the template, and the current UA doesn't support DnD, // and the drop area is marked as "hide before enter", ensure it is hidden as the DnD module // will not do this (since we will not be loading the DnD module) if (dropArea && !qq.supportedFeatures.fileDrop && qq(dropArea).hasAttribute(HIDE_DROPZONE_ATTR)) { qq(dropArea).css({ display: "none" }); } // Ensure the `showThumbnails` flag is only set if the thumbnail element // is present in the template AND the current UA is capable of generating client-side previews. thumbnail = qq(tempTemplateEl).getByClass(selectorClasses.thumbnail)[0]; if (!showThumbnails) { thumbnail && qq(thumbnail).remove(); } else if (thumbnail) { thumbnailMaxSize = parseInt(thumbnail.getAttribute(THUMBNAIL_MAX_SIZE_ATTR)); // Only enforce max size if the attr value is non-zero thumbnailMaxSize = thumbnailMaxSize > 0 ? thumbnailMaxSize : null; serverScale = qq(thumbnail).hasAttribute(THUMBNAIL_SERVER_SCALE_ATTR); } showThumbnails = showThumbnails && thumbnail; isEditElementsExist = qq(tempTemplateEl).getByClass(selectorClasses.editFilenameInput).length > 0; isRetryElementExist = qq(tempTemplateEl).getByClass(selectorClasses.retry).length > 0; fileListNode = qq(tempTemplateEl).getByClass(selectorClasses.list)[0]; /*jshint -W116*/ if (fileListNode == null) { throw new Error("Could not find the file list container in the template!"); } fileListHtml = fileListNode.innerHTML; fileListNode.innerHTML = ""; log("Template parsing complete"); return { template: qq.trimStr(tempTemplateEl.innerHTML), fileTemplate: qq.trimStr(fileListHtml) }; }, prependFile = function(el, index) { var parentEl = fileList, beforeEl = parentEl.firstChild; if (index > 0) { beforeEl = qq(parentEl).children()[index].nextSibling; } parentEl.insertBefore(el, beforeEl); }, processNewQueuedPreviewRequest = function(queuedThumbRequest) { var id = queuedThumbRequest.id, optFileOrBlob = queuedThumbRequest.optFileOrBlob, relatedThumbnailId = optFileOrBlob && optFileOrBlob.qqThumbnailId, thumbnail = getThumbnail(id), spec = { maxSize: thumbnailMaxSize, scale: true, orient: true }; if (qq.supportedFeatures.imagePreviews) { if (thumbnail) { if (options.limits.maxThumbs && options.limits.maxThumbs <= generatedThumbnails) { maybeSetDisplayNotAvailableImg(id, thumbnail); generateNextQueuedPreview(); } else { displayWaitingImg(thumbnail).done(function() { previewGeneration[id] = new qq.Promise(); previewGeneration[id].done(function() { setTimeout(generateNextQueuedPreview, options.limits.timeBetweenThumbs); }); /* jshint eqnull: true */ // If we've already generated an <img> for this file, use the one that exists, // don't waste resources generating a new one. if (relatedThumbnailId != null) { useCachedPreview(id, relatedThumbnailId); } else { generateNewPreview(id, optFileOrBlob, spec); } }); } } } else if (thumbnail) { displayWaitingImg(thumbnail); generateNextQueuedPreview(); } }, processUpdateQueuedPreviewRequest = function(queuedThumbRequest) { var id = queuedThumbRequest.id, thumbnailUrl = queuedThumbRequest.thumbnailUrl, showWaitingImg = queuedThumbRequest.showWaitingImg, thumbnail = getThumbnail(id), spec = { maxSize: thumbnailMaxSize, scale: serverScale }; if (thumbnail) { if (thumbnailUrl) { if (options.limits.maxThumbs && options.limits.maxThumbs <= generatedThumbnails) { maybeSetDisplayNotAvailableImg(id, thumbnail); generateNextQueuedPreview(); } else { if (showWaitingImg) { displayWaitingImg(thumbnail); } return options.imageGenerator.generate(thumbnailUrl, thumbnail, spec).then( function() { show(thumbnail); generatedThumbnails++; setTimeout(generateNextQueuedPreview, options.limits.timeBetweenThumbs); }, function() { maybeSetDisplayNotAvailableImg(id, thumbnail); setTimeout(generateNextQueuedPreview, options.limits.timeBetweenThumbs); } ); } } else { maybeSetDisplayNotAvailableImg(id, thumbnail); generateNextQueuedPreview(); } } }, setProgressBarWidth = function(id, percent) { var bar = getProgress(id), /* jshint eqnull:true */ progressBarSelector = id == null ? selectorClasses.totalProgressBar : selectorClasses.progressBar; if (bar && !qq(bar).hasClass(progressBarSelector)) { bar = qq(bar).getByClass(progressBarSelector)[0]; } bar && qq(bar).css({width: percent + "%"}); }, show = function(el) { el && qq(el).removeClass(options.classes.hide); }, useCachedPreview = function(targetThumbnailId, cachedThumbnailId) { var targetThumnail = getThumbnail(targetThumbnailId), cachedThumbnail = getThumbnail(cachedThumbnailId); log(qq.format("ID {} is the same file as ID {}. Will use generated thumbnail from ID {} instead.", targetThumbnailId, cachedThumbnailId, cachedThumbnailId)); // Generation of the related thumbnail may still be in progress, so, wait until it is done. previewGeneration[cachedThumbnailId].then(function() { generatedThumbnails++; previewGeneration[targetThumbnailId].success(); log(qq.format("Now using previously generated thumbnail created for ID {} on ID {}.", cachedThumbnailId, targetThumbnailId)); targetThumnail.src = cachedThumbnail.src; show(targetThumnail); }, function() { previewGeneration[targetThumbnailId].failure(); if (!options.placeholders.waitUntilUpdate) { maybeSetDisplayNotAvailableImg(targetThumbnailId, targetThumnail); } }); }; qq.extend(options, spec); log = options.log; // No need to worry about conserving CPU or memory on older browsers, // since there is no ability to preview, and thumbnail display is primitive and quick. if (!qq.supportedFeatures.imagePreviews) { options.limits.timeBetweenThumbs = 0; options.limits.maxThumbs = 0; } container = options.containerEl; showThumbnails = options.imageGenerator !== undefined; templateHtml = parseAndGetTemplate(); cacheThumbnailPlaceholders(); qq.extend(this, { render: function() { log("Rendering template in DOM."); generatedThumbnails = 0; container.innerHTML = templateHtml.template; hide(getDropProcessing()); this.hideTotalProgress(); fileList = options.fileContainerEl || getTemplateEl(container, selectorClasses.list); log("Template rendering complete"); }, renderFailure: function(message) { var cantRenderEl = qq.toElement(message); container.innerHTML = ""; container.appendChild(cantRenderEl); }, reset: function() { this.render(); }, clearFiles: function() { fileList.innerHTML = ""; }, disableCancel: function() { isCancelDisabled = true; }, addFile: function(id, name, prependInfo) { var fileEl = qq.toElement(templateHtml.fileTemplate), fileNameEl = getTemplateEl(fileEl, selectorClasses.file), thumb; qq(fileEl).addClass(FILE_CLASS_PREFIX + id); fileNameEl && qq(fileNameEl).setText(name); fileEl.setAttribute(FILE_ID_ATTR, id); if (prependInfo) { prependFile(fileEl, prependInfo.index); } else { fileList.appendChild(fileEl); } hide(getProgress(id)); hide(getSize(id)); hide(getDelete(id)); hide(getRetry(id)); hide(getPause(id)); hide(getContinue(id)); if (isCancelDisabled) { this.hideCancel(id); } thumb = getThumbnail(id); if (thumb && !thumb.src) { cachedWaitingForThumbnailImg.then(function(waitingImg) { thumb.src = waitingImg.src; if (waitingImg.style.maxHeight && waitingImg.style.maxWidth) { qq(thumb).css({ maxHeight: waitingImg.style.maxHeight, maxWidth: waitingImg.style.maxWidth }); } show(thumb); }); } }, removeFile: function(id) { qq(getFile(id)).remove(); }, getFileId: function(el) { var currentNode = el; if (currentNode) { /*jshint -W116*/ while (currentNode.getAttribute(FILE_ID_ATTR) == null) { currentNode = currentNode.parentNode; } return parseInt(currentNode.getAttribute(FILE_ID_ATTR)); } }, getFileList: function() { return fileList; }, markFilenameEditable: function(id) { var filename = getFilename(id); filename && qq(filename).addClass(options.classes.editable); }, updateFilename: function(id, name) { var filename = getFilename(id); filename && qq(filename).setText(name); }, hideFilename: function(id) { hide(getFilename(id)); }, showFilename: function(id) { show(getFilename(id)); }, isFileName: function(el) { return qq(el).hasClass(selectorClasses.file); }, getButton: function() { return options.button || getTemplateEl(container, selectorClasses.button); }, hideDropProcessing: function() { hide(getDropProcessing()); }, showDropProcessing: function() { show(getDropProcessing()); }, getDropZone: function() { return getTemplateEl(container, selectorClasses.drop); }, isEditFilenamePossible: function() { return isEditElementsExist; }, hideRetry: function(id) { hide(getRetry(id)); }, isRetryPossible: function() { return isRetryElementExist; }, showRetry: function(id) { show(getRetry(id)); }, getFileContainer: function(id) { return getFile(id); }, showEditIcon: function(id) { var icon = getEditIcon(id); icon && qq(icon).addClass(options.classes.editable); }, hideEditIcon: function(id) { var icon = getEditIcon(id); icon && qq(icon).removeClass(options.classes.editable); }, isEditIcon: function(el) { return qq(el).hasClass(selectorClasses.editNameIcon); }, getEditInput: function(id) { return getTemplateEl(getFile(id), selectorClasses.editFilenameInput); }, isEditInput: function(el) { return qq(el).hasClass(selectorClasses.editFilenameInput); }, updateProgress: function(id, loaded, total) { var bar = getProgress(id), percent; if (bar && total > 0) { percent = Math.round(loaded / total * 100); if (percent === 100) { hide(bar); } else { show(bar); } setProgressBarWidth(id, percent); } }, updateTotalProgress: function(loaded, total) { this.updateProgress(null, loaded, total); }, hideProgress: function(id) { var bar = getProgress(id); bar && hide(bar); }, hideTotalProgress: function() { this.hideProgress(); }, resetProgress: function(id) { setProgressBarWidth(id, 0); this.hideTotalProgress(id); }, resetTotalProgress: function() { this.resetProgress(); }, showCancel: function(id) { if (!isCancelDisabled) { var cancel = getCancel(id); cancel && qq(cancel).removeClass(options.classes.hide); } }, hideCancel: function(id) { hide(getCancel(id)); }, isCancel: function(el) { return qq(el).hasClass(selectorClasses.cancel); }, allowPause: function(id) { show(getPause(id)); hide(getContinue(id)); }, uploadPaused: function(id) { this.setStatusText(id, options.text.paused); this.allowContinueButton(id); hide(getSpinner(id)); }, hidePause: function(id) { hide(getPause(id)); }, isPause: function(el) { return qq(el).hasClass(selectorClasses.pause); }, isContinueButton: function(el) { return qq(el).hasClass(selectorClasses.continueButton); }, allowContinueButton: function(id) { show(getContinue(id)); hide(getPause(id)); }, uploadContinued: function(id) { this.setStatusText(id, ""); this.allowPause(id); show(getSpinner(id)); }, showDeleteButton: function(id) { show(getDelete(id)); }, hideDeleteButton: function(id) { hide(getDelete(id)); }, isDeleteButton: function(el) { return qq(el).hasClass(selectorClasses.deleteButton); }, isRetry: function(el) { return qq(el).hasClass(selectorClasses.retry); }, updateSize: function(id, text) { var size = getSize(id); if (size) { show(size); qq(size).setText(text); } }, setStatusText: function(id, text) { var textEl = getTemplateEl(getFile(id), selectorClasses.statusText); if (textEl) { /*jshint -W116*/ if (text == null) { qq(textEl).clearText(); } else { qq(textEl).setText(text); } } }, hideSpinner: function(id) { hide(getSpinner(id)); }, showSpinner: function(id) { show(getSpinner(id)); }, generatePreview: function(id, optFileOrBlob) { thumbGenerationQueue.push({id: id, optFileOrBlob: optFileOrBlob}); !thumbnailQueueMonitorRunning && generateNextQueuedPreview(); }, updateThumbnail: function(id, thumbnailUrl, showWaitingImg) { thumbGenerationQueue.push({update: true, id: id, thumbnailUrl: thumbnailUrl, showWaitingImg: showWaitingImg}); !thumbnailQueueMonitorRunning && generateNextQueuedPreview(); } }); }; /*globals qq */ qq.s3 = qq.s3 || {}; qq.s3.util = qq.s3.util || (function() { "use strict"; return { AWS_PARAM_PREFIX: "x-amz-meta-", SESSION_TOKEN_PARAM_NAME: "x-amz-security-token", REDUCED_REDUNDANCY_PARAM_NAME: "x-amz-storage-class", REDUCED_REDUNDANCY_PARAM_VALUE: "REDUCED_REDUNDANCY", SERVER_SIDE_ENCRYPTION_PARAM_NAME: "x-amz-server-side-encryption", SERVER_SIDE_ENCRYPTION_PARAM_VALUE: "AES256", /** * This allows for the region to be specified in the bucket's endpoint URL, or not. * * Examples of some valid endpoints are: * http://foo.s3.amazonaws.com * https://foo.s3.amazonaws.com * http://foo.s3-ap-northeast-1.amazonaws.com * foo.s3.amazonaws.com * http://foo.bar.com * http://s3.amazonaws.com/foo.bar.com * ...etc * * @param endpoint The bucket's URL. * @returns {String || undefined} The bucket name, or undefined if the URL cannot be parsed. */ getBucket: function(endpoint) { var patterns = [ //bucket in domain /^(?:https?:\/\/)?([a-z0-9.\-_]+)\.s3(?:-[a-z0-9\-]+)?\.amazonaws\.com/i, //bucket in path /^(?:https?:\/\/)?s3(?:-[a-z0-9\-]+)?\.amazonaws\.com\/([a-z0-9.\-_]+)/i, //custom domain /^(?:https?:\/\/)?([a-z0-9.\-_]+)/i ], bucket; qq.each(patterns, function(idx, pattern) { var match = pattern.exec(endpoint); if (match) { bucket = match[1]; return false; } }); return bucket; }, /** * Create a policy document to be signed and sent along with the S3 upload request. * * @param spec Object with properties use to construct the policy document. * @returns {Object} Policy doc. */ getPolicy: function(spec) { var policy = {}, conditions = [], bucket = spec.bucket, key = spec.key, acl = spec.acl, type = spec.type, expirationDate = new Date(), expectedStatus = spec.expectedStatus, sessionToken = spec.sessionToken, params = spec.params, successRedirectUrl = qq.s3.util.getSuccessRedirectAbsoluteUrl(spec.successRedirectUrl), minFileSize = spec.minFileSize, maxFileSize = spec.maxFileSize, reducedRedundancy = spec.reducedRedundancy, serverSideEncryption = spec.serverSideEncryption; policy.expiration = qq.s3.util.getPolicyExpirationDate(expirationDate); conditions.push({acl: acl}); conditions.push({bucket: bucket}); if (type) { conditions.push({"Content-Type": type}); } // jscs:disable requireCamelCaseOrUpperCaseIdentifiers if (expectedStatus) { conditions.push({success_action_status: expectedStatus.toString()}); } if (successRedirectUrl) { conditions.push({success_action_redirect: successRedirectUrl}); } // jscs:enable if (reducedRedundancy) { conditions.push({}); conditions[conditions.length - 1][qq.s3.util.REDUCED_REDUNDANCY_PARAM_NAME] = qq.s3.util.REDUCED_REDUNDANCY_PARAM_VALUE; } if (sessionToken) { conditions.push({}); conditions[conditions.length - 1][qq.s3.util.SESSION_TOKEN_PARAM_NAME] = sessionToken; } if (serverSideEncryption) { conditions.push({}); conditions[conditions.length - 1][qq.s3.util.SERVER_SIDE_ENCRYPTION_PARAM_NAME] = qq.s3.util.SERVER_SIDE_ENCRYPTION_PARAM_VALUE; } conditions.push({key: key}); // user metadata qq.each(params, function(name, val) { var awsParamName = qq.s3.util.AWS_PARAM_PREFIX + name, param = {}; param[awsParamName] = encodeURIComponent(val); conditions.push(param); }); policy.conditions = conditions; qq.s3.util.enforceSizeLimits(policy, minFileSize, maxFileSize); return policy; }, /** * Update a previously constructed policy document with updated credentials. Currently, this only requires we * update the session token. This is only relevant if requests are being signed client-side. * * @param policy Live policy document * @param newSessionToken Updated session token. */ refreshPolicyCredentials: function(policy, newSessionToken) { var sessionTokenFound = false; qq.each(policy.conditions, function(oldCondIdx, oldCondObj) { qq.each(oldCondObj, function(oldCondName, oldCondVal) { if (oldCondName === qq.s3.util.SESSION_TOKEN_PARAM_NAME) { oldCondObj[oldCondName] = newSessionToken; sessionTokenFound = true; } }); }); if (!sessionTokenFound) { policy.conditions.push({}); policy.conditions[policy.conditions.length - 1][qq.s3.util.SESSION_TOKEN_PARAM_NAME] = newSessionToken; } }, /** * Generates all parameters to be passed along with the S3 upload request. This includes invoking a callback * that is expected to asynchronously retrieve a signature for the policy document. Album that the server * signing the request should reject a "tainted" policy document that includes unexpected values, since it is * still possible for a malicious user to tamper with these values during policy document generation, b * before it is sent to the server for signing. * * @param spec Object with properties: `params`, `type`, `key`, `accessKey`, `acl`, `expectedStatus`, `successRedirectUrl`, * `reducedRedundancy`, serverSideEncryption, and `log()`, along with any options associated with `qq.s3.util.getPolicy()`. * @returns {qq.Promise} Promise that will be fulfilled once all parameters have been determined. */ generateAwsParams: function(spec, signPolicyCallback) { var awsParams = {}, customParams = spec.params, promise = new qq.Promise(), policyJson = qq.s3.util.getPolicy(spec), sessionToken = spec.sessionToken, type = spec.type, key = spec.key, accessKey = spec.accessKey, acl = spec.acl, expectedStatus = spec.expectedStatus, successRedirectUrl = qq.s3.util.getSuccessRedirectAbsoluteUrl(spec.successRedirectUrl), reducedRedundancy = spec.reducedRedundancy, serverSideEncryption = spec.serverSideEncryption, log = spec.log; awsParams.key = key; awsParams.AWSAccessKeyId = accessKey; if (type) { awsParams["Content-Type"] = type; } // jscs:disable requireCamelCaseOrUpperCaseIdentifiers if (expectedStatus) { awsParams.success_action_status = expectedStatus; } if (successRedirectUrl) { awsParams.success_action_redirect = successRedirectUrl; } // jscs:enable if (reducedRedundancy) { awsParams[qq.s3.util.REDUCED_REDUNDANCY_PARAM_NAME] = qq.s3.util.REDUCED_REDUNDANCY_PARAM_VALUE; } if (serverSideEncryption) { awsParams[qq.s3.util.SERVER_SIDE_ENCRYPTION_PARAM_NAME] = qq.s3.util.SERVER_SIDE_ENCRYPTION_PARAM_VALUE; } if (sessionToken) { awsParams[qq.s3.util.SESSION_TOKEN_PARAM_NAME] = sessionToken; } awsParams.acl = acl; // Custom (user-supplied) params must be prefixed with the value of `qq.s3.util.AWS_PARAM_PREFIX`. // Custom param values will be URI encoded as well. qq.each(customParams, function(name, val) { var awsParamName = qq.s3.util.AWS_PARAM_PREFIX + name; awsParams[awsParamName] = encodeURIComponent(val); }); // Invoke a promissory callback that should provide us with a base64-encoded policy doc and an // HMAC signature for the policy doc. signPolicyCallback(policyJson).then( function(policyAndSignature, updatedAccessKey, updatedSessionToken) { awsParams.policy = policyAndSignature.policy; awsParams.signature = policyAndSignature.signature; if (updatedAccessKey) { awsParams.AWSAccessKeyId = updatedAccessKey; } if (updatedSessionToken) { awsParams[qq.s3.util.SESSION_TOKEN_PARAM_NAME] = updatedSessionToken; } promise.success(awsParams); }, function(errorMessage) { errorMessage = errorMessage || "Can't continue further with request to S3 as we did not receive " + "a valid signature and policy from the server."; log("Policy signing failed. " + errorMessage, "error"); promise.failure(errorMessage); } ); return promise; }, /** * Add a condition to an existing S3 upload request policy document used to ensure AWS enforces any size * restrictions placed on files server-side. This is important to do, in case users mess with the client-side * checks already in place. * * @param policy Policy document as an `Object`, with a `conditions` property already attached * @param minSize Minimum acceptable size, in bytes * @param maxSize Maximum acceptable size, in bytes (0 = unlimited) */ enforceSizeLimits: function(policy, minSize, maxSize) { var adjustedMinSize = minSize < 0 ? 0 : minSize, // Adjust a maxSize of 0 to the largest possible integer, since we must specify a high and a low in the request adjustedMaxSize = maxSize <= 0 ? 9007199254740992 : maxSize; if (minSize > 0 || maxSize > 0) { policy.conditions.push(["content-length-range", adjustedMinSize.toString(), adjustedMaxSize.toString()]); } }, getPolicyExpirationDate: function(date) { /*jshint -W014 */ // Is this going to be a problem if we encounter this moments before 2 AM just before daylight savings time ends? date.setMinutes(date.getMinutes() + 5); if (Date.prototype.toISOString) { return date.toISOString(); } else { var pad = function(number) { var r = String(number); if (r.length === 1) { r = "0" + r; } return r; }; return date.getUTCFullYear() + "-" + pad(date.getUTCMonth() + 1) + "-" + pad(date.getUTCDate()) + "T" + pad(date.getUTCHours()) + ":" + pad(date.getUTCMinutes()) + ":" + pad(date.getUTCSeconds()) + "." + String((date.getUTCMilliseconds() / 1000).toFixed(3)).slice(2, 5) + "Z"; } }, /** * Looks at a response from S3 contained in an iframe and parses the query string in an attempt to identify * the associated resource. * * @param iframe Iframe containing response * @returns {{bucket: *, key: *, etag: *}} */ parseIframeResponse: function(iframe) { var doc = iframe.contentDocument || iframe.contentWindow.document, queryString = doc.location.search, match = /bucket=(.+)&key=(.+)&etag=(.+)/.exec(queryString); if (match) { return { bucket: match[1], key: match[2], etag: match[3].replace(/%22/g, "") }; } }, /** * @param successRedirectUrl Relative or absolute location of success redirect page * @returns {*|string} undefined if the parameter is undefined, otherwise the absolute location of the success redirect page */ getSuccessRedirectAbsoluteUrl: function(successRedirectUrl) { if (successRedirectUrl) { var targetAnchorContainer = document.createElement("div"), targetAnchor; if (qq.ie7()) { // Album that we must make use of `innerHTML` for IE7 only instead of simply creating an anchor via // `document.createElement('a')` and setting the `href` attribute. The latter approach does not allow us to // obtain an absolute URL in IE7 if the `endpoint` is a relative URL. targetAnchorContainer.innerHTML = "<a href='" + successRedirectUrl + "'></a>"; targetAnchor = targetAnchorContainer.firstChild; return targetAnchor.href; } else { // IE8 and IE9 do not seem to derive an absolute URL from a relative URL using the `innerHTML` // approach above, so we'll just create an anchor this way and set it's `href` attribute. // Due to yet another quirk in IE8 and IE9, we have to set the `href` equal to itself // in order to ensure relative URLs will be properly parsed. targetAnchor = document.createElement("a"); targetAnchor.href = successRedirectUrl; targetAnchor.href = targetAnchor.href; return targetAnchor.href; } } }, // AWS employs a strict interpretation of [RFC 3986](http://tools.ietf.org/html/rfc3986#page-12). // So, we must ensure all reserved characters listed in the spec are percent-encoded, // and spaces are replaced with "+". encodeQueryStringParam: function(param) { var percentEncoded = encodeURIComponent(param); // %-encode characters not handled by `encodeURIComponent` (to follow RFC 3986) percentEncoded = percentEncoded.replace(/[!'()]/g, escape); // %-encode characters not handled by `escape` (to follow RFC 3986) percentEncoded = percentEncoded.replace(/\*/g, "%2A"); // replace percent-encoded spaces with a "+" return percentEncoded.replace(/%20/g, "+"); } }; }()); /*globals qq*/ /** * Defines the public API for non-traditional FineUploaderBasic mode. */ (function() { "use strict"; qq.nonTraditionalBasePublicApi = { setUploadSuccessParams: function(params, id) { this._uploadSuccessParamsStore.set(params, id); }, setUploadSuccessEndpoint: function(endpoint, id) { this._uploadSuccessEndpointStore.set(endpoint, id); } }; qq.nonTraditionalBasePrivateApi = { /** * When the upload has completed, if it is successful, send a request to the `successEndpoint` (if defined). * This will hold up the call to the `onComplete` callback until we have determined success of the upload * according to the local server, if a `successEndpoint` has been defined by the integrator. * * @param id ID of the completed upload * @param name Name of the associated item * @param result Object created from the server's parsed JSON response. * @param xhr Associated XmlHttpRequest, if this was used to send the request. * @returns {boolean || qq.Promise} true/false if success can be determined immediately, otherwise a `qq.Promise` * if we need to ask the server. * @private */ _onComplete: function(id, name, result, xhr) { var success = result.success ? true : false, self = this, onCompleteArgs = arguments, successEndpoint = this._uploadSuccessEndpointStore.get(id), successCustomHeaders = this._options.uploadSuccess.customHeaders, cors = this._options.cors, promise = new qq.Promise(), uploadSuccessParams = this._uploadSuccessParamsStore.get(id), fileParams = this._paramsStore.get(id), // If we are waiting for confirmation from the local server, and have received it, // include properties from the local server response in the `response` parameter // sent to the `onComplete` callback, delegate to the parent `_onComplete`, and // fulfill the associated promise. onSuccessFromServer = function(successRequestResult) { delete self._failedSuccessRequestCallbacks[id]; qq.extend(result, successRequestResult); qq.FineUploaderBasic.prototype._onComplete.apply(self, onCompleteArgs); promise.success(successRequestResult); }, // If the upload success request fails, attempt to re-send the success request (via the core retry code). // The entire upload may be restarted if the server returns a "reset" property with a value of true as well. onFailureFromServer = function(successRequestResult) { var callback = submitSuccessRequest; qq.extend(result, successRequestResult); if (result && result.reset) { callback = null; } if (!callback) { delete self._failedSuccessRequestCallbacks[id]; } else { self._failedSuccessRequestCallbacks[id] = callback; } if (!self._onAutoRetry(id, name, result, xhr, callback)) { qq.FineUploaderBasic.prototype._onComplete.apply(self, onCompleteArgs); promise.failure(successRequestResult); } }, submitSuccessRequest, successAjaxRequester; // Ask the local server if the file sent is ok. if (success && successEndpoint) { successAjaxRequester = new qq.UploadSuccessAjaxRequester({ endpoint: successEndpoint, customHeaders: successCustomHeaders, cors: cors, log: qq.bind(this.log, this) }); // combine custom params and default params qq.extend(uploadSuccessParams, self._getEndpointSpecificParams(id, result, xhr), true); // include any params associated with the file fileParams && qq.extend(uploadSuccessParams, fileParams, true); submitSuccessRequest = qq.bind(function() { successAjaxRequester.sendSuccessRequest(id, uploadSuccessParams) .then(onSuccessFromServer, onFailureFromServer); }, self); submitSuccessRequest(); return promise; } // If we are not asking the local server about the file, just delegate to the parent `_onComplete`. return qq.FineUploaderBasic.prototype._onComplete.apply(this, arguments); }, // If the failure occurred on an upload success request (and a reset was not ordered), try to resend that instead. _manualRetry: function(id) { var successRequestCallback = this._failedSuccessRequestCallbacks[id]; return qq.FineUploaderBasic.prototype._manualRetry.call(this, id, successRequestCallback); } }; }()); /*globals qq */ /** * This defines FineUploaderBasic mode w/ support for uploading to S3, which provides all the basic * functionality of Fine Uploader Basic as well as code to handle uploads directly to S3. * Some inherited options and API methods have a special meaning in the context of the S3 uploader. */ (function() { "use strict"; qq.s3.FineUploaderBasic = function(o) { var options = { request: { // public key (required for server-side signing, ignored if `credentials` have been provided) accessKey: null }, objectProperties: { acl: "private", // string or a function which may be promissory bucket: qq.bind(function(id) { return qq.s3.util.getBucket(this.getEndpoint(id)); }, this), // 'uuid', 'filename', or a function which may be promissory key: "uuid", reducedRedundancy: false, serverSideEncryption: false }, credentials: { // Public key (required). accessKey: null, // Private key (required). secretKey: null, // Expiration date for the credentials (required). May be an ISO string or a `Date`. expiration: null, // Temporary credentials session token. // Only required for temporary credentials obtained via AssumeRoleWithWebIdentity. sessionToken: null }, // optional/ignored if `credentials` is provided signature: { endpoint: null, customHeaders: {} }, uploadSuccess: { endpoint: null, // In addition to the default params sent by Fine Uploader params: {}, customHeaders: {} }, // required if non-File-API browsers, such as IE9 and older, are used iframeSupport: { localBlankPagePath: null }, chunking: { // minimum part size is 5 MiB when uploading to S3 partSize: 5242880 }, cors: { allowXdr: true }, callbacks: { onCredentialsExpired: function() {} } }; // Replace any default options with user defined ones qq.extend(options, o, true); if (!this.setCredentials(options.credentials, true)) { this._currentCredentials.accessKey = options.request.accessKey; } this._aclStore = this._createStore(options.objectProperties.acl); // Call base module qq.FineUploaderBasic.call(this, options); this._uploadSuccessParamsStore = this._createStore(this._options.uploadSuccess.params); this._uploadSuccessEndpointStore = this._createStore(this._options.uploadSuccess.endpoint); // This will hold callbacks for failed uploadSuccess requests that will be invoked on retry. // Indexed by file ID. this._failedSuccessRequestCallbacks = {}; // Holds S3 keys for file representations constructed from a session request. this._cannedKeys = {}; // Holds S3 buckets for file representations constructed from a session request. this._cannedBuckets = {}; this._buckets = {}; }; // Inherit basic public & private API methods. qq.extend(qq.s3.FineUploaderBasic.prototype, qq.basePublicApi); qq.extend(qq.s3.FineUploaderBasic.prototype, qq.basePrivateApi); qq.extend(qq.s3.FineUploaderBasic.prototype, qq.nonTraditionalBasePublicApi); qq.extend(qq.s3.FineUploaderBasic.prototype, qq.nonTraditionalBasePrivateApi); // Define public & private API methods for this module. qq.extend(qq.s3.FineUploaderBasic.prototype, { getBucket: function(id) { if (this._cannedBuckets[id] == null) { return this._buckets[id]; } return this._cannedBuckets[id]; }, /** * @param id File ID * @returns {*} Key name associated w/ the file, if one exists */ getKey: function(id) { /* jshint eqnull:true */ if (this._cannedKeys[id] == null) { return this._handler.getThirdPartyFileId(id); } return this._cannedKeys[id]; }, /** * Override the parent's reset function to cleanup various S3-related items. */ reset: function() { qq.FineUploaderBasic.prototype.reset.call(this); this._failedSuccessRequestCallbacks = []; this._buckets = {}; }, setCredentials: function(credentials, ignoreEmpty) { if (credentials && credentials.secretKey) { if (!credentials.accessKey) { throw new qq.Error("Invalid credentials: no accessKey"); } else if (!credentials.expiration) { throw new qq.Error("Invalid credentials: no expiration"); } else { this._currentCredentials = qq.extend({}, credentials); // Ensure expiration is a `Date`. If initially a string, assuming it is in ISO format. if (qq.isString(credentials.expiration)) { this._currentCredentials.expiration = new Date(credentials.expiration); } } return true; } else if (!ignoreEmpty) { throw new qq.Error("Invalid credentials parameter!"); } else { this._currentCredentials = {}; } }, setAcl: function(acl, id) { this._aclStore.set(acl, id); }, /** * Ensures the parent's upload handler creator passes any additional S3-specific options to the handler as well * as information required to instantiate the specific handler based on the current browser's capabilities. * * @returns {qq.UploadHandlerController} * @private */ _createUploadHandler: function() { var self = this, additionalOptions = { aclStore: this._aclStore, getBucket: qq.bind(this._determineBucket, this), getKeyName: qq.bind(this._determineKeyName, this), iframeSupport: this._options.iframeSupport, objectProperties: this._options.objectProperties, signature: this._options.signature, // pass size limit validation values to include in the request so AWS enforces this server-side validation: { minSizeLimit: this._options.validation.minSizeLimit, maxSizeLimit: this._options.validation.sizeLimit } }; // We assume HTTP if it is missing from the start of the endpoint string. qq.override(this._endpointStore, function(super_) { return { get: function(id) { var endpoint = super_.get(id); if (endpoint.indexOf("http") < 0) { return "http://" + endpoint; } return endpoint; } }; }); // Param names should be lower case to avoid signature mismatches qq.override(this._paramsStore, function(super_) { return { get: function(id) { var oldParams = super_.get(id), modifiedParams = {}; qq.each(oldParams, function(name, val) { modifiedParams[name.toLowerCase()] = qq.isFunction(val) ? val() : val; }); return modifiedParams; } }; }); additionalOptions.signature.credentialsProvider = { get: function() { return self._currentCredentials; }, onExpired: function() { var updateCredentials = new qq.Promise(), callbackRetVal = self._options.callbacks.onCredentialsExpired(); if (qq.isGenericPromise(callbackRetVal)) { callbackRetVal.then(function(credentials) { try { self.setCredentials(credentials); updateCredentials.success(); } catch (error) { self.log("Invalid credentials returned from onCredentialsExpired callback! (" + error.message + ")", "error"); updateCredentials.failure("onCredentialsExpired did not return valid credentials."); } }, function(errorMsg) { self.log("onCredentialsExpired callback indicated failure! (" + errorMsg + ")", "error"); updateCredentials.failure("onCredentialsExpired callback failed."); }); } else { self.log("onCredentialsExpired callback did not return a promise!", "error"); updateCredentials.failure("Unexpected return value for onCredentialsExpired."); } return updateCredentials; } }; return qq.FineUploaderBasic.prototype._createUploadHandler.call(this, additionalOptions, "s3"); }, _determineBucket: function(id) { var maybeBucket = this._options.objectProperties.bucket, promise = new qq.Promise(), self = this; if (qq.isFunction(maybeBucket)) { maybeBucket = maybeBucket(id); if (qq.isGenericPromise(maybeBucket)) { promise = maybeBucket; } else { promise.success(maybeBucket); } } else if (qq.isString(maybeBucket)) { promise.success(maybeBucket); } promise.then( function success(bucket) { self._buckets[id] = bucket; }, function failure(errorMsg) { qq.log("Problem determining bucket for ID " + id + " (" + errorMsg + ")", "error"); } ); return promise; }, /** * Determine the file's key name and passes it to the caller via a promissory callback. This also may * delegate to an integrator-defined function that determines the file's key name on demand, * which also may be promissory. * * @param id ID of the file * @param filename Name of the file * @returns {qq.Promise} A promise that will be fulfilled when the key name has been determined (and will be passed to the caller via the success callback). * @private */ _determineKeyName: function(id, filename) { /*jshint -W015*/ var promise = new qq.Promise(), keynameLogic = this._options.objectProperties.key, extension = qq.getExtension(filename), onGetKeynameFailure = promise.failure, onGetKeynameSuccess = function(keyname, extension) { var keynameToUse = keyname; if (extension !== undefined) { keynameToUse += "." + extension; } promise.success(keynameToUse); }; switch (keynameLogic) { case "uuid": onGetKeynameSuccess(this.getUuid(id), extension); break; case "filename": onGetKeynameSuccess(filename); break; default: if (qq.isFunction(keynameLogic)) { this._handleKeynameFunction(keynameLogic, id, onGetKeynameSuccess, onGetKeynameFailure); } else { this.log(keynameLogic + " is not a valid value for the s3.keyname option!", "error"); onGetKeynameFailure(); } } return promise; }, /** * Called by the internal onUpload handler if the integrator has supplied a function to determine * the file's key name. The integrator's function may be promissory. We also need to fulfill * the promise contract associated with the caller as well. * * @param keynameFunc Integrator-supplied function that must be executed to determine the key name. May be promissory. * @param id ID of the associated file * @param successCallback Invoke this if key name retrieval is successful, passing in the key name. * @param failureCallback Invoke this if key name retrieval was unsuccessful. * @private */ _handleKeynameFunction: function(keynameFunc, id, successCallback, failureCallback) { var self = this, onSuccess = function(keyname) { successCallback(keyname); }, onFailure = function(reason) { self.log(qq.format("Failed to retrieve key name for {}. Reason: {}", id, reason || "null"), "error"); failureCallback(reason); }, keyname = keynameFunc.call(this, id); if (qq.isGenericPromise(keyname)) { keyname.then(onSuccess, onFailure); } /*jshint -W116*/ else if (keyname == null) { onFailure(); } else { onSuccess(keyname); } }, _getEndpointSpecificParams: function(id, response, maybeXhr) { var params = { key: this.getKey(id), uuid: this.getUuid(id), name: this.getName(id), bucket: this.getBucket(id) }; if (maybeXhr && maybeXhr.getResponseHeader("ETag")) { params.etag = maybeXhr.getResponseHeader("ETag"); } else if (response.etag) { params.etag = response.etag; } return params; }, // Hooks into the base internal `_onSubmitDelete` to add key and bucket params to the delete file request. _onSubmitDelete: function(id, onSuccessCallback) { var additionalMandatedParams = { key: this.getKey(id), bucket: this.getBucket(id) }; return qq.FineUploaderBasic.prototype._onSubmitDelete.call(this, id, onSuccessCallback, additionalMandatedParams); }, _addCannedFile: function(sessionData) { var id; /* jshint eqnull:true */ if (sessionData.s3Key == null) { throw new qq.Error("Did not find s3Key property in server session response. This is required!"); } else { id = qq.FineUploaderBasic.prototype._addCannedFile.apply(this, arguments); this._cannedKeys[id] = sessionData.s3Key; this._cannedBuckets[id] = sessionData.s3Bucket; } return id; } }); }()); /* globals qq, CryptoJS */ /** * Handles signature determination for HTML Form Upload requests and Multipart Uploader requests (via the S3 REST API). * * If the S3 requests are to be signed server side, this module will send a POST request to the server in an attempt * to solicit signatures for various S3-related requests. This module also parses the response and attempts * to determine if the effort was successful. * * If the S3 requests are to be signed client-side, without the help of a server, this module will utilize CryptoJS to * sign the requests directly in the browser and send them off to S3. * * @param o Options associated with all such requests * @returns {{getSignature: Function}} API method used to initiate the signature request. * @constructor */ qq.s3.RequestSigner = function(o) { "use strict"; var requester, thisSignatureRequester = this, pendingSignatures = {}, options = { expectingPolicy: false, method: "POST", signatureSpec: { credentialsProvider: {}, endpoint: null, customHeaders: {} }, maxConnections: 3, paramsStore: {}, cors: { expected: false, sendCredentials: false }, log: function(str, level) {} }, credentialsProvider; qq.extend(options, o, true); credentialsProvider = options.signatureSpec.credentialsProvider; function handleSignatureReceived(id, xhrOrXdr, isError) { var responseJson = xhrOrXdr.responseText, pendingSignatureData = pendingSignatures[id], promise = pendingSignatureData.promise, errorMessage, response; delete pendingSignatures[id]; // Attempt to parse what we would expect to be a JSON response if (responseJson) { try { response = qq.parseJson(responseJson); } catch (error) { options.log("Error attempting to parse signature response: " + error, "error"); } } // If we have received a parsable response, and it has an `invalid` property, // the policy document or request headers may have been tampered with client-side. if (response && response.invalid) { isError = true; errorMessage = "Invalid policy document or request headers!"; } // Make sure the response contains policy & signature properties else if (response) { if (options.expectingPolicy && !response.policy) { isError = true; errorMessage = "Response does not include the base64 encoded policy!"; } else if (!response.signature) { isError = true; errorMessage = "Response does not include the signature!"; } } // Something unknown went wrong else { isError = true; errorMessage = "Received an empty or invalid response from the server!"; } if (isError) { if (errorMessage) { options.log(errorMessage, "error"); } promise.failure(errorMessage); } else { promise.success(response); } } function getToSignAndEndOfUrl(type, bucket, key, contentType, headers, uploadId, partNum) { var method = "POST", headerNames = [], headersAsString = "", endOfUrl; /*jshint indent:false */ switch (type) { case thisSignatureRequester.REQUEST_TYPE.MULTIPART_ABORT: method = "DELETE"; endOfUrl = qq.format("uploadId={}", uploadId); break; case thisSignatureRequester.REQUEST_TYPE.MULTIPART_INITIATE: endOfUrl = "uploads"; break; case thisSignatureRequester.REQUEST_TYPE.MULTIPART_COMPLETE: endOfUrl = qq.format("uploadId={}", uploadId); break; case thisSignatureRequester.REQUEST_TYPE.MULTIPART_UPLOAD: method = "PUT"; endOfUrl = qq.format("partNumber={}&uploadId={}", partNum, uploadId); break; } endOfUrl = key + "?" + endOfUrl; qq.each(headers, function(name) { headerNames.push(name); }); headerNames.sort(); qq.each(headerNames, function(idx, name) { headersAsString += name + ":" + headers[name] + "\n"; }); return { toSign: qq.format("{}\n\n{}\n\n{}/{}/{}", method, contentType || "", headersAsString || "\n", bucket, endOfUrl), endOfUrl: endOfUrl }; } function determineSignatureClientSide(toBeSigned, signatureEffort, updatedAccessKey, updatedSessionToken) { var updatedHeaders; // REST API request if (toBeSigned.signatureConstructor) { if (updatedSessionToken) { updatedHeaders = toBeSigned.signatureConstructor.getHeaders(); updatedHeaders[qq.s3.util.SESSION_TOKEN_PARAM_NAME] = updatedSessionToken; toBeSigned.signatureConstructor.withHeaders(updatedHeaders); } signApiRequest(toBeSigned.signatureConstructor.getToSign().stringToSign, signatureEffort); } // Form upload (w/ policy document) else { updatedSessionToken && qq.s3.util.refreshPolicyCredentials(toBeSigned, updatedSessionToken); signPolicy(toBeSigned, signatureEffort, updatedAccessKey, updatedSessionToken); } } function signPolicy(policy, signatureEffort, updatedAccessKey, updatedSessionToken) { var policyStr = JSON.stringify(policy), policyWordArray = CryptoJS.enc.Utf8.parse(policyStr), base64Policy = CryptoJS.enc.Base64.stringify(policyWordArray), policyHmacSha1 = CryptoJS.HmacSHA1(base64Policy, credentialsProvider.get().secretKey), policyHmacSha1Base64 = CryptoJS.enc.Base64.stringify(policyHmacSha1); signatureEffort.success({ policy: base64Policy, signature: policyHmacSha1Base64 }, updatedAccessKey, updatedSessionToken); } function signApiRequest(headersStr, signatureEffort) { var headersWordArray = CryptoJS.enc.Utf8.parse(headersStr), headersHmacSha1 = CryptoJS.HmacSHA1(headersWordArray, credentialsProvider.get().secretKey), headersHmacSha1Base64 = CryptoJS.enc.Base64.stringify(headersHmacSha1); signatureEffort.success({signature: headersHmacSha1Base64}); } requester = qq.extend(this, new qq.AjaxRequester({ acceptHeader: "application/json", method: options.method, contentType: "application/json; charset=utf-8", endpointStore: { get: function() { return options.signatureSpec.endpoint; } }, paramsStore: options.paramsStore, maxConnections: options.maxConnections, customHeaders: options.signatureSpec.customHeaders, log: options.log, onComplete: handleSignatureReceived, cors: options.cors, successfulResponseCodes: { POST: [200] } })); qq.extend(this, { /** * On success, an object containing the parsed JSON response will be passed into the success handler if the * request succeeds. Otherwise an error message will be passed into the failure method. * * @param id File ID. * @param toBeSigned an Object that holds the item(s) to be signed * @returns {qq.Promise} A promise that is fulfilled when the response has been received. */ getSignature: function(id, toBeSigned) { var params = toBeSigned, signatureEffort = new qq.Promise(); if (credentialsProvider.get().secretKey && window.CryptoJS) { if (credentialsProvider.get().expiration.getTime() > Date.now()) { determineSignatureClientSide(toBeSigned, signatureEffort); } // If credentials are expired, ask for new ones before attempting to sign request else { credentialsProvider.onExpired().then(function() { determineSignatureClientSide(toBeSigned, signatureEffort, credentialsProvider.get().accessKey, credentialsProvider.get().sessionToken); }, function(errorMsg) { options.log("Attempt to update expired credentials apparently failed! Unable to sign request. ", "error"); signatureEffort.failure("Unable to sign request - expired credentials."); }); } } else { options.log("Submitting S3 signature request for " + id); if (params.signatureConstructor) { params = {headers: params.signatureConstructor.getToSign().stringToSign}; } requester.initTransport(id) .withParams(params) .send(); pendingSignatures[id] = { promise: signatureEffort }; } return signatureEffort; }, constructStringToSign: function(type, bucket, key) { var headers = {}, uploadId, contentType, partNum, toSignAndEndOfUrl; return { withHeaders: function(theHeaders) { headers = theHeaders; return this; }, withUploadId: function(theUploadId) { uploadId = theUploadId; return this; }, withContentType: function(theContentType) { contentType = theContentType; return this; }, withPartNum: function(thePartNum) { partNum = thePartNum; return this; }, getToSign: function() { var sessionToken = credentialsProvider.get().sessionToken; headers["x-amz-date"] = new Date().toUTCString(); if (sessionToken) { headers[qq.s3.util.SESSION_TOKEN_PARAM_NAME] = sessionToken; } toSignAndEndOfUrl = getToSignAndEndOfUrl(type, bucket, key, contentType, headers, uploadId, partNum); return { headers: (function() { if (contentType) { headers["Content-Type"] = contentType; } return headers; }()), endOfUrl: toSignAndEndOfUrl.endOfUrl, stringToSign: toSignAndEndOfUrl.toSign }; }, getHeaders: function() { return qq.extend({}, headers); }, getEndOfUrl: function() { return toSignAndEndOfUrl && toSignAndEndOfUrl.endOfUrl; } }; } }); }; qq.s3.RequestSigner.prototype.REQUEST_TYPE = { MULTIPART_INITIATE: "multipart_initiate", MULTIPART_COMPLETE: "multipart_complete", MULTIPART_ABORT: "multipart_abort", MULTIPART_UPLOAD: "multipart_upload" }; /*globals qq, XMLHttpRequest*/ /** * Sends a POST request to the server to notify it of a successful upload to an endpoint. The server is expected to indicate success * or failure via the response status. Specific information about the failure can be passed from the server via an `error` * property (by default) in an "application/json" response. * * @param o Options associated with all requests. * @constructor */ qq.UploadSuccessAjaxRequester = function(o) { "use strict"; var requester, pendingRequests = [], options = { method: "POST", endpoint: null, maxConnections: 3, customHeaders: {}, paramsStore: {}, cors: { expected: false, sendCredentials: false }, log: function(str, level) {} }; qq.extend(options, o); function handleSuccessResponse(id, xhrOrXdr, isError) { var promise = pendingRequests[id], responseJson = xhrOrXdr.responseText, successIndicator = {success: true}, failureIndicator = {success: false}, parsedResponse; delete pendingRequests[id]; options.log(qq.format("Received the following response body to an upload success request for id {}: {}", id, responseJson)); try { parsedResponse = qq.parseJson(responseJson); // If this is a cross-origin request, the server may return a 200 response w/ error or success properties // in order to ensure any specific error message is picked up by Fine Uploader for all browsers, // since XDomainRequest (used in IE9 and IE8) doesn't give you access to the // response body for an "error" response. if (isError || (parsedResponse && (parsedResponse.error || parsedResponse.success === false))) { options.log("Upload success request was rejected by the server.", "error"); promise.failure(qq.extend(parsedResponse, failureIndicator)); } else { options.log("Upload success was acknowledged by the server."); promise.success(qq.extend(parsedResponse, successIndicator)); } } catch (error) { // This will be executed if a JSON response is not present. This is not mandatory, so account for this properly. if (isError) { options.log(qq.format("Your server indicated failure in its upload success request response for id {}!", id), "error"); promise.failure(failureIndicator); } else { options.log("Upload success was acknowledged by the server."); promise.success(successIndicator); } } } requester = qq.extend(this, new qq.AjaxRequester({ acceptHeader: "application/json", method: options.method, endpointStore: { get: function() { return options.endpoint; } }, paramsStore: options.paramsStore, maxConnections: options.maxConnections, customHeaders: options.customHeaders, log: options.log, onComplete: handleSuccessResponse, cors: options.cors, successfulResponseCodes: { POST: [200] } })); qq.extend(this, { /** * Sends a request to the server, notifying it that a recently submitted file was successfully sent. * * @param id ID of the associated file * @param spec `Object` with the properties that correspond to important values that we want to * send to the server with this request. * @returns {qq.Promise} A promise to be fulfilled when the response has been received and parsed. The parsed * payload of the response will be passed into the `failure` or `success` promise method. */ sendSuccessRequest: function(id, spec) { var promise = new qq.Promise(); options.log("Submitting upload success request/notification for " + id); requester.initTransport(id) .withParams(spec) .send(); pendingRequests[id] = promise; return promise; } }); }; /*globals qq*/ /** * Ajax requester used to send an ["Initiate Multipart Upload"](http://docs.aws.amazon.com/AmazonS3/latest/API/mpUploadInitiate.html) * request to S3 via the REST API. * * @param o Options from the caller - will override the defaults. * @constructor */ qq.s3.InitiateMultipartAjaxRequester = function(o) { "use strict"; var requester, pendingInitiateRequests = {}, options = { filenameParam: "qqfilename", method: "POST", endpointStore: null, paramsStore: null, signatureSpec: null, aclStore: null, reducedRedundancy: false, serverSideEncryption: false, maxConnections: 3, getContentType: function(id) {}, getBucket: function(id) {}, getKey: function(id) {}, getName: function(id) {}, log: function(str, level) {} }, getSignatureAjaxRequester; qq.extend(options, o); getSignatureAjaxRequester = new qq.s3.RequestSigner({ signatureSpec: options.signatureSpec, cors: options.cors, log: options.log }); /** * Determine all headers for the "Initiate MPU" request, including the "Authorization" header, which must be determined * by the local server. This is a promissory function. If the server responds with a signature, the headers * (including the Authorization header) will be passed into the success method of the promise. Otherwise, the failure * method on the promise will be called. * * @param id Associated file ID * @returns {qq.Promise} */ function getHeaders(id) { var bucket = options.getBucket(id), headers = {}, promise = new qq.Promise(), key = options.getKey(id), signatureConstructor; headers["x-amz-acl"] = options.aclStore.get(id); if (options.reducedRedundancy) { headers[qq.s3.util.REDUCED_REDUNDANCY_PARAM_NAME] = qq.s3.util.REDUCED_REDUNDANCY_PARAM_VALUE; } if (options.serverSideEncryption) { headers[qq.s3.util.SERVER_SIDE_ENCRYPTION_PARAM_NAME] = qq.s3.util.SERVER_SIDE_ENCRYPTION_PARAM_VALUE; } headers[qq.s3.util.AWS_PARAM_PREFIX + options.filenameParam] = encodeURIComponent(options.getName(id)); qq.each(options.paramsStore.get(id), function(name, val) { headers[qq.s3.util.AWS_PARAM_PREFIX + name] = encodeURIComponent(val); }); signatureConstructor = getSignatureAjaxRequester.constructStringToSign (getSignatureAjaxRequester.REQUEST_TYPE.MULTIPART_INITIATE, bucket, key) .withContentType(options.getContentType(id)) .withHeaders(headers); // Ask the local server to sign the request. Use this signature to form the Authorization header. getSignatureAjaxRequester.getSignature(id, {signatureConstructor: signatureConstructor}).then(function(response) { headers = signatureConstructor.getHeaders(); headers.Authorization = "AWS " + options.signatureSpec.credentialsProvider.get().accessKey + ":" + response.signature; promise.success(headers, signatureConstructor.getEndOfUrl()); }, promise.failure); return promise; } /** * Called by the base ajax requester when the response has been received. We definitively determine here if the * "Initiate MPU" request has been a success or not. * * @param id ID associated with the file. * @param xhr `XMLHttpRequest` object containing the response, among other things. * @param isError A boolean indicating success or failure according to the base ajax requester (primarily based on status code). */ function handleInitiateRequestComplete(id, xhr, isError) { var promise = pendingInitiateRequests[id], domParser = new DOMParser(), responseDoc = domParser.parseFromString(xhr.responseText, "application/xml"), uploadIdElements, messageElements, uploadId, errorMessage, status; delete pendingInitiateRequests[id]; // The base ajax requester may declare the request to be a failure based on status code. if (isError) { status = xhr.status; messageElements = responseDoc.getElementsByTagName("Message"); if (messageElements.length > 0) { errorMessage = messageElements[0].textContent; } } // If the base ajax requester has not declared this a failure, make sure we can retrieve the uploadId from the response. else { uploadIdElements = responseDoc.getElementsByTagName("UploadId"); if (uploadIdElements.length > 0) { uploadId = uploadIdElements[0].textContent; } else { errorMessage = "Upload ID missing from request"; } } // Either fail the promise (passing a descriptive error message) or declare it a success (passing the upload ID) if (uploadId === undefined) { if (errorMessage) { options.log(qq.format("Specific problem detected initiating multipart upload request for {}: '{}'.", id, errorMessage), "error"); } else { options.log(qq.format("Unexplained error with initiate multipart upload request for {}. Status code {}.", id, status), "error"); } promise.failure("Problem initiating upload request.", xhr); } else { options.log(qq.format("Initiate multipart upload request successful for {}. Upload ID is {}", id, uploadId)); promise.success(uploadId, xhr); } } requester = qq.extend(this, new qq.AjaxRequester({ method: options.method, contentType: null, endpointStore: options.endpointStore, maxConnections: options.maxConnections, allowXRequestedWithAndCacheControl: false, //These headers are not necessary & would break some installations if added log: options.log, onComplete: handleInitiateRequestComplete, successfulResponseCodes: { POST: [200] } })); qq.extend(this, { /** * Sends the "Initiate MPU" request to AWS via the REST API. First, though, we must get a signature from the * local server for the request. If all is successful, the uploadId from AWS will be passed into the promise's * success handler. Otherwise, an error message will ultimately be passed into the failure method. * * @param id The ID associated with the file * @returns {qq.Promise} */ send: function(id) { var promise = new qq.Promise(); getHeaders(id).then(function(headers, endOfUrl) { options.log("Submitting S3 initiate multipart upload request for " + id); pendingInitiateRequests[id] = promise; requester.initTransport(id) .withPath(endOfUrl) .withHeaders(headers) .send(); }, promise.failure); return promise; } }); }; /*globals qq*/ /** * Ajax requester used to send an ["Complete Multipart Upload"](http://docs.aws.amazon.com/AmazonS3/latest/API/mpUploadComplete.html) * request to S3 via the REST API. * * @param o Options passed by the creator, to overwrite any default option values. * @constructor */ qq.s3.CompleteMultipartAjaxRequester = function(o) { "use strict"; var requester, pendingCompleteRequests = {}, options = { method: "POST", contentType: "text/xml", endpointStore: null, signatureSpec: null, maxConnections: 3, getBucket: function(id) {}, getKey: function(id) {}, log: function(str, level) {} }, getSignatureAjaxRequester; qq.extend(options, o); // Transport for requesting signatures (for the "Complete" requests) from the local server getSignatureAjaxRequester = new qq.s3.RequestSigner({ signatureSpec: options.signatureSpec, cors: options.cors, log: options.log }); /** * Attach all required headers (including Authorization) to the "Complete" request. This is a promissory function * that will fulfill the associated promise once all headers have been attached or when an error has occurred that * prevents headers from being attached. * * @param id Associated file ID * @param uploadId ID of the associated upload, according to AWS * @returns {qq.Promise} */ function getHeaders(id, uploadId) { var headers = {}, promise = new qq.Promise(), bucket = options.getBucket(id), signatureConstructor = getSignatureAjaxRequester.constructStringToSign (getSignatureAjaxRequester.REQUEST_TYPE.MULTIPART_COMPLETE, bucket, options.getKey(id)) .withUploadId(uploadId) .withContentType("application/xml; charset=UTF-8"); // Ask the local server to sign the request. Use this signature to form the Authorization header. getSignatureAjaxRequester.getSignature(id, {signatureConstructor: signatureConstructor}).then(function(response) { headers = signatureConstructor.getHeaders(); headers.Authorization = "AWS " + options.signatureSpec.credentialsProvider.get().accessKey + ":" + response.signature; promise.success(headers, signatureConstructor.getEndOfUrl()); }, promise.failure); return promise; } /** * Called by the base ajax requester when the response has been received. We definitively determine here if the * "Complete MPU" request has been a success or not. * * @param id ID associated with the file. * @param xhr `XMLHttpRequest` object containing the response, among other things. * @param isError A boolean indicating success or failure according to the base ajax requester (primarily based on status code). */ function handleCompleteRequestComplete(id, xhr, isError) { var promise = pendingCompleteRequests[id], domParser = new DOMParser(), bucket = options.getBucket(id), key = options.getKey(id), responseDoc = domParser.parseFromString(xhr.responseText, "application/xml"), bucketEls = responseDoc.getElementsByTagName("Bucket"), keyEls = responseDoc.getElementsByTagName("Key"); delete pendingCompleteRequests[id]; options.log(qq.format("Complete response status {}, body = {}", xhr.status, xhr.responseText)); // If the base requester has determine this a failure, give up. if (isError) { options.log(qq.format("Complete Multipart Upload request for {} failed with status {}.", id, xhr.status), "error"); } else { // Make sure the correct bucket and key has been specified in the XML response from AWS. if (bucketEls.length && keyEls.length) { if (bucketEls[0].textContent !== bucket) { isError = true; options.log(qq.format("Wrong bucket in response to Complete Multipart Upload request for {}.", id), "error"); } // TODO Compare key name from response w/ expected key name if AWS ever fixes the encoding of key names in this response. } else { isError = true; options.log(qq.format("Missing bucket and/or key in response to Complete Multipart Upload request for {}.", id), "error"); } } if (isError) { promise.failure("Problem combining the file parts!", xhr); } else { promise.success({}, xhr); } } /** * @param etagEntries Array of objects containing `etag` values and their associated `part` numbers. * @returns {string} XML string containing the body to send with the "Complete" request */ function getCompleteRequestBody(etagEntries) { var doc = document.implementation.createDocument(null, "CompleteMultipartUpload", null); // The entries MUST be sorted by part number, per the AWS API spec. etagEntries.sort(function(a, b) { return a.part - b.part; }); // Construct an XML document for each pair of etag/part values that correspond to part uploads. qq.each(etagEntries, function(idx, etagEntry) { var part = etagEntry.part, etag = etagEntry.etag, partEl = doc.createElement("Part"), partNumEl = doc.createElement("PartNumber"), partNumTextEl = doc.createTextNode(part), etagTextEl = doc.createTextNode(etag), etagEl = doc.createElement("ETag"); etagEl.appendChild(etagTextEl); partNumEl.appendChild(partNumTextEl); partEl.appendChild(partNumEl); partEl.appendChild(etagEl); qq(doc).children()[0].appendChild(partEl); }); // Turn the resulting XML document into a string fit for transport. return new XMLSerializer().serializeToString(doc); } requester = qq.extend(this, new qq.AjaxRequester({ method: options.method, contentType: "application/xml; charset=UTF-8", endpointStore: options.endpointStore, maxConnections: options.maxConnections, allowXRequestedWithAndCacheControl: false, //These headers are not necessary & would break some installations if added log: options.log, onComplete: handleCompleteRequestComplete, successfulResponseCodes: { POST: [200] } })); qq.extend(this, { /** * Sends the "Complete" request and fulfills the returned promise when the success of this request is known. * * @param id ID associated with the file. * @param uploadId AWS uploadId for this file * @param etagEntries Array of objects containing `etag` values and their associated `part` numbers. * @returns {qq.Promise} */ send: function(id, uploadId, etagEntries) { var promise = new qq.Promise(); getHeaders(id, uploadId).then(function(headers, endOfUrl) { var body = getCompleteRequestBody(etagEntries); options.log("Submitting S3 complete multipart upload request for " + id); pendingCompleteRequests[id] = promise; delete headers["Content-Type"]; requester.initTransport(id) .withPath(endOfUrl) .withHeaders(headers) .withPayload(body) .send(); }, promise.failure); return promise; } }); }; /*globals qq */ /** * Ajax requester used to send an ["Abort Multipart Upload"](http://docs.aws.amazon.com/AmazonS3/latest/API/mpUploadAbort.html) * request to S3 via the REST API. * @param o * @constructor */ qq.s3.AbortMultipartAjaxRequester = function(o) { "use strict"; var requester, options = { method: "DELETE", endpointStore: null, signatureSpec: null, maxConnections: 3, getBucket: function(id) {}, getKey: function(id) {}, log: function(str, level) {} }, getSignatureAjaxRequester; qq.extend(options, o); // Transport for requesting signatures (for the "Complete" requests) from the local server getSignatureAjaxRequester = new qq.s3.RequestSigner({ signatureSpec: options.signatureSpec, cors: options.cors, log: options.log }); /** * Attach all required headers (including Authorization) to the "Abort" request. This is a promissory function * that will fulfill the associated promise once all headers have been attached or when an error has occurred that * prevents headers from being attached. * * @param id Associated file ID * @param uploadId ID of the associated upload, according to AWS * @returns {qq.Promise} */ function getHeaders(id, uploadId) { var headers = {}, promise = new qq.Promise(), endpoint = options.endpointStore.get(id), bucket = options.getBucket(id), signatureConstructor = getSignatureAjaxRequester.constructStringToSign (getSignatureAjaxRequester.REQUEST_TYPE.MULTIPART_ABORT, bucket, options.getKey(id)) .withUploadId(uploadId); // Ask the local server to sign the request. Use this signature to form the Authorization header. getSignatureAjaxRequester.getSignature(id, {signatureConstructor: signatureConstructor}).then(function(response) { headers = signatureConstructor.getHeaders(); headers.Authorization = "AWS " + options.signatureSpec.credentialsProvider.get().accessKey + ":" + response.signature; promise.success(headers, signatureConstructor.getEndOfUrl()); }, promise.failure); return promise; } /** * Called by the base ajax requester when the response has been received. We definitively determine here if the * "Abort MPU" request has been a success or not. * * @param id ID associated with the file. * @param xhr `XMLHttpRequest` object containing the response, among other things. * @param isError A boolean indicating success or failure according to the base ajax requester (primarily based on status code). */ function handleAbortRequestComplete(id, xhr, isError) { var domParser = new DOMParser(), responseDoc = domParser.parseFromString(xhr.responseText, "application/xml"), errorEls = responseDoc.getElementsByTagName("Error"), awsErrorMsg; options.log(qq.format("Abort response status {}, body = {}", xhr.status, xhr.responseText)); // If the base requester has determine this a failure, give up. if (isError) { options.log(qq.format("Abort Multipart Upload request for {} failed with status {}.", id, xhr.status), "error"); } else { // Make sure the correct bucket and key has been specified in the XML response from AWS. if (errorEls.length) { isError = true; awsErrorMsg = responseDoc.getElementsByTagName("Message")[0].textContent; options.log(qq.format("Failed to Abort Multipart Upload request for {}. Error: {}", id, awsErrorMsg), "error"); } else { options.log(qq.format("Abort MPU request succeeded for file ID {}.", id)); } } } requester = qq.extend(this, new qq.AjaxRequester({ validMethods: ["DELETE"], method: options.method, contentType: null, endpointStore: options.endpointStore, maxConnections: options.maxConnections, allowXRequestedWithAndCacheControl: false, //These headers are not necessary & would break some installations if added log: options.log, onComplete: handleAbortRequestComplete, successfulResponseCodes: { DELETE: [204] } })); qq.extend(this, { /** * Sends the "Abort" request. * * @param id ID associated with the file. * @param uploadId AWS uploadId for this file */ send: function(id, uploadId) { getHeaders(id, uploadId).then(function(headers, endOfUrl) { options.log("Submitting S3 Abort multipart upload request for " + id); requester.initTransport(id) .withPath(endOfUrl) .withHeaders(headers) .send(); }); } }); }; /*globals qq */ /** * Upload handler used by the upload to S3 module that depends on File API support, and, therefore, makes use of * `XMLHttpRequest` level 2 to upload `File`s and `Blob`s directly to S3 buckets via the associated AWS API. * * If chunking is supported and enabled, the S3 Multipart Upload REST API is utilized. * * @param spec Options passed from the base handler * @param proxy Callbacks & methods used to query for or push out data/changes */ qq.s3.XhrUploadHandler = function(spec, proxy) { "use strict"; var getName = proxy.getName, log = proxy.log, expectedStatus = 200, onGetBucket = spec.getBucket, onGetKeyName = spec.getKeyName, filenameParam = spec.filenameParam, paramsStore = spec.paramsStore, endpointStore = spec.endpointStore, aclStore = spec.aclStore, reducedRedundancy = spec.objectProperties.reducedRedundancy, serverSideEncryption = spec.objectProperties.serverSideEncryption, validation = spec.validation, signature = spec.signature, handler = this, credentialsProvider = spec.signature.credentialsProvider, chunked = { // Sends a "Complete Multipart Upload" request and then signals completion of the upload // when the response to this request has been parsed. combine: function(id) { var uploadId = handler._getPersistableData(id).uploadId, etagMap = handler._getPersistableData(id).etags, result = new qq.Promise(); requesters.completeMultipart.send(id, uploadId, etagMap).then( result.success, function failure(reason, xhr) { result.failure(upload.done(id, xhr).response, xhr); } ); return result; }, // The last step in handling a chunked upload. This is called after each chunk has been sent. // The request may be successful, or not. If it was successful, we must extract the "ETag" element // in the XML response and store that along with the associated part number. // We need these items to "Complete" the multipart upload after all chunks have been successfully sent. done: function(id, xhr, chunkIdx) { var response = upload.response.parse(id, xhr), etag; if (response.success) { etag = xhr.getResponseHeader("ETag"); if (!handler._getPersistableData(id).etags) { handler._getPersistableData(id).etags = []; } handler._getPersistableData(id).etags.push({part: chunkIdx + 1, etag: etag}); } }, /** * Determines headers that must be attached to the chunked (Multipart Upload) request. One of these headers is an * Authorization value, which must be determined by asking the local server to sign the request first. So, this * function returns a promise. Once all headers are determined, the `success` method of the promise is called with * the headers object. If there was some problem determining the headers, we delegate to the caller's `failure` * callback. * * @param id File ID * @param chunkIdx Index of the chunk to PUT * @returns {qq.Promise} */ initHeaders: function(id, chunkIdx) { var headers = {}, endpoint = spec.endpointStore.get(id), bucket = upload.bucket.getName(id), key = upload.key.urlSafe(id), promise = new qq.Promise(), signatureConstructor = requesters.restSignature.constructStringToSign (requesters.restSignature.REQUEST_TYPE.MULTIPART_UPLOAD, bucket, key) .withPartNum(chunkIdx + 1) .withUploadId(handler._getPersistableData(id).uploadId); // Ask the local server to sign the request. Use this signature to form the Authorization header. requesters.restSignature.getSignature(id + "." + chunkIdx, {signatureConstructor: signatureConstructor}).then(function(response) { headers = signatureConstructor.getHeaders(); headers.Authorization = "AWS " + credentialsProvider.get().accessKey + ":" + response.signature; promise.success(headers, signatureConstructor.getEndOfUrl()); }, promise.failure); return promise; }, put: function(id, chunkIdx) { var xhr = handler._createXhr(id, chunkIdx), chunkData = handler._getChunkData(id, chunkIdx), domain = spec.endpointStore.get(id), promise = new qq.Promise(); // Add appropriate headers to the multipart upload request. // Once these have been determined (asynchronously) attach the headers and send the chunk. chunked.initHeaders(id, chunkIdx).then(function(headers, endOfUrl) { var url = domain + "/" + endOfUrl; handler._registerProgressHandler(id, chunkIdx, chunkData.size); upload.track(id, xhr, chunkIdx).then(promise.success, promise.failure); xhr.open("PUT", url, true); qq.each(headers, function(name, val) { xhr.setRequestHeader(name, val); }); xhr.send(chunkData.blob); }, function() { promise.failure({error: "Problem signing the chunk!"}, xhr); }); return promise; }, send: function(id, chunkIdx) { var promise = new qq.Promise(); chunked.setup(id).then( // The "Initiate" request succeeded. We are ready to send the first chunk. function() { chunked.put(id, chunkIdx).then(promise.success, promise.failure); }, // We were unable to initiate the chunked upload process. function(errorMessage, xhr) { promise.failure({error: errorMessage}, xhr); } ); return promise; }, /** * Sends an "Initiate Multipart Upload" request to S3 via the REST API, but only if the MPU has not already been * initiated. * * @param id Associated file ID * @returns {qq.Promise} A promise that is fulfilled when the initiate request has been sent and the response has been parsed. */ setup: function(id) { var promise = new qq.Promise(), uploadId = handler._getPersistableData(id).uploadId, uploadIdPromise = new qq.Promise(); if (!uploadId) { handler._getPersistableData(id).uploadId = uploadIdPromise; requesters.initiateMultipart.send(id).then( function(uploadId) { handler._getPersistableData(id).uploadId = uploadId; uploadIdPromise.success(uploadId); promise.success(uploadId); }, function(errorMsg) { handler._getPersistableData(id).uploadId = null; promise.failure(errorMsg); uploadIdPromise.failure(errorMsg); } ); } else if (uploadId instanceof qq.Promise) { uploadId.then(function(uploadId) { promise.success(uploadId); }); } else { promise.success(uploadId); } return promise; } }, requesters = { abortMultipart: new qq.s3.AbortMultipartAjaxRequester({ endpointStore: endpointStore, signatureSpec: signature, cors: spec.cors, log: log, getBucket: function(id) { return upload.bucket.getName(id); }, getKey: function(id) { return upload.key.urlSafe(id); } }), completeMultipart: new qq.s3.CompleteMultipartAjaxRequester({ endpointStore: endpointStore, signatureSpec: signature, cors: spec.cors, log: log, getBucket: function(id) { return upload.bucket.getName(id); }, getKey: function(id) { return upload.key.urlSafe(id); } }), initiateMultipart: new qq.s3.InitiateMultipartAjaxRequester({ filenameParam: filenameParam, endpointStore: endpointStore, paramsStore: paramsStore, signatureSpec: signature, aclStore: aclStore, reducedRedundancy: reducedRedundancy, serverSideEncryption: serverSideEncryption, cors: spec.cors, log: log, getContentType: function(id) { return handler._getMimeType(id); }, getBucket: function(id) { return upload.bucket.getName(id); }, getKey: function(id) { return upload.key.urlSafe(id); }, getName: function(id) { return getName(id); } }), policySignature: new qq.s3.RequestSigner({ expectingPolicy: true, signatureSpec: signature, cors: spec.cors, log: log }), restSignature: new qq.s3.RequestSigner({ signatureSpec: signature, cors: spec.cors, log: log }) }, simple = { /** * Used for simple (non-chunked) uploads to determine the parameters to send along with the request. Part of this * process involves asking the local server to sign the request, so this function returns a promise. The promise * is fulfilled when all parameters are determined, or when we determine that all parameters cannnot be calculated * due to some error. * * @param id File ID * @returns {qq.Promise} */ initParams: function(id) { /*jshint -W040 */ var customParams = paramsStore.get(id); customParams[filenameParam] = getName(id); return qq.s3.util.generateAwsParams({ endpoint: endpointStore.get(id), params: customParams, type: handler._getMimeType(id), bucket: upload.bucket.getName(id), key: handler.getThirdPartyFileId(id), accessKey: credentialsProvider.get().accessKey, sessionToken: credentialsProvider.get().sessionToken, acl: aclStore.get(id), expectedStatus: expectedStatus, minFileSize: validation.minSizeLimit, maxFileSize: validation.maxSizeLimit, reducedRedundancy: reducedRedundancy, serverSideEncryption: serverSideEncryption, log: log }, qq.bind(requesters.policySignature.getSignature, this, id)); }, send: function(id) { var promise = new qq.Promise(), xhr = handler._createXhr(id), fileOrBlob = handler.getFile(id); handler._registerProgressHandler(id); upload.track(id, xhr).then(promise.success, promise.failure); // Delegate to a function the sets up the XHR request and notifies us when it is ready to be sent, along w/ the payload. simple.setup(id, xhr, fileOrBlob).then(function(toSend) { log("Sending upload request for " + id); xhr.send(toSend); }, promise.failure); return promise; }, /** * Starts the upload process by delegating to an async function that determine parameters to be attached to the * request. If all params can be determined, we are called back with the params and the caller of this function is * informed by invoking the `success` method on the promise returned by this function, passing the payload of the * request. If some error occurs here, we delegate to a function that signals a failure for this upload attempt. * * Album that this is only used by the simple (non-chunked) upload process. * * @param id File ID * @param xhr XMLHttpRequest to use for the upload * @param fileOrBlob `File` or `Blob` to send * @returns {qq.Promise} */ setup: function(id, xhr, fileOrBlob) { var formData = new FormData(), endpoint = endpointStore.get(id), url = endpoint, promise = new qq.Promise(); simple.initParams(id).then( // Success - all params determined function(awsParams) { xhr.open("POST", url, true); qq.obj2FormData(awsParams, formData); // AWS requires the file field be named "file". formData.append("file", fileOrBlob); promise.success(formData); }, // Failure - we couldn't determine some params (likely the signature) function(errorMessage) { promise.failure({error: errorMessage}); } ); return promise; } }, upload = { /** * Album that this is called when an upload has reached a termination point, * regardless of success/failure. For example, it is called when we have * encountered an error during the upload or when the file may have uploaded successfully. * * @param id file ID */ bucket: { promise: function(id) { var promise = new qq.Promise(), cachedBucket = handler._getFileState(id).bucket; if (cachedBucket) { promise.success(cachedBucket); } else { onGetBucket(id).then(function(bucket) { handler._getFileState(id).bucket = bucket; promise.success(bucket); }, promise.failure); } return promise; }, getName: function(id) { return handler._getFileState(id).bucket; } }, done: function(id, xhr) { var response = upload.response.parse(id, xhr), isError = response.success !== true; if (isError && upload.response.shouldReset(response.code)) { log("This is an unrecoverable error, we must restart the upload entirely on the next retry attempt.", "error"); response.reset = true; } return { success: !isError, response: response }; }, key: { promise: function(id) { var promise = new qq.Promise(), key = handler.getThirdPartyFileId(id); /* jshint eqnull:true */ if (key == null) { key = new qq.Promise(); handler._setThirdPartyFileId(id, key); onGetKeyName(id, getName(id)).then( function(key) { handler._setThirdPartyFileId(id, key); promise.success(key); }, function(errorReason) { handler._setThirdPartyFileId(id, null); promise.failure(errorReason); } ); } else if (qq.isGenericPromise(key)) { promise.then(key.success, key.failure); } else { promise.success(key); } return promise; }, urlSafe: function(id) { return encodeURIComponent(handler.getThirdPartyFileId(id)); } }, response: { parse: function(id, xhr) { var response = {}, parsedErrorProps; try { log(qq.format("Received response status {} with body: {}", xhr.status, xhr.responseText)); if (xhr.status === expectedStatus) { response.success = true; } else { parsedErrorProps = upload.response.parseError(xhr.responseText); if (parsedErrorProps) { response.error = parsedErrorProps.message; response.code = parsedErrorProps.code; } } } catch (error) { log("Error when attempting to parse xhr response text (" + error.message + ")", "error"); } return response; }, /** * This parses an XML response by extracting the "Message" and "Code" elements that accompany AWS error responses. * * @param awsResponseXml XML response from AWS * @returns {object} Object w/ `code` and `message` properties, or undefined if we couldn't find error info in the XML document. */ parseError: function(awsResponseXml) { var parser = new DOMParser(), parsedDoc = parser.parseFromString(awsResponseXml, "application/xml"), errorEls = parsedDoc.getElementsByTagName("Error"), errorDetails = {}, codeEls, messageEls; if (errorEls.length) { codeEls = parsedDoc.getElementsByTagName("Code"); messageEls = parsedDoc.getElementsByTagName("Message"); if (messageEls.length) { errorDetails.message = messageEls[0].textContent; } if (codeEls.length) { errorDetails.code = codeEls[0].textContent; } return errorDetails; } }, // Determine if the upload should be restarted on the next retry attempt // based on the error code returned in the response from AWS. shouldReset: function(errorCode) { /*jshint -W014 */ return errorCode === "EntityTooSmall" || errorCode === "InvalidPart" || errorCode === "InvalidPartOrder" || errorCode === "NoSuchUpload"; } }, start: function(id, optChunkIdx) { var promise = new qq.Promise(); upload.key.promise(id).then(function() { upload.bucket.promise(id).then(function() { /* jshint eqnull:true */ if (optChunkIdx == null) { simple.send(id).then(promise.success, promise.failure); } else { chunked.send(id, optChunkIdx).then(promise.success, promise.failure); } }); }, function(errorReason) { promise.failure({error: errorReason}); }); return promise; }, track: function(id, xhr, optChunkIdx) { var promise = new qq.Promise(); xhr.onreadystatechange = function() { if (xhr.readyState === 4) { var result; /* jshint eqnull:true */ if (optChunkIdx == null) { result = upload.done(id, xhr); promise[result.success ? "success" : "failure"](result.response, xhr); } else { chunked.done(id, xhr, optChunkIdx); result = upload.done(id, xhr); promise[result.success ? "success" : "failure"](result.response, xhr); } } }; return promise; } }; qq.extend(this, { uploadChunk: upload.start, uploadFile: upload.start }); qq.extend(this, new qq.XhrUploadHandler({ options: qq.extend({namespace: "s3"}, spec), proxy: qq.extend({getEndpoint: spec.endpointStore.get}, proxy) })); qq.override(this, function(super_) { return { expunge: function(id) { var uploadId = handler._getPersistableData(id) && handler._getPersistableData(id).uploadId, existedInLocalStorage = handler._maybeDeletePersistedChunkData(id); if (uploadId !== undefined && existedInLocalStorage) { requesters.abortMultipart.send(id, uploadId); } super_.expunge(id); }, finalizeChunks: function(id) { return chunked.combine(id); }, _getLocalStorageId: function(id) { var baseStorageId = super_._getLocalStorageId(id), bucketName = upload.bucket.getName(id); return baseStorageId + "-" + bucketName; } }; }); }; /*globals qq */ /** * Upload handler used by the upload to S3 module that assumes the current user agent does not have any support for the * File API, and, therefore, makes use of iframes and forms to submit the files directly to S3 buckets via the associated * AWS API. * * @param options Options passed from the base handler * @param proxy Callbacks & methods used to query for or push out data/changes */ qq.s3.FormUploadHandler = function(options, proxy) { "use strict"; var handler = this, onUuidChanged = proxy.onUuidChanged, getName = proxy.getName, getUuid = proxy.getUuid, log = proxy.log, onGetBucket = options.getBucket, onGetKeyName = options.getKeyName, filenameParam = options.filenameParam, paramsStore = options.paramsStore, endpointStore = options.endpointStore, aclStore = options.aclStore, reducedRedundancy = options.objectProperties.reducedRedundancy, serverSideEncryption = options.objectProperties.serverSideEncryption, validation = options.validation, signature = options.signature, successRedirectUrl = options.iframeSupport.localBlankPagePath, credentialsProvider = options.signature.credentialsProvider, getSignatureAjaxRequester = new qq.s3.RequestSigner({ signatureSpec: signature, cors: options.cors, log: log }); if (successRedirectUrl === undefined) { throw new Error("successRedirectEndpoint MUST be defined if you intend to use browsers that do not support the File API!"); } /** * Attempt to parse the contents of an iframe after receiving a response from the server. If the contents cannot be * read (perhaps due to a security error) it is safe to assume that the upload was not successful since Amazon should * have redirected to a known endpoint that should provide a parseable response. * * @param id ID of the associated file * @param iframe target of the form submit * @returns {boolean} true if the contents can be read, false otherwise */ function isValidResponse(id, iframe) { var response, endpoint = options.endpointStore.get(id), bucket = qq.s3.util.getBucket(endpoint), doc, innerHtml, responseData; //IE may throw an "access is denied" error when attempting to access contentDocument on the iframe in some cases try { // iframe.contentWindow.document - for IE<7 doc = iframe.contentDocument || iframe.contentWindow.document; innerHtml = doc.body.innerHTML; responseData = qq.s3.util.parseIframeResponse(iframe); if (responseData.bucket === bucket && responseData.key === qq.s3.util.encodeQueryStringParam(handler.getThirdPartyFileId(id))) { return true; } log("Response from AWS included an unexpected bucket or key name.", "error"); } catch (error) { log("Error when attempting to parse form upload response (" + error.message + ")", "error"); } return false; } function generateAwsParams(id) { /*jshint -W040 */ var customParams = paramsStore.get(id); customParams[filenameParam] = getName(id); return qq.s3.util.generateAwsParams({ endpoint: endpointStore.get(id), params: customParams, bucket: handler._getFileState(id).bucket, key: handler.getThirdPartyFileId(id), accessKey: credentialsProvider.get().accessKey, sessionToken: credentialsProvider.get().sessionToken, acl: aclStore.get(id), minFileSize: validation.minSizeLimit, maxFileSize: validation.maxSizeLimit, successRedirectUrl: successRedirectUrl, reducedRedundancy: reducedRedundancy, serverSideEncryption: serverSideEncryption, log: log }, qq.bind(getSignatureAjaxRequester.getSignature, this, id)); } /** * Creates form, that will be submitted to iframe */ function createForm(id, iframe) { var promise = new qq.Promise(), method = options.demoMode ? "GET" : "POST", endpoint = options.endpointStore.get(id), fileName = getName(id); generateAwsParams(id).then(function(params) { var form = handler._initFormForUpload({ method: method, endpoint: endpoint, params: params, paramsInBody: true, targetName: iframe.name }); promise.success(form); }, function(errorMessage) { promise.failure(errorMessage); handleFinishedUpload(id, iframe, fileName, {error: errorMessage}); }); return promise; } function handleUpload(id) { var iframe = handler._createIframe(id), input = handler.getInput(id), promise = new qq.Promise(); createForm(id, iframe).then(function(form) { form.appendChild(input); // Register a callback when the response comes in from S3 handler._attachLoadEvent(iframe, function(response) { log("iframe loaded"); // If the common response handler has determined success or failure immediately if (response) { // If there is something fundamentally wrong with the response (such as iframe content is not accessible) if (response.success === false) { log("Amazon likely rejected the upload request", "error"); promise.failure(response); } } // The generic response (iframe onload) handler was not able to make a determination regarding the success of the request else { response = {}; response.success = isValidResponse(id, iframe); // If the more specific response handle detected a problem with the response from S3 if (response.success === false) { log("A success response was received by Amazon, but it was invalid in some way.", "error"); promise.failure(response); } else { qq.extend(response, qq.s3.util.parseIframeResponse(iframe)); promise.success(response); } } handleFinishedUpload(id, iframe); }); log("Sending upload request for " + id); form.submit(); qq(form).remove(); }, promise.failure); return promise; } function handleFinishedUpload(id, iframe) { handler._detachLoadEvent(id); iframe && qq(iframe).remove(); } qq.extend(this, new qq.FormUploadHandler({ options: { isCors: false, inputName: "file" }, proxy: { onCancel: options.onCancel, onUuidChanged: onUuidChanged, getName: getName, getUuid: getUuid, log: log } })); qq.extend(this, { uploadFile: function(id) { var name = getName(id), promise = new qq.Promise(); if (handler.getThirdPartyFileId(id)) { if (handler._getFileState(id).bucket) { handleUpload(id).then(promise.success, promise.failure); } else { onGetBucket(id).then(function(bucket) { handler._getFileState(id).bucket = bucket; handleUpload(id).then(promise.success, promise.failure); }); } } else { // The S3 uploader module will either calculate the key or ask the server for it // and will call us back once it is known. onGetKeyName(id, name).then(function(key) { onGetBucket(id).then(function(bucket) { handler._getFileState(id).bucket = bucket; handler._setThirdPartyFileId(id, key); handleUpload(id).then(promise.success, promise.failure); }, function(errorReason) { promise.failure({error: errorReason}); }); }, function(errorReason) { promise.failure({error: errorReason}); }); } return promise; } }); }; /*globals qq */ /** * This defines FineUploader mode w/ support for uploading to S3, which provides all the basic * functionality of Fine Uploader as well as code to handle uploads directly to S3. * This module inherits all logic from FineUploader mode and FineUploaderBasicS3 mode and adds some UI-related logic * specific to the upload-to-S3 workflow. Some inherited options and API methods have a special meaning * in the context of the S3 uploader. */ (function() { "use strict"; qq.s3.FineUploader = function(o) { var options = { failedUploadTextDisplay: { mode: "custom" } }; // Replace any default options with user defined ones qq.extend(options, o, true); // Inherit instance data from FineUploader, which should in turn inherit from s3.FineUploaderBasic. qq.FineUploader.call(this, options, "s3"); if (!qq.supportedFeatures.ajaxUploading && options.iframeSupport.localBlankPagePath === undefined) { this._options.element.innerHTML = "<div>You MUST set the <code>localBlankPagePath</code> property " + "of the <code>iframeSupport</code> option since this browser does not support the File API!</div>"; } }; // Inherit the API methods from FineUploaderBasicS3 qq.extend(qq.s3.FineUploader.prototype, qq.s3.FineUploaderBasic.prototype); // Inherit public and private API methods related to UI qq.extend(qq.s3.FineUploader.prototype, qq.uiPublicApi); qq.extend(qq.s3.FineUploader.prototype, qq.uiPrivateApi); }()); /*globals qq*/ qq.PasteSupport = function(o) { "use strict"; var options, detachPasteHandler; options = { targetElement: null, callbacks: { log: function(message, level) {}, pasteReceived: function(blob) {} } }; function isImage(item) { return item.type && item.type.indexOf("image/") === 0; } function registerPasteHandler() { detachPasteHandler = qq(options.targetElement).attach("paste", function(event) { var clipboardData = event.clipboardData; if (clipboardData) { qq.each(clipboardData.items, function(idx, item) { if (isImage(item)) { var blob = item.getAsFile(); options.callbacks.pasteReceived(blob); } }); } }); } function unregisterPasteHandler() { if (detachPasteHandler) { detachPasteHandler(); } } qq.extend(options, o); registerPasteHandler(); qq.extend(this, { reset: function() { unregisterPasteHandler(); } }); }; /*globals qq, document, CustomEvent*/ qq.DragAndDrop = function(o) { "use strict"; var options, HIDE_ZONES_EVENT_NAME = "qq-hidezones", HIDE_BEFORE_ENTER_ATTR = "qq-hide-dropzone", uploadDropZones = [], droppedFiles = [], disposeSupport = new qq.DisposeSupport(); options = { dropZoneElements: [], allowMultipleItems: true, classes: { dropActive: null }, callbacks: new qq.DragAndDrop.callbacks() }; qq.extend(options, o, true); function uploadDroppedFiles(files, uploadDropZone) { // We need to convert the `FileList` to an actual `Array` to avoid iteration issues var filesAsArray = Array.prototype.slice.call(files); options.callbacks.dropLog("Grabbed " + files.length + " dropped files."); uploadDropZone.dropDisabled(false); options.callbacks.processingDroppedFilesComplete(filesAsArray, uploadDropZone.getElement()); } function traverseFileTree(entry) { var parseEntryPromise = new qq.Promise(); if (entry.isFile) { entry.file(function(file) { var name = entry.name, fullPath = entry.fullPath, indexOfNameInFullPath = fullPath.indexOf(name); // remove file name from full path string fullPath = fullPath.substr(0, indexOfNameInFullPath); // remove leading slash in full path string if (fullPath.charAt(0) === "/") { fullPath = fullPath.substr(1); } file.qqPath = fullPath; droppedFiles.push(file); parseEntryPromise.success(); }, function(fileError) { options.callbacks.dropLog("Problem parsing '" + entry.fullPath + "'. FileError code " + fileError.code + ".", "error"); parseEntryPromise.failure(); }); } else if (entry.isDirectory) { getFilesInDirectory(entry).then( function allEntriesRead(entries) { var entriesLeft = entries.length; qq.each(entries, function(idx, entry) { traverseFileTree(entry).done(function() { entriesLeft -= 1; if (entriesLeft === 0) { parseEntryPromise.success(); } }); }); if (!entries.length) { parseEntryPromise.success(); } }, function readFailure(fileError) { options.callbacks.dropLog("Problem parsing '" + entry.fullPath + "'. FileError code " + fileError.code + ".", "error"); parseEntryPromise.failure(); } ); } return parseEntryPromise; } // Promissory. Guaranteed to read all files in the root of the passed directory. function getFilesInDirectory(entry, reader, accumEntries, existingPromise) { var promise = existingPromise || new qq.Promise(), dirReader = reader || entry.createReader(); dirReader.readEntries( function readSuccess(entries) { var newEntries = accumEntries ? accumEntries.concat(entries) : entries; if (entries.length) { setTimeout(function() { // prevent stack oveflow, however unlikely getFilesInDirectory(entry, dirReader, newEntries, promise); }, 0); } else { promise.success(newEntries); } }, promise.failure ); return promise; } function handleDataTransfer(dataTransfer, uploadDropZone) { var pendingFolderPromises = [], handleDataTransferPromise = new qq.Promise(); options.callbacks.processingDroppedFiles(); uploadDropZone.dropDisabled(true); if (dataTransfer.files.length > 1 && !options.allowMultipleItems) { options.callbacks.processingDroppedFilesComplete([]); options.callbacks.dropError("tooManyFilesError", ""); uploadDropZone.dropDisabled(false); handleDataTransferPromise.failure(); } else { droppedFiles = []; if (qq.isFolderDropSupported(dataTransfer)) { qq.each(dataTransfer.items, function(idx, item) { var entry = item.webkitGetAsEntry(); if (entry) { //due to a bug in Chrome's File System API impl - #149735 if (entry.isFile) { droppedFiles.push(item.getAsFile()); } else { pendingFolderPromises.push(traverseFileTree(entry).done(function() { pendingFolderPromises.pop(); if (pendingFolderPromises.length === 0) { handleDataTransferPromise.success(); } })); } } }); } else { droppedFiles = dataTransfer.files; } if (pendingFolderPromises.length === 0) { handleDataTransferPromise.success(); } } return handleDataTransferPromise; } function setupDropzone(dropArea) { var dropZone = new qq.UploadDropZone({ HIDE_ZONES_EVENT_NAME: HIDE_ZONES_EVENT_NAME, element: dropArea, onEnter: function(e) { qq(dropArea).addClass(options.classes.dropActive); e.stopPropagation(); }, onLeaveNotDescendants: function(e) { qq(dropArea).removeClass(options.classes.dropActive); }, onDrop: function(e) { handleDataTransfer(e.dataTransfer, dropZone).then( function() { uploadDroppedFiles(droppedFiles, dropZone); }, function() { options.callbacks.dropLog("Drop event DataTransfer parsing failed. No files will be uploaded.", "error"); } ); } }); disposeSupport.addDisposer(function() { dropZone.dispose(); }); qq(dropArea).hasAttribute(HIDE_BEFORE_ENTER_ATTR) && qq(dropArea).hide(); uploadDropZones.push(dropZone); return dropZone; } function isFileDrag(dragEvent) { var fileDrag; qq.each(dragEvent.dataTransfer.types, function(key, val) { if (val === "Files") { fileDrag = true; return false; } }); return fileDrag; } // Attempt to determine when the file has left the document. It is not always possible to detect this // in all cases, but it is generally possible in all browsers, with a few exceptions. // // Exceptions: // * IE10+ & Safari: We can't detect a file leaving the document if the Explorer window housing the file // overlays the browser window. // * IE10+: If the file is dragged out of the window too quickly, IE does not set the expected values of the // event's X & Y properties. function leavingDocumentOut(e) { if (qq.firefox()) { return !e.relatedTarget; } if (qq.safari()) { return e.x < 0 || e.y < 0; } return e.x === 0 && e.y === 0; } function setupDragDrop() { var dropZones = options.dropZoneElements, maybeHideDropZones = function() { setTimeout(function() { qq.each(dropZones, function(idx, dropZone) { qq(dropZone).hasAttribute(HIDE_BEFORE_ENTER_ATTR) && qq(dropZone).hide(); qq(dropZone).removeClass(options.classes.dropActive); }); }, 10); }; qq.each(dropZones, function(idx, dropZone) { var uploadDropZone = setupDropzone(dropZone); // IE <= 9 does not support the File API used for drag+drop uploads if (dropZones.length && qq.supportedFeatures.fileDrop) { disposeSupport.attach(document, "dragenter", function(e) { if (!uploadDropZone.dropDisabled() && isFileDrag(e)) { qq.each(dropZones, function(idx, dropZone) { // We can't apply styles to non-HTMLElements, since they lack the `style` property. // Also, if the drop zone isn't initially hidden, let's not mess with `style.display`. if (dropZone instanceof HTMLElement && qq(dropZone).hasAttribute(HIDE_BEFORE_ENTER_ATTR)) { qq(dropZone).css({display: "block"}); } }); } }); } }); disposeSupport.attach(document, "dragleave", function(e) { if (leavingDocumentOut(e)) { maybeHideDropZones(); } }); // Just in case we were not able to detect when a dragged file has left the document, // hide all relevant drop zones the next time the mouse enters the document. // Album that mouse events such as this one are not fired during drag operations. disposeSupport.attach(qq(document).children()[0], "mouseenter", function(e) { maybeHideDropZones(); }); disposeSupport.attach(document, "drop", function(e) { e.preventDefault(); maybeHideDropZones(); }); disposeSupport.attach(document, HIDE_ZONES_EVENT_NAME, maybeHideDropZones); } setupDragDrop(); qq.extend(this, { setupExtraDropzone: function(element) { options.dropZoneElements.push(element); setupDropzone(element); }, removeDropzone: function(element) { var i, dzs = options.dropZoneElements; for (i in dzs) { if (dzs[i] === element) { return dzs.splice(i, 1); } } }, dispose: function() { disposeSupport.dispose(); qq.each(uploadDropZones, function(idx, dropZone) { dropZone.dispose(); }); } }); }; qq.DragAndDrop.callbacks = function() { "use strict"; return { processingDroppedFiles: function() {}, processingDroppedFilesComplete: function(files, targetEl) {}, dropError: function(code, errorSpecifics) { qq.log("Drag & drop error code '" + code + " with these specifics: '" + errorSpecifics + "'", "error"); }, dropLog: function(message, level) { qq.log(message, level); } }; }; qq.UploadDropZone = function(o) { "use strict"; var disposeSupport = new qq.DisposeSupport(), options, element, preventDrop, dropOutsideDisabled; options = { element: null, onEnter: function(e) {}, onLeave: function(e) {}, // is not fired when leaving element by hovering descendants onLeaveNotDescendants: function(e) {}, onDrop: function(e) {} }; qq.extend(options, o); element = options.element; function dragoverShouldBeCanceled() { return qq.safari() || (qq.firefox() && qq.windows()); } function disableDropOutside(e) { // run only once for all instances if (!dropOutsideDisabled) { // for these cases we need to catch onDrop to reset dropArea if (dragoverShouldBeCanceled) { disposeSupport.attach(document, "dragover", function(e) { e.preventDefault(); }); } else { disposeSupport.attach(document, "dragover", function(e) { if (e.dataTransfer) { e.dataTransfer.dropEffect = "none"; e.preventDefault(); } }); } dropOutsideDisabled = true; } } function isValidFileDrag(e) { // e.dataTransfer currently causing IE errors // IE9 does NOT support file API, so drag-and-drop is not possible if (!qq.supportedFeatures.fileDrop) { return false; } var effectTest, dt = e.dataTransfer, // do not check dt.types.contains in webkit, because it crashes safari 4 isSafari = qq.safari(); // dt.effectAllowed is none in Safari 5 // dt.types.contains check is for firefox // dt.effectAllowed crashes IE 11 & 10 when files have been dragged from // the filesystem effectTest = qq.ie() && qq.supportedFeatures.fileDrop ? true : dt.effectAllowed !== "none"; return dt && effectTest && (dt.files || (!isSafari && dt.types.contains && dt.types.contains("Files"))); } function isOrSetDropDisabled(isDisabled) { if (isDisabled !== undefined) { preventDrop = isDisabled; } return preventDrop; } function triggerHidezonesEvent() { var hideZonesEvent; function triggerUsingOldApi() { hideZonesEvent = document.createEvent("Event"); hideZonesEvent.initEvent(options.HIDE_ZONES_EVENT_NAME, true, true); } if (window.CustomEvent) { try { hideZonesEvent = new CustomEvent(options.HIDE_ZONES_EVENT_NAME); } catch (err) { triggerUsingOldApi(); } } else { triggerUsingOldApi(); } document.dispatchEvent(hideZonesEvent); } function attachEvents() { disposeSupport.attach(element, "dragover", function(e) { if (!isValidFileDrag(e)) { return; } // dt.effectAllowed crashes IE 11 & 10 when files have been dragged from // the filesystem var effect = qq.ie() && qq.supportedFeatures.fileDrop ? null : e.dataTransfer.effectAllowed; if (effect === "move" || effect === "linkMove") { e.dataTransfer.dropEffect = "move"; // for FF (only move allowed) } else { e.dataTransfer.dropEffect = "copy"; // for Chrome } e.stopPropagation(); e.preventDefault(); }); disposeSupport.attach(element, "dragenter", function(e) { if (!isOrSetDropDisabled()) { if (!isValidFileDrag(e)) { return; } options.onEnter(e); } }); disposeSupport.attach(element, "dragleave", function(e) { if (!isValidFileDrag(e)) { return; } options.onLeave(e); var relatedTarget = document.elementFromPoint(e.clientX, e.clientY); // do not fire when moving a mouse over a descendant if (qq(this).contains(relatedTarget)) { return; } options.onLeaveNotDescendants(e); }); disposeSupport.attach(element, "drop", function(e) { if (!isOrSetDropDisabled()) { if (!isValidFileDrag(e)) { return; } e.preventDefault(); e.stopPropagation(); options.onDrop(e); triggerHidezonesEvent(); } }); } disableDropOutside(); attachEvents(); qq.extend(this, { dropDisabled: function(isDisabled) { return isOrSetDropDisabled(isDisabled); }, dispose: function() { disposeSupport.dispose(); }, getElement: function() { return element; } }); }; /*globals qq, XMLHttpRequest*/ qq.DeleteFileAjaxRequester = function(o) { "use strict"; var requester, options = { method: "DELETE", uuidParamName: "qquuid", endpointStore: {}, maxConnections: 3, customHeaders: function(id) {return {};}, paramsStore: {}, demoMode: false, cors: { expected: false, sendCredentials: false }, log: function(str, level) {}, onDelete: function(id) {}, onDeleteComplete: function(id, xhrOrXdr, isError) {} }; qq.extend(options, o); function getMandatedParams() { if (options.method.toUpperCase() === "POST") { return { _method: "DELETE" }; } return {}; } requester = qq.extend(this, new qq.AjaxRequester({ acceptHeader: "application/json", validMethods: ["POST", "DELETE"], method: options.method, endpointStore: options.endpointStore, paramsStore: options.paramsStore, mandatedParams: getMandatedParams(), maxConnections: options.maxConnections, customHeaders: function(id) { return options.customHeaders.get(id); }, demoMode: options.demoMode, log: options.log, onSend: options.onDelete, onComplete: options.onDeleteComplete, cors: options.cors })); qq.extend(this, { sendDelete: function(id, uuid, additionalMandatedParams) { var additionalOptions = additionalMandatedParams || {}; options.log("Submitting delete file request for " + id); if (options.method === "DELETE") { requester.initTransport(id) .withPath(uuid) .withParams(additionalOptions) .send(); } else { additionalOptions[options.uuidParamName] = uuid; requester.initTransport(id) .withParams(additionalOptions) .send(); } } }); }; /*global qq, define */ /*jshint strict:false,bitwise:false,nonew:false,asi:true,-W064,-W116,-W089 */ /** * Mega pixel image rendering library for iOS6+ * * Fixes iOS6+'s image file rendering issue for large size image (over mega-pixel), * which causes unexpected subsampling when drawing it in canvas. * By using this library, you can safely render the image with proper stretching. * * Copyright (c) 2012 Shinichi Tomita <shinichi.tomita@gmail.com> * Released under the MIT license * * Heavily modified by Widen for Fine Uploader */ (function() { /** * Detect subsampling in loaded image. * In iOS, larger images than 2M pixels may be subsampled in rendering. */ function detectSubsampling(img) { var iw = img.naturalWidth, ih = img.naturalHeight, canvas = document.createElement("canvas"), ctx; if (iw * ih > 1024 * 1024) { // subsampling may happen over megapixel image canvas.width = canvas.height = 1; ctx = canvas.getContext("2d"); ctx.drawImage(img, -iw + 1, 0); // subsampled image becomes half smaller in rendering size. // check alpha channel value to confirm image is covering edge pixel or not. // if alpha value is 0 image is not covering, hence subsampled. return ctx.getImageData(0, 0, 1, 1).data[3] === 0; } else { return false; } } /** * Detecting vertical squash in loaded image. * Fixes a bug which squash image vertically while drawing into canvas for some images. */ function detectVerticalSquash(img, iw, ih) { var canvas = document.createElement("canvas"), sy = 0, ey = ih, py = ih, ctx, data, alpha, ratio; canvas.width = 1; canvas.height = ih; ctx = canvas.getContext("2d"); ctx.drawImage(img, 0, 0); data = ctx.getImageData(0, 0, 1, ih).data; // search image edge pixel position in case it is squashed vertically. while (py > sy) { alpha = data[(py - 1) * 4 + 3]; if (alpha === 0) { ey = py; } else { sy = py; } py = (ey + sy) >> 1; } ratio = (py / ih); return (ratio === 0) ? 1 : ratio; } /** * Rendering image element (with resizing) and get its data URL */ function renderImageToDataURL(img, options, doSquash) { var canvas = document.createElement("canvas"), mime = options.mime || "image/jpeg"; renderImageToCanvas(img, canvas, options, doSquash); return canvas.toDataURL(mime, options.quality || 0.8); } function maybeCalculateDownsampledDimensions(spec) { var maxPixels = 5241000; //iOS specific value if (!qq.ios()) { throw new qq.Error("Downsampled dimensions can only be reliably calculated for iOS!"); } if (spec.origHeight * spec.origWidth > maxPixels) { return { newHeight: Math.round(Math.sqrt(maxPixels * (spec.origHeight / spec.origWidth))), newWidth: Math.round(Math.sqrt(maxPixels * (spec.origWidth / spec.origHeight))) } } } /** * Rendering image element (with resizing) into the canvas element */ function renderImageToCanvas(img, canvas, options, doSquash) { var iw = img.naturalWidth, ih = img.naturalHeight, width = options.width, height = options.height, ctx = canvas.getContext("2d"), modifiedDimensions; ctx.save(); if (!qq.supportedFeatures.unlimitedScaledImageSize) { modifiedDimensions = maybeCalculateDownsampledDimensions({ origWidth: width, origHeight: height }); if (modifiedDimensions) { qq.log(qq.format("Had to reduce dimensions due to device limitations from {}w / {}h to {}w / {}h", width, height, modifiedDimensions.newWidth, modifiedDimensions.newHeight), "warn"); width = modifiedDimensions.newWidth; height = modifiedDimensions.newHeight; } } transformCoordinate(canvas, width, height, options.orientation); // Fine Uploader specific: Save some CPU cycles if not using iOS // Assumption: This logic is only needed to overcome iOS image sampling issues if (qq.ios()) { (function() { if (detectSubsampling(img)) { iw /= 2; ih /= 2; } var d = 1024, // size of tiling canvas tmpCanvas = document.createElement("canvas"), vertSquashRatio = doSquash ? detectVerticalSquash(img, iw, ih) : 1, dw = Math.ceil(d * width / iw), dh = Math.ceil(d * height / ih / vertSquashRatio), sy = 0, dy = 0, tmpCtx, sx, dx; tmpCanvas.width = tmpCanvas.height = d; tmpCtx = tmpCanvas.getContext("2d"); while (sy < ih) { sx = 0, dx = 0; while (sx < iw) { tmpCtx.clearRect(0, 0, d, d); tmpCtx.drawImage(img, -sx, -sy); ctx.drawImage(tmpCanvas, 0, 0, d, d, dx, dy, dw, dh); sx += d; dx += dw; } sy += d; dy += dh; } ctx.restore(); tmpCanvas = tmpCtx = null; }()) } else { ctx.drawImage(img, 0, 0, width, height); } canvas.qqImageRendered && canvas.qqImageRendered(); } /** * Transform canvas coordination according to specified frame size and orientation * Orientation value is from EXIF tag */ function transformCoordinate(canvas, width, height, orientation) { switch (orientation) { case 5: case 6: case 7: case 8: canvas.width = height; canvas.height = width; break; default: canvas.width = width; canvas.height = height; } var ctx = canvas.getContext("2d"); switch (orientation) { case 2: // horizontal flip ctx.translate(width, 0); ctx.scale(-1, 1); break; case 3: // 180 rotate left ctx.translate(width, height); ctx.rotate(Math.PI); break; case 4: // vertical flip ctx.translate(0, height); ctx.scale(1, -1); break; case 5: // vertical flip + 90 rotate right ctx.rotate(0.5 * Math.PI); ctx.scale(1, -1); break; case 6: // 90 rotate right ctx.rotate(0.5 * Math.PI); ctx.translate(0, -height); break; case 7: // horizontal flip + 90 rotate right ctx.rotate(0.5 * Math.PI); ctx.translate(width, -height); ctx.scale(-1, 1); break; case 8: // 90 rotate left ctx.rotate(-0.5 * Math.PI); ctx.translate(-width, 0); break; default: break; } } /** * MegaPixImage class */ function MegaPixImage(srcImage, errorCallback) { var self = this; if (window.Blob && srcImage instanceof Blob) { (function() { var img = new Image(), URL = window.URL && window.URL.createObjectURL ? window.URL : window.webkitURL && window.webkitURL.createObjectURL ? window.webkitURL : null; if (!URL) { throw Error("No createObjectURL function found to create blob url"); } img.src = URL.createObjectURL(srcImage); self.blob = srcImage; srcImage = img; }()); } if (!srcImage.naturalWidth && !srcImage.naturalHeight) { srcImage.onload = function() { var listeners = self.imageLoadListeners; if (listeners) { self.imageLoadListeners = null; // IE11 doesn't reliably report actual image dimensions immediately after onload for small files, // so let's push this to the end of the UI thread queue. setTimeout(function() { for (var i = 0, len = listeners.length; i < len; i++) { listeners[i](); } }, 0); } }; srcImage.onerror = errorCallback; this.imageLoadListeners = []; } this.srcImage = srcImage; } /** * Rendering megapix image into specified target element */ MegaPixImage.prototype.render = function(target, options) { options = options || {}; var self = this, imgWidth = this.srcImage.naturalWidth, imgHeight = this.srcImage.naturalHeight, width = options.width, height = options.height, maxWidth = options.maxWidth, maxHeight = options.maxHeight, doSquash = !this.blob || this.blob.type === "image/jpeg", tagName = target.tagName.toLowerCase(), opt; if (this.imageLoadListeners) { this.imageLoadListeners.push(function() { self.render(target, options) }); return; } if (width && !height) { height = (imgHeight * width / imgWidth) << 0; } else if (height && !width) { width = (imgWidth * height / imgHeight) << 0; } else { width = imgWidth; height = imgHeight; } if (maxWidth && width > maxWidth) { width = maxWidth; height = (imgHeight * width / imgWidth) << 0; } if (maxHeight && height > maxHeight) { height = maxHeight; width = (imgWidth * height / imgHeight) << 0; } opt = { width: width, height: height }, qq.each(options, function(optionsKey, optionsValue) { opt[optionsKey] = optionsValue; }); if (tagName === "img") { (function() { var oldTargetSrc = target.src; target.src = renderImageToDataURL(self.srcImage, opt, doSquash); oldTargetSrc === target.src && target.onload(); }()) } else if (tagName === "canvas") { renderImageToCanvas(this.srcImage, target, opt, doSquash); } if (typeof this.onrender === "function") { this.onrender(target); } }; qq.MegaPixImage = MegaPixImage; })(); /*globals qq */ /** * Draws a thumbnail of a Blob/File/URL onto an <img> or <canvas>. * * @constructor */ qq.ImageGenerator = function(log) { "use strict"; function isImg(el) { return el.tagName.toLowerCase() === "img"; } function isCanvas(el) { return el.tagName.toLowerCase() === "canvas"; } function isImgCorsSupported() { return new Image().crossOrigin !== undefined; } function isCanvasSupported() { var canvas = document.createElement("canvas"); return canvas.getContext && canvas.getContext("2d"); } // This is only meant to determine the MIME type of a renderable image file. // It is used to ensure images drawn from a URL that have transparent backgrounds // are rendered correctly, among other things. function determineMimeOfFileName(nameWithPath) { /*jshint -W015 */ var pathSegments = nameWithPath.split("/"), name = pathSegments[pathSegments.length - 1], extension = qq.getExtension(name); extension = extension && extension.toLowerCase(); switch (extension) { case "jpeg": case "jpg": return "image/jpeg"; case "png": return "image/png"; case "bmp": return "image/bmp"; case "gif": return "image/gif"; case "tiff": case "tif": return "image/tiff"; } } // This will likely not work correctly in IE8 and older. // It's only used as part of a formula to determine // if a canvas can be used to scale a server-hosted thumbnail. // If canvas isn't supported by the UA (IE8 and older) // this method should not even be called. function isCrossOrigin(url) { var targetAnchor = document.createElement("a"), targetProtocol, targetHostname, targetPort; targetAnchor.href = url; targetProtocol = targetAnchor.protocol; targetPort = targetAnchor.port; targetHostname = targetAnchor.hostname; if (targetProtocol.toLowerCase() !== window.location.protocol.toLowerCase()) { return true; } if (targetHostname.toLowerCase() !== window.location.hostname.toLowerCase()) { return true; } // IE doesn't take ports into consideration when determining if two endpoints are same origin. if (targetPort !== window.location.port && !qq.ie()) { return true; } return false; } function registerImgLoadListeners(img, promise) { img.onload = function() { img.onload = null; img.onerror = null; promise.success(img); }; img.onerror = function() { img.onload = null; img.onerror = null; log("Problem drawing thumbnail!", "error"); promise.failure(img, "Problem drawing thumbnail!"); }; } function registerCanvasDrawImageListener(canvas, promise) { // The image is drawn on the canvas by a third-party library, // and we want to know when this is completed. Since the library // may invoke drawImage many times in a loop, we need to be called // back when the image is fully rendered. So, we are expecting the // code that draws this image to follow a convention that involves a // function attached to the canvas instance be invoked when it is done. canvas.qqImageRendered = function() { promise.success(canvas); }; } // Fulfills a `qq.Promise` when an image has been drawn onto the target, // whether that is a <canvas> or an <img>. The attempt is considered a // failure if the target is not an <img> or a <canvas>, or if the drawing // attempt was not successful. function registerThumbnailRenderedListener(imgOrCanvas, promise) { var registered = isImg(imgOrCanvas) || isCanvas(imgOrCanvas); if (isImg(imgOrCanvas)) { registerImgLoadListeners(imgOrCanvas, promise); } else if (isCanvas(imgOrCanvas)) { registerCanvasDrawImageListener(imgOrCanvas, promise); } else { promise.failure(imgOrCanvas); log(qq.format("Element container of type {} is not supported!", imgOrCanvas.tagName), "error"); } return registered; } // Draw a preview iff the current UA can natively display it. // Also rotate the image if necessary. function draw(fileOrBlob, container, options) { var drawPreview = new qq.Promise(), identifier = new qq.Identify(fileOrBlob, log), maxSize = options.maxSize, // jshint eqnull:true orient = options.orient == null ? true : options.orient, megapixErrorHandler = function() { container.onerror = null; container.onload = null; log("Could not render preview, file may be too large!", "error"); drawPreview.failure(container, "Browser cannot render image!"); }; identifier.isPreviewable().then( function(mime) { // If options explicitly specify that Orientation is not desired, // replace the orient task with a dummy promise that "succeeds" immediately. var dummyExif = { parse: function() { return new qq.Promise().success(); } }, exif = orient ? new qq.Exif(fileOrBlob, log) : dummyExif, mpImg = new qq.MegaPixImage(fileOrBlob, megapixErrorHandler); if (registerThumbnailRenderedListener(container, drawPreview)) { exif.parse().then( function(exif) { var orientation = exif && exif.Orientation; mpImg.render(container, { maxWidth: maxSize, maxHeight: maxSize, orientation: orientation, mime: mime }); }, function(failureMsg) { log(qq.format("EXIF data could not be parsed ({}). Assuming orientation = 1.", failureMsg)); mpImg.render(container, { maxWidth: maxSize, maxHeight: maxSize, mime: mime }); } ); } }, function() { log("Not previewable"); drawPreview.failure(container, "Not previewable"); } ); return drawPreview; } function drawOnCanvasOrImgFromUrl(url, canvasOrImg, draw, maxSize) { var tempImg = new Image(), tempImgRender = new qq.Promise(); registerThumbnailRenderedListener(tempImg, tempImgRender); if (isCrossOrigin(url)) { tempImg.crossOrigin = "anonymous"; } tempImg.src = url; tempImgRender.then( function rendered() { registerThumbnailRenderedListener(canvasOrImg, draw); var mpImg = new qq.MegaPixImage(tempImg); mpImg.render(canvasOrImg, { maxWidth: maxSize, maxHeight: maxSize, mime: determineMimeOfFileName(url) }); }, draw.failure ); } function drawOnImgFromUrlWithCssScaling(url, img, draw, maxSize) { registerThumbnailRenderedListener(img, draw); // NOTE: The fact that maxWidth/height is set on the thumbnail for scaled images // that must drop back to CSS is known and exploited by the templating module. // In this module, we pre-render "waiting" thumbs for all files immediately after they // are submitted, and we must be sure to pass any style associated with the "waiting" preview. qq(img).css({ maxWidth: maxSize + "px", maxHeight: maxSize + "px" }); img.src = url; } // Draw a (server-hosted) thumbnail given a URL. // This will optionally scale the thumbnail as well. // It attempts to use <canvas> to scale, but will fall back // to max-width and max-height style properties if the UA // doesn't support canvas or if the images is cross-domain and // the UA doesn't support the crossorigin attribute on img tags, // which is required to scale a cross-origin image using <canvas> & // then export it back to an <img>. function drawFromUrl(url, container, options) { var draw = new qq.Promise(), scale = options.scale, maxSize = scale ? options.maxSize : null; // container is an img, scaling needed if (scale && isImg(container)) { // Iff canvas is available in this UA, try to use it for scaling. // Otherwise, fall back to CSS scaling if (isCanvasSupported()) { // Attempt to use <canvas> for image scaling, // but we must fall back to scaling via CSS/styles // if this is a cross-origin image and the UA doesn't support <img> CORS. if (isCrossOrigin(url) && !isImgCorsSupported()) { drawOnImgFromUrlWithCssScaling(url, container, draw, maxSize); } else { drawOnCanvasOrImgFromUrl(url, container, draw, maxSize); } } else { drawOnImgFromUrlWithCssScaling(url, container, draw, maxSize); } } // container is a canvas, scaling optional else if (isCanvas(container)) { drawOnCanvasOrImgFromUrl(url, container, draw, maxSize); } // container is an img & no scaling: just set the src attr to the passed url else if (registerThumbnailRenderedListener(container, draw)) { container.src = url; } return draw; } qq.extend(this, { /** * Generate a thumbnail. Depending on the arguments, this may either result in * a client-side rendering of an image (if a `Blob` is supplied) or a server-generated * image that may optionally be scaled client-side using <canvas> or CSS/styles (as a fallback). * * @param fileBlobOrUrl a `File`, `Blob`, or a URL pointing to the image * @param container <img> or <canvas> to contain the preview * @param options possible properties include `maxSize` (int), `orient` (bool - default true), and `resize` (bool - default true) * @returns qq.Promise fulfilled when the preview has been drawn, or the attempt has failed */ generate: function(fileBlobOrUrl, container, options) { if (qq.isString(fileBlobOrUrl)) { log("Attempting to update thumbnail based on server response."); return drawFromUrl(fileBlobOrUrl, container, options || {}); } else { log("Attempting to draw client-side image preview."); return draw(fileBlobOrUrl, container, options || {}); } } }); }; /*globals qq */ /** * EXIF image data parser. Currently only parses the Orientation tag value, * but this may be expanded to other tags in the future. * * @param fileOrBlob Attempt to parse EXIF data in this `Blob` * @constructor */ qq.Exif = function(fileOrBlob, log) { "use strict"; // Orientation is the only tag parsed here at this time. var TAG_IDS = [274], TAG_INFO = { 274: { name: "Orientation", bytes: 2 } }; // Convert a little endian (hex string) to big endian (decimal). function parseLittleEndian(hex) { var result = 0, pow = 0; while (hex.length > 0) { result += parseInt(hex.substring(0, 2), 16) * Math.pow(2, pow); hex = hex.substring(2, hex.length); pow += 8; } return result; } // Find the byte offset, of Application Segment 1 (EXIF). // External callers need not supply any arguments. function seekToApp1(offset, promise) { var theOffset = offset, thePromise = promise; if (theOffset === undefined) { theOffset = 2; thePromise = new qq.Promise(); } qq.readBlobToHex(fileOrBlob, theOffset, 4).then(function(hex) { var match = /^ffe([0-9])/.exec(hex), segmentLength; if (match) { if (match[1] !== "1") { segmentLength = parseInt(hex.slice(4, 8), 16); seekToApp1(theOffset + segmentLength + 2, thePromise); } else { thePromise.success(theOffset); } } else { thePromise.failure("No EXIF header to be found!"); } }); return thePromise; } // Find the byte offset of Application Segment 1 (EXIF) for valid JPEGs only. function getApp1Offset() { var promise = new qq.Promise(); qq.readBlobToHex(fileOrBlob, 0, 6).then(function(hex) { if (hex.indexOf("ffd8") !== 0) { promise.failure("Not a valid JPEG!"); } else { seekToApp1().then(function(offset) { promise.success(offset); }, function(error) { promise.failure(error); }); } }); return promise; } // Determine the byte ordering of the EXIF header. function isLittleEndian(app1Start) { var promise = new qq.Promise(); qq.readBlobToHex(fileOrBlob, app1Start + 10, 2).then(function(hex) { promise.success(hex === "4949"); }); return promise; } // Determine the number of directory entries in the EXIF header. function getDirEntryCount(app1Start, littleEndian) { var promise = new qq.Promise(); qq.readBlobToHex(fileOrBlob, app1Start + 18, 2).then(function(hex) { if (littleEndian) { return promise.success(parseLittleEndian(hex)); } else { promise.success(parseInt(hex, 16)); } }); return promise; } // Get the IFD portion of the EXIF header as a hex string. function getIfd(app1Start, dirEntries) { var offset = app1Start + 20, bytes = dirEntries * 12; return qq.readBlobToHex(fileOrBlob, offset, bytes); } // Obtain an array of all directory entries (as hex strings) in the EXIF header. function getDirEntries(ifdHex) { var entries = [], offset = 0; while (offset + 24 <= ifdHex.length) { entries.push(ifdHex.slice(offset, offset + 24)); offset += 24; } return entries; } // Obtain values for all relevant tags and return them. function getTagValues(littleEndian, dirEntries) { var TAG_VAL_OFFSET = 16, tagsToFind = qq.extend([], TAG_IDS), vals = {}; qq.each(dirEntries, function(idx, entry) { var idHex = entry.slice(0, 4), id = littleEndian ? parseLittleEndian(idHex) : parseInt(idHex, 16), tagsToFindIdx = tagsToFind.indexOf(id), tagValHex, tagName, tagValLength; if (tagsToFindIdx >= 0) { tagName = TAG_INFO[id].name; tagValLength = TAG_INFO[id].bytes; tagValHex = entry.slice(TAG_VAL_OFFSET, TAG_VAL_OFFSET + (tagValLength * 2)); vals[tagName] = littleEndian ? parseLittleEndian(tagValHex) : parseInt(tagValHex, 16); tagsToFind.splice(tagsToFindIdx, 1); } if (tagsToFind.length === 0) { return false; } }); return vals; } qq.extend(this, { /** * Attempt to parse the EXIF header for the `Blob` associated with this instance. * * @returns {qq.Promise} To be fulfilled when the parsing is complete. * If successful, the parsed EXIF header as an object will be included. */ parse: function() { var parser = new qq.Promise(), onParseFailure = function(message) { log(qq.format("EXIF header parse failed: '{}' ", message)); parser.failure(message); }; getApp1Offset().then(function(app1Offset) { log(qq.format("Moving forward with EXIF header parsing for '{}'", fileOrBlob.name === undefined ? "blob" : fileOrBlob.name)); isLittleEndian(app1Offset).then(function(littleEndian) { log(qq.format("EXIF Byte order is {} endian", littleEndian ? "little" : "big")); getDirEntryCount(app1Offset, littleEndian).then(function(dirEntryCount) { log(qq.format("Found {} APP1 directory entries", dirEntryCount)); getIfd(app1Offset, dirEntryCount).then(function(ifdHex) { var dirEntries = getDirEntries(ifdHex), tagValues = getTagValues(littleEndian, dirEntries); log("Successfully parsed some EXIF tags"); parser.success(tagValues); }, onParseFailure); }, onParseFailure); }, onParseFailure); }, onParseFailure); return parser; } }); }; /*globals qq */ qq.Identify = function(fileOrBlob, log) { "use strict"; function isIdentifiable(magicBytes, questionableBytes) { var identifiable = false, magicBytesEntries = [].concat(magicBytes); qq.each(magicBytesEntries, function(idx, magicBytesArrayEntry) { if (questionableBytes.indexOf(magicBytesArrayEntry) === 0) { identifiable = true; return false; } }); return identifiable; } qq.extend(this, { /** * Determines if a Blob can be displayed natively in the current browser. This is done by reading magic * bytes in the beginning of the file, so this is an asynchronous operation. Before we attempt to read the * file, we will examine the blob's type attribute to save CPU cycles. * * @returns {qq.Promise} Promise that is fulfilled when identification is complete. * If successful, the MIME string is passed to the success handler. */ isPreviewable: function() { var self = this, idenitifer = new qq.Promise(), previewable = false, name = fileOrBlob.name === undefined ? "blob" : fileOrBlob.name; log(qq.format("Attempting to determine if {} can be rendered in this browser", name)); log("First pass: check type attribute of blob object."); if (this.isPreviewableSync()) { log("Second pass: check for magic bytes in file header."); qq.readBlobToHex(fileOrBlob, 0, 4).then(function(hex) { qq.each(self.PREVIEWABLE_MIME_TYPES, function(mime, bytes) { if (isIdentifiable(bytes, hex)) { // Safari is the only supported browser that can deal with TIFFs natively, // so, if this is a TIFF and the UA isn't Safari, declare this file "non-previewable". if (mime !== "image/tiff" || qq.supportedFeatures.tiffPreviews) { previewable = true; idenitifer.success(mime); } return false; } }); log(qq.format("'{}' is {} able to be rendered in this browser", name, previewable ? "" : "NOT")); if (!previewable) { idenitifer.failure(); } }, function() { log("Error reading file w/ name '" + name + "'. Not able to be rendered in this browser."); idenitifer.failure(); }); } else { idenitifer.failure(); } return idenitifer; }, /** * Determines if a Blob can be displayed natively in the current browser. This is done by checking the * blob's type attribute. This is a synchronous operation, useful for situations where an asynchronous operation * would be challenging to support. Album that the blob's type property is not as accurate as reading the * file's magic bytes. * * @returns {Boolean} true if the blob can be rendered in the current browser */ isPreviewableSync: function() { var fileMime = fileOrBlob.type, // Assumption: This will only ever be executed in browsers that support `Object.keys`. isRecognizedImage = qq.indexOf(Object.keys(this.PREVIEWABLE_MIME_TYPES), fileMime) >= 0, previewable = false, name = fileOrBlob.name === undefined ? "blob" : fileOrBlob.name; if (isRecognizedImage) { if (fileMime === "image/tiff") { previewable = qq.supportedFeatures.tiffPreviews; } else { previewable = true; } } !previewable && log(name + " is not previewable in this browser per the blob's type attr"); return previewable; } }); }; qq.Identify.prototype.PREVIEWABLE_MIME_TYPES = { "image/jpeg": "ffd8ff", "image/gif": "474946", "image/png": "89504e", "image/bmp": "424d", "image/tiff": ["49492a00", "4d4d002a"] }; /*globals qq*/ /** * Attempts to validate an image, wherever possible. * * @param blob File or Blob representing a user-selecting image. * @param log Uses this to post log messages to the console. * @constructor */ qq.ImageValidation = function(blob, log) { "use strict"; /** * @param limits Object with possible image-related limits to enforce. * @returns {boolean} true if at least one of the limits has a non-zero value */ function hasNonZeroLimits(limits) { var atLeastOne = false; qq.each(limits, function(limit, value) { if (value > 0) { atLeastOne = true; return false; } }); return atLeastOne; } /** * @returns {qq.Promise} The promise is a failure if we can't obtain the width & height. * Otherwise, `success` is called on the returned promise with an object containing * `width` and `height` properties. */ function getWidthHeight() { var sizeDetermination = new qq.Promise(); new qq.Identify(blob, log).isPreviewable().then(function() { var image = new Image(), url = window.URL && window.URL.createObjectURL ? window.URL : window.webkitURL && window.webkitURL.createObjectURL ? window.webkitURL : null; if (url) { image.onerror = function() { log("Cannot determine dimensions for image. May be too large.", "error"); sizeDetermination.failure(); }; image.onload = function() { sizeDetermination.success({ width: this.width, height: this.height }); }; image.src = url.createObjectURL(blob); } else { log("No createObjectURL function available to generate image URL!", "error"); sizeDetermination.failure(); } }, sizeDetermination.failure); return sizeDetermination; } /** * * @param limits Object with possible image-related limits to enforce. * @param dimensions Object containing `width` & `height` properties for the image to test. * @returns {String || undefined} The name of the failing limit. Undefined if no failing limits. */ function getFailingLimit(limits, dimensions) { var failingLimit; qq.each(limits, function(limitName, limitValue) { if (limitValue > 0) { var limitMatcher = /(max|min)(Width|Height)/.exec(limitName), dimensionPropName = limitMatcher[2].charAt(0).toLowerCase() + limitMatcher[2].slice(1), actualValue = dimensions[dimensionPropName]; /*jshint -W015*/ switch (limitMatcher[1]) { case "min": if (actualValue < limitValue) { failingLimit = limitName; return false; } break; case "max": if (actualValue > limitValue) { failingLimit = limitName; return false; } break; } } }); return failingLimit; } /** * Validate the associated blob. * * @param limits * @returns {qq.Promise} `success` is called on the promise is the image is valid or * if the blob is not an image, or if the image is not verifiable. * Otherwise, `failure` with the name of the failing limit. */ this.validate = function(limits) { var validationEffort = new qq.Promise(); log("Attempting to validate image."); if (hasNonZeroLimits(limits)) { getWidthHeight().then(function(dimensions) { var failingLimit = getFailingLimit(limits, dimensions); if (failingLimit) { validationEffort.failure(failingLimit); } else { validationEffort.success(); } }, validationEffort.success); } else { validationEffort.success(); } return validationEffort; }; }; /* globals qq */ /** * Module used to control populating the initial list of files. * * @constructor */ qq.Session = function(spec) { "use strict"; var options = { endpoint: null, params: {}, customHeaders: {}, cors: {}, addFileRecord: function(sessionData) {}, log: function(message, level) {} }; qq.extend(options, spec, true); function isJsonResponseValid(response) { if (qq.isArray(response)) { return true; } options.log("Session response is not an array.", "error"); } function handleFileItems(fileItems, success, xhrOrXdr, promise) { var someItemsIgnored = false; success = success && isJsonResponseValid(fileItems); if (success) { qq.each(fileItems, function(idx, fileItem) { /* jshint eqnull:true */ if (fileItem.uuid == null) { someItemsIgnored = true; options.log(qq.format("Session response item {} did not include a valid UUID - ignoring.", idx), "error"); } else if (fileItem.name == null) { someItemsIgnored = true; options.log(qq.format("Session response item {} did not include a valid name - ignoring.", idx), "error"); } else { try { options.addFileRecord(fileItem); return true; } catch (err) { someItemsIgnored = true; options.log(err.message, "error"); } } return false; }); } promise[success && !someItemsIgnored ? "success" : "failure"](fileItems, xhrOrXdr); } // Initiate a call to the server that will be used to populate the initial file list. // Returns a `qq.Promise`. this.refresh = function() { /*jshint indent:false */ var refreshEffort = new qq.Promise(), refreshCompleteCallback = function(response, success, xhrOrXdr) { handleFileItems(response, success, xhrOrXdr, refreshEffort); }, requsterOptions = qq.extend({}, options), requester = new qq.SessionAjaxRequester( qq.extend(requsterOptions, {onComplete: refreshCompleteCallback}) ); requester.queryServer(); return refreshEffort; }; }; /*globals qq, XMLHttpRequest*/ /** * Thin module used to send GET requests to the server, expecting information about session * data used to initialize an uploader instance. * * @param spec Various options used to influence the associated request. * @constructor */ qq.SessionAjaxRequester = function(spec) { "use strict"; var requester, options = { endpoint: null, customHeaders: {}, params: {}, cors: { expected: false, sendCredentials: false }, onComplete: function(response, success, xhrOrXdr) {}, log: function(str, level) {} }; qq.extend(options, spec); function onComplete(id, xhrOrXdr, isError) { var response = null; /* jshint eqnull:true */ if (xhrOrXdr.responseText != null) { try { response = qq.parseJson(xhrOrXdr.responseText); } catch (err) { options.log("Problem parsing session response: " + err.message, "error"); isError = true; } } options.onComplete(response, !isError, xhrOrXdr); } requester = qq.extend(this, new qq.AjaxRequester({ acceptHeader: "application/json", validMethods: ["GET"], method: "GET", endpointStore: { get: function() { return options.endpoint; } }, customHeaders: options.customHeaders, log: options.log, onComplete: onComplete, cors: options.cors })); qq.extend(this, { queryServer: function() { var params = qq.extend({}, options.params); options.log("Session query request."); requester.initTransport("sessionRefresh") .withParams(params) .withCacheBuster() .send(); } }); }; /* globals qq */ /** * Module that handles support for existing forms. * * @param options Options passed from the integrator-supplied options related to form support. * @param startUpload Callback to invoke when files "stored" should be uploaded. * @param log Proxy for the logger * @constructor */ qq.FormSupport = function(options, startUpload, log) { "use strict"; var self = this, interceptSubmit = options.interceptSubmit, formEl = options.element, autoUpload = options.autoUpload; // Available on the public API associated with this module. qq.extend(this, { // To be used by the caller to determine if the endpoint will be determined by some processing // that occurs in this module, such as if the form has an action attribute. // Ignore if `attachToForm === false`. newEndpoint: null, // To be used by the caller to determine if auto uploading should be allowed. // Ignore if `attachToForm === false`. newAutoUpload: autoUpload, // true if a form was detected and is being tracked by this module attachedToForm: false, // Returns an object with names and values for all valid form elements associated with the attached form. getFormInputsAsObject: function() { /* jshint eqnull:true */ if (formEl == null) { return null; } return self._form2Obj(formEl); } }); // If the form contains an action attribute, this should be the new upload endpoint. function determineNewEndpoint(formEl) { if (formEl.getAttribute("action")) { self.newEndpoint = formEl.getAttribute("action"); } } // Return true only if the form is valid, or if we cannot make this determination. // If the form is invalid, ensure invalid field(s) are highlighted in the UI. function validateForm(formEl, nativeSubmit) { if (formEl.checkValidity && !formEl.checkValidity()) { log("Form did not pass validation checks - will not upload.", "error"); nativeSubmit(); } else { return true; } } // Intercept form submit attempts, unless the integrator has told us not to do this. function maybeUploadOnSubmit(formEl) { var nativeSubmit = formEl.submit; // Intercept and squelch submit events. qq(formEl).attach("submit", function(event) { event = event || window.event; if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; } validateForm(formEl, nativeSubmit) && startUpload(); }); // The form's `submit()` function may be called instead (i.e. via jQuery.submit()). // Intercept that too. formEl.submit = function() { validateForm(formEl, nativeSubmit) && startUpload(); }; } // If the element value passed from the uploader is a string, assume it is an element ID - select it. // The rest of the code in this module depends on this being an HTMLElement. function determineFormEl(formEl) { if (formEl) { if (qq.isString(formEl)) { formEl = document.getElementById(formEl); } if (formEl) { log("Attaching to form element."); determineNewEndpoint(formEl); interceptSubmit && maybeUploadOnSubmit(formEl); } } return formEl; } formEl = determineFormEl(formEl); this.attachedToForm = !!formEl; }; qq.extend(qq.FormSupport.prototype, { // Converts all relevant form fields to key/value pairs. This is meant to mimic the data a browser will // construct from a given form when the form is submitted. _form2Obj: function(form) { "use strict"; var obj = {}, notIrrelevantType = function(type) { var irrelevantTypes = [ "button", "image", "reset", "submit" ]; return qq.indexOf(irrelevantTypes, type.toLowerCase()) < 0; }, radioOrCheckbox = function(type) { return qq.indexOf(["checkbox", "radio"], type.toLowerCase()) >= 0; }, ignoreValue = function(el) { if (radioOrCheckbox(el.type) && !el.checked) { return true; } return el.disabled && el.type.toLowerCase() !== "hidden"; }, selectValue = function(select) { var value = null; qq.each(qq(select).children(), function(idx, child) { if (child.tagName.toLowerCase() === "option" && child.selected) { value = child.value; return false; } }); return value; }; qq.each(form.elements, function(idx, el) { if ((qq.isInput(el, true) || el.tagName.toLowerCase() === "textarea") && notIrrelevantType(el.type) && !ignoreValue(el)) { obj[el.name] = el.value; } else if (el.tagName.toLowerCase() === "select" && !ignoreValue(el)) { var value = selectValue(el); if (value !== null) { obj[el.name] = value; } } }); return obj; } }); /* globals qq, ExifRestorer */ /** * Controls generation of scaled images based on a reference image encapsulated in a `File` or `Blob`. * Scaled images are generated and converted to blobs on-demand. * Multiple scaled images per reference image with varying sizes and other properties are supported. * * @param spec Information about the scaled images to generate. * @param log Logger instance * @constructor */ qq.Scaler = function(spec, log) { "use strict"; var self = this, includeReference = spec.sendOriginal, orient = spec.orient, defaultType = spec.defaultType, defaultQuality = spec.defaultQuality / 100, failedToScaleText = spec.failureText, includeExif = spec.includeExif, sizes = this._getSortedSizes(spec.sizes); // Revealed API for instances of this module qq.extend(this, { // If no targeted sizes have been declared or if this browser doesn't support // client-side image preview generation, there is no scaling to do. enabled: qq.supportedFeatures.scaling && sizes.length > 0, getFileRecords: function(originalFileUuid, originalFileName, originalBlobOrBlobData) { var self = this, records = [], originalBlob = originalBlobOrBlobData.blob ? originalBlobOrBlobData.blob : originalBlobOrBlobData, idenitifier = new qq.Identify(originalBlob, log); // If the reference file cannot be rendered natively, we can't create scaled versions. if (idenitifier.isPreviewableSync()) { // Create records for each scaled version & add them to the records array, smallest first. qq.each(sizes, function(idx, sizeRecord) { var outputType = self._determineOutputType({ defaultType: defaultType, requestedType: sizeRecord.type, refType: originalBlob.type }); records.push({ uuid: qq.getUniqueId(), name: self._getName(originalFileName, { name: sizeRecord.name, type: outputType, refType: originalBlob.type }), blob: new qq.BlobProxy(originalBlob, qq.bind(self._generateScaledImage, self, { maxSize: sizeRecord.maxSize, orient: orient, type: outputType, quality: defaultQuality, failedText: failedToScaleText, includeExif: includeExif, log: log })) }); }); includeReference && records.push({ uuid: originalFileUuid, name: originalFileName, blob: originalBlob }); } else { records.push({ uuid: originalFileUuid, name: originalFileName, blob: originalBlob }); } return records; }, handleNewFile: function(file, name, uuid, size, fileList, batchId, uuidParamName, api) { var self = this, buttonId = file.qqButtonId || (file.blob && file.blob.qqButtonId), scaledIds = [], originalId = null, addFileToHandler = api.addFileToHandler, uploadData = api.uploadData, paramsStore = api.paramsStore, proxyGroupId = qq.getUniqueId(); qq.each(self.getFileRecords(uuid, name, file), function(idx, record) { var relatedBlob = file, relatedSize = size, id; if (record.blob instanceof qq.BlobProxy) { relatedBlob = record.blob; relatedSize = -1; } id = uploadData.addFile({ uuid: record.uuid, name: record.name, size: relatedSize, batchId: batchId, proxyGroupId: proxyGroupId }); if (record.blob instanceof qq.BlobProxy) { scaledIds.push(id); } else { originalId = id; } addFileToHandler(id, relatedBlob); fileList.push({id: id, file: relatedBlob}); }); // If we are potentially uploading an original file and some scaled versions, // ensure the scaled versions include reference's to the parent's UUID and size // in their associated upload requests. if (originalId !== null) { qq.each(scaledIds, function(idx, scaledId) { var params = { qqparentuuid: uploadData.retrieve({id: originalId}).uuid, qqparentsize: uploadData.retrieve({id: originalId}).size }; // Make SURE the UUID for each scaled image is sent with the upload request, // to be consistent (since we need to ensure it is sent for the original file as well). params[uuidParamName] = uploadData.retrieve({id: scaledId}).uuid; uploadData.setParentId(scaledId, originalId); paramsStore.addReadOnly(scaledId, params); }); // If any scaled images are tied to this parent image, be SURE we send its UUID as an upload request // parameter as well. if (scaledIds.length) { (function() { var param = {}; param[uuidParamName] = uploadData.retrieve({id: originalId}).uuid; paramsStore.addReadOnly(originalId, param); }()); } } } }); }; qq.extend(qq.Scaler.prototype, { scaleImage: function(id, specs, api) { "use strict"; if (!qq.supportedFeatures.scaling) { throw new qq.Error("Scaling is not supported in this browser!"); } var scalingEffort = new qq.Promise(), log = api.log, file = api.getFile(id), uploadData = api.uploadData.retrieve({id: id}), name = uploadData && uploadData.name, uuid = uploadData && uploadData.uuid, scalingOptions = { sendOriginal: false, orient: specs.orient, defaultType: specs.type || null, defaultQuality: specs.quality, failedToScaleText: "Unable to scale", sizes: [{name: "", maxSize: specs.maxSize}] }, scaler = new qq.Scaler(scalingOptions, log); if (!qq.Scaler || !qq.supportedFeatures.imagePreviews || !file) { scalingEffort.failure(); log("Could not generate requested scaled image for " + id + ". " + "Scaling is either not possible in this browser, or the file could not be located.", "error"); } else { (qq.bind(function() { // Assumption: There will never be more than one record var record = scaler.getFileRecords(uuid, name, file)[0]; if (record && record.blob instanceof qq.BlobProxy) { record.blob.create().then(scalingEffort.success, scalingEffort.failure); } else { log(id + " is not a scalable image!", "error"); scalingEffort.failure(); } }, this)()); } return scalingEffort; }, // NOTE: We cannot reliably determine at this time if the UA supports a specific MIME type for the target format. // image/jpeg and image/png are the only safe choices at this time. _determineOutputType: function(spec) { "use strict"; var requestedType = spec.requestedType, defaultType = spec.defaultType, referenceType = spec.refType; // If a default type and requested type have not been specified, this should be a // JPEG if the original type is a JPEG, otherwise, a PNG. if (!defaultType && !requestedType) { if (referenceType !== "image/jpeg") { return "image/png"; } return referenceType; } // A specified default type is used when a requested type is not specified. if (!requestedType) { return defaultType; } // If requested type is specified, use it, as long as this recognized type is supported by the current UA if (qq.indexOf(Object.keys(qq.Identify.prototype.PREVIEWABLE_MIME_TYPES), requestedType) >= 0) { if (requestedType === "image/tiff") { return qq.supportedFeatures.tiffPreviews ? requestedType : defaultType; } return requestedType; } return defaultType; }, // Get a file name for a generated scaled file record, based on the provided scaled image description _getName: function(originalName, scaledVersionProperties) { "use strict"; var startOfExt = originalName.lastIndexOf("."), versionType = scaledVersionProperties.type || "image/png", referenceType = scaledVersionProperties.refType, scaledName = "", scaledExt = qq.getExtension(originalName), nameAppendage = ""; if (scaledVersionProperties.name && scaledVersionProperties.name.trim().length) { nameAppendage = " (" + scaledVersionProperties.name + ")"; } if (startOfExt >= 0) { scaledName = originalName.substr(0, startOfExt); if (referenceType !== versionType) { scaledExt = versionType.split("/")[1]; } scaledName += nameAppendage + "." + scaledExt; } else { scaledName = originalName + nameAppendage; } return scaledName; }, // We want the smallest scaled file to be uploaded first _getSortedSizes: function(sizes) { "use strict"; sizes = qq.extend([], sizes); return sizes.sort(function(a, b) { if (a.maxSize > b.maxSize) { return 1; } if (a.maxSize < b.maxSize) { return -1; } return 0; }); }, _generateScaledImage: function(spec, sourceFile) { "use strict"; var self = this, log = spec.log, maxSize = spec.maxSize, orient = spec.orient, type = spec.type, quality = spec.quality, failedText = spec.failedText, includeExif = spec.includeExif && sourceFile.type === "image/jpeg" && type === "image/jpeg", scalingEffort = new qq.Promise(), imageGenerator = new qq.ImageGenerator(log), canvas = document.createElement("canvas"); log("Attempting to generate scaled version for " + sourceFile.name); imageGenerator.generate(sourceFile, canvas, {maxSize: maxSize, orient: orient}).then(function() { var scaledImageDataUri = canvas.toDataURL(type, quality), signalSuccess = function() { log("Success generating scaled version for " + sourceFile.name); var blob = qq.dataUriToBlob(scaledImageDataUri); scalingEffort.success(blob); }; if (includeExif) { self._insertExifHeader(sourceFile, scaledImageDataUri, log).then(function(scaledImageDataUriWithExif) { scaledImageDataUri = scaledImageDataUriWithExif; signalSuccess(); }, function() { log("Problem inserting EXIF header into scaled image. Using scaled image w/out EXIF data.", "error"); signalSuccess(); }); } else { signalSuccess(); } }, function() { log("Failed attempt to generate scaled version for " + sourceFile.name, "error"); scalingEffort.failure(failedText); }); return scalingEffort; }, // Attempt to insert the original image's EXIF header into a scaled version. _insertExifHeader: function(originalImage, scaledImageDataUri, log) { "use strict"; var reader = new FileReader(), insertionEffort = new qq.Promise(), originalImageDataUri = ""; reader.onload = function() { originalImageDataUri = reader.result; insertionEffort.success(ExifRestorer.restore(originalImageDataUri, scaledImageDataUri)); }; reader.onerror = function() { log("Problem reading " + originalImage.name + " during attempt to transfer EXIF data to scaled version.", "error"); insertionEffort.failure(); }; reader.readAsDataURL(originalImage); return insertionEffort; }, _dataUriToBlob: function(dataUri) { "use strict"; var byteString, mimeString, arrayBuffer, intArray; // convert base64 to raw binary data held in a string if (dataUri.split(",")[0].indexOf("base64") >= 0) { byteString = atob(dataUri.split(",")[1]); } else { byteString = decodeURI(dataUri.split(",")[1]); } // extract the MIME mimeString = dataUri.split(",")[0] .split(":")[1] .split(";")[0]; // write the bytes of the binary string to an ArrayBuffer arrayBuffer = new ArrayBuffer(byteString.length); intArray = new Uint8Array(arrayBuffer); qq.each(byteString, function(idx, character) { intArray[idx] = character.charCodeAt(0); }); return this._createBlob(arrayBuffer, mimeString); }, _createBlob: function(data, mime) { "use strict"; var BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder || window.MSBlobBuilder, blobBuilder = BlobBuilder && new BlobBuilder(); if (blobBuilder) { blobBuilder.append(data); return blobBuilder.getBlob(mime); } else { return new Blob([data], {type: mime}); } } }); //Based on MinifyJpeg //http://elicon.blog57.fc2.com/blog-entry-206.html var ExifRestorer = (function() { var ExifRestorer = {}; ExifRestorer.KEY_STR = "ABCDEFGHIJKLMNOP" + "QRSTUVWXYZabcdef" + "ghijklmnopqrstuv" + "wxyz0123456789+/" + "="; ExifRestorer.encode64 = function(input) { var output = "", chr1, chr2, chr3 = "", enc1, enc2, enc3, enc4 = "", i = 0; do { chr1 = input[i++]; chr2 = input[i++]; chr3 = input[i++]; enc1 = chr1 >> 2; enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); enc4 = chr3 & 63; if (isNaN(chr2)) { enc3 = enc4 = 64; } else if (isNaN(chr3)) { enc4 = 64; } output = output + this.KEY_STR.charAt(enc1) + this.KEY_STR.charAt(enc2) + this.KEY_STR.charAt(enc3) + this.KEY_STR.charAt(enc4); chr1 = chr2 = chr3 = ""; enc1 = enc2 = enc3 = enc4 = ""; } while (i < input.length); return output; }; ExifRestorer.restore = function(origFileBase64, resizedFileBase64) { var expectedBase64Header = "data:image/jpeg;base64,"; if (!origFileBase64.match(expectedBase64Header)) { return resizedFileBase64; } var rawImage = this.decode64(origFileBase64.replace(expectedBase64Header, "")); var segments = this.slice2Segments(rawImage); var image = this.exifManipulation(resizedFileBase64, segments); return expectedBase64Header + this.encode64(image); }; ExifRestorer.exifManipulation = function(resizedFileBase64, segments) { var exifArray = this.getExifArray(segments), newImageArray = this.insertExif(resizedFileBase64, exifArray), aBuffer = new Uint8Array(newImageArray); return aBuffer; }; ExifRestorer.getExifArray = function(segments) { var seg; for (var x = 0; x < segments.length; x++) { seg = segments[x]; if (seg[0] == 255 & seg[1] == 225) //(ff e1) { return seg; } } return []; }; ExifRestorer.insertExif = function(resizedFileBase64, exifArray) { var imageData = resizedFileBase64.replace("data:image/jpeg;base64,", ""), buf = this.decode64(imageData), separatePoint = buf.indexOf(255,3), mae = buf.slice(0, separatePoint), ato = buf.slice(separatePoint), array = mae; array = array.concat(exifArray); array = array.concat(ato); return array; }; ExifRestorer.slice2Segments = function(rawImageArray) { var head = 0, segments = []; while (1) { if (rawImageArray[head] == 255 & rawImageArray[head + 1] == 218){break;} if (rawImageArray[head] == 255 & rawImageArray[head + 1] == 216) { head += 2; } else { var length = rawImageArray[head + 2] * 256 + rawImageArray[head + 3], endPoint = head + length + 2, seg = rawImageArray.slice(head, endPoint); segments.push(seg); head = endPoint; } if (head > rawImageArray.length){break;} } return segments; }; ExifRestorer.decode64 = function(input) { var output = "", chr1, chr2, chr3 = "", enc1, enc2, enc3, enc4 = "", i = 0, buf = []; // remove all characters that are not A-Z, a-z, 0-9, +, /, or = var base64test = /[^A-Za-z0-9\+\/\=]/g; if (base64test.exec(input)) { throw new Error("There were invalid base64 characters in the input text. " + "Valid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='"); } input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); do { enc1 = this.KEY_STR.indexOf(input.charAt(i++)); enc2 = this.KEY_STR.indexOf(input.charAt(i++)); enc3 = this.KEY_STR.indexOf(input.charAt(i++)); enc4 = this.KEY_STR.indexOf(input.charAt(i++)); chr1 = (enc1 << 2) | (enc2 >> 4); chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); chr3 = ((enc3 & 3) << 6) | enc4; buf.push(chr1); if (enc3 != 64) { buf.push(chr2); } if (enc4 != 64) { buf.push(chr3); } chr1 = chr2 = chr3 = ""; enc1 = enc2 = enc3 = enc4 = ""; } while (i < input.length); return buf; }; return ExifRestorer; })(); /* globals qq */ /** * Keeps a running tally of total upload progress for a batch of files. * * @param callback Invoked when total progress changes, passing calculated total loaded & total size values. * @param getSize Function that returns the size of a file given its ID * @constructor */ qq.TotalProgress = function(callback, getSize) { "use strict"; var perFileProgress = {}, totalLoaded = 0, totalSize = 0, lastLoadedSent = -1, lastTotalSent = -1, callbackProxy = function(loaded, total) { if (loaded !== lastLoadedSent || total !== lastTotalSent) { callback(loaded, total); } lastLoadedSent = loaded; lastTotalSent = total; }, /** * @param failed Array of file IDs that have failed * @param retryable Array of file IDs that are retryable * @returns true if none of the failed files are eligible for retry */ noRetryableFiles = function(failed, retryable) { var none = true; qq.each(failed, function(idx, failedId) { if (qq.indexOf(retryable, failedId) >= 0) { none = false; return false; } }); return none; }, onCancel = function(id) { updateTotalProgress(id, -1, -1); delete perFileProgress[id]; }, onAllComplete = function(successful, failed, retryable) { if (failed.length === 0 || noRetryableFiles(failed, retryable)) { callbackProxy(totalSize, totalSize); this.reset(); } }, onNew = function(id) { var size = getSize(id); // We might not know the size yet, such as for blob proxies if (size > 0) { updateTotalProgress(id, 0, size); perFileProgress[id] = {loaded: 0, total: size}; } }, /** * Invokes the callback with the current total progress of all files in the batch. Called whenever it may * be appropriate to re-calculate and dissemenate this data. * * @param id ID of a file that has changed in some important way * @param newLoaded New loaded value for this file. -1 if this value should no longer be part of calculations * @param newTotal New total size of the file. -1 if this value should no longer be part of calculations */ updateTotalProgress = function(id, newLoaded, newTotal) { var oldLoaded = perFileProgress[id] ? perFileProgress[id].loaded : 0, oldTotal = perFileProgress[id] ? perFileProgress[id].total : 0; if (newLoaded === -1 && newTotal === -1) { totalLoaded -= oldLoaded; totalSize -= oldTotal; } else { if (newLoaded) { totalLoaded += newLoaded - oldLoaded; } if (newTotal) { totalSize += newTotal - oldTotal; } } callbackProxy(totalLoaded, totalSize); }; qq.extend(this, { // Called when a batch of files has completed uploading. onAllComplete: onAllComplete, // Called when the status of a file has changed. onStatusChange: function(id, oldStatus, newStatus) { if (newStatus === qq.status.CANCELED || newStatus === qq.status.REJECTED) { onCancel(id); } else if (newStatus === qq.status.SUBMITTING) { onNew(id); } }, // Called whenever the upload progress of an individual file has changed. onIndividualProgress: function(id, loaded, total) { updateTotalProgress(id, loaded, total); perFileProgress[id] = {loaded: loaded, total: total}; }, // Called whenever the total size of a file has changed, such as when the size of a generated blob is known. onNewSize: function(id) { onNew(id); }, reset: function() { perFileProgress = {}; totalLoaded = 0; totalSize = 0; } }); }; /*globals qq */ // Base handler for UI (FineUploader mode) events. // Some more specific handlers inherit from this one. qq.UiEventHandler = function(s, protectedApi) { "use strict"; var disposer = new qq.DisposeSupport(), spec = { eventType: "click", attachTo: null, onHandled: function(target, event) {} }; // This makes up the "public" API methods that will be accessible // to instances constructing a base or child handler qq.extend(this, { addHandler: function(element) { addHandler(element); }, dispose: function() { disposer.dispose(); } }); function addHandler(element) { disposer.attach(element, spec.eventType, function(event) { // Only in IE: the `event` is a property of the `window`. event = event || window.event; // On older browsers, we must check the `srcElement` instead of the `target`. var target = event.target || event.srcElement; spec.onHandled(target, event); }); } // These make up the "protected" API methods that children of this base handler will utilize. qq.extend(protectedApi, { getFileIdFromItem: function(item) { return item.qqFileId; }, getDisposeSupport: function() { return disposer; } }); qq.extend(spec, s); if (spec.attachTo) { addHandler(spec.attachTo); } }; /* global qq */ qq.FileButtonsClickHandler = function(s) { "use strict"; var inheritedInternalApi = {}, spec = { templating: null, log: function(message, lvl) {}, onDeleteFile: function(fileId) {}, onCancel: function(fileId) {}, onRetry: function(fileId) {}, onPause: function(fileId) {}, onContinue: function(fileId) {}, onGetName: function(fileId) {} }, buttonHandlers = { cancel: function(id) { spec.onCancel(id); }, retry: function(id) { spec.onRetry(id); }, deleteButton: function(id) { spec.onDeleteFile(id); }, pause: function(id) { spec.onPause(id); }, continueButton: function(id) { spec.onContinue(id); } }; function examineEvent(target, event) { qq.each(buttonHandlers, function(buttonType, handler) { var firstLetterCapButtonType = buttonType.charAt(0).toUpperCase() + buttonType.slice(1), fileId; if (spec.templating["is" + firstLetterCapButtonType](target)) { fileId = spec.templating.getFileId(target); qq.preventDefault(event); spec.log(qq.format("Detected valid file button click event on file '{}', ID: {}.", spec.onGetName(fileId), fileId)); handler(fileId); return false; } }); } qq.extend(spec, s); spec.eventType = "click"; spec.onHandled = examineEvent; spec.attachTo = spec.templating.getFileList(); qq.extend(this, new qq.UiEventHandler(spec, inheritedInternalApi)); }; /*globals qq */ // Child of FilenameEditHandler. Used to detect click events on filename display elements. qq.FilenameClickHandler = function(s) { "use strict"; var inheritedInternalApi = {}, spec = { templating: null, log: function(message, lvl) {}, classes: { file: "qq-upload-file", editNameIcon: "qq-edit-filename-icon" }, onGetUploadStatus: function(fileId) {}, onGetName: function(fileId) {} }; qq.extend(spec, s); // This will be called by the parent handler when a `click` event is received on the list element. function examineEvent(target, event) { if (spec.templating.isFileName(target) || spec.templating.isEditIcon(target)) { var fileId = spec.templating.getFileId(target), status = spec.onGetUploadStatus(fileId); // We only allow users to change filenames of files that have been submitted but not yet uploaded. if (status === qq.status.SUBMITTED) { spec.log(qq.format("Detected valid filename click event on file '{}', ID: {}.", spec.onGetName(fileId), fileId)); qq.preventDefault(event); inheritedInternalApi.handleFilenameEdit(fileId, target, true); } } } spec.eventType = "click"; spec.onHandled = examineEvent; qq.extend(this, new qq.FilenameEditHandler(spec, inheritedInternalApi)); }; /*globals qq */ // Child of FilenameEditHandler. Used to detect focusin events on file edit input elements. qq.FilenameInputFocusInHandler = function(s, inheritedInternalApi) { "use strict"; var spec = { templating: null, onGetUploadStatus: function(fileId) {}, log: function(message, lvl) {} }; if (!inheritedInternalApi) { inheritedInternalApi = {}; } // This will be called by the parent handler when a `focusin` event is received on the list element. function handleInputFocus(target, event) { if (spec.templating.isEditInput(target)) { var fileId = spec.templating.getFileId(target), status = spec.onGetUploadStatus(fileId); if (status === qq.status.SUBMITTED) { spec.log(qq.format("Detected valid filename input focus event on file '{}', ID: {}.", spec.onGetName(fileId), fileId)); inheritedInternalApi.handleFilenameEdit(fileId, target); } } } spec.eventType = "focusin"; spec.onHandled = handleInputFocus; qq.extend(spec, s); qq.extend(this, new qq.FilenameEditHandler(spec, inheritedInternalApi)); }; /*globals qq */ /** * Child of FilenameInputFocusInHandler. Used to detect focus events on file edit input elements. This child module is only * needed for UAs that do not support the focusin event. Currently, only Firefox lacks this event. * * @param spec Overrides for default specifications */ qq.FilenameInputFocusHandler = function(spec) { "use strict"; spec.eventType = "focus"; spec.attachTo = null; qq.extend(this, new qq.FilenameInputFocusInHandler(spec, {})); }; /*globals qq */ // Handles edit-related events on a file item (FineUploader mode). This is meant to be a parent handler. // Children will delegate to this handler when specific edit-related actions are detected. qq.FilenameEditHandler = function(s, inheritedInternalApi) { "use strict"; var spec = { templating: null, log: function(message, lvl) {}, onGetUploadStatus: function(fileId) {}, onGetName: function(fileId) {}, onSetName: function(fileId, newName) {}, onEditingStatusChange: function(fileId, isEditing) {} }; function getFilenameSansExtension(fileId) { var filenameSansExt = spec.onGetName(fileId), extIdx = filenameSansExt.lastIndexOf("."); if (extIdx > 0) { filenameSansExt = filenameSansExt.substr(0, extIdx); } return filenameSansExt; } function getOriginalExtension(fileId) { var origName = spec.onGetName(fileId); return qq.getExtension(origName); } // Callback iff the name has been changed function handleNameUpdate(newFilenameInputEl, fileId) { var newName = newFilenameInputEl.value, origExtension; if (newName !== undefined && qq.trimStr(newName).length > 0) { origExtension = getOriginalExtension(fileId); if (origExtension !== undefined) { newName = newName + "." + origExtension; } spec.onSetName(fileId, newName); } spec.onEditingStatusChange(fileId, false); } // The name has been updated if the filename edit input loses focus. function registerInputBlurHandler(inputEl, fileId) { inheritedInternalApi.getDisposeSupport().attach(inputEl, "blur", function() { handleNameUpdate(inputEl, fileId); }); } // The name has been updated if the user presses enter. function registerInputEnterKeyHandler(inputEl, fileId) { inheritedInternalApi.getDisposeSupport().attach(inputEl, "keyup", function(event) { var code = event.keyCode || event.which; if (code === 13) { handleNameUpdate(inputEl, fileId); } }); } qq.extend(spec, s); spec.attachTo = spec.templating.getFileList(); qq.extend(this, new qq.UiEventHandler(spec, inheritedInternalApi)); qq.extend(inheritedInternalApi, { handleFilenameEdit: function(id, target, focusInput) { var newFilenameInputEl = spec.templating.getEditInput(id); spec.onEditingStatusChange(id, true); newFilenameInputEl.value = getFilenameSansExtension(id); if (focusInput) { newFilenameInputEl.focus(); } registerInputBlurHandler(newFilenameInputEl, id); registerInputEnterKeyHandler(newFilenameInputEl, id); } }); }; /* CryptoJS v3.1.2 code.google.com/p/crypto-js (c) 2009-2013 by Jeff Mott. All rights reserved. code.google.com/p/crypto-js/wiki/License */ /** * CryptoJS core components. */ var CryptoJS = CryptoJS || (function (Math, undefined) { /** * CryptoJS namespace. */ var C = {}; /** * Library namespace. */ var C_lib = C.lib = {}; /** * Base object for prototypal inheritance. */ var Base = C_lib.Base = (function () { function F() {} return { /** * Creates a new object that inherits from this object. * * @param {Object} overrides Properties to copy into the new object. * * @return {Object} The new object. * * @static * * @example * * var MyType = CryptoJS.lib.Base.extend({ * field: 'value', * * method: function () { * } * }); */ extend: function (overrides) { // Spawn F.prototype = this; var subtype = new F(); // Augment if (overrides) { subtype.mixIn(overrides); } // Create default initializer if (!subtype.hasOwnProperty('init')) { subtype.init = function () { subtype.$super.init.apply(this, arguments); }; } // Initializer's prototype is the subtype object subtype.init.prototype = subtype; // Reference supertype subtype.$super = this; return subtype; }, /** * Extends this object and runs the init method. * Arguments to create() will be passed to init(). * * @return {Object} The new object. * * @static * * @example * * var instance = MyType.create(); */ create: function () { var instance = this.extend(); instance.init.apply(instance, arguments); return instance; }, /** * Initializes a newly created object. * Override this method to add some logic when your objects are created. * * @example * * var MyType = CryptoJS.lib.Base.extend({ * init: function () { * // ... * } * }); */ init: function () { }, /** * Copies properties into this object. * * @param {Object} properties The properties to mix in. * * @example * * MyType.mixIn({ * field: 'value' * }); */ mixIn: function (properties) { for (var propertyName in properties) { if (properties.hasOwnProperty(propertyName)) { this[propertyName] = properties[propertyName]; } } // IE won't copy toString using the loop above if (properties.hasOwnProperty('toString')) { this.toString = properties.toString; } }, /** * Creates a copy of this object. * * @return {Object} The clone. * * @example * * var clone = instance.clone(); */ clone: function () { return this.init.prototype.extend(this); } }; }()); /** * An array of 32-bit words. * * @property {Array} words The array of 32-bit words. * @property {number} sigBytes The number of significant bytes in this word array. */ var WordArray = C_lib.WordArray = Base.extend({ /** * Initializes a newly created word array. * * @param {Array} words (Optional) An array of 32-bit words. * @param {number} sigBytes (Optional) The number of significant bytes in the words. * * @example * * var wordArray = CryptoJS.lib.WordArray.create(); * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]); * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6); */ init: function (words, sigBytes) { words = this.words = words || []; if (sigBytes != undefined) { this.sigBytes = sigBytes; } else { this.sigBytes = words.length * 4; } }, /** * Converts this word array to a string. * * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex * * @return {string} The stringified word array. * * @example * * var string = wordArray + ''; * var string = wordArray.toString(); * var string = wordArray.toString(CryptoJS.enc.Utf8); */ toString: function (encoder) { return (encoder || Hex).stringify(this); }, /** * Concatenates a word array to this word array. * * @param {WordArray} wordArray The word array to append. * * @return {WordArray} This word array. * * @example * * wordArray1.concat(wordArray2); */ concat: function (wordArray) { // Shortcuts var thisWords = this.words; var thatWords = wordArray.words; var thisSigBytes = this.sigBytes; var thatSigBytes = wordArray.sigBytes; // Clamp excess bits this.clamp(); // Concat if (thisSigBytes % 4) { // Copy one byte at a time for (var i = 0; i < thatSigBytes; i++) { var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8); } } else if (thatWords.length > 0xffff) { // Copy one word at a time for (var i = 0; i < thatSigBytes; i += 4) { thisWords[(thisSigBytes + i) >>> 2] = thatWords[i >>> 2]; } } else { // Copy all words at once thisWords.push.apply(thisWords, thatWords); } this.sigBytes += thatSigBytes; // Chainable return this; }, /** * Removes insignificant bits. * * @example * * wordArray.clamp(); */ clamp: function () { // Shortcuts var words = this.words; var sigBytes = this.sigBytes; // Clamp words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8); words.length = Math.ceil(sigBytes / 4); }, /** * Creates a copy of this word array. * * @return {WordArray} The clone. * * @example * * var clone = wordArray.clone(); */ clone: function () { var clone = Base.clone.call(this); clone.words = this.words.slice(0); return clone; }, /** * Creates a word array filled with random bytes. * * @param {number} nBytes The number of random bytes to generate. * * @return {WordArray} The random word array. * * @static * * @example * * var wordArray = CryptoJS.lib.WordArray.random(16); */ random: function (nBytes) { var words = []; for (var i = 0; i < nBytes; i += 4) { words.push((Math.random() * 0x100000000) | 0); } return new WordArray.init(words, nBytes); } }); /** * Encoder namespace. */ var C_enc = C.enc = {}; /** * Hex encoding strategy. */ var Hex = C_enc.Hex = { /** * Converts a word array to a hex string. * * @param {WordArray} wordArray The word array. * * @return {string} The hex string. * * @static * * @example * * var hexString = CryptoJS.enc.Hex.stringify(wordArray); */ stringify: function (wordArray) { // Shortcuts var words = wordArray.words; var sigBytes = wordArray.sigBytes; // Convert var hexChars = []; for (var i = 0; i < sigBytes; i++) { var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; hexChars.push((bite >>> 4).toString(16)); hexChars.push((bite & 0x0f).toString(16)); } return hexChars.join(''); }, /** * Converts a hex string to a word array. * * @param {string} hexStr The hex string. * * @return {WordArray} The word array. * * @static * * @example * * var wordArray = CryptoJS.enc.Hex.parse(hexString); */ parse: function (hexStr) { // Shortcut var hexStrLength = hexStr.length; // Convert var words = []; for (var i = 0; i < hexStrLength; i += 2) { words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4); } return new WordArray.init(words, hexStrLength / 2); } }; /** * Latin1 encoding strategy. */ var Latin1 = C_enc.Latin1 = { /** * Converts a word array to a Latin1 string. * * @param {WordArray} wordArray The word array. * * @return {string} The Latin1 string. * * @static * * @example * * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray); */ stringify: function (wordArray) { // Shortcuts var words = wordArray.words; var sigBytes = wordArray.sigBytes; // Convert var latin1Chars = []; for (var i = 0; i < sigBytes; i++) { var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; latin1Chars.push(String.fromCharCode(bite)); } return latin1Chars.join(''); }, /** * Converts a Latin1 string to a word array. * * @param {string} latin1Str The Latin1 string. * * @return {WordArray} The word array. * * @static * * @example * * var wordArray = CryptoJS.enc.Latin1.parse(latin1String); */ parse: function (latin1Str) { // Shortcut var latin1StrLength = latin1Str.length; // Convert var words = []; for (var i = 0; i < latin1StrLength; i++) { words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8); } return new WordArray.init(words, latin1StrLength); } }; /** * UTF-8 encoding strategy. */ var Utf8 = C_enc.Utf8 = { /** * Converts a word array to a UTF-8 string. * * @param {WordArray} wordArray The word array. * * @return {string} The UTF-8 string. * * @static * * @example * * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray); */ stringify: function (wordArray) { try { return decodeURIComponent(escape(Latin1.stringify(wordArray))); } catch (e) { throw new Error('Malformed UTF-8 data'); } }, /** * Converts a UTF-8 string to a word array. * * @param {string} utf8Str The UTF-8 string. * * @return {WordArray} The word array. * * @static * * @example * * var wordArray = CryptoJS.enc.Utf8.parse(utf8String); */ parse: function (utf8Str) { return Latin1.parse(unescape(encodeURIComponent(utf8Str))); } }; /** * Abstract buffered block algorithm template. * * The property blockSize must be implemented in a concrete subtype. * * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0 */ var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({ /** * Resets this block algorithm's data buffer to its initial state. * * @example * * bufferedBlockAlgorithm.reset(); */ reset: function () { // Initial values this._data = new WordArray.init(); this._nDataBytes = 0; }, /** * Adds new data to this block algorithm's buffer. * * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8. * * @example * * bufferedBlockAlgorithm._append('data'); * bufferedBlockAlgorithm._append(wordArray); */ _append: function (data) { // Convert string to WordArray, else assume WordArray already if (typeof data == 'string') { data = Utf8.parse(data); } // Append this._data.concat(data); this._nDataBytes += data.sigBytes; }, /** * Processes available data blocks. * * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype. * * @param {boolean} doFlush Whether all blocks and partial blocks should be processed. * * @return {WordArray} The processed data. * * @example * * var processedData = bufferedBlockAlgorithm._process(); * var processedData = bufferedBlockAlgorithm._process(!!'flush'); */ _process: function (doFlush) { // Shortcuts var data = this._data; var dataWords = data.words; var dataSigBytes = data.sigBytes; var blockSize = this.blockSize; var blockSizeBytes = blockSize * 4; // Count blocks ready var nBlocksReady = dataSigBytes / blockSizeBytes; if (doFlush) { // Round up to include partial blocks nBlocksReady = Math.ceil(nBlocksReady); } else { // Round down to include only full blocks, // less the number of blocks that must remain in the buffer nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0); } // Count words ready var nWordsReady = nBlocksReady * blockSize; // Count bytes ready var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes); // Process blocks if (nWordsReady) { for (var offset = 0; offset < nWordsReady; offset += blockSize) { // Perform concrete-algorithm logic this._doProcessBlock(dataWords, offset); } // Remove processed words var processedWords = dataWords.splice(0, nWordsReady); data.sigBytes -= nBytesReady; } // Return processed words return new WordArray.init(processedWords, nBytesReady); }, /** * Creates a copy of this object. * * @return {Object} The clone. * * @example * * var clone = bufferedBlockAlgorithm.clone(); */ clone: function () { var clone = Base.clone.call(this); clone._data = this._data.clone(); return clone; }, _minBufferSize: 0 }); /** * Abstract hasher template. * * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits) */ var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({ /** * Configuration options. */ cfg: Base.extend(), /** * Initializes a newly created hasher. * * @param {Object} cfg (Optional) The configuration options to use for this hash computation. * * @example * * var hasher = CryptoJS.algo.SHA256.create(); */ init: function (cfg) { // Apply config defaults this.cfg = this.cfg.extend(cfg); // Set initial values this.reset(); }, /** * Resets this hasher to its initial state. * * @example * * hasher.reset(); */ reset: function () { // Reset data buffer BufferedBlockAlgorithm.reset.call(this); // Perform concrete-hasher logic this._doReset(); }, /** * Updates this hasher with a message. * * @param {WordArray|string} messageUpdate The message to append. * * @return {Hasher} This hasher. * * @example * * hasher.update('message'); * hasher.update(wordArray); */ update: function (messageUpdate) { // Append this._append(messageUpdate); // Update the hash this._process(); // Chainable return this; }, /** * Finalizes the hash computation. * Album that the finalize operation is effectively a destructive, read-once operation. * * @param {WordArray|string} messageUpdate (Optional) A final message update. * * @return {WordArray} The hash. * * @example * * var hash = hasher.finalize(); * var hash = hasher.finalize('message'); * var hash = hasher.finalize(wordArray); */ finalize: function (messageUpdate) { // Final message update if (messageUpdate) { this._append(messageUpdate); } // Perform concrete-hasher logic var hash = this._doFinalize(); return hash; }, blockSize: 512/32, /** * Creates a shortcut function to a hasher's object interface. * * @param {Hasher} hasher The hasher to create a helper for. * * @return {Function} The shortcut function. * * @static * * @example * * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256); */ _createHelper: function (hasher) { return function (message, cfg) { return new hasher.init(cfg).finalize(message); }; }, /** * Creates a shortcut function to the HMAC's object interface. * * @param {Hasher} hasher The hasher to use in this HMAC helper. * * @return {Function} The shortcut function. * * @static * * @example * * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256); */ _createHmacHelper: function (hasher) { return function (message, key) { return new C_algo.HMAC.init(hasher, key).finalize(message); }; } }); /** * Algorithm namespace. */ var C_algo = C.algo = {}; return C; }(Math)); /* CryptoJS v3.1.2 code.google.com/p/crypto-js (c) 2009-2013 by Jeff Mott. All rights reserved. code.google.com/p/crypto-js/wiki/License */ (function () { // Shortcuts var C = CryptoJS; var C_lib = C.lib; var WordArray = C_lib.WordArray; var C_enc = C.enc; /** * Base64 encoding strategy. */ var Base64 = C_enc.Base64 = { /** * Converts a word array to a Base64 string. * * @param {WordArray} wordArray The word array. * * @return {string} The Base64 string. * * @static * * @example * * var base64String = CryptoJS.enc.Base64.stringify(wordArray); */ stringify: function (wordArray) { // Shortcuts var words = wordArray.words; var sigBytes = wordArray.sigBytes; var map = this._map; // Clamp excess bits wordArray.clamp(); // Convert var base64Chars = []; for (var i = 0; i < sigBytes; i += 3) { var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff; var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff; var triplet = (byte1 << 16) | (byte2 << 8) | byte3; for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) { base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f)); } } // Add padding var paddingChar = map.charAt(64); if (paddingChar) { while (base64Chars.length % 4) { base64Chars.push(paddingChar); } } return base64Chars.join(''); }, /** * Converts a Base64 string to a word array. * * @param {string} base64Str The Base64 string. * * @return {WordArray} The word array. * * @static * * @example * * var wordArray = CryptoJS.enc.Base64.parse(base64String); */ parse: function (base64Str) { // Shortcuts var base64StrLength = base64Str.length; var map = this._map; // Ignore padding var paddingChar = map.charAt(64); if (paddingChar) { var paddingIndex = base64Str.indexOf(paddingChar); if (paddingIndex != -1) { base64StrLength = paddingIndex; } } // Convert var words = []; var nBytes = 0; for (var i = 0; i < base64StrLength; i++) { if (i % 4) { var bits1 = map.indexOf(base64Str.charAt(i - 1)) << ((i % 4) * 2); var bits2 = map.indexOf(base64Str.charAt(i)) >>> (6 - (i % 4) * 2); words[nBytes >>> 2] |= (bits1 | bits2) << (24 - (nBytes % 4) * 8); nBytes++; } } return WordArray.create(words, nBytes); }, _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=' }; }()); /* CryptoJS v3.1.2 code.google.com/p/crypto-js (c) 2009-2013 by Jeff Mott. All rights reserved. code.google.com/p/crypto-js/wiki/License */ (function () { // Shortcuts var C = CryptoJS; var C_lib = C.lib; var Base = C_lib.Base; var C_enc = C.enc; var Utf8 = C_enc.Utf8; var C_algo = C.algo; /** * HMAC algorithm. */ var HMAC = C_algo.HMAC = Base.extend({ /** * Initializes a newly created HMAC. * * @param {Hasher} hasher The hash algorithm to use. * @param {WordArray|string} key The secret key. * * @example * * var hmacHasher = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, key); */ init: function (hasher, key) { // Init hasher hasher = this._hasher = new hasher.init(); // Convert string to WordArray, else assume WordArray already if (typeof key == 'string') { key = Utf8.parse(key); } // Shortcuts var hasherBlockSize = hasher.blockSize; var hasherBlockSizeBytes = hasherBlockSize * 4; // Allow arbitrary length keys if (key.sigBytes > hasherBlockSizeBytes) { key = hasher.finalize(key); } // Clamp excess bits key.clamp(); // Clone key for inner and outer pads var oKey = this._oKey = key.clone(); var iKey = this._iKey = key.clone(); // Shortcuts var oKeyWords = oKey.words; var iKeyWords = iKey.words; // XOR keys with pad constants for (var i = 0; i < hasherBlockSize; i++) { oKeyWords[i] ^= 0x5c5c5c5c; iKeyWords[i] ^= 0x36363636; } oKey.sigBytes = iKey.sigBytes = hasherBlockSizeBytes; // Set initial values this.reset(); }, /** * Resets this HMAC to its initial state. * * @example * * hmacHasher.reset(); */ reset: function () { // Shortcut var hasher = this._hasher; // Reset hasher.reset(); hasher.update(this._iKey); }, /** * Updates this HMAC with a message. * * @param {WordArray|string} messageUpdate The message to append. * * @return {HMAC} This HMAC instance. * * @example * * hmacHasher.update('message'); * hmacHasher.update(wordArray); */ update: function (messageUpdate) { this._hasher.update(messageUpdate); // Chainable return this; }, /** * Finalizes the HMAC computation. * Album that the finalize operation is effectively a destructive, read-once operation. * * @param {WordArray|string} messageUpdate (Optional) A final message update. * * @return {WordArray} The HMAC. * * @example * * var hmac = hmacHasher.finalize(); * var hmac = hmacHasher.finalize('message'); * var hmac = hmacHasher.finalize(wordArray); */ finalize: function (messageUpdate) { // Shortcut var hasher = this._hasher; // Compute HMAC var innerHash = hasher.finalize(messageUpdate); hasher.reset(); var hmac = hasher.finalize(this._oKey.clone().concat(innerHash)); return hmac; } }); }()); /* CryptoJS v3.1.2 code.google.com/p/crypto-js (c) 2009-2013 by Jeff Mott. All rights reserved. code.google.com/p/crypto-js/wiki/License */ (function () { // Shortcuts var C = CryptoJS; var C_lib = C.lib; var WordArray = C_lib.WordArray; var Hasher = C_lib.Hasher; var C_algo = C.algo; // Reusable object var W = []; /** * SHA-1 hash algorithm. */ var SHA1 = C_algo.SHA1 = Hasher.extend({ _doReset: function () { this._hash = new WordArray.init([ 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0 ]); }, _doProcessBlock: function (M, offset) { // Shortcut var H = this._hash.words; // Working variables var a = H[0]; var b = H[1]; var c = H[2]; var d = H[3]; var e = H[4]; // Computation for (var i = 0; i < 80; i++) { if (i < 16) { W[i] = M[offset + i] | 0; } else { var n = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]; W[i] = (n << 1) | (n >>> 31); } var t = ((a << 5) | (a >>> 27)) + e + W[i]; if (i < 20) { t += ((b & c) | (~b & d)) + 0x5a827999; } else if (i < 40) { t += (b ^ c ^ d) + 0x6ed9eba1; } else if (i < 60) { t += ((b & c) | (b & d) | (c & d)) - 0x70e44324; } else /* if (i < 80) */ { t += (b ^ c ^ d) - 0x359d3e2a; } e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t; } // Intermediate hash value H[0] = (H[0] + a) | 0; H[1] = (H[1] + b) | 0; H[2] = (H[2] + c) | 0; H[3] = (H[3] + d) | 0; H[4] = (H[4] + e) | 0; }, _doFinalize: function () { // Shortcuts var data = this._data; var dataWords = data.words; var nBitsTotal = this._nDataBytes * 8; var nBitsLeft = data.sigBytes * 8; // Add padding dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000); dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal; data.sigBytes = dataWords.length * 4; // Hash final blocks this._process(); // Return final computed hash return this._hash; }, clone: function () { var clone = Hasher.clone.call(this); clone._hash = this._hash.clone(); return clone; } }); /** * Shortcut function to the hasher's object interface. * * @param {WordArray|string} message The message to hash. * * @return {WordArray} The hash. * * @static * * @example * * var hash = CryptoJS.SHA1('message'); * var hash = CryptoJS.SHA1(wordArray); */ C.SHA1 = Hasher._createHelper(SHA1); /** * Shortcut function to the HMAC's object interface. * * @param {WordArray|string} message The message to hash. * @param {WordArray|string} key The secret key. * * @return {WordArray} The HMAC. * * @static * * @example * * var hmac = CryptoJS.HmacSHA1(message, key); */ C.HmacSHA1 = Hasher._createHmacHelper(SHA1); }()); /*! 2015-04-02 */
'use strict'; module.exports = function(environment) { let ENV = { modulePrefix: 'emberjs-tutorial', environment, rootURL: '/', locationType: 'auto', EmberENV: { FEATURES: { // Here you can enable experimental features on an ember canary build // e.g. EMBER_NATIVE_DECORATOR_SUPPORT: true }, EXTEND_PROTOTYPES: { // Prevent Ember Data from overriding Date.parse. Date: false } }, APP: { // Here you can pass flags/options to your application instance // when it is created } }; if (environment === 'development') { // ENV.APP.LOG_RESOLVER = true; // ENV.APP.LOG_ACTIVE_GENERATION = true; // ENV.APP.LOG_TRANSITIONS = true; // ENV.APP.LOG_TRANSITIONS_INTERNAL = true; // ENV.APP.LOG_VIEW_LOOKUPS = true; } if (environment === 'test') { // Testem prefers this... ENV.locationType = 'none'; // keep test console output quieter ENV.APP.LOG_ACTIVE_GENERATION = false; ENV.APP.LOG_VIEW_LOOKUPS = false; ENV.APP.rootElement = '#ember-testing'; ENV.APP.autoboot = false; } if (environment === 'production') { // here you can enable a production-specific feature } return ENV; };
const maxVol = client.config.opt.maxVol; module.exports = { name: 'volume', aliases: ['ses'], utilisation: `{prefix}volume [1-${maxVol}]`, voiceChannel: true, execute(client, message, args) { const queue = player.getQueue(message.guild.id); if (!queue || !queue.playing) return message.channel.send(`${message.author}, Şuanda çalan bir müzik yok!. ❌`); const vol = parseInt(args[0]); if (!vol) return message.channel.send(`Mevcut ses seviyesi: **${queue.volume}** 🔊\n**Ses seviyesini değiştirmek için \`1\` ile \`${maxVol}\` arasında bir sayı yazın.**`); if (queue.volume === vol) return message.channel.send(`${message.author}, Değiştirmek istediğiniz ses düzeyi zaten geçerli olan ses düzeyidir. ❌`); if (vol < 0 || vol > maxVol) return message.channel.send(`${message.author}, **Ses seviyesini değiştirmek için \`1\` ile \`${maxVol}\` arasında bir sayı yazın.** ❌`); const success = queue.setVolume(vol); return message.channel.send(success ? `Ses seviyesi değiştirildi: **%${vol}**/**${maxVol}** 🔊` : `${message.author}, Birşeyler yanlış gitti. ❌`); }, };
const mongoose = require('mongoose'); const bcrypt = require('bcrypt'); const Schema = mongoose.Schema; let employeeSchema = new Schema({ employeeId: { type: Number, required: true }, name: { firstName: String, lastName: String, }, username: { type: String, required: true }, password: { type: String, required: true }, department: { type: String }, role: { type: String }, email: { type: String }, joinedDate: { type: Date }, employmentStatus: { fullTime: Boolean }, mobile: { type: Number }, payroll: { type: Schema.Types.ObjectId, ref: 'Payroll' }, accountCreated: { type: Date, default: Date.now } }, { timestamps: true }); //hashing a password before saving it to the database employeeSchema.pre('save', function (next) { let user = this; bcrypt.hash(user.password, 10, function (err, hash) { if (err) { return next(err); } user.password = hash; next(); }); }); // Define Mongoose Model const Employee = mongoose.model('Employee', employeeSchema); module.exports = Employee;
// THIS FILE IS AUTO GENERATED import { GenIcon } from '../lib'; export function DiLinux (props) { return GenIcon({"tag":"svg","attr":{"version":"1.1","viewBox":"0 0 32 32"},"child":[{"tag":"path","attr":{"d":"M15.534 8.411c0 0.102-0.102 0.102-0.102 0.102h-0.102c-0.102 0-0.102-0.102-0.204-0.204 0 0-0.102-0.102-0.102-0.204s0-0.102 0.102-0.102l0.204 0.102c0.102 0.102 0.204 0.204 0.204 0.306zM13.698 7.391c0-0.51-0.204-0.816-0.51-0.816 0 0 0 0.102-0.102 0.102v0.204h0.306c0 0.204 0.102 0.306 0.102 0.51h0.204zM17.268 6.881c0.204 0 0.306 0.204 0.408 0.51h0.204c-0.102-0.102-0.102-0.204-0.102-0.306s0-0.204-0.102-0.306-0.204-0.204-0.306-0.204c0 0-0.102 0.102-0.204 0.102 0 0.102 0.102 0.102 0.102 0.204zM14.208 8.513c-0.102 0-0.102 0-0.102-0.102s0-0.204 0.102-0.306c0.204 0 0.306-0.102 0.306-0.102 0.102 0 0.102 0.102 0.102 0.102 0 0.102-0.102 0.204-0.306 0.408h-0.102zM13.086 8.411c-0.408-0.204-0.51-0.51-0.51-1.020 0-0.306 0-0.51 0.204-0.714 0.102-0.204 0.306-0.306 0.51-0.306s0.306 0.102 0.51 0.306c0.102 0.306 0.204 0.612 0.204 0.918v0.204h0.102v-0.102c0.102 0 0.102-0.204 0.102-0.612 0-0.306 0-0.612-0.204-0.918s-0.408-0.51-0.816-0.51c-0.306 0-0.612 0.204-0.714 0.51-0.204 0.408-0.245 0.714-0.245 1.224 0 0.408 0.143 0.816 0.551 1.224 0.102-0.102 0.204-0.102 0.306-0.204zM25.834 22.791c0.102 0 0.102-0.041 0.102-0.133 0-0.224-0.102-0.489-0.408-0.785-0.306-0.306-0.816-0.5-1.428-0.581-0.102-0.010-0.204-0.010-0.204-0.010-0.102-0.020-0.102-0.020-0.204-0.020-0.102-0.010-0.306-0.031-0.408-0.051 0.306-0.949 0.408-1.785 0.408-2.519 0-1.020-0.204-1.734-0.612-2.346s-0.816-0.918-1.326-1.020c-0.102 0.102-0.102 0.102-0.102 0.204 0.51 0.204 1.020 0.612 1.326 1.224 0.306 0.714 0.408 1.326 0.408 2.040 0 0.571-0.102 1.418-0.51 2.499-0.408 0.163-0.816 0.54-1.122 1.132 0 0.092 0 0.143 0.102 0.143 0 0 0.102-0.092 0.204-0.265 0.204-0.173 0.306-0.347 0.51-0.52 0.306-0.173 0.51-0.265 0.816-0.265 0.51 0 1.020 0.071 1.326 0.214 0.408 0.133 0.612 0.275 0.714 0.439 0.102 0.153 0.204 0.296 0.306 0.428 0 0.132 0.102 0.194 0.102 0.194zM16.452 8.003c-0.102-0.102-0.102-0.306-0.102-0.51 0-0.408 0-0.612 0.204-0.918 0.204-0.204 0.408-0.306 0.612-0.306 0.306 0 0.51 0.204 0.714 0.408 0.102 0.306 0.204 0.51 0.204 0.816 0 0.51-0.204 0.816-0.612 0.918 0 0 0.102 0.102 0.204 0.102 0.204 0 0.306 0.102 0.51 0.204 0.102-0.612 0.204-1.020 0.204-1.53 0-0.612-0.102-1.020-0.306-1.326-0.306-0.306-0.612-0.408-1.020-0.408-0.306 0-0.612 0.102-0.918 0.306-0.204 0.306-0.306 0.51-0.306 0.816 0 0.51 0.102 0.918 0.306 1.326 0.102 0 0.204 0.102 0.306 0.102zM17.676 9.635c-1.326 0.918-2.346 1.326-3.162 1.326-0.714 0-1.428-0.306-2.040-0.816 0.102 0.204 0.204 0.408 0.306 0.51l0.612 0.612c0.408 0.408 0.918 0.612 1.428 0.612 0.714 0 1.53-0.408 2.55-1.122l0.918-0.612c0.204-0.204 0.408-0.408 0.408-0.714 0-0.102 0-0.204-0.102-0.204-0.102-0.204-0.612-0.51-1.632-0.816-0.918-0.408-1.632-0.612-2.040-0.612-0.306 0-0.816 0.204-1.53 0.612-0.612 0.408-1.020 0.816-1.020 1.224 0 0 0.102 0.102 0.204 0.306 0.612 0.51 1.224 0.816 1.836 0.816 0.816 0 1.836-0.408 3.162-1.428v0.204c0.102-0 0.102 0.102 0.102 0.102zM20.021 30.236c0.408 0.767 1.122 1.152 1.938 1.152 0.204 0 0.408-0.031 0.612-0.092 0.204-0.041 0.408-0.112 0.51-0.194 0.102-0.071 0.204-0.143 0.306-0.224 0.204-0.071 0.204-0.122 0.306-0.173l1.734-1.499c0.408-0.325 0.816-0.61 1.326-0.857 0.408-0.245 0.816-0.408 1.020-0.5 0.306-0.082 0.51-0.204 0.714-0.367 0.102-0.153 0.204-0.347 0.204-0.592 0-0.296-0.204-0.52-0.408-0.683s-0.408-0.275-0.612-0.347-0.408-0.235-0.714-0.51c-0.204-0.265-0.408-0.632-0.51-1.112l-0.102-0.591c-0.102-0.275-0.102-0.479-0.204-0.592 0-0.031 0-0.041-0.102-0.041s-0.306 0.092-0.408 0.265c-0.204 0.173-0.408 0.367-0.612 0.571-0.102 0.204-0.408 0.387-0.612 0.561-0.306 0.173-0.612 0.265-0.816 0.265-0.816 0-1.224-0.224-1.53-0.663-0.204-0.326-0.306-0.704-0.408-1.132-0.204-0.173-0.306-0.265-0.51-0.265-0.51 0-0.714 0.53-0.714 1.601v3.172c0 0.092-0.102 0.296-0.102 0.612-0.102 0.316-0.102 0.675-0.102 1.081l-0.204 1.132v0.017zM5.233 29.693c0.948 0.139 2.040 0.435 3.274 0.888 1.234 0.449 1.989 0.683 2.264 0.683 0.714 0 1.306-0.316 1.795-0.927 0.102-0.198 0.102-0.43 0.102-0.698 0-0.964-0.581-2.183-1.744-3.661l-0.694-0.928c-0.143-0.194-0.316-0.49-0.54-0.887-0.214-0.398-0.408-0.704-0.561-0.918-0.133-0.235-0.347-0.469-0.622-0.704-0.265-0.235-0.571-0.387-0.908-0.469-0.428 0.082-0.724 0.224-0.867 0.418s-0.224 0.408-0.245 0.632c-0.031 0.214-0.092 0.357-0.194 0.428-0.102 0.061-0.275 0.112-0.51 0.163-0.051 0-0.143 0-0.275 0.010h-0.275c-0.541 0-0.908 0.061-1.101 0.163-0.255 0.296-0.388 0.632-0.388 0.989 0 0.163 0.041 0.439 0.122 0.826 0.082 0.377 0.122 0.683 0.122 0.897 0 0.418-0.122 0.836-0.377 1.254-0.255 0.439-0.388 0.765-0.388 0.997 0.102 0.396 0.775 0.674 2.009 0.837zM8.629 20.42c0-0.704 0.184-1.479 0.561-2.397 0.367-0.918 0.734-1.53 1.091-1.938-0.020-0.102-0.071-0.102-0.153-0.102l-0.102-0.102c-0.296 0.306-0.653 1.020-1.081 2.040-0.428 0.918-0.653 1.764-0.653 2.387 0 0.459 0.112 0.857 0.316 1.203 0.224 0.337 0.765 0.826 1.622 1.448l1.081 0.704c1.152 1 1.764 1.693 1.764 2.101 0 0.214-0.102 0.428-0.408 0.663-0.204 0.245-0.479 0.367-0.714 0.367-0.020 0-0.031 0.020-0.031 0.071 0 0.010 0.102 0.214 0.316 0.612 0.428 0.581 1.346 0.867 2.57 0.867 2.244 0 3.977-0.918 5.303-2.754 0-0.51 0-0.826-0.102-0.959v-0.377c0-0.663 0.102-1.163 0.306-1.489s0.408-0.479 0.714-0.479c0.204 0 0.408 0.071 0.612 0.224 0.102-0.785 0.102-1.469 0.102-2.081 0-0.928 0-1.693-0.204-2.407-0.102-0.612-0.306-1.122-0.51-1.53-0.204-0.306-0.408-0.612-0.612-0.918s-0.306-0.612-0.51-0.918c-0.102-0.408-0.204-0.714-0.204-1.224-0.306-0.51-0.51-1.020-0.816-1.53-0.204-0.51-0.408-1.020-0.612-1.428l-0.918 0.714c-1.020 0.714-1.836 1.020-2.55 1.020-0.612 0-1.122-0.102-1.428-0.51l-0.612-0.51c0 0.306-0.102 0.714-0.306 1.122l-0.643 1.224c-0.286 0.714-0.438 1.122-0.469 1.428-0.041 0.204-0.071 0.408-0.092 0.408l-0.765 1.53c-0.826 1.53-1.244 2.947-1.244 4.12 0 0.235 0.020 0.479 0.061 0.724-0.459-0.316-0.683-0.755-0.683-1.326zM15.932 30.068c-1.326 0-2.346 0.18-3.060 0.535v-0.031c-0.51 0.612-1.081 0.928-1.877 0.928-0.5 0-1.285-0.194-2.346-0.581-1.071-0.367-2.019-0.649-2.845-0.834-0.082-0.023-0.265-0.058-0.561-0.105-0.286-0.046-0.551-0.093-0.785-0.14-0.214-0.046-0.459-0.115-0.724-0.209-0.255-0.081-0.459-0.186-0.612-0.313-0.141-0.129-0.21-0.273-0.21-0.436s0.035-0.337 0.104-0.523c0.065-0.112 0.137-0.224 0.208-0.326 0.071-0.112 0.133-0.214 0.173-0.316 0.061-0.092 0.102-0.184 0.143-0.286 0.041-0.092 0.082-0.184 0.102-0.296 0.020-0.102 0.041-0.204 0.041-0.306s-0.041-0.408-0.122-0.948c-0.082-0.53-0.122-0.867-0.122-1.010 0-0.449 0.102-0.806 0.326-1.061s0.439-0.388 0.663-0.388h1.173c0.092 0 0.235-0.051 0.449-0.173 0.071-0.163 0.133-0.296 0.173-0.418 0.051-0.122 0.071-0.214 0.092-0.255 0.020-0.061 0.041-0.122 0.061-0.173 0.041-0.071 0.092-0.153 0.163-0.235-0.082-0.102-0.122-0.235-0.122-0.398 0-0.112 0-0.214 0.020-0.275 0-0.367 0.173-0.887 0.54-1.571l0.357-0.643c0.296-0.551 0.52-0.959 0.683-1.367 0.173-0.408 0.357-1.020 0.561-1.836 0.163-0.714 0.551-1.428 1.163-2.142l0.765-0.918c0.53-0.612 0.877-1.122 1.071-1.53s0.296-0.918 0.296-1.326c0-0.204-0.051-0.816-0.163-1.836-0.102-1.020-0.153-2.040-0.153-2.958 0-0.714 0.061-1.224 0.194-1.734s0.367-1.020 0.714-1.428c0.306-0.408 0.714-0.816 1.326-1.020s1.326-0.306 2.142-0.306c0.306 0 0.612 0 0.918 0.102 0.306 0 0.714 0.102 1.224 0.306 0.408 0.204 0.816 0.408 1.122 0.714 0.408 0.306 0.714 0.816 1.020 1.326 0.204 0.612 0.408 1.224 0.51 2.040 0.102 0.51 0.102 1.020 0.204 1.734 0 0.612 0.102 1.020 0.102 1.326 0.102 0.306 0.102 0.714 0.204 1.224 0.102 0.408 0.204 0.816 0.408 1.122 0.204 0.408 0.408 0.816 0.714 1.224 0.306 0.51 0.714 1.020 1.122 1.632 0.918 1.020 1.632 2.142 2.040 3.263 0.51 1.020 0.816 2.346 0.816 3.763 0 0.704-0.102 1.387-0.306 2.050 0.204 0 0.306 0.082 0.408 0.224s0.204 0.449 0.306 0.928l0.102 0.755c0.102 0.224 0.204 0.439 0.51 0.622 0.204 0.184 0.408 0.337 0.714 0.459 0.204 0.102 0.51 0.245 0.714 0.428 0.204 0.204 0.306 0.418 0.306 0.642 0 0.347-0.102 0.602-0.306 0.785-0.204 0.204-0.408 0.347-0.714 0.439-0.204 0.102-0.612 0.306-1.224 0.594-0.51 0.302-1.020 0.668-1.53 1.101l-1.020 0.868c-0.408 0.398-0.816 0.683-1.122 0.857-0.306 0.184-0.714 0.275-1.122 0.275l-0.714-0.082c-0.816-0.214-1.326-0.622-1.632-1.244-1.632-0.198-2.958-0.296-3.774-0.296z"}}]})(props); };
macDetailCallback("0050c2ba4000/36",[{"a":"SOCIEDAD DE CONDUENOS 21 ALCALA DE HENARES MADRID ES 28804","o":"CUSTOS MOBILE S.L.","d":"2009-11-29","t":"add","s":"ieee","c":"ES"}]);
const data = { name: "en-CH", likelySubtags: { en: "en-Latn-US" }, identity: { language: "en", territory: "CH" }, territory: "CH", numbers: { currencies: { ADP: { displayName: "Andorran Peseta", "displayName-count-one": "Andorran peseta", "displayName-count-other": "Andorran pesetas", symbol: "ADP" }, AED: { displayName: "United Arab Emirates Dirham", "displayName-count-one": "UAE dirham", "displayName-count-other": "UAE dirhams", symbol: "AED" }, AFA: { displayName: "Afghan Afghani (1927–2002)", "displayName-count-one": "Afghan afghani (1927–2002)", "displayName-count-other": "Afghan afghanis (1927–2002)", symbol: "AFA" }, AFN: { displayName: "Afghan Afghani", "displayName-count-one": "Afghan Afghani", "displayName-count-other": "Afghan Afghanis", symbol: "AFN" }, ALK: { displayName: "Albanian Lek (1946–1965)", "displayName-count-one": "Albanian lek (1946–1965)", "displayName-count-other": "Albanian lekë (1946–1965)", symbol: "ALK" }, ALL: { displayName: "Albanian Lek", "displayName-count-one": "Albanian lek", "displayName-count-other": "Albanian lekë", symbol: "ALL" }, AMD: { displayName: "Armenian Dram", "displayName-count-one": "Armenian dram", "displayName-count-other": "Armenian drams", symbol: "AMD" }, ANG: { displayName: "Netherlands Antillean Guilder", "displayName-count-one": "Netherlands Antillean guilder", "displayName-count-other": "Netherlands Antillean guilders", symbol: "ANG" }, AOA: { displayName: "Angolan Kwanza", "displayName-count-one": "Angolan kwanza", "displayName-count-other": "Angolan kwanzas", symbol: "AOA", "symbol-alt-narrow": "Kz" }, AOK: { displayName: "Angolan Kwanza (1977–1991)", "displayName-count-one": "Angolan kwanza (1977–1991)", "displayName-count-other": "Angolan kwanzas (1977–1991)", symbol: "AOK" }, AON: { displayName: "Angolan New Kwanza (1990–2000)", "displayName-count-one": "Angolan new kwanza (1990–2000)", "displayName-count-other": "Angolan new kwanzas (1990–2000)", symbol: "AON" }, AOR: { displayName: "Angolan Readjusted Kwanza (1995–1999)", "displayName-count-one": "Angolan readjusted kwanza (1995–1999)", "displayName-count-other": "Angolan readjusted kwanzas (1995–1999)", symbol: "AOR" }, ARA: { displayName: "Argentine Austral", "displayName-count-one": "Argentine austral", "displayName-count-other": "Argentine australs", symbol: "ARA" }, ARL: { displayName: "Argentine Peso Ley (1970–1983)", "displayName-count-one": "Argentine peso ley (1970–1983)", "displayName-count-other": "Argentine pesos ley (1970–1983)", symbol: "ARL" }, ARM: { displayName: "Argentine Peso (1881–1970)", "displayName-count-one": "Argentine peso (1881–1970)", "displayName-count-other": "Argentine pesos (1881–1970)", symbol: "ARM" }, ARP: { displayName: "Argentine Peso (1983–1985)", "displayName-count-one": "Argentine peso (1983–1985)", "displayName-count-other": "Argentine pesos (1983–1985)", symbol: "ARP" }, ARS: { displayName: "Argentine Peso", "displayName-count-one": "Argentine peso", "displayName-count-other": "Argentine pesos", symbol: "ARS", "symbol-alt-narrow": "$" }, ATS: { displayName: "Austrian Schilling", "displayName-count-one": "Austrian schilling", "displayName-count-other": "Austrian schillings", symbol: "ATS" }, AUD: { displayName: "Australian Dollar", "displayName-count-one": "Australian dollar", "displayName-count-other": "Australian dollars", symbol: "A$", "symbol-alt-narrow": "$" }, AWG: { displayName: "Aruban Florin", "displayName-count-one": "Aruban florin", "displayName-count-other": "Aruban florin", symbol: "AWG" }, AZM: { displayName: "Azerbaijani Manat (1993–2006)", "displayName-count-one": "Azerbaijani manat (1993–2006)", "displayName-count-other": "Azerbaijani manats (1993–2006)", symbol: "AZM" }, AZN: { displayName: "Azerbaijani Manat", "displayName-count-one": "Azerbaijani manat", "displayName-count-other": "Azerbaijani manats", symbol: "AZN" }, BAD: { displayName: "Bosnia-Herzegovina Dinar (1992–1994)", "displayName-count-one": "Bosnia-Herzegovina dinar (1992–1994)", "displayName-count-other": "Bosnia-Herzegovina dinars (1992–1994)", symbol: "BAD" }, BAM: { displayName: "Bosnia-Herzegovina Convertible Mark", "displayName-count-one": "Bosnia-Herzegovina convertible mark", "displayName-count-other": "Bosnia-Herzegovina convertible marks", symbol: "BAM", "symbol-alt-narrow": "KM" }, BAN: { displayName: "Bosnia-Herzegovina New Dinar (1994–1997)", "displayName-count-one": "Bosnia-Herzegovina new dinar (1994–1997)", "displayName-count-other": "Bosnia-Herzegovina new dinars (1994–1997)", symbol: "BAN" }, BBD: { displayName: "Barbadian Dollar", "displayName-count-one": "Barbadian dollar", "displayName-count-other": "Barbadian dollars", symbol: "BBD", "symbol-alt-narrow": "$" }, BDT: { displayName: "Bangladeshi Taka", "displayName-count-one": "Bangladeshi taka", "displayName-count-other": "Bangladeshi takas", symbol: "BDT", "symbol-alt-narrow": "৳" }, BEC: { displayName: "Belgian Franc (convertible)", "displayName-count-one": "Belgian franc (convertible)", "displayName-count-other": "Belgian francs (convertible)", symbol: "BEC" }, BEF: { displayName: "Belgian Franc", "displayName-count-one": "Belgian franc", "displayName-count-other": "Belgian francs", symbol: "BEF" }, BEL: { displayName: "Belgian Franc (financial)", "displayName-count-one": "Belgian franc (financial)", "displayName-count-other": "Belgian francs (financial)", symbol: "BEL" }, BGL: { displayName: "Bulgarian Hard Lev", "displayName-count-one": "Bulgarian hard lev", "displayName-count-other": "Bulgarian hard leva", symbol: "BGL" }, BGM: { displayName: "Bulgarian Socialist Lev", "displayName-count-one": "Bulgarian socialist lev", "displayName-count-other": "Bulgarian socialist leva", symbol: "BGM" }, BGN: { displayName: "Bulgarian Lev", "displayName-count-one": "Bulgarian lev", "displayName-count-other": "Bulgarian leva", symbol: "BGN" }, BGO: { displayName: "Bulgarian Lev (1879–1952)", "displayName-count-one": "Bulgarian lev (1879–1952)", "displayName-count-other": "Bulgarian leva (1879–1952)", symbol: "BGO" }, BHD: { displayName: "Bahraini Dinar", "displayName-count-one": "Bahraini dinar", "displayName-count-other": "Bahraini dinars", symbol: "BHD" }, BIF: { displayName: "Burundian Franc", "displayName-count-one": "Burundian franc", "displayName-count-other": "Burundian francs", symbol: "BIF" }, BMD: { displayName: "Bermudan Dollar", "displayName-count-one": "Bermudan dollar", "displayName-count-other": "Bermudan dollars", symbol: "BMD", "symbol-alt-narrow": "$" }, BND: { displayName: "Brunei Dollar", "displayName-count-one": "Brunei dollar", "displayName-count-other": "Brunei dollars", symbol: "BND", "symbol-alt-narrow": "$" }, BOB: { displayName: "Bolivian Boliviano", "displayName-count-one": "Bolivian boliviano", "displayName-count-other": "Bolivian bolivianos", symbol: "BOB", "symbol-alt-narrow": "Bs" }, BOL: { displayName: "Bolivian Boliviano (1863–1963)", "displayName-count-one": "Bolivian boliviano (1863–1963)", "displayName-count-other": "Bolivian bolivianos (1863–1963)", symbol: "BOL" }, BOP: { displayName: "Bolivian Peso", "displayName-count-one": "Bolivian peso", "displayName-count-other": "Bolivian pesos", symbol: "BOP" }, BOV: { displayName: "Bolivian Mvdol", "displayName-count-one": "Bolivian mvdol", "displayName-count-other": "Bolivian mvdols", symbol: "BOV" }, BRB: { displayName: "Brazilian New Cruzeiro (1967–1986)", "displayName-count-one": "Brazilian new cruzeiro (1967–1986)", "displayName-count-other": "Brazilian new cruzeiros (1967–1986)", symbol: "BRB" }, BRC: { displayName: "Brazilian Cruzado (1986–1989)", "displayName-count-one": "Brazilian cruzado (1986–1989)", "displayName-count-other": "Brazilian cruzados (1986–1989)", symbol: "BRC" }, BRE: { displayName: "Brazilian Cruzeiro (1990–1993)", "displayName-count-one": "Brazilian cruzeiro (1990–1993)", "displayName-count-other": "Brazilian cruzeiros (1990–1993)", symbol: "BRE" }, BRL: { displayName: "Brazilian Real", "displayName-count-one": "Brazilian real", "displayName-count-other": "Brazilian reals", symbol: "R$", "symbol-alt-narrow": "R$" }, BRN: { displayName: "Brazilian New Cruzado (1989–1990)", "displayName-count-one": "Brazilian new cruzado (1989–1990)", "displayName-count-other": "Brazilian new cruzados (1989–1990)", symbol: "BRN" }, BRR: { displayName: "Brazilian Cruzeiro (1993–1994)", "displayName-count-one": "Brazilian cruzeiro (1993–1994)", "displayName-count-other": "Brazilian cruzeiros (1993–1994)", symbol: "BRR" }, BRZ: { displayName: "Brazilian Cruzeiro (1942–1967)", "displayName-count-one": "Brazilian cruzeiro (1942–1967)", "displayName-count-other": "Brazilian cruzeiros (1942–1967)", symbol: "BRZ" }, BSD: { displayName: "Bahamian Dollar", "displayName-count-one": "Bahamian dollar", "displayName-count-other": "Bahamian dollars", symbol: "BSD", "symbol-alt-narrow": "$" }, BTN: { displayName: "Bhutanese Ngultrum", "displayName-count-one": "Bhutanese ngultrum", "displayName-count-other": "Bhutanese ngultrums", symbol: "BTN" }, BUK: { displayName: "Burmese Kyat", "displayName-count-one": "Burmese kyat", "displayName-count-other": "Burmese kyats", symbol: "BUK" }, BWP: { displayName: "Botswanan Pula", "displayName-count-one": "Botswanan pula", "displayName-count-other": "Botswanan pulas", symbol: "BWP", "symbol-alt-narrow": "P" }, BYB: { displayName: "Belarusian New Rouble (1994–1999)", "displayName-count-one": "Belarusian new rouble (1994–1999)", "displayName-count-other": "Belarusian new roubles (1994–1999)", symbol: "BYB" }, BYN: { displayName: "Belarusian Rouble", "displayName-count-one": "Belarusian rouble", "displayName-count-other": "Belarusian roubles", symbol: "BYN", "symbol-alt-narrow": "р." }, BYR: { displayName: "Belarusian Rouble (2000–2016)", "displayName-count-one": "Belarusian rouble (2000–2016)", "displayName-count-other": "Belarusian roubles (2000–2016)", symbol: "BYR" }, BZD: { displayName: "Belize Dollar", "displayName-count-one": "Belize dollar", "displayName-count-other": "Belize dollars", symbol: "BZD", "symbol-alt-narrow": "$" }, CAD: { displayName: "Canadian Dollar", "displayName-count-one": "Canadian dollar", "displayName-count-other": "Canadian dollars", symbol: "CA$", "symbol-alt-narrow": "$" }, CDF: { displayName: "Congolese Franc", "displayName-count-one": "Congolese franc", "displayName-count-other": "Congolese francs", symbol: "CDF" }, CHE: { displayName: "WIR Euro", "displayName-count-one": "WIR euro", "displayName-count-other": "WIR euros", symbol: "CHE" }, CHF: { displayName: "Swiss Franc", "displayName-count-one": "Swiss franc", "displayName-count-other": "Swiss francs", symbol: "CHF" }, CHW: { displayName: "WIR Franc", "displayName-count-one": "WIR franc", "displayName-count-other": "WIR francs", symbol: "CHW" }, CLE: { displayName: "Chilean Escudo", "displayName-count-one": "Chilean escudo", "displayName-count-other": "Chilean escudos", symbol: "CLE" }, CLF: { displayName: "Chilean Unit of Account (UF)", "displayName-count-one": "Chilean unit of account (UF)", "displayName-count-other": "Chilean units of account (UF)", symbol: "CLF" }, CLP: { displayName: "Chilean Peso", "displayName-count-one": "Chilean peso", "displayName-count-other": "Chilean pesos", symbol: "CLP", "symbol-alt-narrow": "$" }, CNH: { displayName: "Chinese Yuan (offshore)", "displayName-count-one": "Chinese yuan (offshore)", "displayName-count-other": "Chinese yuan (offshore)", symbol: "CNH" }, CNX: { displayName: "Chinese People’s Bank Dollar", "displayName-count-one": "Chinese People’s Bank dollar", "displayName-count-other": "Chinese People’s Bank dollars", symbol: "CNX" }, CNY: { displayName: "Chinese Yuan", "displayName-count-one": "Chinese yuan", "displayName-count-other": "Chinese yuan", symbol: "CN¥", "symbol-alt-narrow": "¥" }, COP: { displayName: "Colombian Peso", "displayName-count-one": "Colombian peso", "displayName-count-other": "Colombian pesos", symbol: "COP", "symbol-alt-narrow": "$" }, COU: { displayName: "Colombian Real Value Unit", "displayName-count-one": "Colombian real value unit", "displayName-count-other": "Colombian real value units", symbol: "COU" }, CRC: { displayName: "Costa Rican Colón", "displayName-count-one": "Costa Rican colón", "displayName-count-other": "Costa Rican colóns", symbol: "CRC", "symbol-alt-narrow": "₡" }, CSD: { displayName: "Serbian Dinar (2002–2006)", "displayName-count-one": "Serbian dinar (2002–2006)", "displayName-count-other": "Serbian dinars (2002–2006)", symbol: "CSD" }, CSK: { displayName: "Czechoslovak Hard Koruna", "displayName-count-one": "Czechoslovak hard koruna", "displayName-count-other": "Czechoslovak hard korunas", symbol: "CSK" }, CUC: { displayName: "Cuban Convertible Peso", "displayName-count-one": "Cuban convertible peso", "displayName-count-other": "Cuban convertible pesos", symbol: "CUC", "symbol-alt-narrow": "$" }, CUP: { displayName: "Cuban Peso", "displayName-count-one": "Cuban peso", "displayName-count-other": "Cuban pesos", symbol: "CUP", "symbol-alt-narrow": "$" }, CVE: { displayName: "Cape Verdean Escudo", "displayName-count-one": "Cape Verdean escudo", "displayName-count-other": "Cape Verdean escudos", symbol: "CVE" }, CYP: { displayName: "Cypriot Pound", "displayName-count-one": "Cypriot pound", "displayName-count-other": "Cypriot pounds", symbol: "CYP" }, CZK: { displayName: "Czech Koruna", "displayName-count-one": "Czech koruna", "displayName-count-other": "Czech korunas", symbol: "CZK", "symbol-alt-narrow": "Kč" }, DDM: { displayName: "East German Mark", "displayName-count-one": "East German mark", "displayName-count-other": "East German marks", symbol: "DDM" }, DEM: { displayName: "German Mark", "displayName-count-one": "German mark", "displayName-count-other": "German marks", symbol: "DEM" }, DJF: { displayName: "Djiboutian Franc", "displayName-count-one": "Djiboutian franc", "displayName-count-other": "Djiboutian francs", symbol: "DJF" }, DKK: { displayName: "Danish Krone", "displayName-count-one": "Danish krone", "displayName-count-other": "Danish kroner", symbol: "DKK", "symbol-alt-narrow": "kr" }, DOP: { displayName: "Dominican Peso", "displayName-count-one": "Dominican peso", "displayName-count-other": "Dominican pesos", symbol: "DOP", "symbol-alt-narrow": "$" }, DZD: { displayName: "Algerian Dinar", "displayName-count-one": "Algerian dinar", "displayName-count-other": "Algerian dinars", symbol: "DZD" }, ECS: { displayName: "Ecuadorian Sucre", "displayName-count-one": "Ecuadorian sucre", "displayName-count-other": "Ecuadorian sucres", symbol: "ECS" }, ECV: { displayName: "Ecuadorian Unit of Constant Value", "displayName-count-one": "Ecuadorian unit of constant value", "displayName-count-other": "Ecuadorian units of constant value", symbol: "ECV" }, EEK: { displayName: "Estonian Kroon", "displayName-count-one": "Estonian kroon", "displayName-count-other": "Estonian kroons", symbol: "EEK" }, EGP: { displayName: "Egyptian Pound", "displayName-count-one": "Egyptian pound", "displayName-count-other": "Egyptian pounds", symbol: "EGP", "symbol-alt-narrow": "E£" }, ERN: { displayName: "Eritrean Nakfa", "displayName-count-one": "Eritrean nakfa", "displayName-count-other": "Eritrean nakfas", symbol: "ERN" }, ESA: { displayName: "Spanish Peseta (A account)", "displayName-count-one": "Spanish peseta (A account)", "displayName-count-other": "Spanish pesetas (A account)", symbol: "ESA" }, ESB: { displayName: "Spanish Peseta (convertible account)", "displayName-count-one": "Spanish peseta (convertible account)", "displayName-count-other": "Spanish pesetas (convertible account)", symbol: "ESB" }, ESP: { displayName: "Spanish Peseta", "displayName-count-one": "Spanish peseta", "displayName-count-other": "Spanish pesetas", symbol: "ESP", "symbol-alt-narrow": "₧" }, ETB: { displayName: "Ethiopian Birr", "displayName-count-one": "Ethiopian birr", "displayName-count-other": "Ethiopian birrs", symbol: "ETB" }, EUR: { pattern: "¤#,##0.00", displayName: "Euro", "displayName-count-one": "euro", "displayName-count-other": "euros", symbol: "€", "symbol-alt-narrow": "€" }, FIM: { displayName: "Finnish Markka", "displayName-count-one": "Finnish markka", "displayName-count-other": "Finnish markkas", symbol: "FIM" }, FJD: { displayName: "Fijian Dollar", "displayName-count-one": "Fijian dollar", "displayName-count-other": "Fijian dollars", symbol: "FJD", "symbol-alt-narrow": "$" }, FKP: { displayName: "Falkland Islands Pound", "displayName-count-one": "Falkland Islands pound", "displayName-count-other": "Falkland Islands pounds", symbol: "FKP", "symbol-alt-narrow": "£" }, FRF: { displayName: "French Franc", "displayName-count-one": "French franc", "displayName-count-other": "French francs", symbol: "FRF" }, GBP: { displayName: "British Pound", "displayName-count-one": "British pound", "displayName-count-other": "British pounds", symbol: "£", "symbol-alt-narrow": "£" }, GEK: { displayName: "Georgian Kupon Larit", "displayName-count-one": "Georgian kupon larit", "displayName-count-other": "Georgian kupon larits", symbol: "GEK" }, GEL: { displayName: "Georgian Lari", "displayName-count-one": "Georgian lari", "displayName-count-other": "Georgian laris", symbol: "GEL", "symbol-alt-narrow": "₾" }, GHC: { displayName: "Ghanaian Cedi (1979–2007)", "displayName-count-one": "Ghanaian cedi (1979–2007)", "displayName-count-other": "Ghanaian cedis (1979–2007)", symbol: "GHC" }, GHS: { displayName: "Ghanaian Cedi", "displayName-count-one": "Ghanaian cedi", "displayName-count-other": "Ghanaian cedis", symbol: "GHS" }, GIP: { displayName: "Gibraltar Pound", "displayName-count-one": "Gibraltar pound", "displayName-count-other": "Gibraltar pounds", symbol: "GIP", "symbol-alt-narrow": "£" }, GMD: { displayName: "Gambian Dalasi", "displayName-count-one": "Gambian dalasi", "displayName-count-other": "Gambian dalasis", symbol: "GMD" }, GNF: { displayName: "Guinean Franc", "displayName-count-one": "Guinean franc", "displayName-count-other": "Guinean francs", symbol: "GNF", "symbol-alt-narrow": "FG" }, GNS: { displayName: "Guinean Syli", "displayName-count-one": "Guinean syli", "displayName-count-other": "Guinean sylis", symbol: "GNS" }, GQE: { displayName: "Equatorial Guinean Ekwele", "displayName-count-one": "Equatorial Guinean ekwele", "displayName-count-other": "Equatorial Guinean ekwele", symbol: "GQE" }, GRD: { displayName: "Greek Drachma", "displayName-count-one": "Greek drachma", "displayName-count-other": "Greek drachmas", symbol: "GRD" }, GTQ: { displayName: "Guatemalan Quetzal", "displayName-count-one": "Guatemalan quetzal", "displayName-count-other": "Guatemalan quetzals", symbol: "GTQ", "symbol-alt-narrow": "Q" }, GWE: { displayName: "Portuguese Guinea Escudo", "displayName-count-one": "Portuguese Guinea escudo", "displayName-count-other": "Portuguese Guinea escudos", symbol: "GWE" }, GWP: { displayName: "Guinea-Bissau Peso", "displayName-count-one": "Guinea-Bissau peso", "displayName-count-other": "Guinea-Bissau pesos", symbol: "GWP" }, GYD: { displayName: "Guyanaese Dollar", "displayName-count-one": "Guyanaese dollar", "displayName-count-other": "Guyanaese dollars", symbol: "GYD", "symbol-alt-narrow": "$" }, HKD: { displayName: "Hong Kong Dollar", "displayName-count-one": "Hong Kong dollar", "displayName-count-other": "Hong Kong dollars", symbol: "HK$", "symbol-alt-narrow": "$" }, HNL: { displayName: "Honduran Lempira", "displayName-count-one": "Honduran lempira", "displayName-count-other": "Honduran lempiras", symbol: "HNL", "symbol-alt-narrow": "L" }, HRD: { displayName: "Croatian Dinar", "displayName-count-one": "Croatian dinar", "displayName-count-other": "Croatian dinars", symbol: "HRD" }, HRK: { displayName: "Croatian Kuna", "displayName-count-one": "Croatian kuna", "displayName-count-other": "Croatian kunas", symbol: "HRK", "symbol-alt-narrow": "kn" }, HTG: { displayName: "Haitian Gourde", "displayName-count-one": "Haitian gourde", "displayName-count-other": "Haitian gourdes", symbol: "HTG" }, HUF: { displayName: "Hungarian Forint", "displayName-count-one": "Hungarian forint", "displayName-count-other": "Hungarian forints", symbol: "HUF", "symbol-alt-narrow": "Ft" }, IDR: { displayName: "Indonesian Rupiah", "displayName-count-one": "Indonesian rupiah", "displayName-count-other": "Indonesian rupiahs", symbol: "IDR", "symbol-alt-narrow": "Rp" }, IEP: { displayName: "Irish Pound", "displayName-count-one": "Irish pound", "displayName-count-other": "Irish pounds", symbol: "IEP" }, ILP: { displayName: "Israeli Pound", "displayName-count-one": "Israeli pound", "displayName-count-other": "Israeli pounds", symbol: "ILP" }, ILR: { displayName: "Israeli Shekel (1980–1985)", "displayName-count-one": "Israeli shekel (1980–1985)", "displayName-count-other": "Israeli shekels (1980–1985)", symbol: "ILR" }, ILS: { displayName: "Israeli New Shekel", "displayName-count-one": "Israeli new shekel", "displayName-count-other": "Israeli new shekels", symbol: "₪", "symbol-alt-narrow": "₪" }, INR: { displayName: "Indian Rupee", "displayName-count-one": "Indian rupee", "displayName-count-other": "Indian rupees", symbol: "₹", "symbol-alt-narrow": "₹" }, IQD: { displayName: "Iraqi Dinar", "displayName-count-one": "Iraqi dinar", "displayName-count-other": "Iraqi dinars", symbol: "IQD" }, IRR: { displayName: "Iranian Rial", "displayName-count-one": "Iranian rial", "displayName-count-other": "Iranian rials", symbol: "IRR" }, ISJ: { displayName: "Icelandic Króna (1918–1981)", "displayName-count-one": "Icelandic króna (1918–1981)", "displayName-count-other": "Icelandic krónur (1918–1981)", symbol: "ISJ" }, ISK: { displayName: "Icelandic Króna", "displayName-count-one": "Icelandic króna", "displayName-count-other": "Icelandic krónur", symbol: "ISK", "symbol-alt-narrow": "kr" }, ITL: { displayName: "Italian Lira", "displayName-count-one": "Italian lira", "displayName-count-other": "Italian liras", symbol: "ITL" }, JMD: { displayName: "Jamaican Dollar", "displayName-count-one": "Jamaican dollar", "displayName-count-other": "Jamaican dollars", symbol: "JMD", "symbol-alt-narrow": "$" }, JOD: { displayName: "Jordanian Dinar", "displayName-count-one": "Jordanian dinar", "displayName-count-other": "Jordanian dinars", symbol: "JOD" }, JPY: { displayName: "Japanese Yen", "displayName-count-one": "Japanese yen", "displayName-count-other": "Japanese yen", symbol: "JP¥", "symbol-alt-narrow": "¥" }, KES: { displayName: "Kenyan Shilling", "displayName-count-one": "Kenyan shilling", "displayName-count-other": "Kenyan shillings", symbol: "KES" }, KGS: { displayName: "Kyrgystani Som", "displayName-count-one": "Kyrgystani som", "displayName-count-other": "Kyrgystani soms", symbol: "KGS" }, KHR: { displayName: "Cambodian Riel", "displayName-count-one": "Cambodian riel", "displayName-count-other": "Cambodian riels", symbol: "KHR", "symbol-alt-narrow": "៛" }, KMF: { displayName: "Comorian Franc", "displayName-count-one": "Comorian franc", "displayName-count-other": "Comorian francs", symbol: "KMF", "symbol-alt-narrow": "CF" }, KPW: { displayName: "North Korean Won", "displayName-count-one": "North Korean won", "displayName-count-other": "North Korean won", symbol: "KPW", "symbol-alt-narrow": "₩" }, KRH: { displayName: "South Korean Hwan (1953–1962)", "displayName-count-one": "South Korean hwan (1953–1962)", "displayName-count-other": "South Korean hwan (1953–1962)", symbol: "KRH" }, KRO: { displayName: "South Korean Won (1945–1953)", "displayName-count-one": "South Korean won (1945–1953)", "displayName-count-other": "South Korean won (1945–1953)", symbol: "KRO" }, KRW: { displayName: "South Korean Won", "displayName-count-one": "South Korean won", "displayName-count-other": "South Korean won", symbol: "₩", "symbol-alt-narrow": "₩" }, KWD: { displayName: "Kuwaiti Dinar", "displayName-count-one": "Kuwaiti dinar", "displayName-count-other": "Kuwaiti dinars", symbol: "KWD" }, KYD: { displayName: "Cayman Islands Dollar", "displayName-count-one": "Cayman Islands dollar", "displayName-count-other": "Cayman Islands dollars", symbol: "KYD", "symbol-alt-narrow": "$" }, KZT: { displayName: "Kazakhstani Tenge", "displayName-count-one": "Kazakhstani tenge", "displayName-count-other": "Kazakhstani tenges", symbol: "KZT", "symbol-alt-narrow": "₸" }, LAK: { displayName: "Laotian Kip", "displayName-count-one": "Laotian kip", "displayName-count-other": "Laotian kips", symbol: "LAK", "symbol-alt-narrow": "₭" }, LBP: { displayName: "Lebanese Pound", "displayName-count-one": "Lebanese pound", "displayName-count-other": "Lebanese pounds", symbol: "LBP", "symbol-alt-narrow": "L£" }, LKR: { displayName: "Sri Lankan Rupee", "displayName-count-one": "Sri Lankan rupee", "displayName-count-other": "Sri Lankan rupees", symbol: "LKR", "symbol-alt-narrow": "Rs" }, LRD: { displayName: "Liberian Dollar", "displayName-count-one": "Liberian dollar", "displayName-count-other": "Liberian dollars", symbol: "LRD", "symbol-alt-narrow": "$" }, LSL: { displayName: "Lesotho Loti", "displayName-count-one": "Lesotho loti", "displayName-count-other": "Lesotho lotis", symbol: "LSL" }, LTL: { displayName: "Lithuanian Litas", "displayName-count-one": "Lithuanian litas", "displayName-count-other": "Lithuanian litai", symbol: "LTL", "symbol-alt-narrow": "Lt" }, LTT: { displayName: "Lithuanian Talonas", "displayName-count-one": "Lithuanian talonas", "displayName-count-other": "Lithuanian talonases", symbol: "LTT" }, LUC: { displayName: "Luxembourgian Convertible Franc", "displayName-count-one": "Luxembourgian convertible franc", "displayName-count-other": "Luxembourgian convertible francs", symbol: "LUC" }, LUF: { displayName: "Luxembourgian Franc", "displayName-count-one": "Luxembourgian franc", "displayName-count-other": "Luxembourgian francs", symbol: "LUF" }, LUL: { displayName: "Luxembourg Financial Franc", "displayName-count-one": "Luxembourg financial franc", "displayName-count-other": "Luxembourg financial francs", symbol: "LUL" }, LVL: { displayName: "Latvian Lats", "displayName-count-one": "Latvian lats", "displayName-count-other": "Latvian lati", symbol: "LVL", "symbol-alt-narrow": "Ls" }, LVR: { displayName: "Latvian Rouble", "displayName-count-one": "Latvian rouble", "displayName-count-other": "Latvian roubles", symbol: "LVR" }, LYD: { displayName: "Libyan Dinar", "displayName-count-one": "Libyan dinar", "displayName-count-other": "Libyan dinars", symbol: "LYD" }, MAD: { displayName: "Moroccan Dirham", "displayName-count-one": "Moroccan dirham", "displayName-count-other": "Moroccan dirhams", symbol: "MAD" }, MAF: { displayName: "Moroccan Franc", "displayName-count-one": "Moroccan franc", "displayName-count-other": "Moroccan francs", symbol: "MAF" }, MCF: { displayName: "Monegasque Franc", "displayName-count-one": "Monegasque franc", "displayName-count-other": "Monegasque francs", symbol: "MCF" }, MDC: { displayName: "Moldovan Cupon", "displayName-count-one": "Moldovan cupon", "displayName-count-other": "Moldovan cupon", symbol: "MDC" }, MDL: { displayName: "Moldovan Leu", "displayName-count-one": "Moldovan leu", "displayName-count-other": "Moldovan lei", symbol: "MDL" }, MGA: { displayName: "Malagasy Ariary", "displayName-count-one": "Malagasy ariary", "displayName-count-other": "Malagasy ariaries", symbol: "MGA", "symbol-alt-narrow": "Ar" }, MGF: { displayName: "Malagasy Franc", "displayName-count-one": "Malagasy franc", "displayName-count-other": "Malagasy francs", symbol: "MGF" }, MKD: { displayName: "Macedonian Denar", "displayName-count-one": "Macedonian denar", "displayName-count-other": "Macedonian denari", symbol: "MKD" }, MKN: { displayName: "Macedonian Denar (1992–1993)", "displayName-count-one": "Macedonian denar (1992–1993)", "displayName-count-other": "Macedonian denari (1992–1993)", symbol: "MKN" }, MLF: { displayName: "Malian Franc", "displayName-count-one": "Malian franc", "displayName-count-other": "Malian francs", symbol: "MLF" }, MMK: { displayName: "Myanmar Kyat", "displayName-count-one": "Myanmar kyat", "displayName-count-other": "Myanmar kyats", symbol: "MMK", "symbol-alt-narrow": "K" }, MNT: { displayName: "Mongolian Tugrik", "displayName-count-one": "Mongolian tugrik", "displayName-count-other": "Mongolian tugriks", symbol: "MNT", "symbol-alt-narrow": "₮" }, MOP: { displayName: "Macanese Pataca", "displayName-count-one": "Macanese pataca", "displayName-count-other": "Macanese patacas", symbol: "MOP" }, MRO: { displayName: "Mauritanian Ouguiya (1973–2017)", "displayName-count-one": "Mauritanian ouguiya (1973–2017)", "displayName-count-other": "Mauritanian ouguiyas (1973–2017)", symbol: "MRO" }, MRU: { displayName: "Mauritanian Ouguiya", "displayName-count-one": "Mauritanian ouguiya", "displayName-count-other": "Mauritanian ouguiyas", symbol: "MRU" }, MTL: { displayName: "Maltese Lira", "displayName-count-one": "Maltese lira", "displayName-count-other": "Maltese lira", symbol: "MTL" }, MTP: { displayName: "Maltese Pound", "displayName-count-one": "Maltese pound", "displayName-count-other": "Maltese pounds", symbol: "MTP" }, MUR: { displayName: "Mauritian Rupee", "displayName-count-one": "Mauritian rupee", "displayName-count-other": "Mauritian rupees", symbol: "MUR", "symbol-alt-narrow": "Rs" }, MVP: { displayName: "Maldivian Rupee (1947–1981)", "displayName-count-one": "Maldivian rupee (1947–1981)", "displayName-count-other": "Maldivian rupees (1947–1981)", symbol: "MVP" }, MVR: { displayName: "Maldivian Rufiyaa", "displayName-count-one": "Maldivian rufiyaa", "displayName-count-other": "Maldivian rufiyaas", symbol: "MVR" }, MWK: { displayName: "Malawian Kwacha", "displayName-count-one": "Malawian kwacha", "displayName-count-other": "Malawian kwachas", symbol: "MWK" }, MXN: { displayName: "Mexican Peso", "displayName-count-one": "Mexican peso", "displayName-count-other": "Mexican pesos", symbol: "MX$", "symbol-alt-narrow": "$" }, MXP: { displayName: "Mexican Silver Peso (1861–1992)", "displayName-count-one": "Mexican silver peso (1861–1992)", "displayName-count-other": "Mexican silver pesos (1861–1992)", symbol: "MXP" }, MXV: { displayName: "Mexican Investment Unit", "displayName-count-one": "Mexican investment unit", "displayName-count-other": "Mexican investment units", symbol: "MXV" }, MYR: { displayName: "Malaysian Ringgit", "displayName-count-one": "Malaysian ringgit", "displayName-count-other": "Malaysian ringgits", symbol: "MYR", "symbol-alt-narrow": "RM" }, MZE: { displayName: "Mozambican Escudo", "displayName-count-one": "Mozambican escudo", "displayName-count-other": "Mozambican escudos", symbol: "MZE" }, MZM: { displayName: "Mozambican Metical (1980–2006)", "displayName-count-one": "Mozambican metical (1980–2006)", "displayName-count-other": "Mozambican meticals (1980–2006)", symbol: "MZM" }, MZN: { displayName: "Mozambican Metical", "displayName-count-one": "Mozambican metical", "displayName-count-other": "Mozambican meticals", symbol: "MZN" }, NAD: { displayName: "Namibian Dollar", "displayName-count-one": "Namibian dollar", "displayName-count-other": "Namibian dollars", symbol: "NAD", "symbol-alt-narrow": "$" }, NGN: { displayName: "Nigerian Naira", "displayName-count-one": "Nigerian naira", "displayName-count-other": "Nigerian nairas", symbol: "NGN", "symbol-alt-narrow": "₦" }, NIC: { displayName: "Nicaraguan Córdoba (1988–1991)", "displayName-count-one": "Nicaraguan córdoba (1988–1991)", "displayName-count-other": "Nicaraguan córdobas (1988–1991)", symbol: "NIC" }, NIO: { displayName: "Nicaraguan Córdoba", "displayName-count-one": "Nicaraguan córdoba", "displayName-count-other": "Nicaraguan córdobas", symbol: "NIO", "symbol-alt-narrow": "C$" }, NLG: { displayName: "Dutch Guilder", "displayName-count-one": "Dutch guilder", "displayName-count-other": "Dutch guilders", symbol: "NLG" }, NOK: { displayName: "Norwegian Krone", "displayName-count-one": "Norwegian krone", "displayName-count-other": "Norwegian kroner", symbol: "NOK", "symbol-alt-narrow": "kr" }, NPR: { displayName: "Nepalese Rupee", "displayName-count-one": "Nepalese rupee", "displayName-count-other": "Nepalese rupees", symbol: "NPR", "symbol-alt-narrow": "Rs" }, NZD: { displayName: "New Zealand Dollar", "displayName-count-one": "New Zealand dollar", "displayName-count-other": "New Zealand dollars", symbol: "NZ$", "symbol-alt-narrow": "$" }, OMR: { displayName: "Omani Rial", "displayName-count-one": "Omani rial", "displayName-count-other": "Omani rials", symbol: "OMR" }, PAB: { displayName: "Panamanian Balboa", "displayName-count-one": "Panamanian balboa", "displayName-count-other": "Panamanian balboas", symbol: "PAB" }, PEI: { displayName: "Peruvian Inti", "displayName-count-one": "Peruvian inti", "displayName-count-other": "Peruvian intis", symbol: "PEI" }, PEN: { displayName: "Peruvian Sol", "displayName-count-one": "Peruvian sol", "displayName-count-other": "Peruvian soles", symbol: "PEN" }, PES: { displayName: "Peruvian Sol (1863–1965)", "displayName-count-one": "Peruvian sol (1863–1965)", "displayName-count-other": "Peruvian soles (1863–1965)", symbol: "PES" }, PGK: { displayName: "Papua New Guinean Kina", "displayName-count-one": "Papua New Guinean kina", "displayName-count-other": "Papua New Guinean kina", symbol: "PGK" }, PHP: { displayName: "Philippine Piso", "displayName-count-one": "Philippine piso", "displayName-count-other": "Philippine pisos", symbol: "PHP", "symbol-alt-narrow": "₱" }, PKR: { displayName: "Pakistani Rupee", "displayName-count-one": "Pakistani rupee", "displayName-count-other": "Pakistani rupees", symbol: "PKR", "symbol-alt-narrow": "Rs" }, PLN: { displayName: "Polish Zloty", "displayName-count-one": "Polish zloty", "displayName-count-other": "Polish zlotys", symbol: "PLN", "symbol-alt-narrow": "zł" }, PLZ: { displayName: "Polish Zloty (1950–1995)", "displayName-count-one": "Polish zloty (PLZ)", "displayName-count-other": "Polish zlotys (PLZ)", symbol: "PLZ" }, PTE: { displayName: "Portuguese Escudo", "displayName-count-one": "Portuguese escudo", "displayName-count-other": "Portuguese escudos", symbol: "PTE" }, PYG: { displayName: "Paraguayan Guarani", "displayName-count-one": "Paraguayan guarani", "displayName-count-other": "Paraguayan guaranis", symbol: "PYG", "symbol-alt-narrow": "₲" }, QAR: { displayName: "Qatari Rial", "displayName-count-one": "Qatari rial", "displayName-count-other": "Qatari rials", symbol: "QAR" }, RHD: { displayName: "Rhodesian Dollar", "displayName-count-one": "Rhodesian dollar", "displayName-count-other": "Rhodesian dollars", symbol: "RHD" }, ROL: { displayName: "Romanian Leu (1952–2006)", "displayName-count-one": "Romanian leu (1952–2006)", "displayName-count-other": "Romanian Lei (1952–2006)", symbol: "ROL" }, RON: { displayName: "Romanian Leu", "displayName-count-one": "Romanian leu", "displayName-count-other": "Romanian lei", symbol: "RON", "symbol-alt-narrow": "lei" }, RSD: { displayName: "Serbian Dinar", "displayName-count-one": "Serbian dinar", "displayName-count-other": "Serbian dinars", symbol: "RSD" }, RUB: { displayName: "Russian Rouble", "displayName-count-one": "Russian rouble", "displayName-count-other": "Russian roubles", symbol: "RUB", "symbol-alt-narrow": "₽" }, RUR: { displayName: "Russian Rouble (1991–1998)", "displayName-count-one": "Russian rouble (1991–1998)", "displayName-count-other": "Russian roubles (1991–1998)", symbol: "RUR", "symbol-alt-narrow": "р." }, RWF: { displayName: "Rwandan Franc", "displayName-count-one": "Rwandan franc", "displayName-count-other": "Rwandan francs", symbol: "RWF", "symbol-alt-narrow": "RF" }, SAR: { displayName: "Saudi Riyal", "displayName-count-one": "Saudi riyal", "displayName-count-other": "Saudi riyals", symbol: "SAR" }, SBD: { displayName: "Solomon Islands Dollar", "displayName-count-one": "Solomon Islands dollar", "displayName-count-other": "Solomon Islands dollars", symbol: "SBD", "symbol-alt-narrow": "$" }, SCR: { displayName: "Seychellois Rupee", "displayName-count-one": "Seychellois rupee", "displayName-count-other": "Seychellois rupees", symbol: "SCR" }, SDD: { displayName: "Sudanese Dinar (1992–2007)", "displayName-count-one": "Sudanese dinar (1992–2007)", "displayName-count-other": "Sudanese dinars (1992–2007)", symbol: "SDD" }, SDG: { displayName: "Sudanese Pound", "displayName-count-one": "Sudanese pound", "displayName-count-other": "Sudanese pounds", symbol: "SDG" }, SDP: { displayName: "Sudanese Pound (1957–1998)", "displayName-count-one": "Sudanese pound (1957–1998)", "displayName-count-other": "Sudanese pounds (1957–1998)", symbol: "SDP" }, SEK: { displayName: "Swedish Krona", "displayName-count-one": "Swedish krona", "displayName-count-other": "Swedish kronor", symbol: "SEK", "symbol-alt-narrow": "kr" }, SGD: { displayName: "Singapore Dollar", "displayName-count-one": "Singapore dollar", "displayName-count-other": "Singapore dollars", symbol: "SGD", "symbol-alt-narrow": "$" }, SHP: { displayName: "St Helena Pound", "displayName-count-one": "St Helena pound", "displayName-count-other": "St Helena pounds", symbol: "SHP", "symbol-alt-narrow": "£" }, SIT: { displayName: "Slovenian Tolar", "displayName-count-one": "Slovenian tolar", "displayName-count-other": "Slovenian tolars", symbol: "SIT" }, SKK: { displayName: "Slovak Koruna", "displayName-count-one": "Slovak koruna", "displayName-count-other": "Slovak korunas", symbol: "SKK" }, SLL: { displayName: "Sierra Leonean Leone", "displayName-count-one": "Sierra Leonean leone", "displayName-count-other": "Sierra Leonean leones", symbol: "SLL" }, SOS: { displayName: "Somali Shilling", "displayName-count-one": "Somali shilling", "displayName-count-other": "Somali shillings", symbol: "SOS" }, SRD: { displayName: "Surinamese Dollar", "displayName-count-one": "Surinamese dollar", "displayName-count-other": "Surinamese dollars", symbol: "SRD", "symbol-alt-narrow": "$" }, SRG: { displayName: "Surinamese Guilder", "displayName-count-one": "Surinamese guilder", "displayName-count-other": "Surinamese guilders", symbol: "SRG" }, SSP: { displayName: "South Sudanese Pound", "displayName-count-one": "South Sudanese pound", "displayName-count-other": "South Sudanese pounds", symbol: "SSP", "symbol-alt-narrow": "£" }, STD: { displayName: "São Tomé & Príncipe Dobra (1977–2017)", "displayName-count-one": "São Tomé & Príncipe dobra (1977–2017)", "displayName-count-other": "São Tomé & Príncipe dobras (1977–2017)", symbol: "STD" }, STN: { displayName: "São Tomé & Príncipe Dobra", "displayName-count-one": "São Tomé & Príncipe dobra", "displayName-count-other": "São Tomé & Príncipe dobras", symbol: "STN", "symbol-alt-narrow": "Db" }, SUR: { displayName: "Soviet Rouble", "displayName-count-one": "Soviet rouble", "displayName-count-other": "Soviet roubles", symbol: "SUR" }, SVC: { displayName: "Salvadoran Colón", "displayName-count-one": "Salvadoran colón", "displayName-count-other": "Salvadoran colones", symbol: "SVC" }, SYP: { displayName: "Syrian Pound", "displayName-count-one": "Syrian pound", "displayName-count-other": "Syrian pounds", symbol: "SYP", "symbol-alt-narrow": "£" }, SZL: { displayName: "Swazi Lilangeni", "displayName-count-one": "Swazi lilangeni", "displayName-count-other": "Swazi emalangeni", symbol: "SZL" }, THB: { displayName: "Thai Baht", "displayName-count-one": "Thai baht", "displayName-count-other": "Thai baht", symbol: "THB", "symbol-alt-narrow": "฿" }, TJR: { displayName: "Tajikistani Rouble", "displayName-count-one": "Tajikistani rouble", "displayName-count-other": "Tajikistani roubles", symbol: "TJR" }, TJS: { displayName: "Tajikistani Somoni", "displayName-count-one": "Tajikistani somoni", "displayName-count-other": "Tajikistani somonis", symbol: "TJS" }, TMM: { displayName: "Turkmenistani Manat (1993–2009)", "displayName-count-one": "Turkmenistani manat (1993–2009)", "displayName-count-other": "Turkmenistani manat (1993–2009)", symbol: "TMM" }, TMT: { displayName: "Turkmenistani Manat", "displayName-count-one": "Turkmenistani manat", "displayName-count-other": "Turkmenistani manat", symbol: "TMT" }, TND: { displayName: "Tunisian Dinar", "displayName-count-one": "Tunisian dinar", "displayName-count-other": "Tunisian dinars", symbol: "TND" }, TOP: { displayName: "Tongan Paʻanga", "displayName-count-one": "Tongan paʻanga", "displayName-count-other": "Tongan paʻanga", symbol: "TOP", "symbol-alt-narrow": "T$" }, TPE: { displayName: "Timorese Escudo", "displayName-count-one": "Timorese escudo", "displayName-count-other": "Timorese escudos", symbol: "TPE" }, TRL: { displayName: "Turkish Lira (1922–2005)", "displayName-count-one": "Turkish lira (1922–2005)", "displayName-count-other": "Turkish Lira (1922–2005)", symbol: "TRL" }, TRY: { displayName: "Turkish Lira", "displayName-count-one": "Turkish lira", "displayName-count-other": "Turkish Lira", symbol: "TRY", "symbol-alt-narrow": "₺", "symbol-alt-variant": "TL" }, TTD: { displayName: "Trinidad & Tobago Dollar", "displayName-count-one": "Trinidad & Tobago dollar", "displayName-count-other": "Trinidad & Tobago dollars", symbol: "TTD", "symbol-alt-narrow": "$" }, TWD: { displayName: "New Taiwan Dollar", "displayName-count-one": "New Taiwan dollar", "displayName-count-other": "New Taiwan dollars", symbol: "NT$", "symbol-alt-narrow": "$" }, TZS: { displayName: "Tanzanian Shilling", "displayName-count-one": "Tanzanian shilling", "displayName-count-other": "Tanzanian shillings", symbol: "TZS" }, UAH: { displayName: "Ukrainian Hryvnia", "displayName-count-one": "Ukrainian hryvnia", "displayName-count-other": "Ukrainian hryvnias", symbol: "UAH", "symbol-alt-narrow": "₴" }, UAK: { displayName: "Ukrainian Karbovanets", "displayName-count-one": "Ukrainian karbovanets", "displayName-count-other": "Ukrainian karbovantsiv", symbol: "UAK" }, UGS: { displayName: "Ugandan Shilling (1966–1987)", "displayName-count-one": "Ugandan shilling (1966–1987)", "displayName-count-other": "Ugandan shillings (1966–1987)", symbol: "UGS" }, UGX: { displayName: "Ugandan Shilling", "displayName-count-one": "Ugandan shilling", "displayName-count-other": "Ugandan shillings", symbol: "UGX" }, USD: { displayName: "US Dollar", "displayName-count-one": "US dollar", "displayName-count-other": "US dollars", symbol: "US$", "symbol-alt-narrow": "$" }, USN: { displayName: "US Dollar (Next day)", "displayName-count-one": "US dollar (next day)", "displayName-count-other": "US dollars (next day)", symbol: "USN" }, USS: { displayName: "US Dollar (Same day)", "displayName-count-one": "US dollar (same day)", "displayName-count-other": "US dollars (same day)", symbol: "USS" }, UYI: { displayName: "Uruguayan Peso (Indexed Units)", "displayName-count-one": "Uruguayan peso (indexed units)", "displayName-count-other": "Uruguayan pesos (indexed units)", symbol: "UYI" }, UYP: { displayName: "Uruguayan Peso (1975–1993)", "displayName-count-one": "Uruguayan peso (1975–1993)", "displayName-count-other": "Uruguayan pesos (1975–1993)", symbol: "UYP" }, UYU: { displayName: "Uruguayan Peso", "displayName-count-one": "Uruguayan peso", "displayName-count-other": "Uruguayan pesos", symbol: "UYU", "symbol-alt-narrow": "$" }, UYW: { displayName: "Uruguayan Nominal Wage Index Unit", "displayName-count-one": "Uruguayan nominal wage index unit", "displayName-count-other": "Uruguayan nominal wage index units", symbol: "UYW" }, UZS: { displayName: "Uzbekistani Som", "displayName-count-one": "Uzbekistani som", "displayName-count-other": "Uzbekistani som", symbol: "UZS" }, VEB: { displayName: "Venezuelan Bolívar (1871–2008)", "displayName-count-one": "Venezuelan bolívar (1871–2008)", "displayName-count-other": "Venezuelan bolívars (1871–2008)", symbol: "VEB" }, VEF: { displayName: "Venezuelan Bolívar (2008–2018)", "displayName-count-one": "Venezuelan bolívar (2008–2018)", "displayName-count-other": "Venezuelan bolívars (2008–2018)", symbol: "VEF", "symbol-alt-narrow": "Bs" }, VES: { displayName: "Venezuelan Bolívar", "displayName-count-one": "Venezuelan bolívar", "displayName-count-other": "Venezuelan bolívars", symbol: "VES" }, VND: { displayName: "Vietnamese Dong", "displayName-count-one": "Vietnamese dong", "displayName-count-other": "Vietnamese dong", symbol: "₫", "symbol-alt-narrow": "₫" }, VNN: { displayName: "Vietnamese Dong (1978–1985)", "displayName-count-one": "Vietnamese dong (1978–1985)", "displayName-count-other": "Vietnamese dong (1978–1985)", symbol: "VNN" }, VUV: { displayName: "Vanuatu Vatu", "displayName-count-one": "Vanuatu vatu", "displayName-count-other": "Vanuatu vatus", symbol: "VUV" }, WST: { displayName: "Samoan Tala", "displayName-count-one": "Samoan tala", "displayName-count-other": "Samoan tala", symbol: "WST" }, XAF: { displayName: "Central African CFA Franc", "displayName-count-one": "Central African CFA franc", "displayName-count-other": "Central African CFA francs", symbol: "FCFA" }, XAG: { displayName: "Silver", "displayName-count-one": "troy ounce of silver", "displayName-count-other": "troy ounces of silver", symbol: "XAG" }, XAU: { displayName: "Gold", "displayName-count-one": "troy ounce of gold", "displayName-count-other": "troy ounces of gold", symbol: "XAU" }, XBA: { displayName: "European Composite Unit", "displayName-count-one": "European composite unit", "displayName-count-other": "European composite units", symbol: "XBA" }, XBB: { displayName: "European Monetary Unit", "displayName-count-one": "European monetary unit", "displayName-count-other": "European monetary units", symbol: "XBB" }, XBC: { displayName: "European Unit of Account (XBC)", "displayName-count-one": "European unit of account (XBC)", "displayName-count-other": "European units of account (XBC)", symbol: "XBC" }, XBD: { displayName: "European Unit of Account (XBD)", "displayName-count-one": "European unit of account (XBD)", "displayName-count-other": "European units of account (XBD)", symbol: "XBD" }, XCD: { displayName: "East Caribbean Dollar", "displayName-count-one": "East Caribbean dollar", "displayName-count-other": "East Caribbean dollars", symbol: "EC$", "symbol-alt-narrow": "$" }, XDR: { displayName: "Special Drawing Rights", "displayName-count-one": "special drawing rights", "displayName-count-other": "special drawing rights", symbol: "XDR" }, XEU: { displayName: "European Currency Unit", "displayName-count-one": "European currency unit", "displayName-count-other": "European currency units", symbol: "XEU" }, XFO: { displayName: "French Gold Franc", "displayName-count-one": "French gold franc", "displayName-count-other": "French gold francs", symbol: "XFO" }, XFU: { displayName: "French UIC-Franc", "displayName-count-one": "French UIC-franc", "displayName-count-other": "French UIC-francs", symbol: "XFU" }, XOF: { displayName: "West African CFA Franc", "displayName-count-one": "West African CFA franc", "displayName-count-other": "West African CFA francs", symbol: "CFA" }, XPD: { displayName: "Palladium", "displayName-count-one": "troy ounce of palladium", "displayName-count-other": "troy ounces of palladium", symbol: "XPD" }, XPF: { displayName: "CFP Franc", "displayName-count-one": "CFP franc", "displayName-count-other": "CFP francs", symbol: "CFPF" }, XPT: { displayName: "Platinum", "displayName-count-one": "troy ounce of platinum", "displayName-count-other": "troy ounces of platinum", symbol: "XPT" }, XRE: { displayName: "RINET Funds", "displayName-count-one": "RINET Funds unit", "displayName-count-other": "RINET Funds units", symbol: "XRE" }, XSU: { displayName: "Sucre", "displayName-count-one": "Sucre", "displayName-count-other": "Sucres", symbol: "XSU" }, XTS: { displayName: "Testing Currency Code", "displayName-count-one": "Testing Currency unit", "displayName-count-other": "Testing Currency units", symbol: "XTS" }, XUA: { displayName: "ADB Unit of Account", "displayName-count-one": "ADB unit of account", "displayName-count-other": "ADB units of account", symbol: "XUA" }, XXX: { displayName: "Unknown Currency", "displayName-count-one": "(unknown unit of currency)", "displayName-count-other": "(unknown currency)", symbol: "¤" }, YDD: { displayName: "Yemeni Dinar", "displayName-count-one": "Yemeni dinar", "displayName-count-other": "Yemeni dinars", symbol: "YDD" }, YER: { displayName: "Yemeni Rial", "displayName-count-one": "Yemeni rial", "displayName-count-other": "Yemeni rials", symbol: "YER" }, YUD: { displayName: "Yugoslavian Hard Dinar (1966–1990)", "displayName-count-one": "Yugoslavian hard dinar (1966–1990)", "displayName-count-other": "Yugoslavian hard dinars (1966–1990)", symbol: "YUD" }, YUM: { displayName: "Yugoslavian New Dinar (1994–2002)", "displayName-count-one": "Yugoslavian new dinar (1994–2002)", "displayName-count-other": "Yugoslavian new dinars (1994–2002)", symbol: "YUM" }, YUN: { displayName: "Yugoslavian Convertible Dinar (1990–1992)", "displayName-count-one": "Yugoslavian convertible dinar (1990–1992)", "displayName-count-other": "Yugoslavian convertible dinars (1990–1992)", symbol: "YUN" }, YUR: { displayName: "Yugoslavian Reformed Dinar (1992–1993)", "displayName-count-one": "Yugoslavian reformed dinar (1992–1993)", "displayName-count-other": "Yugoslavian reformed dinars (1992–1993)", symbol: "YUR" }, ZAL: { displayName: "South African Rand (financial)", "displayName-count-one": "South African rand (financial)", "displayName-count-other": "South African rands (financial)", symbol: "ZAL" }, ZAR: { displayName: "South African Rand", "displayName-count-one": "South African rand", "displayName-count-other": "South African rand", symbol: "ZAR", "symbol-alt-narrow": "R" }, ZMK: { displayName: "Zambian Kwacha (1968–2012)", "displayName-count-one": "Zambian kwacha (1968–2012)", "displayName-count-other": "Zambian kwachas (1968–2012)", symbol: "ZMK" }, ZMW: { displayName: "Zambian Kwacha", "displayName-count-one": "Zambian kwacha", "displayName-count-other": "Zambian kwachas", symbol: "ZMW", "symbol-alt-narrow": "ZK" }, ZRN: { displayName: "Zairean New Zaire (1993–1998)", "displayName-count-one": "Zairean new zaire (1993–1998)", "displayName-count-other": "Zairean new zaires (1993–1998)", symbol: "ZRN" }, ZRZ: { displayName: "Zairean Zaire (1971–1993)", "displayName-count-one": "Zairean zaire (1971–1993)", "displayName-count-other": "Zairean zaires (1971–1993)", symbol: "ZRZ" }, ZWD: { displayName: "Zimbabwean Dollar (1980–2008)", "displayName-count-one": "Zimbabwean dollar (1980–2008)", "displayName-count-other": "Zimbabwean dollars (1980–2008)", symbol: "ZWD" }, ZWL: { displayName: "Zimbabwean Dollar (2009)", "displayName-count-one": "Zimbabwean dollar (2009)", "displayName-count-other": "Zimbabwean dollars (2009)", symbol: "ZWL" }, ZWR: { displayName: "Zimbabwean Dollar (2008)", "displayName-count-one": "Zimbabwean dollar (2008)", "displayName-count-other": "Zimbabwean dollars (2008)", symbol: "ZWR" } }, localeCurrency: "CHF" } }; export default data;
module.exports = { clone: clone }; /** * A simple clone function that also allows you to pass an "extend" object whose properties will be * added to the cloned copy of the original object passed. */ function clone(object, extend) { const cloned = {}; for (var key in object) { cloned[key] = object[key]; } for (var key in extend) { cloned[key] = extend[key]; } return cloned; }
const {Schema, Types} = require('mongoose'); const moment = require('moment'); const reactionSchema = new Schema ( { reactionBody: { type: String, required: true, trim: true, maxlength: 280 }, username: { type: String, required: true, }, createdAt: { type: Date, default: Date.now, get: createdAtVal => moment(createdAtVal).format('MMM DD, YYYY [at] hh:mm a') }, reactionId: { type: Schema.Types.ObjectId, default: () => new Types.ObjectId() } } ) module.exports = reactionSchema;
/** * https://leetcode.com/problems/out-of-boundary-paths/ * @param {number} m * @param {number} n * @param {number} maxMove * @param {number} startRow * @param {number} startColumn * @return {number} */ var findPaths = function(m, n, maxMove, startRow, startColumn) { dp = Array(m + 1).fill().map(() => Array(n + 1).fill().map(() => Array(maxMove + 1).fill())) return solve(m, n, maxMove, startRow, startColumn) }; let dp const solve = (m, n, maxMove, startRow, startColumn) => { if (maxMove < 0) { return 0 } if (startRow === m || startColumn === n || startRow === -1 || startColumn === -1) { return 1 } if (dp[startRow][startColumn][maxMove] !== undefined) { return dp[startRow][startColumn][maxMove] } const left = solve(m, n, maxMove - 1, startRow + 1, startColumn) const right = solve(m, n, maxMove - 1, startRow - 1, startColumn) const top = solve(m, n, maxMove - 1, startRow, startColumn - 1) const bottom = solve(m, n, maxMove - 1, startRow, startColumn + 1) const total = (left + right + top + bottom) % 1000000007 dp[startRow][startColumn][maxMove] = total return dp[startRow][startColumn][maxMove] }
#!/usr/bin/env node /* * Web API for creating and combining SSS shares * * Author: Daan Sprenkels <hello@dsprenkels.com> * * This module contains a proof of concept UI for splitting secrets and * restoring them afterwards. The respresention of the shares is plain hex. * * WARNING! **This code will leak the message length by timing oracle!** * The code in this module is not intended to be side-channel resistant, so do * not just use it if this is a requirement for you. * * Have a nice day. :) */ "use strict"; const bodyParser = require('body-parser'); const cors = require('cors') const app = require('express')(); const morgan = require('morgan'); const sss = require('shamirsecretsharing'); function pad(dataBuf) { // Start padding with 0x80 character dataBuf = Buffer.concat([dataBuf, new Buffer([0x80])]); while (dataBuf.length < 64) { // Add zeros to padding dataBuf = Buffer.concat([dataBuf, new Buffer([0])]); } return dataBuf; } function removeDuplicates(shares) { if (!shares) return shares; shares.sort(); let i = 1; while (i < shares.length) { if (shares[i].equals(shares[i-1])) { shares.splice(i, 1); } else { i++; } } return shares; } function unpad(dataBuf) { while (dataBuf[dataBuf.length-1] != 0x80) { dataBuf = dataBuf.slice(0, -1); } dataBuf = dataBuf.slice(0, -1); return dataBuf; } // Setup logging app.use(morgan('short')) // Setup body-parser app.use(bodyParser.urlencoded({ extended: true })); // Allow cross-origin requests app.use(cors()); // -- REQUEST HANDLERS -- app.get('/', (req, res) => { res.sendFile(__dirname + '/index.html'); }); app.get('/help', (req, res) => { res.set('Content-Type', 'text/plain'); res.send('Use `POST /split` with data `data=[Text]&count=[Int]&threshold=[Int]` or ' + '`POST /combine` with data `share=[Share]&share=[Share]&...`'); }); app.post('/split', (req, res) => { res.set('Content-Type', 'text/plain'); if (!req.body.data) { res.status(400); res.send("No `data` field supplied"); return; } if (!req.body.count) { res.status(400); res.send("No `count` field supplied"); return; } if (!req.body.threshold) { res.status(400); res.send("No `threshold` field supplied"); return; } // Pad the input data (exposes timing oracle) let dataBuf = new Buffer.from(req.body.data, 'utf8'); if (dataBuf.length > 63) { res.send("Error: text too long (max 63 bytes)"); } dataBuf = pad(dataBuf); let count = parseInt(req.body.count); let threshold = parseInt(req.body.threshold); console.log(1); sss.createShares(dataBuf, count, threshold) .then((shares) => { console.log("1/2"); let lines = [] for (let i = 0; i < shares.length; i++) { lines.push(shares[i].toString("hex")); } res.send(lines.join("\n")); res.end(); }).catch((e) => { console.log("2/2"); res.send(e.message); res.end(); return; }); }); app.post('/combine', (req, res) => { res.set('Content-Type', 'text/plain'); let shares = req.body.share; let shareBufs = []; for (let i = 0; i < shares.length; i++) { let share = shares[i]; try { shareBufs.push(new Buffer(share, "hex")); } catch (e) { res.send(e.message + ": " + share); return; } } let p = sss.combineShares(removeDuplicates(shareBufs)); p.then((dataBuf) => { dataBuf = unpad(dataBuf); res.send(dataBuf.toString('utf8')); }).catch((err) => { res.send(err.toString()); }); }); app.listen(3000, function () { console.log('SSS web-ui listening on port 3000.') })
(function () { $.typeahead({ input: '.weather-station-search', minLength: 0, maxItem: 15, order: "asc", hint: true, accent: true, searchOnFocus: true, backdrop: { "background-color": "#3879d9", "opacity": "0.1", "filter": "alpha(opacity=10)" }, display: ["weather_point_name"], source: { users: { ajax: { url: '/data/weather_stations', data: 'response' } } }, emptyTemplate: "no result found", callback: { onEnter: function (node, query, result, resultCount, resultCountPerGroup) { $('#selected-single-latitude').attr('value', result.latitude); $('#selected-single-longitude').attr('value', result.longitude); $('#weather_point_id').attr('value', result.weather_point_id); $('#selected_data').show(); $('#selected_point_name').html(result.weather_point_name); $('#selected_lat').html(result.latitude); $('#selected_long').html(result.longitude); $('#closecancel').attr('value', 'Cancel').removeClass("btn-default").addClass("btn-danger").on('click', function () { }); $('#donesave').attr('value', 'Done').removeClass("btn-primary").addClass("btn-success").on('click', function () { $('.modal').on('hidden.bs.modal', function () { $(this).find('form')[0].reset(); // Display the selected locations in the form $('#selected-location-wrapper').removeClass('hide'); $('#selected-location-wrapper .single').removeClass('hide'); if (!$('.selected-weather-station').hasClass('hide')) $('.selected-weather-station').removeClass('hide'); $('#selected-location-wrapper .selected-latitude').text($("#selected-single-latitude").val()); $('#selected-location-wrapper .selected-longitude').text($("#selected-single-longitude").val()); $('#selected-location-wrapper .weather_point').text($("#weather_point_id").val()); if (!$('#selected-location-wrapper .multiple').hasClass('hide')) { $('#selected-location-wrapper .multiple').addClass('hide') } }); }); } }, debug: true }) })(); (function () { $.typeahead({ input: '.school-search', minLength: 0, maxItem: 15, order: "asc", hint: true, accent: true, searchOnFocus: true, backdrop: { "background-color": "#3879d9", "opacity": "0.1", "filter": "alpha(opacity=10)" }, display: ["weather_point_name"], source: { users: { ajax: { url: '/data/schools', data: 'response' } } }, emptyTemplate: "No result found", callback: { onEnter: function (node, query, result, resultCount, resultCountPerGroup) { $('#selected-single-latitude').attr('value', result.latitude); $('#selected-single-longitude').attr('value', result.longitude); $('#weather_point_id').attr('value', result.weather_point_id); $('#school_selected_data').show(); $('#school_selected_point_name').html(result.weather_point_name); $('#school_selected_lat').html(result.latitude); $('#school_selected_long').html(result.longitude); $('#closecancel2').attr('value', 'Cancel').removeClass("btn-default").addClass("btn-danger").on('click', function () { }); $('#donesave2').attr('value', 'Done').removeClass("btn-primary").addClass("btn-success").on('click', function () { $('.modal').on('hidden.bs.modal', function () { $(this).find('form')[0].reset(); // Display the selected locations in the form $('#selected-location-wrapper').removeClass('hide'); $('#selected-location-wrapper .single').removeClass('hide'); if (!$('.selected-weather-station').hasClass('hide')) $('.selected-weather-station').removeClass('hide'); $('#selected-location-wrapper .selected-latitude').text($("#selected-single-latitude").val()); $('#selected-location-wrapper .selected-longitude').text($("#selected-single-longitude").val()); $('#selected-location-wrapper .weather_point').text($("#weather_point_id").val()); if (!$('#selected-location-wrapper .multiple').hasClass('hide')) { $('#selected-location-wrapper .multiple').addClass('hide') } }); }); } }, debug: true, }) })()
import Navbar from './Navbar'; import Home from './Home'; import { BrowserRouter as Router, Route, Switch} from 'react-router-dom' import Create from './Create'; import BlogDetails from './BlogDetails'; import NotFound from './NotFound'; function App() { return ( <Router> <div className="App"> <Navbar /> <div className="content"> <Switch> <Route exact path="/"> <Home /> </Route> <Route path="/create"> <Create /> </Route> <Route path="/blogs/:id"> <BlogDetails /> </Route> <Route path="*"> <NotFound /> </Route> </Switch> </div> </div> </Router> ); } export default App;
(/* istanbul ignore next */ function (global, factory) { if (typeof define === "function" && define.amd) { define(['module', 'exports', '../util/context-to-element', '../get/shadow-host'], factory); } else if (typeof exports !== "undefined") { factory(module, exports, require('../util/context-to-element'), require('../get/shadow-host')); } else { var mod = { exports: {} }; factory(mod, mod.exports, global.contextToElement, global.shadowHost); global.shadowed = mod.exports; } })(this, function (module, exports, _contextToElement, _shadowHost) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = function (context) { var element = (0, _contextToElement2.default)({ label: 'is/shadowed', resolveDocument: true, context: context }); return Boolean((0, _shadowHost2.default)({ context: element })); }; var _contextToElement2 = _interopRequireDefault(_contextToElement); var _shadowHost2 = _interopRequireDefault(_shadowHost); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } module.exports = exports['default']; }); //# sourceMappingURL=shadowed.js.map
import * as action from './index' describe('login action test', () => { it('should log user in', () => { const user = { email: 'email@email.com', password: 'test123' } const expectedAction = { user: { email: 'email@email.com', password: 'test123' }, type: 'LOGIN' } expect(action.login(user)).toEqual(expectedAction) }) }) describe('logout action test', () => { it('should log user out', () => { const user = { email: 'email@email.com', password: 'test123' } const expectedAction = { type: 'LOGOUT' } expect(action.logout(user)).toEqual(expectedAction) }) }) describe('addGear action test', () => { it('should let the user addGear', () => { const testOwner = { email: 'email@email.com', password: 'test123' } const gear = { name: 'rope', activity: 'climbing', price: '10', owner: testOwner } const expectedAction = { gear: { name: 'rope', activity: 'climbing', price: '10', owner: { email: 'email@email.com', password: 'test123' } }, type: 'ADD_GEAR' } expect(action.addGear(gear)).toEqual(expectedAction) }) }) describe('getAllGear action test', () => { it('should return storedGear', () => { const testOwner = { email: 'email@email.com', password: 'test123' } const storedGear = [ { name: 'rope', activity: 'climbing', price: '10', owner: testOwner }, { name: 'harness', activity: 'climbing', price: '10', owner: testOwner }, { name: 'shoes', activity: 'climbing', price: '10', owner: testOwner } ] const expectedAction = { storedGear: [ { name: 'rope', activity: 'climbing', price: '10', owner: testOwner }, { name: 'harness', activity: 'climbing', price: '10', owner: testOwner }, { name: 'shoes', activity: 'climbing', price: '10', owner: testOwner } ], type: 'GET_GEAR' } expect(action.getAllGear(storedGear)).toEqual(expectedAction) }) })
'use strict'; /** * Development environment settings * * This file can include shared settings for a development team, * such as API keys or remote database passwords. If you're using * a version control solution for your Sails app, this file will * be committed to your repository unless you add it to your .gitignore * file. If your repository will be publicly viewable, don't add * any private information to this file! * */ var fs = require('fs'); module.exports = { hookTimeout: process.env.KONGA_HOOK_TIMEOUT || 60000, port: process.env.PORT || 1337, explicitHost: process.env.HOST || "0.0.0.0", // kong_admin_url: process.env.KONG_ADMIN_URL || 'http://127.0.0.1:8001', ssl: { key: process.env.SSL_KEY_PATH ? fs.readFileSync(process.env.SSL_KEY_PATH) : null, cert: process.env.SSL_CRT_PATH ? fs.readFileSync(process.env.SSL_CRT_PATH) : null }, log: { level: process.env.KONGA_LOG_LEVEL || "debug" } };
import axios from 'axios'; exports.get = function(courseID) { return axios.get('/api/compare', { params: { id: courseID, }, }); };
// (C) 2009 Alon 'Kripken' Zakai Library.include('library/1_3/'); Library.include('library/' + Global.LIBRARY_VERSION + '/__CorePatches'); Library.include('library/' + Global.LIBRARY_VERSION + '/Plugins'); Library.include('library/' + Global.LIBRARY_VERSION + '/Firing'); Library.include('library/' + Global.LIBRARY_VERSION + '/Health'); Library.include('library/' + Global.LIBRARY_VERSION + '/GameManager'); Library.include('library/' + Global.LIBRARY_VERSION + '/modes/Teamwork'); Library.include('library/' + Global.LIBRARY_VERSION + '/World'); Library.include('library/' + Global.LIBRARY_VERSION + '/CutScenes'); Library.include('library/' + Global.LIBRARY_VERSION + '/Chat'); Library.include('library/' + Global.LIBRARY_VERSION + '/Swarm'); Library.include('library/' + Global.LIBRARY_VERSION + '/CustomEffect'); Library.include('library/' + Global.LIBRARY_VERSION + '/guns/Rocket'); Library.include('library/' + Global.LIBRARY_VERSION + '/guns/Chaingun'); Library.include('library/' + Global.LIBRARY_VERSION + '/guns/Insta'); Library.include('library/' + Global.LIBRARY_VERSION + '/mapelements/FlickeringLights'); Library.include('library/' + Global.LIBRARY_VERSION + '/mapelements/Cannons'); Library.include('library/' + Global.LIBRARY_VERSION + '/mapelements/PlotTriggers'); Library.include('library/' + Global.LIBRARY_VERSION + '/mapelements/Pickups'); //Library.include('library/' + Global.LIBRARY_VERSION + '/Octree'); // Default materials, etc. Library.include('library/' + Global.LIBRARY_VERSION + '/MapDefaults'); // Textures Library.include('textures/gk/swarm/'); // Map settings Map.fogColor(45, 30, 10); Map.fog(1500); Map.loadSky("skyboxes/gk2/swarm/nnu_sb01"); Map.skylight(0, 0, 0); Map.ambient(1); Map.shadowmapAmbient("0x101010"); Map.shadowmapAngle(300); //// Cannons SwarmRocketCannonPlugin = { init: function() { this.autoTargetSearchRadius = 465; }, activate: function() { this.autoTargetParams = { rotateSpeed: 60, minPitch: -45, maxPitch: 45, eyeHeight: 7, // Where we shoot from /* effectiveSearchRadius: function(actor, target, distance) { var direction = target.position.subNew(actor.position).toYawPitch(); var yawDiff = Math.abs( normalizeAngle(direction.yaw, actor.autoTargetYaw) - actor.autoTargetYaw ); var pitchDiff = Math.abs( normalizeAngle(direction.pitch, actor.autoTargetPitch) - actor.autoTargetPitch ); if (yawDiff + pitchDiff > 45) return 500; return distance; }, */ seekDelay: 3.0, // How often to search for an entity to target fullSyncRate: 1.0/5, interpolateRate: 1/30, }; this.botFiringParams = { firingDelay: 3, triggerFingerDelay: 0.33, }; }, }; makeCannon('RocketCannon', RocketGun.extend({ projectileClass: Rocket.extend({ explosionPower: 25, speed: 150, accuracy: 0.5, timeLeft: 8.0, gravityFactor: 0 }) }), [Projectiles.plugin, SwarmRocketCannonPlugin]); makeCannon('UpsidedownRocketCannon', RocketGun.extend({ projectileClass: Rocket.extend({ explosionPower: 25, speed: 150, accuracy: 0.5, timeLeft: 8.0, gravityFactor: 0 }) }), [Projectiles.plugin, UpsidedownCannonPlugin, SwarmRocketCannonPlugin]); SwarmInstaCannonPlugin = { init: function() { this.autoTargetSearchRadius = 150; }, activate: function() { this.autoTargetParams = { rotateSpeed: 60, minPitch: -45, maxPitch: 45, eyeHeight: 7, // Where we shoot from seekDelay: 3.0, // How often to search for an entity to target fullSyncRate: 1.0/5, interpolateRate: 1/30, }; }, }; makeCannon('InstaCannon', InstaGun.extend({ damage: 25 }), [SwarmInstaCannonPlugin]); makeCannon('UpsidedownInstaCannon', InstaGun.extend({ damage: 25 }), [UpsidedownCannonPlugin, SwarmInstaCannonPlugin]); makeCannon('UpsidedownCannon', InstaGun.extend({ damage: 25 }), [UpsidedownCannonPlugin, SwarmInstaCannonPlugin]); //// Player class PowerfulRocket = Rocket.extend({ explosionPower: 66.0, gravityFactor: 0.0, }); PowerfulRocketGun = RocketGun.extend({ projectileClass: PowerfulRocket, }); playerChaingun = Firing.registerGun(new Chaingun(), 'Chaingun'); playerRocketLauncher = Firing.registerGun(new PowerfulRocketGun(), 'Rocket Launcher'); registerEntityClass( bakePlugins( Player, [ Firing.plugins.protocol, Firing.plugins.player, Health.plugin, GameManager.playerPlugin, Chat.playerPlugin, Projectiles.plugin, Chaingun.plugin, Character.plugins.effectiveCameraHeight, Character.plugins.footsteps, { _class: "GamePlayer", HUDModelOffset: new Vector3(0, 0, 1.5), // Adjust for higher eyeheight&aboveeye with 115% model init: function() { this.modelName = ''; // Start invisible, until spawned this.canMove = false; // Start immobile, until spawned this.gunIndexes = [playerChaingun, playerRocketLauncher]; this.currGunIndex = playerChaingun; this.maxHealth = 100; // 115% size model this.eyeHeight = 15.35; this.aboveEye = 1.15; this.radius = 3.5; this.position = [1631.93, 299.10, 416.05]; this.yaw = 200.81; this.pitch = -15.27; }, activate: function() { this.movementSpeed = 75; }, deactivate: function() { // After 1 player logs in, restart map after last player logs out - so fresh for new players TODO: This functionality in a plugin // 1 means just us - as we are in the process of deactivating; we aren't removed from the store yet if (getClientEntities().length === 1) { GameManager.getSingleton().eventManager.add({ secondsBefore: 0.25, // After this client is safely out func: function() { CAPI.signalComponent('MapControl', 'restart'); }, }); } }, getColor: function() { return this.HUDModelName.split('/').pop(); }, clientActivate: function() { this.gunAmmos[playerChaingun] = null; this.gunAmmos[playerRocketLauncher] = 10; this.maxMovementSpeed = 75; // Sync! this.bigCavernSlowness = 0; }, // Big cavern clientAct: function(seconds) { var position = this.position.copy(); if (1542 <= position.x && position.x <= 2688 && 716 <= position.y && position.y <= 1179 && 500 <= position.z && position.z <= 550) { if (position.z >= 511.8) { this.bigCavernSlowness = Math.max(0, this.bigCavernSlowness - seconds); } else { this.bigCavernSlowness = 1.0; } var speed = (1-this.bigCavernSlowness)*this.maxMovementSpeed + this.bigCavernSlowness*this.maxMovementSpeed/3.33; CAPI.setMaxSpeed(this, speed); } }, } ] ) ); //// Game props etc. //! Shows a particle effect until triggered (so players know what is left) BigCavernDoorTrigger = registerEntityClass(bakePlugins(PlotTrigger, [{ _class: 'BigCavernTrigger', shouldAct: true, renderDynamic: null, clientActivate: function(seconds) { this.timer = new RepeatingTimer(1/10); this.connect('client_onModify_state', function(state) { if (state === 'open' && this.state === 'closed') { Sound.play('0ad/thunder_10.ogg', this.center); var player = getPlayerEntity(); if (player && player.position.isCloseTo(this.position, 50)) { Effect.lightning(player.center, this.center, 0.5, 0xFF9933, 1.0); } } }); }, clientAct: function(seconds) { if (this.state === 'closed' && this.timer.tick(seconds)) { var position = this.position.copy(); position.z += this.collisionRadiusHeight*1.5; Effect.splash(PARTICLE.SPARK, 10, 1/5, position, 0x4477EE, 1.0, 70, 1); } }, }])); KeycardBase = registerEntityClass(bakePlugins(RecursivePlotTrigger, [{ _class: 'KeycardBase', useRenderDynamicTest: true, init: function() { this.stateModelNames = ['gk/swarm/keycard/base', 'gk/swarm/keycard/base']; }, renderDynamic: function() { if (this.state === 'open') { if (!this.childModelName) { var child = filter( function(trigger) { return trigger.parentEntity === this.uniqueId; }, getEntitiesByClass(this.childEntityClass), this )[0]; this.childModelName = child.stateModelNames.get(0); } var o = this.position; var flags = MODEL.LIGHT; var args = [GameManager.getSingleton(), this.childModelName, ANIM_IDLE, o.x, o.y-1.5, o.z+18, 180, 0, 180, flags, 0]; GameManager.getSingleton().renderingHashHint = 0; CAPI.renderModel2.apply(null, args); } }, }])); //! Final boss battle trigger BigBossTrigger = registerEntityClass(bakePlugins(PlotTrigger, [{ _class: 'BigBossTrigger', renderDynamic: null, activate: function(seconds) { this.openTime = -1; this.connect('onModify_state', function(state) { if (state === 'open') { this.openTime = Global.time; } }); GameManager.getSingleton().eventManager.add({ secondsBefore: 0, secondsBetween: 1, func: bind(function() { // 1 player: 30, 2 players: 15, 3+ players: 5 var resetDelay = clamp(50 - 10*getClientEntities().length, 5, 30); if (this.state === 'open' && Global.time - this.openTime > resetDelay) { this.state = 'closed'; // Players must reopen! } }, this), entity: this, }); }, clientActivate: function(seconds) { GameManager.getSingleton().eventManager.add({ secondsBefore: 0, secondsBetween: 1/10, func: bind(function() { if (this.state === 'closed') { Effect.splash(PARTICLE.SPARK, 10, 1/5, this.center, 0xEE7744, 1.0, 70, 1); } }, this), entity: this, }); this.connect('client_onModify_state', function(state) { if (state === 'open' && this.state === 'closed') { Sound.play('0ad/alarmcreatemiltaryfoot_1.ogg', this.position.copy()); } }); }, }])); BigBossHeart = registerEntityClass(bakePlugins(RecursivePlotTrigger, [{ _class: 'BigBossHeart', shouldAct: true, maxHealth: 100, health: new StateInteger(), init: function() { this.states = ['closed']; this.stateModelNames = ['']; this.radius = 0; }, activate: function() { this.health = this.maxHealth; GameManager.getSingleton().eventManager.add({ secondsBefore: 0, secondsBetween: 1, func: bind(function() { if (this.health < this.maxHealth) { log(ERROR, this.health); var children = filter(function(child) { return child.state === 'closed'; }, getEntitiesByClass('BigBossTrigger')); this.health = Math.min(this.health + 5*children.length, this.maxHealth); } }, this), entity: this, }); this.connect('onModify_health', function(health) { if (health <= 0 && !this.gameOver) { this.gameOver = true; // Stop attackers in last room GameManager.getSingleton().disableAutoTargeting = true; forEach(getEntitiesByClass('SwarmBugSpawner'), function(spawner) { spawner.reactivateDelay = 10000; spawner.deactivateSpawner(); }); // Restart map / TODO: Move to next map GameManager.getSingleton().eventManager.add({ secondsBefore: 21, // XXX: Coordinate with player cutscene! func: function() { CAPI.signalComponent('MapControl', 'restart'); }, entity: this, }); } }); }, clientActivate: function(seconds) { GameManager.getSingleton().eventManager.add({ secondsBefore: 0, secondsBetween: 0, func: bind(function() { var factor = this.health/this.maxHealth; if (factor < 0.9) { var color = 255;//clamp(255*factor, 0, 255); Effect.splash(PARTICLE.SPARK, 10, factor*1/2, this.center, color + (color << 8) + (color << 16), 1.0, 70, 1); return factor*1/3; } else { return 1/2; } }, this), entity: this, }); this.connect('client_onModify_health', function(health) { if (health <= 0) { GameManager.getSingleton().showEndTitles(this.position.addNew(new Vector3(0, 0, this.collisionRadiusHeight))); } }); /* XXX TEST GameManager.getSingleton().eventManager.add({ secondsBefore: 3, func: bind(function() { for (var i = 0; i < Map.textures.length; i++) { //log(ERROR, i + ' / ' + Map.textures.length); Map.texture('0', '<dds>textures/gk/swarm/gk_botter_map_tex_0002_cc.jpg', 0, 0, 0, 0.5, i); } }, this), entity: this, }); XXX TEST */ }, clientAct: function() { if (getPlayerEntity() && this.position.isCloseTo(getPlayerEntity().position, 384)) { var factors = Global.gameHUD.calcFactors(); CAPI.showHUDImage( 'packages/gamehud/gk/swarm/boss/GK_Boss_IMG_Overlay_256x256.png', (1/Global.aspectRatio)*factors.x*128/Global.screenWidth, factors.y*128/Global.screenHeight, factors.x*256/Global.screenWidth, factors.y*256/Global.screenHeight ); var raw = Math.floor(10*this.health/this.maxHealth); CAPI.showHUDImage( 'packages/gamehud/gk/swarm/boss/GK_Boss_IMG_Overlay_64x256_HP_0' + raw + '.png', factors.x*((1/Global.aspectRatio)*128+32)/Global.screenWidth, factors.y*128/Global.screenHeight, factors.x*64/Global.screenWidth, factors.y*256/Global.screenHeight ); } }, sufferDamage: function(kwargs) { if (kwargs.damage >= 0) { this.health -= Math.max(kwargs.damage, 10); } }, }])); // Monkeypatch World.isColliding so we can chaingun the heart var getCollidableEntitiesOld = World.getCollidableEntities; World.getCollidableEntities = function() { return getCollidableEntitiesOld().concat(getEntitiesByClass('BigBossHeart')); } //// Application ApplicationManager.setApplicationClass(Application.extend({ _class: "GameApplication", getPcClass: function() { return "GamePlayer"; }, // Replace this with appropriate behaviour for when a player falls of the map clientOnEntityOffMap: Health.dieIfOffMap, getScoreboardText: GameManager.getScoreboardText, clientClick: function(button, down, position) { // log(ERROR, "MAT: " + World.getMaterial(position)); Firing.clientClick.apply(Firing, arguments); }, actionKey: function(index, down) { if (!down) return; if (index === 0) { // action key 0: Help UserInterface.showMessage("Middle mouse: Cycle weapons"); } else if (index >= 1 && index <= 4) { // Or: bind MOUSE2 actionkey1 var gunIndexes = getPlayerEntity().gunIndexes.asArray(); if (findIdentical(gunIndexes, index-1) >= 0) { getPlayerEntity().currGunIndex = index-1; } } else if (index === 7) { // die getPlayerEntity().health = 0; } }, performJump: function(down) { if (down) { var player = getPlayerEntity(); if (player.physicalState >= PHYSICALSTATE.SLOPE || player.inWater) { Sound.play('gk/jump2.ogg', player.position); player.velocity.z += 125; } } }, getCrosshair: function() { return 'packages/gamehud/gk/swarm/crosshair.png'; }, handleTextMessage: Chat.handleTextMessage, })); //// Game manager SwarmPickups = { base: { collisionRadiusWidth: 3, collisionRadiusHeight: 3, secondsLeft: 10.0, useRenderDynamicTest: true, }, }; SwarmPickups['h'] = merge(SwarmPickups['base'], { renderDynamic: function() { var o = this.position; var flags = MODEL.LIGHT | MODEL.CULL_VFC | MODEL.CULL_DIST; var args = [GameManager.getSingleton(), 'gk/swarm/health', ANIM_IDLE, o.x, o.y, o.z, 0, 0, 0, flags, 0]; GameManager.getSingleton().renderingHashHint = 0; CAPI.renderModel2.apply(null, args); }, doPickup: function(player) { player.health = Math.min(player.maxHealth, player.health + 50); }, }); SwarmPickups['r'] = merge(SwarmPickups['base'], { renderDynamic: function() { var o = this.position; var flags = MODEL.LIGHT | MODEL.CULL_VFC | MODEL.CULL_DIST; var args = [GameManager.getSingleton(), 'gk/swarm/munition', ANIM_IDLE, o.x, o.y, o.z, 0, 0, 0, flags, 0]; GameManager.getSingleton().renderingHashHint = 0; CAPI.renderModel2.apply(null, args); }, doPickup: function(player) { player.gunAmmos[playerRocketLauncher] = Math.min(player.gunAmmos[playerRocketLauncher] + 5, 99); }, }); SwarmPickups['hp'] = merge(SwarmPickups['h'], { secondsLeft: 60.0, }); SwarmPickups['rp'] = merge(SwarmPickups['r'], { secondsLeft: 60.0, }); CutSceneWithBackgroundText = CutScenes.BaseAction.extend({ doExecute: function() { this.oldShowHUDImage('packages/gamehud/gk/swarm/cutscene_overlay.png', 0.5, 0.5, Math.max(Global.aspectRatio, 1), Math.min(Global.aspectRatio, 1)); return this._super.apply(this, arguments); }, /* showSubtitleBackground: function() { var factors = Global.gameHUD.calcFactors(); this.oldShowHUDImage('packages/gamehud/gk/swarm/textbox.png', 0.5, 0.9, factors.x*800/Global.screenWidth, factors.y*128/Global.screenHeight); }, */ }); Projectiles.serverside = false; GameManager.setup([ GameManager.managerPlugins.messages, GameManager.managerPlugins.radar, GameManager.managerPlugins.eventList, // TeamworkMode.managerPlugin, Pickups.managerPlugin, Projectiles.plugin, ParallelActionsPlugin, { pickupTypes: { 'h': SwarmPickups['h'], 'r': SwarmPickups['r'], 'hp': SwarmPickups['hp'], 'rp': SwarmPickups['rp'], }, activate: function() { this.playerColors = { 'red': null, 'yellow': null, 'blue': null }; }, clientAct: function() { if (!this.shownIntro && getPlayerEntity()) { this.showIntro(); this.shownIntro = true; } forEach(getEntitiesByClass(Player), function(player) { if (player !== getPlayerEntity()) { this.drawRadarElement(player.position, 'packages/hud/radar/' + player.getColor() + '_dot.png', player); } }, this); }, showIntro: function() { if (Global.noCutscenes) return; if (isIntensityVersionAtLeast('1.1.3')) { Sound.playMusic('music/Pal_Zoltan_Illes__Rolling_Militia.ogg'); } else { log(WARNING, "Cannot play music, need to upgrade the engine"); } var factor = 4/3; function renderBug(o, yaw, pitch, roll, startTime) { var anim = 50|ANIM_LOOP; var flags = MODEL.LIGHT | MODEL.CULL_VFC | MODEL.CULL_DIST | MODEL.DYNSHADOW; var args = [GameManager.getSingleton(), 'gk/botter/1', anim, o.x, o.y, o.z, yaw, pitch, roll, flags, startTime]; GameManager.getSingleton().renderingHashHint = 1; CAPI.renderModel2.apply(null, args); } getPlayerEntity().queueAction(new (CutSceneWithBackgroundText.extend({ canBeCancelled: true, subtitles: [ new (CutScenes.Subtitle.extend({ start: 0.5*factor, end: 9.0*factor, text: 'You have been sent to a malfunctioning base...', }))(), new (CutScenes.Subtitle.extend({ start: 11.0*factor, end: 19.0*factor, text: 'Others have been sent before you...', }))(), new (CutScenes.Subtitle.extend({ start: 22.0*factor, end: 29.0*factor, text: 'Their video feeds indicate the base is overrun...', }))(), ], }))( [ new (CutScenes.SmoothAction.extend({ markers: [ { position: new Vector3(1379.26, 577.65, 505.52), yaw: 31.09, pitch: -10.90 }, { position: new Vector3(1852.22, 545.97, 568.96), yaw: 307.90, pitch: -15.18 }, { position: new Vector3(1840.70, 34.74, 527.08), yaw: 230.81, pitch: -12.54 }, ], delayAfter: 1.0, }))(), new (CutScenes.SmoothAction.extend(merge( { delayBefore: 1.0, markers: [ { position: new Vector3(1021.78, 1305.85, 594.17), yaw: 157.08, pitch: 4.63 }, { position: new Vector3(858.32, 1516.53, 676.01), yaw: 143.36, pitch: 18.00 }, { position: new Vector3(988.48, 1874.73, 601.13), yaw: 60.72, pitch: 1.54 }, ], delayAfter: 1.0, }, RenderingCaptureActionPlugin, { renderDynamic: function() { renderBug(new Vector3(1074.87, 1819.10, 572.01), 120, 0, 0, 50); } } )))(), new (CutScenes.SmoothAction.extend(merge( { delayBefore: 1.0, markers: [ { position: new Vector3(522.99, 717.87, 577.47), yaw: 30, pitch: 1.90 }, { position: new Vector3(520.65, 706.02, 586.36), yaw: -90.90, pitch: -20.45 }, { position: new Vector3(491.87, 917.46, 576.36), yaw: 125.72, pitch: 1.09 }, { position: new Vector3(525.50, 918.42, 554), yaw: 117.81, pitch: -21.27 }, ], }, RenderingCaptureActionPlugin, { renderDynamic: function() { renderBug(new Vector3(570.11, 1005.64, 544.08), 166, 0, 0, 0); renderBug(new Vector3(618.83, 988.90, 557.63), 267, -30, 0, 25); renderBug(new Vector3(474.58, 898.20, 566.14), 269, 0, -45, 50); renderBug(new Vector3(548.00, 630.06, 544.09), 175, 0, 0, 75); renderBug(new Vector3(536.99, 926.66, 544.08), 223, 0, 0, 100); } } )))(), ] )); getPlayerEntity().queueAction(new (Action.extend({ doStart: function() { GameManager.getSingleton().addHUDMessage({ text: "Tip: Press '9' for firstperson", color: 0xFFDDCC, duration: 5, y: 0.8, size: 0.66, }); }, }))()); }, showEndTitles: function(fireworksOrigin) { getPlayerEntity().health = getPlayerEntity().maxHealth; // don't die from final rockets! // Fireworks var startTime = Global.time; for (var i = 0; i < 5; i++) { GameManager.getSingleton().eventManager.add({ secondsBefore: Math.random(), secondsBetween: 0, // Dynamic func: bind(function() { Sound.play('olpc/MichaelBierylo/sfx_DoorSlam.wav', fireworksOrigin); this.addParallelAction(new CustomEffect.Fireworks({ shots: [{ position: fireworksOrigin.copy(), velocity: new Vector3(30*(Math.random()-0.5), 30*(Math.random()-0.5), 20 + 30*(Math.random()-0.5)), secondsLeft: 3.0, childMinZ: fireworksOrigin.z - 50, minVelocityZ: -10, childSecondsLeft: 0.6, getColor: function() { if (this.size === 1.0) return 0xFFEECC; return Math.floor(Math.random()*255) + (Math.floor(Math.random()*255) << 8) + (Math.floor(Math.random()*255) << 16); }, size: 1.0, }], })); if (Global.time - startTime > 25) { return false; } else { return -1; } }, this), entity: this, }); } // Cutscene getPlayerEntity().queueAction(new (CutSceneWithBackgroundText.extend({ subtitles: [ new (CutScenes.Subtitle.extend({ start: 2/3, end: 25.0, text: 'You defeated the computer!', }))(), ], }))( [ new (CutScenes.SmoothAction.extend({ markers: [ { position: new Vector3(2568.11, 1109.05, 856.76), yaw: 59.81, pitch: 4.72 }, { position: new Vector3(2521.69, 1161.13, 858.84), yaw: 44.90, pitch: -2.27 }, { position: new Vector3(2598.12, 1222.86, 859.70), yaw: 19.18, pitch: -7.27 }, { position: new Vector3(2738.24, 1256.46, 862.41), yaw: 335.99, pitch: -3.36 }, { position: new Vector3(2767.91, 1167.78, 859.01), yaw: 312.99, pitch: -1.45 }, ], }))(), ] )); }, }, ]); //// Load permanent entities if (Global.SERVER) { // Run this only on the server - not the clients var entities = CAPI.readFile(Global.entitiesFile ? Global.entitiesFile : "base/GK_Swarm_data/entities.json"); loadEntities(entities); GameManager.getSingleton().registerTeams([ { _name: 'red', setup: function(player) { var manager = GameManager.getSingleton(); var possibles = filter(function(color) { return !manager.playerColors[color] || manager.playerColors[color].deactivated; }, keys(manager.playerColors)); if (possibles.length === 0) { possibles = keys(manager.playerColors); // All taken, so pick any of them } var color = Random.choice(possibles); manager.playerColors[color] = player; player.defaultModelName = 'stromar_1_1/' + color + '/130'; player.defaultHUDModelName = 'stromar_1_1/hud/' + color; }, flagModelName: 'flag/red', }, ]); } //Map.preloadModel('stromar_1_1/red/130'); //Map.preloadModel('stromar/hud/red'); for (var i = 0; i <= 8; i++) { Map.preloadModel('gk/botter/' + i); } Global.gameHUD = { // TODO: handle low resolutions getHealthParams: function() { var factors = this.calcFactors(); var w = 42, h = 273; var ret = { x: (Global.screenWidth-factors.x*w/2)/Global.screenWidth, y: factors.y*(282+h/2)/Global.screenHeight, w: factors.x*w/Global.screenWidth, h: factors.y*h/Global.screenHeight, }; return ret; }, getRadarParams: function() { var factors = this.calcFactors(); var w = 282; return { centerX: (Global.screenWidth-factors.y*w/2)/Global.screenWidth, centerY: factors.y*(w/2)/Global.screenHeight, radius: factors.y*(w/2)/Global.screenHeight, image: 'packages/gamehud/gk/swarm/gk_pc_rada_bg_image_1.png', }; }, getFiringParams: function(gun) { var factors = this.calcFactors(); var ammo = getPlayerEntity().gunAmmos[gun.gunIndex]; var ammo1 = ammo !== null ? Math.floor(ammo/10) : '+'; var ammo2 = ammo !== null ? Math.floor(ammo%10) : 'N'; return { gun: { icon: gun instanceof Chaingun ? 'packages/gamehud/gk/swarm/gk_wepon_gun_0.png' : 'packages/gamehud/gk/swarm/gk_wepon_missile_0.png', x: factors.x*(Global.screenWidth+factors.y*(-282-64-64-64/2))/Global.screenWidth, y: factors.y*(5 + 128/2)/Global.screenHeight, w: factors.x*64/Global.screenWidth, h: factors.y*128/Global.screenHeight, }, ammo1: { icon: 'packages/gamehud/gk/swarm/gk_ammo_e1_' + ammo1 + '.png', x: factors.x*(Global.screenWidth+factors.y*(-282-64-64/2))/Global.screenWidth, y: factors.y*(5 + 128/2)/Global.screenHeight, w: factors.x*64/Global.screenWidth, h: factors.y*128/Global.screenHeight, }, ammo2: { icon: 'packages/gamehud/gk/swarm/gk_ammo_e2_' + ammo2 + '.png', x: factors.x*(Global.screenWidth+factors.y*(-282-64/2))/Global.screenWidth, y: factors.y*(5 + 128/2)/Global.screenHeight, w: factors.x*64/Global.screenWidth, h: factors.y*128/Global.screenHeight, }, }; }, getPlotItemParams: function(index) { var factors = this.calcFactors(); return { x: factors.x*(Global.screenWidth+factors.y*(-282-64-64-64/2-16-48*index))/Global.screenWidth, y: factors.y*(5 + 64/2)/Global.screenHeight, w: factors.x*32/Global.screenWidth, h: factors.y*32/Global.screenHeight, }; }, calcFactors: function() { return { x: Global.screenWidth/Math.max(Global.screenWidth,Global.screenHeight), y: Global.screenHeight/Math.max(Global.screenWidth,Global.screenHeight), }; }, }; //Global.profiling = { interval: 10.0 };
//this script shows the brightness with servo let phoVal = 0 //photocell value, from 0 to 1023 let serVal = 0 // servo value, from 0 to 180 basic.forever(function () { phoVal = pins.analogReadPin(AnalogPin.P0) serVal = pins.map(phoVal, 0, 1023, 0, 180) pins.servoWritePin(AnalogPin.P1, serVal) })
const db = require("../../db/postgres"); const queries = require("../../db/scripts/queries/queries_book"); const updateBook = async (req, res) => { const book = new Book(req.body); const type = req.user.id_contacttype; book.bookID = req.params.id; if(type !== 1){ res.sendStatus(403); } else{ try{ await db.query("BEGIN"); if (book.subCategoryID) { await db.query(queries.updateSubCategoryID,[book.subCategoryID, book.bookID]); } if (book.seriesID) { await db.query(queries.updateSeriesID, [book.seriesID, book.bookID]); } if (book.title) { await db.query(queries.updateTitle, [book.title, book.bookID]); } if (book.subTitle) { await db.query(queries.updateSubTitle, [book.subTitle, book.bookID]); } if (book.publicationDate) { await db.query(queries.updatePublicationDate, [book.publicationDate, book.bookID]); } if (book.description) { await db.query(queries.updateDescription, [book.description, book.bookID]); } await db.query("COMMIT"); /* await db.query(queries.updateBook,[ book.subCategoryID, book.seriesID, book.title, book.subTitle, book.publicationDate, book.description, book.bookID ]); res.status(201).send({message: "Book updated successfully!"}); */ return res.status(200).send({message: "Book updated successfully."}) }catch(err){ await db.query("ROLLBACK"); return res.status(500).send(err); } } }; function Book(body) { this.title = body.title; this.subTitle = body.subtitle; this.description = body.description; this.publicationDate = body.publication_date; this.seriesID = body.series; this.subCategoryID = body.subcategory; this.bookID = body.book_id; }; module.exports = updateBook;
export { default as useCampaignsTable } from './campaigns'
const path = require('path'); const CLIArgs = require('../constants/CLIArgs'); const CompilerOptionKeys = [ CLIArgs.MODULE_RESOLUTION, CLIArgs.EXPERIMENTAL_DECORATORS, CLIArgs.SYNTHETIC_IMPORTS, CLIArgs.TARGET, CLIArgs.MODULE, CLIArgs.BASE_URL ]; /** * Parses CLI args and generates current working directory if provided. * * @param {{ params, config }} args Object with params and config objects, * used to carry config and params across parsers. * @return {Promise<{ params, config }>} Modified params and config objects. */ async function argsParser({ params, config }) { const { argv = {} } = params; const cwd = argv._ && argv._.length > 0 ? path.resolve(argv._[0]) : process.cwd(); if (!cwd || typeof cwd !== 'string') { throw new TypeError(`Invalid cwd, '${cwd}' was given.`); } const compilerOptions = Object.values(CLIArgs) .filter((key) => CompilerOptionKeys.indexOf(key) !== -1) .reduce((acc, cur) => { if (argv[cur]) { acc[cur] = argv[cur]; } return acc; }, {}); return { params: { ...params, cwd, output: argv[CLIArgs.OUTPUT], template: argv[CLIArgs.TEMPLATE] || 'default', webpackConfigLocation: argv[CLIArgs.WEBPACK_CONFIG] || path.join(cwd, 'webpack.config.js') }, config: { ...config, compilerOptions } }; } argsParser.parserName = 'args parser'; module.exports = { argsParser, CompilerOptionKeys };
let response; exports.lambdaHandler = async (event, context) => { try { response = { 'statusCode': 200, 'body': JSON.stringify({ message: JSON.stringify(event).toUpperCase(), }) } } catch (err) { console.log(err); return err; } return response };
var searchData= [ ['bad_5fgateway',['BAD_GATEWAY',['../d0/d58/classscl_1_1http_1_1StatusCode.html#a21837ec6220da7207b37ee92a117f8cd',1,'scl::http::StatusCode']]], ['bad_5frequest',['BAD_REQUEST',['../d0/d58/classscl_1_1http_1_1StatusCode.html#a27df05e65c606ce61544652916d7f9e2',1,'scl::http::StatusCode']]], ['bandwidth_5flimit_5fexceeded',['BANDWIDTH_LIMIT_EXCEEDED',['../d0/d58/classscl_1_1http_1_1StatusCode.html#af9bf32058572c5ed98e3d1e43ed0799d',1,'scl::http::StatusCode']]], ['begin',['begin',['../d6/d5d/classscl_1_1stream_1_1creators_1_1details_1_1FromStlIterator.html#aa679cdbeadb598a561bdc769953a4129',1,'scl::stream::creators::details::FromStlIterator']]] ];
"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); const rest = __importStar(require("typed-rest-client/RestClient")); const semver = __importStar(require("semver")); var Stage; (function (Stage) { Stage["latest"] = "ReleasedAndBlessed"; Stage["preview"] = "EarlyAccessPreview"; Stage["_released"] = "Released"; })(Stage || (Stage = {})); async function pickVersion(spec) { spec = spec.trim(); let versions = await fetchVersions(); let range = semver.validRange(spec, true); let selected; if (range) { selected = versions.find(v => semver.satisfies(v.version, range, true)); } else { let stage = spec == 'latest' ? Stage.latest : spec == 'preview' ? Stage.preview : null; if (!stage) { throw new Error(`Invalid release label: '${spec}'. Valid labels are 'latest' and 'preview'.`); } selected = versions.find(v => v.stage === stage); } if (!selected) { throw new Error(`No valid versions could be found for '${spec}'.`); } return selected; } exports.default = pickVersion; async function fetchVersions() { const http = new rest.RestClient('nuget/setup-nuget-exe', undefined, undefined, { allowRetries: true, maxRetries: 3 }); return (await http .get('https://dist.nuget.org/tools.json') .then(j => j.result || { 'nuget.exe': [] }) .then(n => n['nuget.exe'])).map(v => { return { ...v, uploaded: new Date(v.uploaded) }; }); }
'use strict'; class BaseApi { static get EMARSYS() { return 'EMARSYS'; } constructor(transmitter) { this.transmitter = transmitter; } getRandomId() { return Math.floor(Math.random() * 10000000); } exposeMethods(methodList) { return methodList.reduce((memo, methodName) => { memo[methodName] = this[methodName].bind(this); return memo; }, {}); } } module.exports = BaseApi;
{ "type": "FeatureCollection", "features": [ { "type": "Feature", "properties": { "Unnamed: 0": 0, "Incident Number": 140580017, "Date": "02\/27\/2014", "Time": "07:40 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.108199, -87.934553 ], "Address": "1915 W FAIRMOUNT AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.934553025535223, 43.10819851399404 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 1, "Incident Number": 140580047, "Date": "02\/27\/2014", "Time": "12:14 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.125670, -87.966055 ], "Address": "5942 N SHERMAN BL", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.966055109200738, 43.125669546752988 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 2, "Incident Number": 140570009, "Date": "02\/26\/2014", "Time": "01:32 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.127491, -87.963545 ], "Address": "6052 N 41ST ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.963544705598309, 43.127490919382929 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 3, "Incident Number": 140550076, "Date": "02\/24\/2014", "Time": "01:25 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.125576, -87.966066 ], "Address": "5936 N SHERMAN BL", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.966066160368911, 43.125576401192646 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 4, "Incident Number": 140540057, "Date": "02\/23\/2014", "Time": "11:41 AM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.097699, -87.948000 ], "Address": "4424 N 28TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 1, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 6, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.947999869187512, 43.097698626015813 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 5, "Incident Number": 140510019, "Date": "02\/20\/2014", "Time": "07:34 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.136807, -87.963443 ], "Address": "4101 W KIEHNAU AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.963443444630386, 43.13680650678068 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 6, "Incident Number": 140510026, "Date": "02\/20\/2014", "Time": "06:51 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": "THEFT FROM MOTOR VEHICLE", "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.106948, -87.957724 ], "Address": "4920 N 36TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.957724360782692, 43.106947994171634 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 7, "Incident Number": 140500040, "Date": "02\/19\/2014", "Time": "06:50 AM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.096876, -87.943918 ], "Address": "4383 N 25TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 1, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 2, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 6, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.943918387760206, 43.096875893704166 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 8, "Incident Number": 140500050, "Date": "02\/19\/2014", "Time": "10:19 AM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.103538, -87.950344 ], "Address": "4750 N 30TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.950344404062861, 43.103537832361951 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 9, "Incident Number": 140500118, "Date": "02\/19\/2014", "Time": "07:22 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.116668, -87.962305 ], "Address": "5448 N 40TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.962305360782693, 43.116667994171621 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 10, "Incident Number": 140490075, "Date": "02\/18\/2014", "Time": "04:09 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.091308, -87.939692 ], "Address": "4074 N TEUTONIA AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 0, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 1, "g_clusterK8": 2, "m_clusterK8": 4, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.939692316781375, 43.091308392463418 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 11, "Incident Number": 140480046, "Date": "02\/17\/2014", "Time": "11:58 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.124669, -87.964602 ], "Address": "5882 N 42ND ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.964602393531266, 43.124669161809692 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 12, "Incident Number": 140430008, "Date": "02\/12\/2014", "Time": "03:42 AM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.089887, -87.946493 ], "Address": "2620 W CAPITOL DR", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 0, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 1, "g_clusterK8": 2, "m_clusterK8": 4, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.946493223007678, 43.089887460470756 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 13, "Incident Number": 140430016, "Date": "02\/12\/2014", "Time": "08:37 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.127234, -87.964855 ], "Address": "6033 N 42ND ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.964855256737806, 43.127233970385205 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 14, "Incident Number": 140430027, "Date": "02\/12\/2014", "Time": "11:55 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.109031, -87.938680 ], "Address": "2105 W COLFAX PL", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.938680470802353, 43.109031135641075 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 15, "Incident Number": 140400037, "Date": "02\/09\/2014", "Time": "11:27 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.146356, -87.957348 ], "Address": "7069 N 37TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.957347534998945, 43.146356144872797 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 16, "Incident Number": 140400060, "Date": "02\/09\/2014", "Time": "04:10 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.116471, -87.959990 ], "Address": "5437 N 38TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 1, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 4, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.959989632003953, 43.116471031363602 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 17, "Incident Number": 140380019, "Date": "02\/07\/2014", "Time": "07:12 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.127291, -87.964740 ], "Address": "6040 N 42ND ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.964739556137644, 43.127290882839247 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 18, "Incident Number": 140380025, "Date": "02\/07\/2014", "Time": "08:53 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.127024, -87.963570 ], "Address": "6027 N 41ST ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.963569582544551, 43.127024456018916 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 19, "Incident Number": 140380095, "Date": "02\/07\/2014", "Time": "04:57 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.133230, -87.968552 ], "Address": "4554 W WOOLWORTH AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.968551751457099, 43.133229511541202 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 20, "Incident Number": 140390002, "Date": "02\/07\/2014", "Time": "10:16 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.111927, -87.957220 ], "Address": "3520 W VILLARD AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.957220080904833, 43.111926511541185 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 21, "Incident Number": 140370017, "Date": "02\/06\/2014", "Time": "08:20 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.129747, -87.964428 ], "Address": "4209 W KAUL AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.964428074867911, 43.1297469986404 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 22, "Incident Number": 140370028, "Date": "02\/06\/2014", "Time": "10:19 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.129777, -87.965265 ], "Address": "4247 W DOUGLAS AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.965264635088403, 43.129776576510814 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 23, "Incident Number": 140370029, "Date": "02\/06\/2014", "Time": "10:35 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.109059, -87.939098 ], "Address": "5008 N 22ND ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.939097538460004, 43.109058799479797 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 24, "Incident Number": 140370051, "Date": "02\/06\/2014", "Time": "02:11 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.110037, -87.972640 ], "Address": "5079 N 48TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.972639650325803, 43.110036502914198 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 25, "Incident Number": 140360099, "Date": "02\/05\/2014", "Time": "04:06 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.106369, -87.968950 ], "Address": "4900 N 45TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 1, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 2, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.968949547649885, 43.106368764944101 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 26, "Incident Number": 140360101, "Date": "02\/05\/2014", "Time": "04:58 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.110983, -87.939156 ], "Address": "5141 N 22ND ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.939155540778273, 43.110983103140633 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 27, "Incident Number": 140350108, "Date": "02\/04\/2014", "Time": "04:51 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.096427, -87.926750 ], "Address": "4380 N GREEN BAY AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 0, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 3, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 6, "g_clusterK7": 0, "m_clusterK7": 6, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.926750425731598, 43.096426993623353 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 28, "Incident Number": 140360010, "Date": "02\/04\/2014", "Time": "10:57 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": "THEFT FROM BUILDING", "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.107732, -87.935193 ], "Address": "4956 N 19TH PL", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.935192860782692, 43.10773213627445 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 29, "Incident Number": 140340050, "Date": "02\/03\/2014", "Time": "11:36 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.133075, -87.971522 ], "Address": "4725 W WOOLWORTH AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.971521567353747, 43.133074798812636 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 30, "Incident Number": 140320093, "Date": "02\/01\/2014", "Time": "06:12 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.097534, -87.946831 ], "Address": "4409 N 27TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 1, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 2, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 6, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.946830875296939, 43.097533719551144 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 31, "Incident Number": 140570118, "Date": "02\/26\/2014", "Time": "09:52 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.068062, -87.977136 ], "Address": "5060 W CENTER ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 1, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -87.977136378830849, 43.068061963361401 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 32, "Incident Number": 140560019, "Date": "02\/25\/2014", "Time": "08:20 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.087464, -88.000538 ], "Address": "7084 W BECKETT AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 5, "g_clusterK8": 5, "m_clusterK8": 5, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -88.000538109469829, 43.087464313636055 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 33, "Incident Number": 140560045, "Date": "02\/25\/2014", "Time": "12:29 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.067755, -87.990890 ], "Address": "2675 N 63RD ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 0, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 1, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 5, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -87.990889577038359, 43.067754670552262 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 34, "Incident Number": 140550021, "Date": "02\/24\/2014", "Time": "06:42 AM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.058934, -87.977568 ], "Address": "2183 N 51ST ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 1, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 5, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -87.977568124790579, 43.05893383236193 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 35, "Incident Number": 140550022, "Date": "02\/24\/2014", "Time": "06:42 AM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.058934, -87.977568 ], "Address": "2183 N 51ST ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 1, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 5, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -87.977568124790579, 43.05893383236193 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 36, "Incident Number": 140530008, "Date": "02\/22\/2014", "Time": "01:00 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.082373, -87.996268 ], "Address": "6730 W KEEFE AVENUE PK", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 2, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 2, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 5, "g_clusterK8": 5, "m_clusterK8": 5, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -87.99626772275596, 43.082372602981224 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 37, "Incident Number": 140500052, "Date": "02\/19\/2014", "Time": "09:10 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.088337, -88.004778 ], "Address": "3907 N 74TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 5, "g_clusterK8": 5, "m_clusterK8": 5, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -88.004778132003949, 43.088337 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 38, "Incident Number": 140420072, "Date": "02\/11\/2014", "Time": "06:01 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.068010, -87.977673 ], "Address": "5100 W CENTER ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 1, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -87.977673, 43.06801049321934 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 39, "Incident Number": 140400006, "Date": "02\/09\/2014", "Time": "12:28 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.085053, -87.989619 ], "Address": "3725 N 62ND ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 2, "g_clusterK6": 1, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 5, "g_clusterK8": 5, "m_clusterK8": 5, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -87.989619124790579, 43.085052586733212 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 40, "Incident Number": 140390061, "Date": "02\/08\/2014", "Time": "01:27 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.086317, -87.999687 ], "Address": "7031 W BECKETT AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 5, "g_clusterK8": 5, "m_clusterK8": 5, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -87.999686741213964, 43.086316642506866 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 41, "Incident Number": 140360130, "Date": "02\/05\/2014", "Time": "07:55 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.073592, -87.985298 ], "Address": "5810 W CHAMBERS ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 0, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 1, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 5, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -87.985298383822183, 43.073592225827873 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 42, "Incident Number": 140350029, "Date": "02\/04\/2014", "Time": "07:23 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.080991, -87.983312 ], "Address": "3409 N 56TH ST #LWR", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 2, "m_clusterK5": 3, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 1, "g_clusterK7": 6, "m_clusterK7": 0, "e_clusterK8": 5, "g_clusterK8": 5, "m_clusterK8": 1, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -87.983311577038364, 43.080991323619372 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 43, "Incident Number": 140340022, "Date": "02\/03\/2014", "Time": "06:00 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.088234, -88.002597 ], "Address": "7284 W APPLETON AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 5, "g_clusterK8": 5, "m_clusterK8": 5, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -88.00259736522608, 43.088234164319857 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 44, "Incident Number": 140340139, "Date": "02\/03\/2014", "Time": "11:19 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.071300, -87.984202 ], "Address": "2868 N 57TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 0, "m_clusterK4": 1, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 1, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -87.984202360782689, 43.071300167638071 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 45, "Incident Number": 140350007, "Date": "02\/03\/2014", "Time": "11:24 PM", "Police District": 3.0, "Offense 1": "ALL OTHER LARCENY", "Offense 2": "MOTOR VEHICLE THEFT", "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.029942, -88.026543 ], "Address": "9132 W DIXON ST #102", "e_clusterK2": 1, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 0, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 2, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 1, "g_clusterK7": 5, "m_clusterK7": 1, "e_clusterK8": 5, "g_clusterK8": 1, "m_clusterK8": 0, "e_clusterK9": 5, "g_clusterK9": 1, "m_clusterK9": 0, "e_clusterK10": 4, "g_clusterK10": 6, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -88.02654321414947, 43.02994167039558 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 46, "Incident Number": 140570129, "Date": "02\/26\/2014", "Time": "11:49 PM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.975477, -87.979315 ], "Address": "3806 S 52ND ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 6, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.979315444601724, 42.975477167638076 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 47, "Incident Number": 140560046, "Date": "02\/25\/2014", "Time": "09:25 AM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.002882, -87.961916 ], "Address": "3811 W LINCOLN AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 6, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.961916455724108, 43.0028815160561 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 48, "Incident Number": 140550080, "Date": "02\/24\/2014", "Time": "02:10 PM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.974034, -87.951836 ], "Address": "2912 W HOWARD AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.951835599526476, 42.974034099526499 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 49, "Incident Number": 140500047, "Date": "02\/19\/2014", "Time": "10:24 AM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.982223, -87.944543 ], "Address": "3414 S 24TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.944542998388343, 42.982222554517143 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 50, "Incident Number": 140450060, "Date": "02\/14\/2014", "Time": "02:33 PM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.977293, -87.948591 ], "Address": "3701 S 27TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.948590751666572, 42.977293424608902 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 51, "Incident Number": 140360087, "Date": "02\/05\/2014", "Time": "03:26 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.998267, -87.955600 ], "Address": "2551 S 33RD ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 6, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.955600471579245, 42.99826676019967 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 52, "Incident Number": 140590004, "Date": "02\/28\/2014", "Time": "12:37 AM", "Police District": 1.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.029368, -87.913602 ], "Address": "247 W FRESHWATER WA", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 6, "g_clusterK9": 6, "m_clusterK9": 6, "e_clusterK10": 8, "g_clusterK10": 8, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -87.913602167638061, 43.029367513994032 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 53, "Incident Number": 140590021, "Date": "02\/28\/2014", "Time": "08:38 AM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.020657, -87.915449 ], "Address": "1019 S 4TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 6, "g_clusterK9": 6, "m_clusterK9": 6, "e_clusterK10": 8, "g_clusterK10": 8, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -87.915448548184912, 43.020656664723873 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 54, "Incident Number": 140590043, "Date": "02\/28\/2014", "Time": "02:00 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.020873, -87.929214 ], "Address": "1006 S 14TH ST #1", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 6, "g_clusterK9": 6, "m_clusterK9": 6, "e_clusterK10": 8, "g_clusterK10": 8, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -87.929214434070133, 43.020873 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 55, "Incident Number": 140580015, "Date": "02\/27\/2014", "Time": "08:06 AM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.019036, -87.930441 ], "Address": "1437 W SCOTT ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 6, "g_clusterK9": 6, "m_clusterK9": 6, "e_clusterK10": 8, "g_clusterK10": 8, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -87.930441, 43.019036488458823 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 56, "Incident Number": 140580045, "Date": "02\/27\/2014", "Time": "01:04 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.018040, -87.924312 ], "Address": "1009 W MADISON ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 6, "g_clusterK9": 6, "m_clusterK9": 6, "e_clusterK10": 8, "g_clusterK10": 8, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -87.924311832361937, 43.01804049567216 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 57, "Incident Number": 140570038, "Date": "02\/26\/2014", "Time": "11:18 AM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.004878, -87.925755 ], "Address": "2168 S 11TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 6, "g_clusterK9": 6, "m_clusterK9": 6, "e_clusterK10": 8, "g_clusterK10": 8, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -87.925754517312257, 43.004878407438412 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 58, "Incident Number": 140570062, "Date": "02\/26\/2014", "Time": "03:39 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.007282, -87.930996 ], "Address": "2046 S 15TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 6, "g_clusterK9": 6, "m_clusterK9": 6, "e_clusterK10": 8, "g_clusterK10": 8, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -87.930995959028451, 43.007282298084135 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 59, "Incident Number": 140530085, "Date": "02\/22\/2014", "Time": "04:44 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.024272, -87.927480 ], "Address": "1236 W PIERCE ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 6, "g_clusterK9": 6, "m_clusterK9": 6, "e_clusterK10": 8, "g_clusterK10": 8, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -87.92748, 43.02427152986305 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 60, "Incident Number": 140520041, "Date": "02\/21\/2014", "Time": "11:45 AM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.022205, -87.933081 ], "Address": "831 S CESAR E CHAVEZ DR", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 6, "g_clusterK9": 6, "m_clusterK9": 6, "e_clusterK10": 8, "g_clusterK10": 8, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -87.933080606468721, 43.022205 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 61, "Incident Number": 140510036, "Date": "02\/20\/2014", "Time": "10:31 AM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.020140, -87.920999 ], "Address": "738 W WASHINGTON ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 6, "g_clusterK9": 6, "m_clusterK9": 6, "e_clusterK10": 8, "g_clusterK10": 8, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -87.92099941326677, 43.020139512118114 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 62, "Incident Number": 140510085, "Date": "02\/20\/2014", "Time": "04:01 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.015988, -87.913292 ], "Address": "225 W ORCHARD ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 6, "g_clusterK9": 6, "m_clusterK9": 6, "e_clusterK10": 8, "g_clusterK10": 8, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -87.913291667638063, 43.015988474032085 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 63, "Incident Number": 140500062, "Date": "02\/19\/2014", "Time": "01:03 AM", "Police District": 1.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.028702, -87.913935 ], "Address": "222 S 3RD ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 6, "g_clusterK9": 6, "m_clusterK9": 6, "e_clusterK10": 8, "g_clusterK10": 8, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -87.913935400744634, 43.028701994171627 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 64, "Incident Number": 140490088, "Date": "02\/18\/2014", "Time": "06:01 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.002089, -87.928465 ], "Address": "2332 S 13TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 6, "g_clusterK9": 6, "m_clusterK9": 6, "e_clusterK10": 8, "g_clusterK10": 8, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -87.928464926279858, 43.002089497085819 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 65, "Incident Number": 140460110, "Date": "02\/15\/2014", "Time": "02:53 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.003694, -87.929222 ], "Address": "1349 W WINDLAKE AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 6, "g_clusterK9": 6, "m_clusterK9": 6, "e_clusterK10": 8, "g_clusterK10": 8, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -87.929222368649647, 43.003694288087026 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 66, "Incident Number": 140440025, "Date": "02\/13\/2014", "Time": "09:50 AM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.999976, -87.921272 ], "Address": "2459 S 8TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 6, "g_clusterK9": 6, "m_clusterK9": 6, "e_clusterK10": 8, "g_clusterK10": 8, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -87.921271548184919, 42.999975838190323 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 67, "Incident Number": 140410017, "Date": "02\/10\/2014", "Time": "08:28 AM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.019036, -87.920352 ], "Address": "717 W SCOTT ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 6, "g_clusterK9": 6, "m_clusterK9": 6, "e_clusterK10": 8, "g_clusterK10": 8, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -87.920352, 43.019036488458823 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 68, "Incident Number": 140410021, "Date": "02\/10\/2014", "Time": "09:12 AM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.997832, -87.927274 ], "Address": "2560 S 12TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 6, "g_clusterK9": 6, "m_clusterK9": 6, "e_clusterK10": 8, "g_clusterK10": 8, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -87.927274437388348, 42.997832077990665 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 69, "Incident Number": 140400017, "Date": "02\/09\/2014", "Time": "03:03 AM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.017064, -87.929473 ], "Address": "1400 W GREENFIELD AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 6, "g_clusterK9": 6, "m_clusterK9": 6, "e_clusterK10": 8, "g_clusterK10": 8, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -87.929473332361937, 43.017063525967913 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 70, "Incident Number": 140360044, "Date": "02\/05\/2014", "Time": "09:18 AM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.002297, -87.918819 ], "Address": "2333 S 6TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 6, "g_clusterK9": 6, "m_clusterK9": 6, "e_clusterK10": 8, "g_clusterK10": 8, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -87.918818548761834, 43.002296959461134 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 71, "Incident Number": 140360124, "Date": "02\/05\/2014", "Time": "06:45 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.009031, -87.923123 ], "Address": "971 W WINDLAKE AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 6, "g_clusterK9": 6, "m_clusterK9": 6, "e_clusterK10": 8, "g_clusterK10": 8, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -87.923122504472062, 43.009030719805963 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 72, "Incident Number": 140340029, "Date": "02\/03\/2014", "Time": "07:49 AM", "Police District": 1.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.030339, -87.912077 ], "Address": "115 W SEEBOTH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 6, "g_clusterK9": 6, "m_clusterK9": 6, "e_clusterK10": 8, "g_clusterK10": 8, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -87.912076552790765, 43.030338961412234 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 73, "Incident Number": 140340076, "Date": "02\/03\/2014", "Time": "03:35 PM", "Police District": 1.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.028266, -87.912717 ], "Address": "233 W OREGON ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 6, "g_clusterK9": 6, "m_clusterK9": 6, "e_clusterK10": 8, "g_clusterK10": 8, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -87.912717170644711, 43.028265762127369 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 74, "Incident Number": 140330048, "Date": "02\/02\/2014", "Time": "11:52 AM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.002855, -87.928650 ], "Address": "1305 W LINCOLN AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 6, "g_clusterK9": 6, "m_clusterK9": 6, "e_clusterK10": 8, "g_clusterK10": 8, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -87.92865, 43.002855484563661 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 75, "Incident Number": 140320003, "Date": "02\/01\/2014", "Time": "01:45 AM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.006678, -87.918672 ], "Address": "2072 S 6TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 6, "g_clusterK9": 6, "m_clusterK9": 6, "e_clusterK10": 8, "g_clusterK10": 8, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -87.918672470136954, 43.006678491257446 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 76, "Incident Number": 140320023, "Date": "02\/01\/2014", "Time": "08:55 AM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.013699, -87.922612 ], "Address": "1618 S 9TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 6, "g_clusterK9": 6, "m_clusterK9": 6, "e_clusterK10": 8, "g_clusterK10": 8, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -87.922612437388352, 43.013698575076461 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 77, "Incident Number": 140590060, "Date": "02\/28\/2014", "Time": "04:10 PM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.953870, -87.939092 ], "Address": "4965 S 20TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.939091558859801, 42.953869939754284 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 78, "Incident Number": 140540053, "Date": "02\/23\/2014", "Time": "12:01 PM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.948368, -87.947523 ], "Address": "5306 S 26TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.947522510098878, 42.948368161809697 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 79, "Incident Number": 140530015, "Date": "02\/22\/2014", "Time": "01:57 AM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.980374, -87.946691 ], "Address": "3526 S 26TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.9466905, 42.980373533181272 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 80, "Incident Number": 140530045, "Date": "02\/22\/2014", "Time": "11:28 AM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.974852, -87.943842 ], "Address": "2305 W TRIPOLI AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.943842167638067, 42.974851506780674 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 81, "Incident Number": 140550064, "Date": "02\/22\/2014", "Time": "10:51 AM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.954291, -87.929256 ], "Address": "4960 S 13TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.929256472878251, 42.954291387731558 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 82, "Incident Number": 140500151, "Date": "02\/19\/2014", "Time": "10:44 PM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.929096, -87.930328 ], "Address": "6331 S 13TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.930327627906323, 42.9290959550464 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 83, "Incident Number": 140430019, "Date": "02\/12\/2014", "Time": "07:44 AM", "Police District": 6.0, "Offense 1": "THEFT FROM MOTOR VEHICLE", "Offense 2": "MOTOR VEHICLE THEFT", "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.960518, -87.916975 ], "Address": "4620 S 5TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.916974960615903, 42.960518413266783 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 84, "Incident Number": 140430041, "Date": "02\/12\/2014", "Time": "01:30 PM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.930474, -87.939070 ], "Address": "1550 W COLLEGE AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.939069960287412, 42.930474044467971 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 85, "Incident Number": 140410019, "Date": "02\/10\/2014", "Time": "08:40 AM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.978933, -87.942223 ], "Address": "3616 S 22ND ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.94222343738835, 42.9789329686364 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 86, "Incident Number": 140370060, "Date": "02\/06\/2014", "Time": "03:00 PM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.946484, -87.929349 ], "Address": "5400 S 13TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.929349256340444, 42.946484049028534 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 87, "Incident Number": 140370100, "Date": "02\/06\/2014", "Time": "02:34 PM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.985935, -87.933756 ], "Address": "3224 S 16TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.933756470136956, 42.985934580904853 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 88, "Incident Number": 140370121, "Date": "02\/06\/2014", "Time": "10:05 PM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.962038, -87.930540 ], "Address": "1340 W ARMOUR AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.930539969059296, 42.962038454499478 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 89, "Incident Number": 140360017, "Date": "02\/05\/2014", "Time": "04:40 AM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.949197, -87.943980 ], "Address": "5251 S 23RD ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.943980040971553, 42.949196779906515 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 90, "Incident Number": 140360151, "Date": "02\/05\/2014", "Time": "09:19 PM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.966879, -87.916896 ], "Address": "4266 S 5TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.916896174418724, 42.966878982514856 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 91, "Incident Number": 140360153, "Date": "02\/05\/2014", "Time": "09:21 PM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.966879, -87.916896 ], "Address": "4266 S 5TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.916896174418724, 42.966878982514856 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 92, "Incident Number": 140350119, "Date": "02\/04\/2014", "Time": "05:26 PM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.973964, -87.941273 ], "Address": "2086 W HOWARD AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.94127322300767, 42.973964453257395 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 93, "Incident Number": 140340072, "Date": "02\/03\/2014", "Time": "01:58 PM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.957755, -87.943736 ], "Address": "4760 S 23RD ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.943736495672155, 42.957755161809672 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 94, "Incident Number": 140340078, "Date": "02\/03\/2014", "Time": "02:57 PM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.985556, -87.932730 ], "Address": "3241 S 15TH PL", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.932729522649694, 42.98555644463039 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 95, "Incident Number": 140330051, "Date": "02\/02\/2014", "Time": "12:46 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.004770, -87.937070 ], "Address": "1900 W GRANT ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 1, "g_clusterK9": 6, "m_clusterK9": 1, "e_clusterK10": 6, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.937069887731553, 43.004769525967916 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 96, "Incident Number": 140540127, "Date": "02\/23\/2014", "Time": "09:59 PM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": "THEFT FROM MOTOR VEHICLE", "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.981813, -87.918412 ], "Address": "500 W HOLT AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 4, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 6, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -87.918411603000251, 42.981813024073368 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 97, "Incident Number": 140530046, "Date": "02\/22\/2014", "Time": "11:29 AM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.990272, -87.931393 ], "Address": "2976 S 15TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 3, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 3, "e_clusterK9": 6, "g_clusterK9": 6, "m_clusterK9": 3, "e_clusterK10": 8, "g_clusterK10": 8, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.931393451815083, 42.990271994171621 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 98, "Incident Number": 140520099, "Date": "02\/21\/2014", "Time": "04:20 PM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.987043, -87.923980 ], "Address": "3151 S 9TH PL", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 4, "g_clusterK7": 3, "m_clusterK7": 4, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 6, "g_clusterK9": 3, "m_clusterK9": 6, "e_clusterK10": 8, "g_clusterK10": 0, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -87.923979573720146, 42.98704283819032 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 99, "Incident Number": 140500092, "Date": "02\/19\/2014", "Time": "05:03 PM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.989595, -87.894350 ], "Address": "3001 S CLEMENT AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 6, "g_clusterK9": 6, "m_clusterK9": 6, "e_clusterK10": 8, "g_clusterK10": 8, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -87.894350403904411, 42.989595209632213 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 100, "Incident Number": 140490117, "Date": "02\/18\/2014", "Time": "09:22 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.002821, -87.917611 ], "Address": "525 W LINCOLN AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 6, "g_clusterK9": 6, "m_clusterK9": 6, "e_clusterK10": 8, "g_clusterK10": 8, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -87.917611196087478, 43.002821495672187 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 101, "Incident Number": 140410013, "Date": "02\/10\/2014", "Time": "05:39 AM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.001724, -87.908098 ], "Address": "2365 S BURRELL ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 6, "g_clusterK9": 6, "m_clusterK9": 6, "e_clusterK10": 8, "g_clusterK10": 8, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -87.908098185964121, 43.001723824631576 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 102, "Incident Number": 140360041, "Date": "02\/05\/2014", "Time": "10:45 AM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.993660, -87.920238 ], "Address": "700 W MONTANA ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 6, "g_clusterK9": 6, "m_clusterK9": 6, "e_clusterK10": 8, "g_clusterK10": 8, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -87.920237876276332, 42.993659500461348 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 103, "Incident Number": 140590015, "Date": "02\/28\/2014", "Time": "05:14 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.070175, -87.955096 ], "Address": "2818 N 33RD ST", "e_clusterK2": 0, "g_clusterK2": 1, "m_clusterK2": 0, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 1, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 4, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.95509636078269, 43.070174832361943 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 104, "Incident Number": 140580069, "Date": "02\/27\/2014", "Time": "04:19 PM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.056193, -87.964487 ], "Address": "4028 W LISBON AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 1, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 4, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 4, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.964486822494194, 43.056192645305494 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 105, "Incident Number": 140550065, "Date": "02\/24\/2014", "Time": "12:17 PM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.059747, -87.952723 ], "Address": "2200 N 31ST ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 1, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 4, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.952723451815075, 43.059746892030724 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 106, "Incident Number": 140530029, "Date": "02\/22\/2014", "Time": "09:16 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.070886, -87.959716 ], "Address": "2858 N 37TH ST", "e_clusterK2": 0, "g_clusterK2": 1, "m_clusterK2": 0, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 1, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 4, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -87.959716389636142, 43.070886 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 107, "Incident Number": 140530043, "Date": "02\/22\/2014", "Time": "11:25 AM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.068266, -87.925437 ], "Address": "2711 N 11TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.925436697760702, 43.068266185128785 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 108, "Incident Number": 140530091, "Date": "02\/22\/2014", "Time": "05:30 PM", "Police District": 7.0, "Offense 1": "AGGRAVATED ASSAULT", "Offense 2": "MOTOR VEHICLE THEFT", "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.069249, -87.953988 ], "Address": "2777 N 32ND ST", "e_clusterK2": 0, "g_clusterK2": 1, "m_clusterK2": 0, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 1, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 4, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.953987628108806, 43.069248586733238 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 109, "Incident Number": 140510130, "Date": "02\/20\/2014", "Time": "10:03 PM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.052713, -87.936193 ], "Address": "1834 W WALNUT ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.936192723007679, 43.052712504327836 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 110, "Incident Number": 140480061, "Date": "02\/17\/2014", "Time": "02:42 PM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.053983, -87.926023 ], "Address": "1108 W VINE ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.926023434574503, 43.053983228050875 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 111, "Incident Number": 140470019, "Date": "02\/16\/2014", "Time": "12:35 AM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.069634, -87.942704 ], "Address": "2403 W HADLEY ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 1, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 4, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.942703667638057, 43.069634466818719 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 112, "Incident Number": 140430116, "Date": "02\/12\/2014", "Time": "09:31 PM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.060704, -87.959990 ], "Address": "3700 W NORTH AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 1, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 4, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.959989709441459, 43.060704209441482 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 113, "Incident Number": 140420031, "Date": "02\/11\/2014", "Time": "10:54 AM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.061316, -87.957579 ], "Address": "2335 N 35TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 1, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 4, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.957579347866968, 43.061315859926097 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 114, "Incident Number": 140400048, "Date": "02\/09\/2014", "Time": "01:31 PM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.061733, -87.957548 ], "Address": "2355 N 35TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 1, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 4, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.957547597667897, 43.061733031363616 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 115, "Incident Number": 140390022, "Date": "02\/08\/2014", "Time": "06:17 AM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.052158, -87.950001 ], "Address": "1631 N 29TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 1, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 4, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.950001124790575, 43.052157754371279 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 116, "Incident Number": 140390064, "Date": "02\/08\/2014", "Time": "01:59 PM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.064414, -87.957434 ], "Address": "2500 N 35TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 1, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 4, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.957433893531274, 43.064414497085806 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 117, "Incident Number": 140370030, "Date": "02\/06\/2014", "Time": "11:02 AM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.064676, -87.958605 ], "Address": "2514 N 36TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 1, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 4, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.958605386317913, 43.064675832361928 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 118, "Incident Number": 140370082, "Date": "02\/06\/2014", "Time": "05:04 PM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.060675, -87.972742 ], "Address": "4700 W NORTH AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 1, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 4, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -87.972742393559926, 43.06067451875456 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 119, "Incident Number": 140350093, "Date": "02\/04\/2014", "Time": "02:41 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.069655, -87.948680 ], "Address": "2703 W ELDER WALLACE DR", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 1, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 4, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.948680059526595, 43.069654648740268 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 120, "Incident Number": 140350151, "Date": "02\/04\/2014", "Time": "08:32 PM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.060440, -87.929254 ], "Address": "1350 W NORTH AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.929253723007676, 43.0604395199084 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 121, "Incident Number": 140340075, "Date": "02\/03\/2014", "Time": "03:31 PM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.063209, -87.948652 ], "Address": "2432 N 28TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 1, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 4, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.948652360782688, 43.063208664723874 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 122, "Incident Number": 140580019, "Date": "02\/27\/2014", "Time": "08:55 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.100173, -87.995628 ], "Address": "4547 N 67TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 5, "g_clusterK8": 5, "m_clusterK8": 5, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -87.995627599255357, 43.100173089647427 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 123, "Incident Number": 140580033, "Date": "02\/27\/2014", "Time": "12:04 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.120531, -88.024405 ], "Address": "5600 N 90TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -88.024404653205877, 43.120531309597233 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 124, "Incident Number": 140580095, "Date": "02\/27\/2014", "Time": "08:29 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.124805, -87.999613 ], "Address": "5876 N 71ST ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 5, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -87.999612828034103, 43.124804832361946 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 125, "Incident Number": 140570027, "Date": "02\/26\/2014", "Time": "09:23 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.107491, -88.019101 ], "Address": "8584 W APPLETON AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -88.019100676034853, 43.107490630907428 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 126, "Incident Number": 140570089, "Date": "02\/26\/2014", "Time": "05:43 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.090134, -87.984393 ], "Address": "5700 W CAPITOL DR", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 0, "e_clusterK8": 5, "g_clusterK8": 5, "m_clusterK8": 5, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -87.984392972630985, 43.090134401484285 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 127, "Incident Number": 140570108, "Date": "02\/26\/2014", "Time": "08:58 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.099077, -88.002270 ], "Address": "7209 W RUBY AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 5, "g_clusterK8": 5, "m_clusterK8": 5, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -88.00227, 43.099076536211037 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 128, "Incident Number": 140570123, "Date": "02\/26\/2014", "Time": "09:15 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.093466, -87.985053 ], "Address": "5825 W HOPE AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 2, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 0, "e_clusterK8": 5, "g_clusterK8": 5, "m_clusterK8": 5, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -87.985053251457089, 43.093465513994033 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 129, "Incident Number": 140560125, "Date": "02\/25\/2014", "Time": "10:40 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.115807, -88.009119 ], "Address": "7900 W FOND DU LAC AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 5, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -88.009119046235128, 43.11580673432578 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 130, "Incident Number": 140560131, "Date": "02\/25\/2014", "Time": "11:47 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.121729, -88.016755 ], "Address": "8500 W FOND DU LAC AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 5, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -88.016755413238116, 43.12172894728478 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 131, "Incident Number": 140550038, "Date": "02\/24\/2014", "Time": "09:47 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.126084, -87.998393 ], "Address": "5952 N 70TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 5, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -87.998392893531275, 43.126083502914184 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 132, "Incident Number": 140550046, "Date": "02\/24\/2014", "Time": "11:00 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.112253, -88.017173 ], "Address": "8508 W VILLARD AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -88.01717310935426, 43.112252522649683 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 133, "Incident Number": 140550088, "Date": "02\/24\/2014", "Time": "03:09 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.105381, -88.006248 ], "Address": "4800 N 76TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 2, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 5, "g_clusterK8": 0, "m_clusterK8": 5, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -88.006247778060171, 43.105380758526245 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 134, "Incident Number": 140540046, "Date": "02\/23\/2014", "Time": "09:16 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.096195, -87.994491 ], "Address": "4333 N 66TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 5, "g_clusterK8": 5, "m_clusterK8": 5, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 3, "g_clusterK10": 4, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -87.994491132003944, 43.096194754371282 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 135, "Incident Number": 140540051, "Date": "02\/23\/2014", "Time": "11:21 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.121270, -87.998852 ], "Address": "7003 W THURSTON CT", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 5, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -87.998852405620724, 43.121270170119558 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 136, "Incident Number": 140540056, "Date": "02\/23\/2014", "Time": "01:02 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.121970, -88.004709 ], "Address": "5733 N 75TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 5, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -88.004709139217297, 43.121969863725553 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 137, "Incident Number": 140540061, "Date": "02\/23\/2014", "Time": "12:28 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.115337, -88.000911 ], "Address": "5401 N 72ND ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 1, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 2, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 5, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -88.00091068307438, 43.115337 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 138, "Incident Number": 140540086, "Date": "02\/23\/2014", "Time": "05:10 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.119663, -88.026063 ], "Address": "9100 W SILVER SPRING DR", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -88.026063284493404, 43.119663284493406 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 139, "Incident Number": 140530039, "Date": "02\/22\/2014", "Time": "09:50 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.109988, -88.001933 ], "Address": "7219 W FOND DU LAC AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 5, "g_clusterK8": 0, "m_clusterK8": 5, "e_clusterK9": 2, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -88.001932608401972, 43.109988078250453 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 140, "Incident Number": 140530093, "Date": "02\/22\/2014", "Time": "06:00 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.122981, -88.018342 ], "Address": "8620 W FOND DU LAC AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 5, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -88.018341777771724, 43.122980878469377 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 141, "Incident Number": 140520097, "Date": "02\/21\/2014", "Time": "05:48 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.098778, -87.995669 ], "Address": "4467 N 67TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 5, "g_clusterK8": 5, "m_clusterK8": 5, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -87.995669157539169, 43.098777754371298 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 142, "Incident Number": 140520129, "Date": "02\/21\/2014", "Time": "08:32 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.097985, -88.003074 ], "Address": "4430 N 73RD ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 5, "g_clusterK8": 5, "m_clusterK8": 5, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -88.00307438631792, 43.097985450458765 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 143, "Incident Number": 140510021, "Date": "02\/20\/2014", "Time": "07:34 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.108570, -88.020462 ], "Address": "8720 W APPLETON AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -88.020461814992359, 43.108569889000968 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 144, "Incident Number": 140510100, "Date": "02\/20\/2014", "Time": "05:43 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.100578, -88.004522 ], "Address": "4567 N 74TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 5, "g_clusterK8": 5, "m_clusterK8": 5, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -88.004521632003943, 43.100577555369625 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 145, "Incident Number": 140500007, "Date": "02\/19\/2014", "Time": "12:16 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.122096, -88.035664 ], "Address": "5738 N 99TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -88.035663864100911, 43.122096303912514 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 146, "Incident Number": 140480053, "Date": "02\/17\/2014", "Time": "01:26 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.112222, -88.008700 ], "Address": "7801 W VILLARD AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 5, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -88.008700416180972, 43.112222488458826 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 147, "Incident Number": 140480096, "Date": "02\/17\/2014", "Time": "08:29 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.121539, -88.033290 ], "Address": "5709 N 97TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -88.033290048184924, 43.121538618096821 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 148, "Incident Number": 140460064, "Date": "02\/15\/2014", "Time": "09:18 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.115339, -88.008990 ], "Address": "7839 W FOND DU LAC AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 5, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -88.008990138236356, 43.115338845115225 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 149, "Incident Number": 140460124, "Date": "02\/15\/2014", "Time": "05:02 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.115580, -88.002045 ], "Address": "5414 N 73RD ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 5, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -88.002044860782689, 43.11558 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 150, "Incident Number": 140460125, "Date": "02\/15\/2014", "Time": "05:05 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.121006, -87.992233 ], "Address": "5668 N 65TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 2, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 5, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -87.992232911853137, 43.121005994171611 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 151, "Incident Number": 140460153, "Date": "02\/15\/2014", "Time": "11:59 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.089195, -87.985587 ], "Address": "3950 N 58TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 0, "e_clusterK8": 5, "g_clusterK8": 5, "m_clusterK8": 5, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -87.985587355502574, 43.089195111575968 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 152, "Incident Number": 140450017, "Date": "02\/14\/2014", "Time": "08:59 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.124723, -87.993394 ], "Address": "5874 N 66TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 5, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -87.993393828034101, 43.124723413266793 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 153, "Incident Number": 140450058, "Date": "02\/14\/2014", "Time": "02:26 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.110143, -87.992433 ], "Address": "5110 N 65TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 0, "e_clusterK8": 5, "g_clusterK8": 5, "m_clusterK8": 5, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 5, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -87.992432860782685, 43.110142910352579 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 154, "Incident Number": 140440076, "Date": "02\/13\/2014", "Time": "04:26 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.126569, -88.015694 ], "Address": "5974 N 84TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -88.015693922384713, 43.12656871717931 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 155, "Incident Number": 140430015, "Date": "02\/12\/2014", "Time": "08:27 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.098120, -87.999438 ], "Address": "4437 N 70TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 5, "g_clusterK8": 5, "m_clusterK8": 5, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -87.999438124790586, 43.098119832361931 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 156, "Incident Number": 140420027, "Date": "02\/11\/2014", "Time": "10:11 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.118513, -88.029882 ], "Address": "9402 W SHERIDAN AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -88.029882083819032, 43.118513453257378 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 157, "Incident Number": 140420029, "Date": "02\/11\/2014", "Time": "10:22 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.102440, -87.995506 ], "Address": "4670 N 67TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 5, "g_clusterK8": 5, "m_clusterK8": 5, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -87.995506360782699, 43.10244041909516 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 158, "Incident Number": 140420079, "Date": "02\/11\/2014", "Time": "06:43 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.091923, -87.991061 ], "Address": "6320 W FIEBRANTZ AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 5, "g_clusterK8": 5, "m_clusterK8": 5, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -87.991061095918923, 43.091923069250662 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 159, "Incident Number": 140410112, "Date": "02\/10\/2014", "Time": "07:59 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.133925, -88.023954 ], "Address": "8929 W MILL RD", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 5, "g_clusterK10": 3, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -88.02395377764131, 43.133924697118573 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 160, "Incident Number": 140410118, "Date": "02\/10\/2014", "Time": "10:37 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.133882, -88.021583 ], "Address": "8739 W MILL RD", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 5, "g_clusterK10": 3, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -88.021583025535222, 43.133881528420758 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 161, "Incident Number": 140400038, "Date": "02\/09\/2014", "Time": "10:54 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.095186, -87.995664 ], "Address": "4272 N 67TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 5, "g_clusterK8": 5, "m_clusterK8": 5, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 3, "g_clusterK10": 4, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -87.995663944601731, 43.095185717179305 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 162, "Incident Number": 140400050, "Date": "02\/09\/2014", "Time": "12:42 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.099758, -87.999373 ], "Address": "4524 N 70TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 5, "g_clusterK8": 5, "m_clusterK8": 5, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -87.99937283524747, 43.099758 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 163, "Incident Number": 140400069, "Date": "02\/09\/2014", "Time": "05:52 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.110844, -88.023425 ], "Address": "8928 W APPLETON AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -88.023425458855556, 43.110844152143493 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 164, "Incident Number": 140360008, "Date": "02\/08\/2014", "Time": "07:19 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.116928, -87.994375 ], "Address": "5430 N 67TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 0, "e_clusterK8": 5, "g_clusterK8": 0, "m_clusterK8": 5, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -87.994374552500048, 43.116928281730665 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 165, "Incident Number": 140390030, "Date": "02\/08\/2014", "Time": "08:36 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.113509, -87.991092 ], "Address": "5262 N 64TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 0, "e_clusterK8": 5, "g_clusterK8": 4, "m_clusterK8": 5, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -87.991092400744634, 43.113508742714515 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 166, "Incident Number": 140390035, "Date": "02\/08\/2014", "Time": "09:00 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.122586, -88.019653 ], "Address": "8654 W MEDFORD AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 5, "g_clusterK10": 3, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -88.019653223959963, 43.122585812395286 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 167, "Incident Number": 140390040, "Date": "02\/08\/2014", "Time": "10:08 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.123078, -88.035292 ], "Address": "9825 W CARMEN AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -88.035291570777275, 43.123078499567313 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 168, "Incident Number": 140390050, "Date": "02\/08\/2014", "Time": "11:11 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.132742, -88.007301 ], "Address": "6323 N 77TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 5, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -88.007300599255359, 43.132741910352593 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 169, "Incident Number": 140390054, "Date": "02\/08\/2014", "Time": "12:25 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.108723, -87.993718 ], "Address": "5011 N 66TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 0, "e_clusterK8": 5, "g_clusterK8": 5, "m_clusterK8": 5, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 5, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -87.993718106468719, 43.108722670552254 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 170, "Incident Number": 140380034, "Date": "02\/07\/2014", "Time": "11:39 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.103198, -87.996829 ], "Address": "4715 N 68TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 5, "g_clusterK8": 5, "m_clusterK8": 5, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -87.996829037076409, 43.1031975925616 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 171, "Incident Number": 140380132, "Date": "02\/07\/2014", "Time": "09:28 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.125399, -88.000941 ], "Address": "5915 N 72ND ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 5, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -88.000941124790586, 43.125398832361952 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 172, "Incident Number": 140370015, "Date": "02\/06\/2014", "Time": "07:50 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.121285, -88.032822 ], "Address": "9626 W THURSTON AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -88.032821642102832, 43.121284522072763 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 173, "Incident Number": 140350034, "Date": "02\/04\/2014", "Time": "09:33 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.132349, -88.008611 ], "Address": "7808 W BENDER AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 5, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -88.008610667638067, 43.132349460470756 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 174, "Incident Number": 140350136, "Date": "02\/04\/2014", "Time": "07:40 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.093584, -87.975733 ], "Address": "4204 N 50TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 5, "g_clusterK8": 5, "m_clusterK8": 4, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -87.975733382422774, 43.093584136274472 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 175, "Incident Number": 140340024, "Date": "02\/03\/2014", "Time": "07:44 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.103739, -87.992070 ], "Address": "6415 W LEON TR", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 5, "g_clusterK8": 5, "m_clusterK8": 5, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -87.992070085780938, 43.103739322494199 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 176, "Incident Number": 140340111, "Date": "02\/03\/2014", "Time": "06:46 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.124642, -87.999690 ], "Address": "5867 N 71ST ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 5, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -87.999690124790575, 43.124642276992319 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 177, "Incident Number": 140320045, "Date": "02\/01\/2014", "Time": "11:44 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.119548, -87.991151 ], "Address": "6400 W SILVER SPRING DR", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 2, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 5, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -87.991150542397037, 43.119547956927775 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 178, "Incident Number": 140320066, "Date": "02\/01\/2014", "Time": "01:35 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.096662, -87.998172 ], "Address": "4356 N 69TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 5, "g_clusterK8": 5, "m_clusterK8": 5, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 3, "g_clusterK10": 4, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -87.998172393531277, 43.096661664723882 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 179, "Incident Number": 140590053, "Date": "02\/28\/2014", "Time": "02:37 PM", "Police District": 1.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.066835, -87.887964 ], "Address": "2632 N OAKLAND AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.887964407957995, 43.066835413266773 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 180, "Incident Number": 140350031, "Date": "02\/04\/2014", "Time": "08:49 AM", "Police District": 1.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.050966, -87.892566 ], "Address": "1609 N PROSPECT AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 4, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.89256618336286, 43.050965928414662 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 181, "Incident Number": 140590032, "Date": "02\/28\/2014", "Time": "11:46 AM", "Police District": 1.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.043011, -87.919088 ], "Address": "600 W STATE ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 0, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 4, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 6, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -87.919088071534787, 43.043011273578657 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 182, "Incident Number": 140570114, "Date": "02\/26\/2014", "Time": "09:41 PM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.042788, -87.927218 ], "Address": "945 N 12TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 0, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 4, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.927217848052464, 43.042788322078152 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 183, "Incident Number": 140520101, "Date": "02\/21\/2014", "Time": "06:15 PM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.045869, -87.957022 ], "Address": "3421 W JUNEAU AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 1, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 1, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.957021525535225, 43.045869470136957 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 184, "Incident Number": 140490092, "Date": "02\/18\/2014", "Time": "06:37 PM", "Police District": 1.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.037329, -87.911453 ], "Address": "111 W MICHIGAN ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 5, "m_clusterK6": 4, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 2, "g_clusterK8": 6, "m_clusterK8": 2, "e_clusterK9": 8, "g_clusterK9": 6, "m_clusterK9": 6, "e_clusterK10": 8, "g_clusterK10": 8, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -87.911453453635346, 43.037329045178382 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 185, "Incident Number": 140430073, "Date": "02\/12\/2014", "Time": "05:27 PM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.048736, -87.947937 ], "Address": "2700 W VLIET ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.947937262175969, 43.048735579136554 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 186, "Incident Number": 140420018, "Date": "02\/11\/2014", "Time": "08:45 AM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.041739, -87.943362 ], "Address": "2420 W KILBOURN AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 1, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 6, "e_clusterK9": 1, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.943362302500688, 43.041739141983598 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 187, "Incident Number": 140420044, "Date": "02\/11\/2014", "Time": "01:31 PM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.050259, -87.957605 ], "Address": "1500 N 35TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 1, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 4, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.957604893531268, 43.050258723007687 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 188, "Incident Number": 140410040, "Date": "02\/10\/2014", "Time": "12:05 PM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.045861, -87.938694 ], "Address": "2024 W JUNEAU AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 5, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 2, "g_clusterK8": 1, "m_clusterK8": 6, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.938694167638062, 43.045861493219327 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 189, "Incident Number": 140350071, "Date": "02\/04\/2014", "Time": "11:51 AM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.050664, -87.957605 ], "Address": "1520 N 35TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 1, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 4, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.957604893531268, 43.050663723007688 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 190, "Incident Number": 140340028, "Date": "02\/03\/2014", "Time": "08:48 AM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.040322, -87.952430 ], "Address": "3010 W WELLS ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 5, "g_clusterK7": 6, "m_clusterK7": 5, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 1, "g_clusterK9": 8, "m_clusterK9": 1, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.952430467251418, 43.040322468261039 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 191, "Incident Number": 140590025, "Date": "02\/28\/2014", "Time": "09:22 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.104863, -88.035012 ], "Address": "9729 W HAMPTON AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -88.0350117485429, 43.104862542847485 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 192, "Incident Number": 140590026, "Date": "02\/28\/2014", "Time": "09:33 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.084557, -88.021362 ], "Address": "3715 N 87TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 1, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 2, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 5, "g_clusterK8": 5, "m_clusterK8": 0, "e_clusterK9": 0, "g_clusterK9": 5, "m_clusterK9": 0, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -88.021361628108806, 43.084557167638053 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 193, "Incident Number": 140580014, "Date": "02\/27\/2014", "Time": "08:06 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.106710, -88.020063 ], "Address": "8616 W POTOMAC AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -88.020062776415401, 43.106710451583943 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 194, "Incident Number": 140570065, "Date": "02\/26\/2014", "Time": "03:46 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.105070, -88.020302 ], "Address": "8620 W HAMPTON AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -88.0203015, 43.105070482110847 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 195, "Incident Number": 140560021, "Date": "02\/25\/2014", "Time": "08:25 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.105572, -88.024606 ], "Address": "4820 N 90TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -88.024606367996043, 43.105571832361932 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 196, "Incident Number": 140550023, "Date": "02\/24\/2014", "Time": "06:35 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.090921, -88.020150 ], "Address": "4047 N 86TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 1, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 2, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 5, "g_clusterK8": 5, "m_clusterK8": 0, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -88.020150132003948, 43.090920754371297 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 197, "Incident Number": 140550053, "Date": "02\/24\/2014", "Time": "11:22 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.106643, -88.040879 ], "Address": "4883 N 103RD ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -88.040878624790579, 43.106643083819023 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 198, "Incident Number": 140540111, "Date": "02\/23\/2014", "Time": "07:22 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.119566, -88.041173 ], "Address": "10330 W SILVER SPRING DR", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -88.041172868366715, 43.119565587215959 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 199, "Incident Number": 140530081, "Date": "02\/22\/2014", "Time": "04:17 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.106527, -88.040879 ], "Address": "4877 N 103RD ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -88.040878624790579, 43.106527058283802 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 200, "Incident Number": 140520060, "Date": "02\/21\/2014", "Time": "01:43 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.104926, -88.009221 ], "Address": "7731 W HAMPTON AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 1, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 2, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 5, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -88.009221441716193, 43.104925521207413 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 201, "Incident Number": 140520085, "Date": "02\/21\/2014", "Time": "04:26 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.095728, -88.033126 ], "Address": "9700 W GRANTOSA DR", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -88.033126077268562, 43.095727542154059 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 202, "Incident Number": 140510005, "Date": "02\/20\/2014", "Time": "12:40 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.087722, -88.037181 ], "Address": "9924 W METCALF PL", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -88.037181477782994, 43.087721520139539 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 203, "Incident Number": 140510040, "Date": "02\/20\/2014", "Time": "09:59 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.095456, -88.023931 ], "Address": "4313 N 89TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 1, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -88.023930650325809, 43.095456 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 204, "Incident Number": 140510108, "Date": "02\/20\/2014", "Time": "06:51 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.104087, -88.023276 ], "Address": "4740 N 89TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -88.023276379104544, 43.104086580904834 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 205, "Incident Number": 140500036, "Date": "02\/19\/2014", "Time": "09:09 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.079112, -88.018871 ], "Address": "3309 N 85TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 1, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 5, "g_clusterK8": 5, "m_clusterK8": 0, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 0, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -88.018871157539181, 43.079112 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 206, "Incident Number": 140470004, "Date": "02\/16\/2014", "Time": "12:34 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.105757, -88.048701 ], "Address": "10905 W JEFFREY LA", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -88.048700748542899, 43.105756506780686 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 207, "Incident Number": 140470028, "Date": "02\/16\/2014", "Time": "08:24 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.097881, -88.023481 ], "Address": "8831 W LAWRENCE AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -88.023481354982977, 43.097880532315898 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 208, "Incident Number": 140470064, "Date": "02\/16\/2014", "Time": "03:26 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.106647, -88.050033 ], "Address": "10958 W STARK ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -88.050033251457094, 43.106646518754566 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 209, "Incident Number": 140470084, "Date": "02\/16\/2014", "Time": "06:48 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.095728, -88.033126 ], "Address": "9700 W GRANTOSA DR", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -88.033126077268562, 43.095727542154059 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 210, "Incident Number": 140460141, "Date": "02\/15\/2014", "Time": "08:19 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.089062, -88.027575 ], "Address": "3970 N 92ND ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 1, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 5, "m_clusterK8": 0, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -88.027574652411474, 43.089061993890624 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 211, "Incident Number": 140450024, "Date": "02\/14\/2014", "Time": "12:54 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.081775, -88.009789 ], "Address": "3457 N 78TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 2, "g_clusterK6": 1, "m_clusterK6": 0, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 5, "g_clusterK8": 5, "m_clusterK8": 0, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -88.009789471579239, 43.081774543712868 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 212, "Incident Number": 140440007, "Date": "02\/13\/2014", "Time": "01:17 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.110452, -88.055516 ], "Address": "5102 N LOVERS LANE RD", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -88.055516202885002, 43.110451928854602 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 213, "Incident Number": 140420025, "Date": "02\/11\/2014", "Time": "09:59 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.108664, -88.024587 ], "Address": "5004 N 90TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -88.024586652609798, 43.108663913856653 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 214, "Incident Number": 140410022, "Date": "02\/10\/2014", "Time": "09:13 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.108667, -88.024852 ], "Address": "9012 W FAIRMOUNT AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -88.024851848120647, 43.108666804708946 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 215, "Incident Number": 140400084, "Date": "02\/09\/2014", "Time": "06:38 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.101604, -88.011946 ], "Address": "8009 W BECKETT AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 1, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 2, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -88.011945616452039, 43.1016038284668 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 216, "Incident Number": 140390098, "Date": "02\/08\/2014", "Time": "07:45 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.099906, -88.025429 ], "Address": "9017 W GRANTOSA DR", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -88.025428662069487, 43.099906401869831 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 217, "Incident Number": 140380026, "Date": "02\/07\/2014", "Time": "11:18 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.091816, -88.017685 ], "Address": "8408 W FIEBRANTZ AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 1, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 2, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 5, "g_clusterK8": 5, "m_clusterK8": 0, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -88.017685137576947, 43.091816064025359 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 218, "Incident Number": 140360030, "Date": "02\/05\/2014", "Time": "09:35 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.105510, -88.042171 ], "Address": "4825 N 104TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -88.042170664752533, 43.105510309740907 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 219, "Incident Number": 140350081, "Date": "02\/04\/2014", "Time": "01:36 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.095474, -88.027545 ], "Address": "4314 N 92ND ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -88.027544867996042, 43.095473664723869 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 220, "Incident Number": 140350085, "Date": "02\/04\/2014", "Time": "01:52 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.095474, -88.027545 ], "Address": "4314 N 92ND ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -88.027544867996042, 43.095473664723869 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 221, "Incident Number": 140330109, "Date": "02\/02\/2014", "Time": "11:21 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.145514, -88.035116 ], "Address": "7000 N 99TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 9, "g_clusterK10": 9, "m_clusterK10": 9 }, "geometry": { "type": "Point", "coordinates": [ -88.035115816925611, 43.145514387731566 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 222, "Incident Number": 140320061, "Date": "02\/01\/2014", "Time": "02:02 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.093105, -88.042128 ], "Address": "4161 N 104TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -88.042128132003953, 43.093104852068791 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 223, "Incident Number": 140320086, "Date": "02\/01\/2014", "Time": "05:32 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.097121, -88.026383 ], "Address": "4405 N 91ST ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -88.026383259632311, 43.097121135234026 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 224, "Incident Number": 140570020, "Date": "02\/26\/2014", "Time": "07:01 AM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.078454, -87.909544 ], "Address": "140 E CONCORDIA AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.909543974464768, 43.078454474897477 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 225, "Incident Number": 140570093, "Date": "02\/26\/2014", "Time": "05:52 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.081433, -87.910845 ], "Address": "3453 N 1ST ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.910845321304109, 43.08143316974612 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 226, "Incident Number": 140550153, "Date": "02\/24\/2014", "Time": "11:10 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.075394, -87.936903 ], "Address": "1909 W HOPKINS ST", "e_clusterK2": 0, "g_clusterK2": 1, "m_clusterK2": 0, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 4, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.936903428270412, 43.075394424635078 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 227, "Incident Number": 140520093, "Date": "02\/21\/2014", "Time": "05:21 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.069664, -87.936746 ], "Address": "2800 N 19TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.936745511556865, 43.06966419477871 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 228, "Incident Number": 140510056, "Date": "02\/20\/2014", "Time": "12:33 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.089430, -87.931881 ], "Address": "1635 W CAPITOL DR", "e_clusterK2": 0, "g_clusterK2": 1, "m_clusterK2": 0, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.931880696087475, 43.089429553955974 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 229, "Incident Number": 140500095, "Date": "02\/19\/2014", "Time": "04:06 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.089169, -87.906000 ], "Address": "401 E CAPITOL DR", "e_clusterK2": 0, "g_clusterK2": 1, "m_clusterK2": 0, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 8, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 7, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.906000069392306, 43.089168518899719 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 230, "Incident Number": 140490068, "Date": "02\/18\/2014", "Time": "03:30 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.082585, -87.914872 ], "Address": "3520 N 4TH ST", "e_clusterK2": 0, "g_clusterK2": 1, "m_clusterK2": 0, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 8, "g_clusterK9": 4, "m_clusterK9": 8, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.914872437388354, 43.082585077990643 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 231, "Incident Number": 140490076, "Date": "02\/18\/2014", "Time": "04:12 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.073004, -87.905206 ], "Address": "3000 N HOLTON ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.905205632196754, 43.07300382514012 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 232, "Incident Number": 140490077, "Date": "02\/18\/2014", "Time": "04:13 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.056410, -87.919015 ], "Address": "625 W BROWN ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.919015232681659, 43.056410267313126 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 233, "Incident Number": 140470080, "Date": "02\/16\/2014", "Time": "06:03 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.088335, -87.933291 ], "Address": "1800 W ATKINSON AV", "e_clusterK2": 0, "g_clusterK2": 1, "m_clusterK2": 0, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.93329081127618, 43.088334626638328 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 234, "Incident Number": 140450067, "Date": "02\/14\/2014", "Time": "03:34 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.060243, -87.908694 ], "Address": "231 E NORTH AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.90869407660567, 43.060242532315883 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 235, "Incident Number": 140420063, "Date": "02\/11\/2014", "Time": "03:01 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.072803, -87.913973 ], "Address": "2976 N MARTIN L KING JR DR", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.913972915171357, 43.072803 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 236, "Incident Number": 140420086, "Date": "02\/11\/2014", "Time": "08:27 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.078816, -87.919394 ], "Address": "625 W CONCORDIA AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.919393919095157, 43.07881649956731 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 237, "Incident Number": 140370037, "Date": "02\/06\/2014", "Time": "11:31 AM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.054344, -87.918737 ], "Address": "1817 N 6TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 4, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.918737310461594, 43.054344302919922 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 238, "Incident Number": 140350023, "Date": "02\/04\/2014", "Time": "06:17 AM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.054668, -87.909750 ], "Address": "1839 N PALMER ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 4, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.909749577615273, 43.054668450458763 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 239, "Incident Number": 140330035, "Date": "02\/02\/2014", "Time": "09:56 AM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.087320, -87.919701 ], "Address": "3863 N 7TH ST", "e_clusterK2": 0, "g_clusterK2": 1, "m_clusterK2": 0, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 8, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 7, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.919700909963609, 43.087320314903764 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 240, "Incident Number": 140570115, "Date": "02\/26\/2014", "Time": "09:47 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.080849, -87.969789 ], "Address": "3379 N 45TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 0, "m_clusterK4": 1, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 3, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 1, "g_clusterK7": 6, "m_clusterK7": 0, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 4, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -87.969789139217298, 43.080849335276127 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 241, "Incident Number": 140540052, "Date": "02\/23\/2014", "Time": "03:35 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.098076, -87.974508 ], "Address": "4445 N 49TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 5, "m_clusterK8": 4, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -87.974508040971543, 43.098075534277797 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 242, "Incident Number": 140540060, "Date": "02\/23\/2014", "Time": "12:43 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.111902, -87.980360 ], "Address": "5427 W VILLARD AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 5, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -87.98036005755911, 43.111901725200184 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 243, "Incident Number": 140540074, "Date": "02\/23\/2014", "Time": "03:15 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.099301, -87.957720 ], "Address": "4520 N HOPKINS ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.957719542559019, 43.099300968924872 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 244, "Incident Number": 140530018, "Date": "02\/22\/2014", "Time": "03:51 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.079883, -87.963206 ], "Address": "4000 W FOND DU LAC AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 1, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -87.96320588457742, 43.079882730507549 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 245, "Incident Number": 140530073, "Date": "02\/22\/2014", "Time": "03:16 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.111979, -87.985403 ], "Address": "5815 W VILLARD AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 5, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -87.985402774078125, 43.111978513994046 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 246, "Incident Number": 140530089, "Date": "02\/22\/2014", "Time": "04:16 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.103042, -87.960284 ], "Address": "4720 N 38TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.960283864677834, 43.103042497085823 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 247, "Incident Number": 140520092, "Date": "02\/21\/2014", "Time": "05:15 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.089941, -87.966932 ], "Address": "4000 N SHERMAN BL", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 1, "e_clusterK7": 1, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 1, "g_clusterK8": 5, "m_clusterK8": 1, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -87.966931533996956, 43.089941217310624 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 248, "Incident Number": 140510137, "Date": "02\/20\/2014", "Time": "03:46 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.099975, -87.963949 ], "Address": "4547 N 41ST ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.963948573720145, 43.09997483819032 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 249, "Incident Number": 140490011, "Date": "02\/18\/2014", "Time": "06:56 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.102791, -87.961550 ], "Address": "4709 N 39TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.961550157539179, 43.10279061226845 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 250, "Incident Number": 140490108, "Date": "02\/18\/2014", "Time": "08:18 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.094070, -87.957011 ], "Address": "4221 N 35TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.957011150325812, 43.09407 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 251, "Incident Number": 140480027, "Date": "02\/17\/2014", "Time": "09:26 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.078752, -87.963163 ], "Address": "3280 N 40TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 1, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -87.963162911853132, 43.078751664723882 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 252, "Incident Number": 140460038, "Date": "02\/15\/2014", "Time": "07:08 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.083854, -87.984423 ], "Address": "3612 N 57TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 1, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 0, "e_clusterK8": 5, "g_clusterK8": 5, "m_clusterK8": 1, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -87.984423400744646, 43.083853575076461 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 253, "Incident Number": 140460078, "Date": "02\/15\/2014", "Time": "10:49 AM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.076993, -87.948333 ], "Address": "2733 W AUER AV", "e_clusterK2": 0, "g_clusterK2": 1, "m_clusterK2": 0, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 1, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 4, "g_clusterK9": 8, "m_clusterK9": 4, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.948333167638054, 43.076992506780691 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 254, "Incident Number": 140450008, "Date": "02\/14\/2014", "Time": "02:29 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.076929, -87.959440 ], "Address": "3626 W FOND DU LAC AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 1, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -87.959440458480188, 43.076929451583958 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 255, "Incident Number": 140410081, "Date": "02\/10\/2014", "Time": "04:37 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.083314, -87.958393 ], "Address": "3602 N 36TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 1, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 2, "g_clusterK10": 4, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -87.958392911853124, 43.083314245628713 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 256, "Incident Number": 140410097, "Date": "02\/10\/2014", "Time": "07:04 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.068003, -87.967834 ], "Address": "4322 W CENTER ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 1, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 4, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -87.967833597044134, 43.06800321872042 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 257, "Incident Number": 140400033, "Date": "02\/09\/2014", "Time": "10:39 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.099301, -87.957720 ], "Address": "4520 N HOPKINS ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.957719542559019, 43.099300968924872 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 258, "Incident Number": 140390037, "Date": "02\/08\/2014", "Time": "09:58 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.097464, -87.974542 ], "Address": "4415 N 49TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 5, "m_clusterK8": 4, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -87.974541573720145, 43.097463534277807 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 259, "Incident Number": 140380018, "Date": "02\/07\/2014", "Time": "07:26 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.075782, -87.957276 ], "Address": "3122 N 35TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 0, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 1, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 4, "g_clusterK9": 8, "m_clusterK9": 4, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -87.957276393531274, 43.07578183236194 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 260, "Incident Number": 140380029, "Date": "02\/07\/2014", "Time": "10:28 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.076431, -87.964429 ], "Address": "3157 N 41ST ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 1, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -87.9644285809335, 43.076430586733238 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 261, "Incident Number": 140370033, "Date": "02\/06\/2014", "Time": "10:49 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.095709, -87.972140 ], "Address": "4328 N 47TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 5, "m_clusterK8": 4, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 4, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -87.972140031607466, 43.095709006108606 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 262, "Incident Number": 140360048, "Date": "02\/05\/2014", "Time": "03:18 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.082803, -87.975938 ], "Address": "3509 N 50TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 3, "g_clusterK5": 2, "m_clusterK5": 3, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 1, "g_clusterK7": 6, "m_clusterK7": 0, "e_clusterK8": 1, "g_clusterK8": 5, "m_clusterK8": 1, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -87.975937632003948, 43.082803005828396 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 263, "Incident Number": 140330068, "Date": "02\/02\/2014", "Time": "04:03 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.102405, -87.957991 ], "Address": "4679 N 36TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.95799065753917, 43.102404754371292 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 264, "Incident Number": 140320099, "Date": "02\/01\/2014", "Time": "08:30 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.100740, -87.957532 ], "Address": "3522 W GLENDALE AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.957531974464771, 43.100740486005975 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 265, "Incident Number": 140590055, "Date": "02\/28\/2014", "Time": "03:25 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.007130, -87.949298 ], "Address": "2065 S 28TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 6, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.949297548184916, 43.007130335276116 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 266, "Incident Number": 140590098, "Date": "02\/28\/2014", "Time": "09:09 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.024234, -87.938811 ], "Address": "2026 W PIERCE ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 6, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.938811335276128, 43.024234493219332 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 267, "Incident Number": 140580080, "Date": "02\/27\/2014", "Time": "07:01 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.018226, -87.961621 ], "Address": "3790 W DOROTHY PL", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 6, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.961621453345231, 43.018226271543135 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 268, "Incident Number": 140540049, "Date": "02\/23\/2014", "Time": "10:57 AM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.015939, -87.960401 ], "Address": "3701 W ORCHARD ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 6, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.960401025535219, 43.015938539529252 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 269, "Incident Number": 140530031, "Date": "02\/22\/2014", "Time": "09:39 AM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.004918, -87.943074 ], "Address": "2188 S MUSKEGO AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 6, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.943073520260185, 43.004918064154893 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 270, "Incident Number": 140530053, "Date": "02\/22\/2014", "Time": "12:40 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.023105, -87.953919 ], "Address": "719 S 32ND ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 6, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.953919091465082, 43.023104832361952 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 271, "Incident Number": 140530096, "Date": "02\/22\/2014", "Time": "06:14 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.012871, -87.958796 ], "Address": "1670 S 36TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 6, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.958795883270952, 43.012871041479528 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 272, "Incident Number": 140530001, "Date": "02\/21\/2014", "Time": "07:04 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.011226, -87.949249 ], "Address": "1755 S 28TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 6, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.949249022649695, 43.011226005828377 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 273, "Incident Number": 140510033, "Date": "02\/19\/2014", "Time": "10:42 AM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.015984, -87.951231 ], "Address": "2928 W ORCHARD ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 6, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.951231, 43.015983504327828 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 274, "Incident Number": 140490020, "Date": "02\/18\/2014", "Time": "08:30 AM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.008948, -87.939523 ], "Address": "1966 S 21ST ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 6, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.93952343738836, 43.008947580904845 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 275, "Incident Number": 140480065, "Date": "02\/17\/2014", "Time": "01:45 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.006436, -87.950394 ], "Address": "2108 S 29TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 6, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.950394462923583, 43.006435994171625 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 276, "Incident Number": 140480088, "Date": "02\/17\/2014", "Time": "08:14 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.010227, -87.940038 ], "Address": "1900 S MUSKEGO AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 6, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.94003809267717, 43.010226797103201 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 277, "Incident Number": 140470035, "Date": "02\/16\/2014", "Time": "09:42 AM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.011314, -87.944571 ], "Address": "2430 W MAPLE ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 6, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.944570664723869, 43.011314474897482 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 278, "Incident Number": 140460007, "Date": "02\/15\/2014", "Time": "01:04 AM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.015097, -87.960870 ], "Address": "3716 W BRANTING LA", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 6, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.960870083819032, 43.015097460470749 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 279, "Incident Number": 140460102, "Date": "02\/15\/2014", "Time": "02:21 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.004268, -87.954134 ], "Address": "2222 S 32ND ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 6, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.954134419066492, 43.004267832361933 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 280, "Incident Number": 140450026, "Date": "02\/14\/2014", "Time": "09:38 AM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.003166, -87.952001 ], "Address": "3000 W LINCOLN AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 6, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.952000919095155, 43.003166467684125 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 281, "Incident Number": 140440066, "Date": "02\/13\/2014", "Time": "02:51 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.995755, -87.951912 ], "Address": "3003 W CLEVELAND AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 6, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.951912207372288, 42.995754953419038 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 282, "Incident Number": 140430061, "Date": "02\/12\/2014", "Time": "04:01 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.011847, -87.942222 ], "Address": "1728 S 23RD ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 6, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.942222381845852, 43.011846974464788 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 283, "Incident Number": 140310047, "Date": "02\/07\/2014", "Time": "12:42 PM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.989655, -87.958005 ], "Address": "3036 S 35TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 6, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.958004651413901, 42.989655348586091 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 284, "Incident Number": 140380045, "Date": "02\/07\/2014", "Time": "12:20 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.010207, -87.959742 ], "Address": "3625 W BURNHAM ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 6, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.959742113653419, 43.010207488458803 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 285, "Incident Number": 140370024, "Date": "02\/06\/2014", "Time": "09:53 AM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.012576, -87.960351 ], "Address": "1669 S 37TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 6, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.960350606468722, 43.01257558673322 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 286, "Incident Number": 140360113, "Date": "02\/05\/2014", "Time": "05:52 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.019955, -87.939491 ], "Address": "1021 S 21ST ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 6, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.939491092618923, 43.019955167638074 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 287, "Incident Number": 140360141, "Date": "02\/05\/2014", "Time": "07:14 PM", "Police District": 2.0, "Offense 1": "BURGLARY\/BREAKING AND ENTERING", "Offense 2": "MOTOR VEHICLE THEFT", "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.011946, -87.958909 ], "Address": "1717 S 36TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 6, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.958908595360214, 43.011945586733219 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 288, "Incident Number": 140360152, "Date": "02\/05\/2014", "Time": "09:20 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.021296, -87.942166 ], "Address": "922 S 23RD ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 6, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.942166451815083, 43.021296 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 289, "Incident Number": 140330004, "Date": "02\/02\/2014", "Time": "01:15 AM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.018659, -87.939489 ], "Address": "1213 S 21ST ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 6, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.939489062611642, 43.018659 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 290, "Incident Number": 140330056, "Date": "02\/02\/2014", "Time": "02:27 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.013197, -87.952752 ], "Address": "1639 S 31ST ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 6, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.95275159925535, 43.013196838190311 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 291, "Incident Number": 140590027, "Date": "02\/28\/2014", "Time": "09:40 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.181272, -88.028692 ], "Address": "8827 N 95TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 9, "g_clusterK10": 9, "m_clusterK10": 9 }, "geometry": { "type": "Point", "coordinates": [ -88.028691609786947, 43.181271953372971 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 292, "Incident Number": 140590029, "Date": "02\/28\/2014", "Time": "10:28 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.158648, -87.988767 ], "Address": "6164 W PORT AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 1, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 2, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 2, "e_clusterK10": 9, "g_clusterK10": 9, "m_clusterK10": 9 }, "geometry": { "type": "Point", "coordinates": [ -87.988767310260499, 43.158647993652011 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 293, "Incident Number": 140590105, "Date": "02\/28\/2014", "Time": "10:42 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.173474, -88.042819 ], "Address": "8573 N 106TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 9, "g_clusterK10": 9, "m_clusterK10": 9 }, "geometry": { "type": "Point", "coordinates": [ -88.042819471579236, 43.173473898695818 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 294, "Incident Number": 140570023, "Date": "02\/26\/2014", "Time": "08:09 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.141393, -88.007741 ], "Address": "7801 W GREEN TREE RD", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 7, "g_clusterK9": 2, "m_clusterK9": 7, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -88.007740941716193, 43.141392546742622 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 295, "Incident Number": 140570096, "Date": "02\/26\/2014", "Time": "05:52 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.134958, -87.982070 ], "Address": "6443 N 56TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 3, "m_clusterK4": 1, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 5, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.982070176437944, 43.1349577543713 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 296, "Incident Number": 140570127, "Date": "02\/26\/2014", "Time": "10:47 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.118723, -87.983626 ], "Address": "5554 N 57TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 5, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -87.983626360782694, 43.118722529834407 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 297, "Incident Number": 140560091, "Date": "02\/25\/2014", "Time": "07:09 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.182327, -87.996130 ], "Address": "8911 N 70TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 9, "g_clusterK10": 9, "m_clusterK10": 9 }, "geometry": { "type": "Point", "coordinates": [ -87.996130274655044, 43.182326599486522 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 298, "Incident Number": 140710120, "Date": "02\/24\/2014", "Time": "07:42 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.177608, -88.023010 ], "Address": "8975 W BROWN DEER RD", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 9, "g_clusterK10": 9, "m_clusterK10": 9 }, "geometry": { "type": "Point", "coordinates": [ -88.023010248542903, 43.177607531738985 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 299, "Incident Number": 140530057, "Date": "02\/22\/2014", "Time": "01:24 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.119084, -87.988967 ], "Address": "6229 W SILVER SPRING DR", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 2, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 5, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -87.988966558039692, 43.119083984898502 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 300, "Incident Number": 140520126, "Date": "02\/21\/2014", "Time": "06:15 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.178016, -88.010631 ], "Address": "8110 W BROWN DEER RD", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 9, "g_clusterK10": 9, "m_clusterK10": 9 }, "geometry": { "type": "Point", "coordinates": [ -88.010630990947263, 43.178016031295606 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 301, "Incident Number": 140510063, "Date": "02\/20\/2014", "Time": "01:24 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.121523, -87.989628 ], "Address": "5736 N 63RD ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 2, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 5, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -87.989628217054644, 43.121523129394362 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 302, "Incident Number": 140510115, "Date": "02\/20\/2014", "Time": "04:35 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.136065, -87.982049 ], "Address": "6507 N 56TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 3, "m_clusterK4": 1, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 5, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.982049150325807, 43.13606475437129 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 303, "Incident Number": 140500148, "Date": "02\/19\/2014", "Time": "10:59 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.118389, -87.964678 ], "Address": "5541 N 42ND ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.964678092042007, 43.118388586733232 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 304, "Incident Number": 140480063, "Date": "02\/17\/2014", "Time": "02:58 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.151227, -88.018154 ], "Address": "7340 N 86TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 9, "g_clusterK10": 9, "m_clusterK10": 9 }, "geometry": { "type": "Point", "coordinates": [ -88.018153886317918, 43.151227407438398 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 305, "Incident Number": 140440017, "Date": "02\/13\/2014", "Time": "06:51 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.157653, -88.044576 ], "Address": "7704 N 107TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 9, "g_clusterK10": 9, "m_clusterK10": 9 }, "geometry": { "type": "Point", "coordinates": [ -88.044575940129661, 43.157653239800339 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 306, "Incident Number": 140430018, "Date": "02\/12\/2014", "Time": "09:01 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.134965, -87.997014 ], "Address": "6817 W BRENTWOOD AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 5, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -87.997014083819025, 43.134964513994049 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 307, "Incident Number": 140430026, "Date": "02\/12\/2014", "Time": "11:34 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.174350, -88.042907 ], "Address": "8647 N 106TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 9, "g_clusterK10": 9, "m_clusterK10": 9 }, "geometry": { "type": "Point", "coordinates": [ -88.04290709000739, 43.174350086139079 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 308, "Incident Number": 140430069, "Date": "02\/12\/2014", "Time": "04:31 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.157485, -88.004794 ], "Address": "7676 N 76TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 9, "g_clusterK10": 9, "m_clusterK10": 9 }, "geometry": { "type": "Point", "coordinates": [ -88.004793888482297, 43.157485247013689 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 309, "Incident Number": 140410025, "Date": "02\/10\/2014", "Time": "09:31 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.142238, -87.985563 ], "Address": "6840 N 60TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 1, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 2, "g_clusterK6": 0, "m_clusterK6": 2, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 5, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.985562875209411, 43.142237633360281 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 310, "Incident Number": 140410047, "Date": "02\/10\/2014", "Time": "12:40 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.154378, -88.019922 ], "Address": "7492 N 87TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 9, "g_clusterK10": 9, "m_clusterK10": 9 }, "geometry": { "type": "Point", "coordinates": [ -88.019922407957992, 43.15437779516995 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 311, "Incident Number": 140410123, "Date": "02\/10\/2014", "Time": "11:28 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.172430, -88.038564 ], "Address": "8455 N 103RD ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 9, "g_clusterK10": 9, "m_clusterK10": 9 }, "geometry": { "type": "Point", "coordinates": [ -88.038563503635331, 43.172430224796685 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 312, "Incident Number": 140400029, "Date": "02\/09\/2014", "Time": "09:40 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.159872, -87.990737 ], "Address": "6421 W PORT AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 1, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 9, "g_clusterK10": 9, "m_clusterK10": 9 }, "geometry": { "type": "Point", "coordinates": [ -87.990736732211587, 43.159872334410743 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 313, "Incident Number": 140400032, "Date": "02\/09\/2014", "Time": "10:38 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.180489, -88.028728 ], "Address": "9031 N 95TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 9, "g_clusterK10": 9, "m_clusterK10": 9 }, "geometry": { "type": "Point", "coordinates": [ -88.028727525967909, 43.180489288649085 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 314, "Incident Number": 140390036, "Date": "02\/08\/2014", "Time": "09:44 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.134652, -88.007442 ], "Address": "7716 W BRENTWOOD AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 5, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -88.007441778925553, 43.134651826822022 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 315, "Incident Number": 140360066, "Date": "02\/05\/2014", "Time": "01:53 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.145686, -88.017511 ], "Address": "8525 W HELENA ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 9, "g_clusterK10": 9, "m_clusterK10": 9 }, "geometry": { "type": "Point", "coordinates": [ -88.0175115, 43.145685525102529 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 316, "Incident Number": 140350090, "Date": "02\/04\/2014", "Time": "02:24 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.187783, -88.001907 ], "Address": "7451 W GLENBROOK RD", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 9, "g_clusterK10": 9, "m_clusterK10": 9 }, "geometry": { "type": "Point", "coordinates": [ -88.001906643199362, 43.187782801517933 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 317, "Incident Number": 140350121, "Date": "02\/04\/2014", "Time": "06:00 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.153642, -88.021112 ], "Address": "8734 W MAGNOLIA ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 9, "g_clusterK10": 9, "m_clusterK10": 9 }, "geometry": { "type": "Point", "coordinates": [ -88.021111583819035, 43.153641511541196 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 318, "Incident Number": 140350126, "Date": "02\/04\/2014", "Time": "06:36 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.178048, -88.002559 ], "Address": "7440 W BROWN DEER RD", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 9, "g_clusterK10": 9, "m_clusterK10": 9 }, "geometry": { "type": "Point", "coordinates": [ -88.002558664428776, 43.178047520594532 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 319, "Incident Number": 140350169, "Date": "02\/04\/2014", "Time": "10:24 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.117501, -87.991003 ], "Address": "5460 N 64TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 2, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 5, "g_clusterK8": 4, "m_clusterK8": 5, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -87.99100315269817, 43.117501395209267 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 320, "Incident Number": 140340132, "Date": "02\/03\/2014", "Time": "09:38 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.182718, -88.002626 ], "Address": "9001 N 75TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 9, "g_clusterK10": 9, "m_clusterK10": 9 }, "geometry": { "type": "Point", "coordinates": [ -88.002626059408996, 43.182718480985649 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 321, "Incident Number": 140320022, "Date": "02\/01\/2014", "Time": "08:13 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.135208, -88.001026 ], "Address": "6440 N LANDERS ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 5, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -88.001025828034102, 43.135208413266781 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 322, "Incident Number": 140320025, "Date": "02\/01\/2014", "Time": "09:05 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.187323, -88.002716 ], "Address": "9231 N 75TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 9, "g_clusterK10": 9, "m_clusterK10": 9 }, "geometry": { "type": "Point", "coordinates": [ -88.002715811723633, 43.187323184868788 ] } }, { "type": "Feature", "properties": { "Unnamed: 0": 323, "Incident Number": 140320060, "Date": "02\/01\/2014", "Time": "01:58 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.135039, -87.999520 ], "Address": "7026 W BRENTWOOD AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 5, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -87.999520416180971, 43.135039486005979 ] } } ] }
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); //# sourceMappingURL=IParameters.js.map
/* eslint-disable no-case-declarations */ import axios from 'axios'; // Our global state object just for votes const initialState = []; // Reducers, a function that takes an action and produces a new version of state, from a payload and a type. export default (state = initialState, action) => { const { type, payload } = action; switch (type) { case 'FETCH_PRODUCTS': return payload; default: return state; } }; // actions are the functions that components can run themselves export const fetchProducts = () => async (dispatch) => { const response = await axios.get('http://localhost:3000/products'); dispatch({ type: 'FETCH_PRODUCTS', payload: response.data, }); }; export const getOneProduct = (product) => async (dispatch) => { const response = await axios.get(`http://localhost:3000/products/${product.id}`); dispatch({ type: 'GET_PRODUCT', payload: response.data, }); }; export const removeInventory = (product) => async (dispatch) => { product.inventory = product.inventory - 1; await axios( { url: `http://localhost:3000/products/${product.id}`, method: 'put', mode: 'cors', cache: 'no-cache', headers: { 'Content-Type': 'application/json' }, data: JSON.stringify(product), }); const response = await axios.get(`http://localhost:3000/products`); dispatch({ type: 'FETCH_PRODUCTS', payload: response.data, }); }; export const addInventory = (product) => async (dispatch) => { product.inventory = product.inventory + 1; await axios( { url: `http://localhost:3000/products/${product.id}`, method: 'put', mode: 'cors', cache: 'no-cache', headers: { 'Content-Type': 'application/json' }, data: JSON.stringify(product), }); const response = await axios.get(`http://localhost:3000/products`); dispatch({ type: 'FETCH_PRODUCTS', payload: response.data, }); };
"use strict"; module.exports = { up: async (queryInterface, Sequelize) => { await queryInterface.createTable("Answers", { id: { allowNull: false, autoIncrement: true, primaryKey: true, type: Sequelize.INTEGER }, UserId: { type: Sequelize.INTEGER, allowNull: false, }, QuestionOptionId: { type: Sequelize.INTEGER, allowNull: false, }, createdAt: { allowNull: false, type: Sequelize.DATE }, updatedAt: { allowNull: false, type: Sequelize.DATE } }); await queryInterface.addConstraint("Answers", { fields: ['UserId'], type: 'foreign key', name: 'Users_fkey_Answers_constraint', references: { //!Required field table: 'Users', field: 'id', schema: 'public' }, onDelete: 'cascade' }); await queryInterface.addConstraint("Answers", { fields: ['QuestionOptionId'], type: 'foreign key', name: 'QuestionOptions_fkey_Answers_constraint', references: { //!Required field table: 'Question_options', field: 'id', schema: 'public' }, onDelete: 'cascade' }); }, down: async (queryInterface, Sequelize) => { await queryInterface.dropTable("Answers"); } };
$(document).ready(function() { $("#connect-home").click(function() { $("#wrap-home").fadeOut(200); }); //弹出 $(function() { $("#wrap-home").hide(); $("#connect-home").dblclick(function() { $("#wrap-home").fadeIn(300); $("#close_x").click(function() { $("#wrap-home").fadeOut(200); }); }); }); //拖动 $("#wrap-home-title").mousedown(function(event) { var isMove = true; var abs_x = event.pageX - $('div.wrap-home').offset().left; var abs_y = event.pageY - $('div.wrap-home').offset().top; $(document).mousemove(function(event) { if (isMove) { var obj = $('div.wrap-home'); var left_x = event.pageX - abs_x; var top_y = event.pageY - abs_y; obj.css({ 'left': left_x, 'top': top_y }); } }).mouseup(function() { isMove = false; }); }); //窗口缩放 var oDiv = document.getElementById('wrap-home'); oDiv.onmousedown = function(ev) { // 获取event对象,兼容性写法 var ev = ev || event; // 鼠标按下时的位置 var mouseDownX = ev.clientX; var mouseDownY = ev.clientY; // 方块上下左右四个边的位置和方块的长宽 var T0 = this.offsetTop; var B0 = this.offsetTop + this.offsetHeight; var L0 = this.offsetLeft; var R0 = this.offsetLeft + this.offsetWidth; var W = this.offsetWidth; var H = this.offsetHeight; // 设置方块的识别范围 var areaT = T0 + 10; var areaB = B0 - 10; var areaL = L0 + 10; var areaR = R0 - 10; // 判断改变方块的大小的方向 // 左 var changeL = mouseDownX < areaL; // 右 var changeR = mouseDownX > areaR; // 上 var changeT = mouseDownY < areaT; // 下 var changeB = mouseDownY > areaB; // IE8 取消默认行为-设置全局捕获 if (oDiv.setCapture) { oDiv.setCapture(); } document.onmousemove = function(ev) { var ev = ev || event; // 鼠标移动时的鼠标位置 var mouseMoveX = ev.clientX; var mouseMoveY = ev.clientY; //根据改变方块大小的方向不同进行大小的改变 // 左 if (changeL) { oDiv.style.width = (mouseDownX - mouseMoveX) + W + 'px'; oDiv.style.left = L0 - (mouseDownX - mouseMoveX) + 'px'; } // 右 if (changeR) { oDiv.style.width = (mouseMoveX - mouseDownX) + W + 'px'; } // 上 if (changeT) { oDiv.style.height = (mouseDownY - mouseMoveY) + H + 'px'; oDiv.style.top = T0 - (mouseDownY - mouseMoveY) + 'px'; } // 下 if (changeB) { oDiv.style.height = (mouseMoveY - mouseDownY) + H + 'px'; } // 限定范围 if (parseInt(oDiv.style.width) < 50) { oDiv.style.width = 50 + 'px'; } if (parseInt(oDiv.style.height) < 50) { oDiv.style.height = 50 + 'px'; } } document.onmouseup = function() { document.onmousemove = null; // 释放全局捕获 if (oDiv.releaseCapture) { oDiv.releaseCapture(); } } return false; } });
function a() { } function b() { }
// // SPDX-FileCopyrightText: 2021 SAP SE or an SAP affiliate company and Gardener contributors // // SPDX-License-Identifier: Apache-2.0 // 'use strict' const _ = require('lodash') const { UnprocessableEntity, NotFound } = require('http-errors') const createError = require('http-errors') const MemberManager = require('../lib/services/members/MemberManager') const SubjectList = require('../lib/services/members/SubjectList') describe('services', function () { describe('members', function () { const memberSubjects = [ { apiGroup: 'rbac.authorization.k8s.io', kind: 'User', name: 'foo@bar.com', role: 'admin', roles: [ 'owner' ] }, { apiGroup: 'rbac.authorization.k8s.io', kind: 'User', name: 'mutiple@bar.com', role: 'admin' }, { kind: 'ServiceAccount', name: 'robot-sa', namespace: 'garden-foo', role: 'admin', roles: [ 'myrole', 'viewer' ] }, { apiGroup: 'rbac.authorization.k8s.io', kind: 'User', name: 'mutiple@bar.com', role: 'admin', roles: [ 'viewer' ] }, { apiGroup: 'rbac.authorization.k8s.io', kind: 'User', name: 'system:serviceaccount:garden-foo:robot-user', role: 'admin' }, { apiGroup: 'rbac.authorization.k8s.io', kind: 'User', name: 'system:serviceaccount:garden-foo:robot-multiple', role: 'otherrole' }, { kind: 'ServiceAccount', name: 'robot-multiple', namespace: 'garden-foo', role: 'admin', roles: [ 'myrole' ] }, { kind: 'ServiceAccount', name: 'robot-multiple', namespace: 'garden-foo', role: 'myrole', roles: [ 'viewer' ] }, { kind: 'ServiceAccount', name: 'robot-orphaned', namespace: 'garden-foo', role: 'myrole' }, { kind: 'ServiceAccount', name: 'robot-foreign-namespace', namespace: 'garden-foreign', role: 'myrole', roles: [ 'viewer' ] }, { apiGroup: 'rbac.authorization.k8s.io', kind: 'User', name: 'system:serviceaccount:garden-foreign:robot-foreign-namespace', role: 'admin' }, { apiGroup: 'rbac.authorization.k8s.io', kind: 'User', name: 'system:serviceaccount:garden-other-foreign:robot-other-foreign-namespace', role: 'otherrole' } ] const serviceAccounts = [ { metadata: { name: 'robot-sa', namespace: 'garden-foo', annotations: { 'dashboard.gardener.cloud/created-by': 'foo', 'dashboard.gardener.cloud/description': 'description' }, creationTimestamp: 'bar-time' }, secrets: [ { name: 'secret-1' } ] }, { metadata: { name: 'robot-user', namespace: 'garden-foo', annotations: { 'dashboard.gardener.cloud/created-by': 'foo' }, creationTimestamp: 'bar-time' } }, { metadata: { name: 'robot-multiple', namespace: 'garden-foo', annotations: { 'dashboard.gardener.cloud/created-by': 'foo' }, creationTimestamp: 'bar-time' }, secrets: [ { name: 'secret-1' }, { name: 'secret-2' } ] }, { metadata: { name: 'robot-nomember', namespace: 'garden-foo', annotations: { 'dashboard.gardener.cloud/created-by': 'foo' }, creationTimestamp: 'bar-time' } } ] const project = { spec: { members: memberSubjects, namespace: 'garden-foo' }, metadata: { name: 'foo' } } const client = { 'core.gardener.cloud': {}, core: {} } beforeEach(function () { client['core.gardener.cloud'].projects = { mergePatch: jest.fn().mockResolvedValue() } client.core.serviceaccounts = { create: jest.fn().mockImplementation((namespace, body) => { return Promise.resolve(_.set(body, 'metadata.creationTimestamp', 'now')) }), delete: jest.fn().mockImplementation((namespace, name) => { const item = _.find(serviceAccounts, { metadata: { name, namespace } }) if (!item) { return Promise.reject(createError(404)) } return Promise.resolve(item) }), mergePatch: jest.fn().mockResolvedValue() } client.core.secrets = { delete: jest.fn().mockResolvedValue() } }) describe('SubjectList', function () { const subjectList = new SubjectList(project) describe('#get', function () { it('should merge role, roles into roles', async function () { const memberRoles = subjectList.get('foo@bar.com').roles expect(memberRoles).toHaveLength(2) expect(memberRoles).toEqual(expect.arrayContaining(['admin', 'owner'])) }) }) describe('#has', function () { it('should merge role, roles into roles', async function () { expect(subjectList.has('foo@bar.com')).toBe(true) expect(subjectList.has('foo@baz.com')).toBe(false) }) }) }) describe('MemberManager', function () { let memberManager beforeEach(function () { memberManager = new MemberManager(client, 'creator', project, serviceAccounts) }) describe('#list', function () { // merge all roles // do not merge service accounts from different namespaces // include no member service accounts it('should merge multiple occurences of same user in members list', async function () { const frontendMemberList = memberManager.list() expect(frontendMemberList).toHaveLength(9) expect(frontendMemberList).toContainEqual({ username: 'mutiple@bar.com', roles: ['admin', 'viewer'] }) expect(frontendMemberList).toContainEqual({ username: 'system:serviceaccount:garden-foo:robot-multiple', roles: ['otherrole', 'admin', 'myrole', 'viewer'], createdBy: 'foo', creationTimestamp: 'bar-time', description: undefined }) expect(frontendMemberList).toContainEqual({ username: 'system:serviceaccount:garden-foreign:robot-foreign-namespace', roles: ['myrole', 'viewer', 'admin'] }) expect(frontendMemberList).toContainEqual({ username: 'system:serviceaccount:garden-foo:robot-nomember', roles: [], createdBy: 'foo', creationTimestamp: 'bar-time', description: undefined }) expect(frontendMemberList).toContainEqual({ username: 'system:serviceaccount:garden-foo:robot-orphaned', roles: ['myrole'], orphaned: true }) }) it('should normalize kind service account members subject to kind user with service account prefix and add metadata from service account', async function () { const frontendMemberList = memberManager.list() expect(frontendMemberList).toContainEqual({ username: 'system:serviceaccount:garden-foo:robot-sa', roles: ['admin', 'myrole', 'viewer'], createdBy: 'foo', creationTimestamp: 'bar-time', description: 'description' }) }) }) describe('#get', function () { it('should throw NotFound', async function () { await expect(memberManager.get('john.doe@baz.com')).rejects.toThrow(NotFound) }) }) describe('#create', function () { // update unique member // update mutiple member, remove + add role, check that minimal changes are applied to multiple accounts, sa members not migrated // delete, check that all occurrences are deleted it('should add a user to project', async function () { const name = 'newuser@bar.com' const roles = ['admin', 'viewer', 'myrole'] await memberManager.create(name, { roles }) // assign user to project const memberSubjects = memberManager.subjectList const newMemberListItem = memberSubjects.subjectListItems[name] expect(newMemberListItem.subject.name).toEqual(name) expect(newMemberListItem.subject.kind).toBe('User') expect(newMemberListItem.subject.role).toBe('admin') expect(newMemberListItem.subject.roles).toEqual(expect.arrayContaining(['viewer', 'myrole'])) expect(newMemberListItem.roles).toEqual(roles) }) it('should add a service account to project', async function () { const name = 'system:serviceaccount:garden-foo:newsa' const roles = ['sa-role'] await memberManager.create(name, { roles }) // assign user to project const memberSubjects = memberManager.subjectList const newMemberListItem = memberSubjects.subjectListItems[name] expect(newMemberListItem.subject.name).toBe('newsa') expect(newMemberListItem.subject.kind).toBe('ServiceAccount') expect(newMemberListItem.subject.role).toBe('sa-role') expect(newMemberListItem.roles).toEqual(roles) }) }) describe('#update', function () { it('should throw NotFound', async function () { await expect(memberManager.update('john.doe@baz.com', {})).rejects.toThrow(NotFound) }) it('should update a project member', async function () { const name = 'foo@bar.com' const roles = ['role1', 'role2'] await memberManager.update(name, { roles }) // assign user to project const memberSubjects = memberManager.subjectList const updatedMemberListItem = memberSubjects.subjectListItems[name] expect(updatedMemberListItem.subject.name).toEqual(name) expect(updatedMemberListItem.subject.kind).toBe('User') expect(updatedMemberListItem.subject.role).toBe('role1') expect(updatedMemberListItem.roles).toEqual(roles) }) it('should add new roles to first occurrence of user, remove roles of other occurrences that are no longer assigned to member', async function () { const name = 'mutiple@bar.com' const roles = ['admin', 'newrole'] await memberManager.update(name, { roles }) // assign user to project const memberSubjects = memberManager.subjectList const newMemberListItemGroup = memberSubjects.subjectListItems[name] const firstUpdatedMemberListItem = newMemberListItemGroup.items[0] const secondUpdatedMemberListItem = newMemberListItemGroup.items[1] expect(firstUpdatedMemberListItem.subject.role).toBe('admin') expect(firstUpdatedMemberListItem.subject.roles).toEqual(expect.arrayContaining(['newrole'])) expect(secondUpdatedMemberListItem.subject.role).toBe('admin') expect(secondUpdatedMemberListItem.subject.roles).toBeUndefined() }) it('should remove member occurrences without roles', async function () { const name = 'mutiple@bar.com' const roles = ['otherrole'] await memberManager.update(name, { roles }) // assign user to project const memberSubjects = memberManager.subjectList const newMemberListItemGroup = memberSubjects.subjectListItems[name] const firstUpdatedMemberListItem = newMemberListItemGroup.items[0] const secondUpdatedMemberListItem = newMemberListItemGroup.items[1] expect(firstUpdatedMemberListItem.subject.role).toBe('otherrole') expect(firstUpdatedMemberListItem.subject.roles).toBeUndefined() expect(secondUpdatedMemberListItem).toBeUndefined() }) it('should throw an error when trying to remove all roles with update', async function () { const name = 'foo@bar.com' const roles = [] await expect(memberManager.update(name, { roles })).rejects.toThrow(UnprocessableEntity) }) it('should not convert a service account kind user to kind serviceaccount', async function () { const name = 'system:serviceaccount:garden-foo:robot-user' const roles = ['admin', 'viewer'] await memberManager.update(name, { roles }) // assign user to project const memberSubjects = memberManager.subjectList const newMemberListItem = memberSubjects.subjectListItems[name] expect(newMemberListItem.subject.name).toEqual(name) expect(newMemberListItem.subject.kind).toBe('User') expect(newMemberListItem.subject.role).toBe('admin') expect(newMemberListItem.subject.roles).toEqual(expect.arrayContaining(['viewer'])) expect(newMemberListItem.roles).toEqual(roles) }) }) describe('#deleteServiceAccount', function () { it('should delete a serviceaccount', async function () { const id = 'system:serviceaccount:garden-foo:robot-sa' const item = memberManager.subjectList.get(id) await memberManager.deleteServiceAccount(item) expect(client.core.serviceaccounts.delete).toBeCalledWith('garden-foo', 'robot-sa') expect(memberManager.subjectList.has(id)).toBe(false) }) it('should not delete a serviceaccount from a different namespace', async function () { const id = 'system:serviceaccount:garden-foreign:robot-foreign-namespace' const item = memberManager.subjectList.get(id) await memberManager.deleteServiceAccount(item) expect(client.core.serviceaccounts.delete).not.toBeCalled() expect(memberManager.subjectList.has(id)).toBe(true) }) it('should not fail if service account has already been deleted', async function () { const id = 'system:serviceaccount:garden-foo:robot-orphaned' const item = memberManager.subjectList.get(id) await memberManager.deleteServiceAccount(item) expect(client.core.serviceaccounts.delete).toBeCalledWith('garden-foo', 'robot-orphaned') expect(memberManager.subjectList.has(id)).toBe(false) }) }) describe('#updateServiceAccount ', function () { it('should not update a serviceaccount from a different namespace', async function () { const id = 'system:serviceaccount:garden-foreign:robot-foreign-namespace' const item = memberManager.subjectList.get(id) await expect(memberManager.updateServiceAccount(item, {})).rejects.toThrow(UnprocessableEntity) }) }) describe('#deleteServiceAccountSecret', function () { it('should delete a serviceaccount secret', async function () { const id = 'system:serviceaccount:garden-foo:robot-sa' const item = memberManager.subjectList.get(id) await memberManager.deleteServiceAccountSecret(item) expect(client.core.secrets.delete).toBeCalledWith('garden-foo', 'secret-1') }) it('should not delete a serviceaccount secret from a different namespace', async function () { const id = 'system:serviceaccount:garden-foreign:robot-foreign-namespace' const item = memberManager.subjectList.get(id) await expect(memberManager.deleteServiceAccountSecret(item)).rejects.toThrow(UnprocessableEntity) }) it('should not delete a service account secret if there is one more secret attached', async function () { const id = 'system:serviceaccount:garden-foo:robot-multiple' const item = memberManager.subjectList.get(id) await expect(memberManager.deleteServiceAccountSecret(item)).rejects.toThrow(UnprocessableEntity) }) }) }) }) })
/** * SimpleBar.js - v5.1.0 * Scrollbars, simpler. * https://grsmto.github.io/simplebar/ * * Made by Adrien Denat from a fork by Jonathan Nicol * Under MIT License */ import 'core-js/modules/es.array.filter'; import 'core-js/modules/es.array.for-each'; import 'core-js/modules/es.array.iterator'; import 'core-js/modules/es.object.assign'; import 'core-js/modules/es.object.to-string'; import 'core-js/modules/es.parse-int'; import 'core-js/modules/es.string.iterator'; import 'core-js/modules/es.weak-map'; import 'core-js/modules/web.dom-collections.iterator'; import throttle from 'lodash.throttle'; import debounce from 'lodash.debounce'; import memoize from 'lodash.memoize'; import ResizeObserver from 'resize-observer-polyfill'; import canUseDOM from 'can-use-dom'; import 'core-js/modules/es.array.reduce'; import 'core-js/modules/es.function.name'; import 'core-js/modules/es.regexp.exec'; import 'core-js/modules/es.string.match'; import 'core-js/modules/es.string.replace'; var cachedScrollbarWidth = null; var cachedDevicePixelRatio = null; if (canUseDOM) { window.addEventListener('resize', function () { if (cachedDevicePixelRatio !== window.devicePixelRatio) { cachedDevicePixelRatio = window.devicePixelRatio; cachedScrollbarWidth = null; } }); } function scrollbarWidth() { if (cachedScrollbarWidth === null) { if (typeof document === 'undefined') { cachedScrollbarWidth = 0; return cachedScrollbarWidth; } var body = document.body; var box = document.createElement('div'); box.classList.add('simplebar-hide-scrollbar'); body.appendChild(box); var width = box.getBoundingClientRect().right; body.removeChild(box); cachedScrollbarWidth = width; } return cachedScrollbarWidth; } function getElementWindow(element) { if (!element || !element.ownerDocument || !element.ownerDocument.defaultView) { return window; } return element.ownerDocument.defaultView; } function getElementDocument(element) { if (!element || !element.ownerDocument) { return document; } return element.ownerDocument; } var SimpleBar = /*#__PURE__*/ function () { function SimpleBar(element, options) { var _this = this; this.onScroll = function () { var elWindow = getElementWindow(_this.el); if (!_this.scrollXTicking) { elWindow.requestAnimationFrame(_this.scrollX); _this.scrollXTicking = true; } if (!_this.scrollYTicking) { elWindow.requestAnimationFrame(_this.scrollY); _this.scrollYTicking = true; } }; this.scrollX = function () { if (_this.axis.x.isOverflowing) { _this.showScrollbar('x'); _this.positionScrollbar('x'); } _this.scrollXTicking = false; }; this.scrollY = function () { if (_this.axis.y.isOverflowing) { _this.showScrollbar('y'); _this.positionScrollbar('y'); } _this.scrollYTicking = false; }; this.onMouseEnter = function () { _this.showScrollbar('x'); _this.showScrollbar('y'); }; this.onMouseMove = function (e) { _this.mouseX = e.clientX; _this.mouseY = e.clientY; if (_this.axis.x.isOverflowing || _this.axis.x.forceVisible) { _this.onMouseMoveForAxis('x'); } if (_this.axis.y.isOverflowing || _this.axis.y.forceVisible) { _this.onMouseMoveForAxis('y'); } }; this.onMouseLeave = function () { _this.onMouseMove.cancel(); if (_this.axis.x.isOverflowing || _this.axis.x.forceVisible) { _this.onMouseLeaveForAxis('x'); } if (_this.axis.y.isOverflowing || _this.axis.y.forceVisible) { _this.onMouseLeaveForAxis('y'); } _this.mouseX = -1; _this.mouseY = -1; }; this.onWindowResize = function () { // Recalculate scrollbarWidth in case it's a zoom _this.scrollbarWidth = _this.getScrollbarWidth(); _this.hideNativeScrollbar(); }; this.hideScrollbars = function () { _this.axis.x.track.rect = _this.axis.x.track.el.getBoundingClientRect(); _this.axis.y.track.rect = _this.axis.y.track.el.getBoundingClientRect(); if (!_this.isWithinBounds(_this.axis.y.track.rect)) { _this.axis.y.scrollbar.el.classList.remove(_this.classNames.visible); _this.axis.y.isVisible = false; } if (!_this.isWithinBounds(_this.axis.x.track.rect)) { _this.axis.x.scrollbar.el.classList.remove(_this.classNames.visible); _this.axis.x.isVisible = false; } }; this.onPointerEvent = function (e) { var isWithinTrackXBounds, isWithinTrackYBounds; _this.axis.x.track.rect = _this.axis.x.track.el.getBoundingClientRect(); _this.axis.y.track.rect = _this.axis.y.track.el.getBoundingClientRect(); if (_this.axis.x.isOverflowing || _this.axis.x.forceVisible) { isWithinTrackXBounds = _this.isWithinBounds(_this.axis.x.track.rect); } if (_this.axis.y.isOverflowing || _this.axis.y.forceVisible) { isWithinTrackYBounds = _this.isWithinBounds(_this.axis.y.track.rect); } // If any pointer event is called on the scrollbar if (isWithinTrackXBounds || isWithinTrackYBounds) { // Preventing the event's default action stops text being // selectable during the drag. e.preventDefault(); // Prevent event leaking e.stopPropagation(); if (e.type === 'mousedown') { if (isWithinTrackXBounds) { _this.axis.x.scrollbar.rect = _this.axis.x.scrollbar.el.getBoundingClientRect(); if (_this.isWithinBounds(_this.axis.x.scrollbar.rect)) { _this.onDragStart(e, 'x'); } else { _this.onTrackClick(e, 'x'); } } if (isWithinTrackYBounds) { _this.axis.y.scrollbar.rect = _this.axis.y.scrollbar.el.getBoundingClientRect(); if (_this.isWithinBounds(_this.axis.y.scrollbar.rect)) { _this.onDragStart(e, 'y'); } else { _this.onTrackClick(e, 'y'); } } } } }; this.drag = function (e) { var eventOffset; var track = _this.axis[_this.draggedAxis].track; var trackSize = track.rect[_this.axis[_this.draggedAxis].sizeAttr]; var scrollbar = _this.axis[_this.draggedAxis].scrollbar; var contentSize = _this.contentWrapperEl[_this.axis[_this.draggedAxis].scrollSizeAttr]; var hostSize = parseInt(_this.elStyles[_this.axis[_this.draggedAxis].sizeAttr], 10); e.preventDefault(); e.stopPropagation(); if (_this.draggedAxis === 'y') { eventOffset = e.pageY; } else { eventOffset = e.pageX; } // Calculate how far the user's mouse is from the top/left of the scrollbar (minus the dragOffset). var dragPos = eventOffset - track.rect[_this.axis[_this.draggedAxis].offsetAttr] - _this.axis[_this.draggedAxis].dragOffset; // Convert the mouse position into a percentage of the scrollbar height/width. var dragPerc = dragPos / (trackSize - scrollbar.size); // Scroll the content by the same percentage. var scrollPos = dragPerc * (contentSize - hostSize); // Fix browsers inconsistency on RTL if (_this.draggedAxis === 'x') { scrollPos = _this.isRtl && SimpleBar.getRtlHelpers().isRtlScrollbarInverted ? scrollPos - (trackSize + scrollbar.size) : scrollPos; scrollPos = _this.isRtl && SimpleBar.getRtlHelpers().isRtlScrollingInverted ? -scrollPos : scrollPos; } _this.contentWrapperEl[_this.axis[_this.draggedAxis].scrollOffsetAttr] = scrollPos; }; this.onEndDrag = function (e) { var elDocument = getElementDocument(_this.el); var elWindow = getElementWindow(_this.el); e.preventDefault(); e.stopPropagation(); _this.el.classList.remove(_this.classNames.dragging); elDocument.removeEventListener('mousemove', _this.drag, true); elDocument.removeEventListener('mouseup', _this.onEndDrag, true); _this.removePreventClickId = elWindow.setTimeout(function () { // Remove these asynchronously so we still suppress click events // generated simultaneously with mouseup. elDocument.removeEventListener('click', _this.preventClick, true); elDocument.removeEventListener('dblclick', _this.preventClick, true); _this.removePreventClickId = null; }); }; this.preventClick = function (e) { e.preventDefault(); e.stopPropagation(); }; this.el = element; this.minScrollbarWidth = 20; this.options = Object.assign({}, SimpleBar.defaultOptions, {}, options); this.classNames = Object.assign({}, SimpleBar.defaultOptions.classNames, {}, this.options.classNames); this.axis = { x: { scrollOffsetAttr: 'scrollLeft', sizeAttr: 'width', scrollSizeAttr: 'scrollWidth', offsetSizeAttr: 'offsetWidth', offsetAttr: 'left', overflowAttr: 'overflowX', dragOffset: 0, isOverflowing: true, isVisible: false, forceVisible: false, track: {}, scrollbar: {} }, y: { scrollOffsetAttr: 'scrollTop', sizeAttr: 'height', scrollSizeAttr: 'scrollHeight', offsetSizeAttr: 'offsetHeight', offsetAttr: 'top', overflowAttr: 'overflowY', dragOffset: 0, isOverflowing: true, isVisible: false, forceVisible: false, track: {}, scrollbar: {} } }; this.removePreventClickId = null; // Don't re-instantiate over an existing one if (SimpleBar.instances.has(this.el)) { return; } this.recalculate = throttle(this.recalculate.bind(this), 64); this.onMouseMove = throttle(this.onMouseMove.bind(this), 64); this.hideScrollbars = debounce(this.hideScrollbars.bind(this), this.options.timeout); this.onWindowResize = debounce(this.onWindowResize.bind(this), 64, { leading: true }); SimpleBar.getRtlHelpers = memoize(SimpleBar.getRtlHelpers); this.init(); } /** * Static properties */ /** * Helper to fix browsers inconsistency on RTL: * - Firefox inverts the scrollbar initial position * - IE11 inverts both scrollbar position and scrolling offset * Directly inspired by @KingSora's OverlayScrollbars https://github.com/KingSora/OverlayScrollbars/blob/master/js/OverlayScrollbars.js#L1634 */ SimpleBar.getRtlHelpers = function getRtlHelpers() { var dummyDiv = document.createElement('div'); dummyDiv.innerHTML = '<div class="hs-dummy-scrollbar-size"><div style="height: 200%; width: 200%; margin: 10px 0;"></div></div>'; var scrollbarDummyEl = dummyDiv.firstElementChild; document.body.appendChild(scrollbarDummyEl); var dummyContainerChild = scrollbarDummyEl.firstElementChild; scrollbarDummyEl.scrollLeft = 0; var dummyContainerOffset = SimpleBar.getOffset(scrollbarDummyEl); var dummyContainerChildOffset = SimpleBar.getOffset(dummyContainerChild); scrollbarDummyEl.scrollLeft = 999; var dummyContainerScrollOffsetAfterScroll = SimpleBar.getOffset(dummyContainerChild); return { // determines if the scrolling is responding with negative values isRtlScrollingInverted: dummyContainerOffset.left !== dummyContainerChildOffset.left && dummyContainerChildOffset.left - dummyContainerScrollOffsetAfterScroll.left !== 0, // determines if the origin scrollbar position is inverted or not (positioned on left or right) isRtlScrollbarInverted: dummyContainerOffset.left !== dummyContainerChildOffset.left }; }; SimpleBar.getOffset = function getOffset(el) { var rect = el.getBoundingClientRect(); var elDocument = getElementDocument(el); var elWindow = getElementWindow(el); return { top: rect.top + (elWindow.pageYOffset || elDocument.documentElement.scrollTop), left: rect.left + (elWindow.pageXOffset || elDocument.documentElement.scrollLeft) }; }; var _proto = SimpleBar.prototype; _proto.init = function init() { // Save a reference to the instance, so we know this DOM node has already been instancied SimpleBar.instances.set(this.el, this); // We stop here on server-side if (canUseDOM) { this.initDOM(); this.scrollbarWidth = this.getScrollbarWidth(); this.recalculate(); this.initListeners(); } }; _proto.initDOM = function initDOM() { var _this2 = this; var elDocument = getElementDocument(this.el); // make sure this element doesn't have the elements yet if (Array.prototype.filter.call(this.el.children, function (child) { return child.classList.contains(_this2.classNames.wrapper); }).length) { // assume that element has his DOM already initiated this.wrapperEl = this.el.querySelector("." + this.classNames.wrapper); this.contentWrapperEl = this.options.scrollableNode || this.el.querySelector("." + this.classNames.contentWrapper); this.contentEl = this.options.contentNode || this.el.querySelector("." + this.classNames.contentEl); this.offsetEl = this.el.querySelector("." + this.classNames.offset); this.maskEl = this.el.querySelector("." + this.classNames.mask); this.placeholderEl = this.findChild(this.wrapperEl, "." + this.classNames.placeholder); this.heightAutoObserverWrapperEl = this.el.querySelector("." + this.classNames.heightAutoObserverWrapperEl); this.heightAutoObserverEl = this.el.querySelector("." + this.classNames.heightAutoObserverEl); this.axis.x.track.el = this.findChild(this.el, "." + this.classNames.track + "." + this.classNames.horizontal); this.axis.y.track.el = this.findChild(this.el, "." + this.classNames.track + "." + this.classNames.vertical); } else { // Prepare DOM this.wrapperEl = document.createElement('div'); this.contentWrapperEl = document.createElement('div'); this.offsetEl = document.createElement('div'); this.maskEl = document.createElement('div'); this.contentEl = document.createElement('div'); this.placeholderEl = document.createElement('div'); this.heightAutoObserverWrapperEl = document.createElement('div'); this.heightAutoObserverEl = document.createElement('div'); this.wrapperEl.classList.add(this.classNames.wrapper); this.contentWrapperEl.classList.add(this.classNames.contentWrapper); this.offsetEl.classList.add(this.classNames.offset); this.maskEl.classList.add(this.classNames.mask); this.contentEl.classList.add(this.classNames.contentEl); this.placeholderEl.classList.add(this.classNames.placeholder); this.heightAutoObserverWrapperEl.classList.add(this.classNames.heightAutoObserverWrapperEl); this.heightAutoObserverEl.classList.add(this.classNames.heightAutoObserverEl); while (this.el.firstChild) { this.contentEl.appendChild(this.el.firstChild); } this.contentWrapperEl.appendChild(this.contentEl); this.offsetEl.appendChild(this.contentWrapperEl); this.maskEl.appendChild(this.offsetEl); this.heightAutoObserverWrapperEl.appendChild(this.heightAutoObserverEl); this.wrapperEl.appendChild(this.heightAutoObserverWrapperEl); this.wrapperEl.appendChild(this.maskEl); this.wrapperEl.appendChild(this.placeholderEl); this.el.appendChild(this.wrapperEl); } if (!this.axis.x.track.el || !this.axis.y.track.el) { var track = document.createElement('div'); var scrollbar = document.createElement('div'); track.classList.add(this.classNames.track); scrollbar.classList.add(this.classNames.scrollbar); track.appendChild(scrollbar); this.axis.x.track.el = track.cloneNode(true); this.axis.x.track.el.classList.add(this.classNames.horizontal); this.axis.y.track.el = track.cloneNode(true); this.axis.y.track.el.classList.add(this.classNames.vertical); this.el.appendChild(this.axis.x.track.el); this.el.appendChild(this.axis.y.track.el); } this.axis.x.scrollbar.el = this.axis.x.track.el.querySelector("." + this.classNames.scrollbar); this.axis.y.scrollbar.el = this.axis.y.track.el.querySelector("." + this.classNames.scrollbar); if (!this.options.autoHide) { this.axis.x.scrollbar.el.classList.add(this.classNames.visible); this.axis.y.scrollbar.el.classList.add(this.classNames.visible); } this.el.setAttribute('data-simplebar', 'init'); }; _proto.initListeners = function initListeners() { var _this3 = this; var elWindow = getElementWindow(this.el); // Event listeners if (this.options.autoHide) { this.el.addEventListener('mouseenter', this.onMouseEnter); } ['mousedown', 'click', 'dblclick'].forEach(function (e) { _this3.el.addEventListener(e, _this3.onPointerEvent, true); }); ['touchstart', 'touchend', 'touchmove'].forEach(function (e) { _this3.el.addEventListener(e, _this3.onPointerEvent, { capture: true, passive: true }); }); this.el.addEventListener('mousemove', this.onMouseMove); this.el.addEventListener('mouseleave', this.onMouseLeave); this.contentWrapperEl.addEventListener('scroll', this.onScroll); // Browser zoom triggers a window resize elWindow.addEventListener('resize', this.onWindowResize); // Hack for https://github.com/WICG/ResizeObserver/issues/38 var resizeObserverStarted = false; var resizeObserver = elWindow.ResizeObserver || ResizeObserver; this.resizeObserver = new resizeObserver(function () { if (!resizeObserverStarted) return; _this3.recalculate(); }); this.resizeObserver.observe(this.el); this.resizeObserver.observe(this.contentEl); elWindow.requestAnimationFrame(function () { resizeObserverStarted = true; }); // This is required to detect horizontal scroll. Vertical scroll only needs the resizeObserver. this.mutationObserver = new elWindow.MutationObserver(this.recalculate); this.mutationObserver.observe(this.contentEl, { childList: true, subtree: true, characterData: true }); }; _proto.recalculate = function recalculate() { var elWindow = getElementWindow(this.el); this.elStyles = elWindow.getComputedStyle(this.el); this.isRtl = this.elStyles.direction === 'rtl'; var isHeightAuto = this.heightAutoObserverEl.offsetHeight <= 1; var isWidthAuto = this.heightAutoObserverEl.offsetWidth <= 1; var contentElOffsetWidth = this.contentEl.offsetWidth; var contentWrapperElOffsetWidth = this.contentWrapperEl.offsetWidth; var elOverflowX = this.elStyles.overflowX; var elOverflowY = this.elStyles.overflowY; this.contentEl.style.padding = this.elStyles.paddingTop + " " + this.elStyles.paddingRight + " " + this.elStyles.paddingBottom + " " + this.elStyles.paddingLeft; this.wrapperEl.style.margin = "-" + this.elStyles.paddingTop + " -" + this.elStyles.paddingRight + " -" + this.elStyles.paddingBottom + " -" + this.elStyles.paddingLeft; var contentElScrollHeight = this.contentEl.scrollHeight; var contentElScrollWidth = this.contentEl.scrollWidth; this.contentWrapperEl.style.height = isHeightAuto ? 'auto' : '100%'; // Determine placeholder size this.placeholderEl.style.width = isWidthAuto ? contentElOffsetWidth + "px" : 'auto'; this.placeholderEl.style.height = contentElScrollHeight + "px"; var contentWrapperElOffsetHeight = this.contentWrapperEl.offsetHeight; this.axis.x.isOverflowing = contentElScrollWidth > contentElOffsetWidth; this.axis.y.isOverflowing = contentElScrollHeight > contentWrapperElOffsetHeight; // Set isOverflowing to false if user explicitely set hidden overflow this.axis.x.isOverflowing = elOverflowX === 'hidden' ? false : this.axis.x.isOverflowing; this.axis.y.isOverflowing = elOverflowY === 'hidden' ? false : this.axis.y.isOverflowing; this.axis.x.forceVisible = this.options.forceVisible === 'x' || this.options.forceVisible === true; this.axis.y.forceVisible = this.options.forceVisible === 'y' || this.options.forceVisible === true; this.hideNativeScrollbar(); // Set isOverflowing to false if scrollbar is not necessary (content is shorter than offset) var offsetForXScrollbar = this.axis.x.isOverflowing ? this.scrollbarWidth : 0; var offsetForYScrollbar = this.axis.y.isOverflowing ? this.scrollbarWidth : 0; this.axis.x.isOverflowing = this.axis.x.isOverflowing && contentElScrollWidth > contentWrapperElOffsetWidth - offsetForYScrollbar; this.axis.y.isOverflowing = this.axis.y.isOverflowing && contentElScrollHeight > contentWrapperElOffsetHeight - offsetForXScrollbar; this.axis.x.scrollbar.size = this.getScrollbarSize('x'); this.axis.y.scrollbar.size = this.getScrollbarSize('y'); this.axis.x.scrollbar.el.style.width = this.axis.x.scrollbar.size + "px"; this.axis.y.scrollbar.el.style.height = this.axis.y.scrollbar.size + "px"; this.positionScrollbar('x'); this.positionScrollbar('y'); this.toggleTrackVisibility('x'); this.toggleTrackVisibility('y'); } /** * Calculate scrollbar size */ ; _proto.getScrollbarSize = function getScrollbarSize(axis) { if (axis === void 0) { axis = 'y'; } if (!this.axis[axis].isOverflowing) { return 0; } var contentSize = this.contentEl[this.axis[axis].scrollSizeAttr]; var trackSize = this.axis[axis].track.el[this.axis[axis].offsetSizeAttr]; var scrollbarSize; var scrollbarRatio = trackSize / contentSize; // Calculate new height/position of drag handle. scrollbarSize = Math.max(~~(scrollbarRatio * trackSize), this.options.scrollbarMinSize); if (this.options.scrollbarMaxSize) { scrollbarSize = Math.min(scrollbarSize, this.options.scrollbarMaxSize); } return scrollbarSize; }; _proto.positionScrollbar = function positionScrollbar(axis) { if (axis === void 0) { axis = 'y'; } if (!this.axis[axis].isOverflowing) { return; } var contentSize = this.contentWrapperEl[this.axis[axis].scrollSizeAttr]; var trackSize = this.axis[axis].track.el[this.axis[axis].offsetSizeAttr]; var hostSize = parseInt(this.elStyles[this.axis[axis].sizeAttr], 10); var scrollbar = this.axis[axis].scrollbar; var scrollOffset = this.contentWrapperEl[this.axis[axis].scrollOffsetAttr]; scrollOffset = axis === 'x' && this.isRtl && SimpleBar.getRtlHelpers().isRtlScrollingInverted ? -scrollOffset : scrollOffset; var scrollPourcent = scrollOffset / (contentSize - hostSize); var handleOffset = ~~((trackSize - scrollbar.size) * scrollPourcent); handleOffset = axis === 'x' && this.isRtl && SimpleBar.getRtlHelpers().isRtlScrollbarInverted ? handleOffset + (trackSize - scrollbar.size) : handleOffset; scrollbar.el.style.transform = axis === 'x' ? "translate3d(" + handleOffset + "px, 0, 0)" : "translate3d(0, " + handleOffset + "px, 0)"; }; _proto.toggleTrackVisibility = function toggleTrackVisibility(axis) { if (axis === void 0) { axis = 'y'; } var track = this.axis[axis].track.el; var scrollbar = this.axis[axis].scrollbar.el; if (this.axis[axis].isOverflowing || this.axis[axis].forceVisible) { track.style.visibility = 'visible'; this.contentWrapperEl.style[this.axis[axis].overflowAttr] = 'scroll'; } else { track.style.visibility = 'hidden'; this.contentWrapperEl.style[this.axis[axis].overflowAttr] = 'hidden'; } // Even if forceVisible is enabled, scrollbar itself should be hidden if (this.axis[axis].isOverflowing) { scrollbar.style.display = 'block'; } else { scrollbar.style.display = 'none'; } }; _proto.hideNativeScrollbar = function hideNativeScrollbar() { this.offsetEl.style[this.isRtl ? 'left' : 'right'] = this.axis.y.isOverflowing || this.axis.y.forceVisible ? "-" + this.scrollbarWidth + "px" : 0; this.offsetEl.style.bottom = this.axis.x.isOverflowing || this.axis.x.forceVisible ? "-" + this.scrollbarWidth + "px" : 0; } /** * On scroll event handling */ ; _proto.onMouseMoveForAxis = function onMouseMoveForAxis(axis) { if (axis === void 0) { axis = 'y'; } this.axis[axis].track.rect = this.axis[axis].track.el.getBoundingClientRect(); this.axis[axis].scrollbar.rect = this.axis[axis].scrollbar.el.getBoundingClientRect(); var isWithinScrollbarBoundsX = this.isWithinBounds(this.axis[axis].scrollbar.rect); if (isWithinScrollbarBoundsX) { this.axis[axis].scrollbar.el.classList.add(this.classNames.hover); } else { this.axis[axis].scrollbar.el.classList.remove(this.classNames.hover); } if (this.isWithinBounds(this.axis[axis].track.rect)) { this.showScrollbar(axis); this.axis[axis].track.el.classList.add(this.classNames.hover); } else { this.axis[axis].track.el.classList.remove(this.classNames.hover); } }; _proto.onMouseLeaveForAxis = function onMouseLeaveForAxis(axis) { if (axis === void 0) { axis = 'y'; } this.axis[axis].track.el.classList.remove(this.classNames.hover); this.axis[axis].scrollbar.el.classList.remove(this.classNames.hover); }; /** * Show scrollbar */ _proto.showScrollbar = function showScrollbar(axis) { if (axis === void 0) { axis = 'y'; } var scrollbar = this.axis[axis].scrollbar.el; if (!this.axis[axis].isVisible) { scrollbar.classList.add(this.classNames.visible); this.axis[axis].isVisible = true; } if (this.options.autoHide) { this.hideScrollbars(); } } /** * Hide Scrollbar */ ; /** * on scrollbar handle drag movement starts */ _proto.onDragStart = function onDragStart(e, axis) { if (axis === void 0) { axis = 'y'; } var elDocument = getElementDocument(this.el); var elWindow = getElementWindow(this.el); var scrollbar = this.axis[axis].scrollbar; // Measure how far the user's mouse is from the top of the scrollbar drag handle. var eventOffset = axis === 'y' ? e.pageY : e.pageX; this.axis[axis].dragOffset = eventOffset - scrollbar.rect[this.axis[axis].offsetAttr]; this.draggedAxis = axis; this.el.classList.add(this.classNames.dragging); elDocument.addEventListener('mousemove', this.drag, true); elDocument.addEventListener('mouseup', this.onEndDrag, true); if (this.removePreventClickId === null) { elDocument.addEventListener('click', this.preventClick, true); elDocument.addEventListener('dblclick', this.preventClick, true); } else { elWindow.clearTimeout(this.removePreventClickId); this.removePreventClickId = null; } } /** * Drag scrollbar handle */ ; _proto.onTrackClick = function onTrackClick(e, axis) { var _this4 = this; if (axis === void 0) { axis = 'y'; } if (!this.options.clickOnTrack) return; var elWindow = getElementWindow(this.el); this.axis[axis].scrollbar.rect = this.axis[axis].scrollbar.el.getBoundingClientRect(); var scrollbar = this.axis[axis].scrollbar; var scrollbarOffset = scrollbar.rect[this.axis[axis].offsetAttr]; var hostSize = parseInt(this.elStyles[this.axis[axis].sizeAttr], 10); var scrolled = this.contentWrapperEl[this.axis[axis].scrollOffsetAttr]; var t = axis === 'y' ? this.mouseY - scrollbarOffset : this.mouseX - scrollbarOffset; var dir = t < 0 ? -1 : 1; var scrollSize = dir === -1 ? scrolled - hostSize : scrolled + hostSize; var speed = 40; var scrollTo = function scrollTo() { if (dir === -1) { if (scrolled > scrollSize) { var _this4$contentWrapper; scrolled -= speed; _this4.contentWrapperEl.scrollTo((_this4$contentWrapper = {}, _this4$contentWrapper[_this4.axis[axis].offsetAttr] = scrolled, _this4$contentWrapper)); elWindow.requestAnimationFrame(scrollTo); } } else { if (scrolled < scrollSize) { var _this4$contentWrapper2; scrolled += speed; _this4.contentWrapperEl.scrollTo((_this4$contentWrapper2 = {}, _this4$contentWrapper2[_this4.axis[axis].offsetAttr] = scrolled, _this4$contentWrapper2)); elWindow.requestAnimationFrame(scrollTo); } } }; scrollTo(); } /** * Getter for content element */ ; _proto.getContentElement = function getContentElement() { return this.contentEl; } /** * Getter for original scrolling element */ ; _proto.getScrollElement = function getScrollElement() { return this.contentWrapperEl; }; _proto.getScrollbarWidth = function getScrollbarWidth() { // Try/catch for FF 56 throwing on undefined computedStyles try { // Detect browsers supporting CSS scrollbar styling and do not calculate if (getComputedStyle(this.contentWrapperEl, '::-webkit-scrollbar').display === 'none' || 'scrollbarWidth' in document.documentElement.style || '-ms-overflow-style' in document.documentElement.style) { return 0; } else { return scrollbarWidth(); } } catch (e) { return scrollbarWidth(); } }; _proto.removeListeners = function removeListeners() { var _this5 = this; var elWindow = getElementWindow(this.el); // Event listeners if (this.options.autoHide) { this.el.removeEventListener('mouseenter', this.onMouseEnter); } ['mousedown', 'click', 'dblclick'].forEach(function (e) { _this5.el.removeEventListener(e, _this5.onPointerEvent, true); }); ['touchstart', 'touchend', 'touchmove'].forEach(function (e) { _this5.el.removeEventListener(e, _this5.onPointerEvent, { capture: true, passive: true }); }); this.el.removeEventListener('mousemove', this.onMouseMove); this.el.removeEventListener('mouseleave', this.onMouseLeave); this.contentWrapperEl.removeEventListener('scroll', this.onScroll); elWindow.removeEventListener('resize', this.onWindowResize); this.mutationObserver.disconnect(); this.resizeObserver.disconnect(); // Cancel all debounced functions this.recalculate.cancel(); this.onMouseMove.cancel(); this.hideScrollbars.cancel(); this.onWindowResize.cancel(); } /** * UnMount mutation observer and delete SimpleBar instance from DOM element */ ; _proto.unMount = function unMount() { this.removeListeners(); SimpleBar.instances.delete(this.el); } /** * Check if mouse is within bounds */ ; _proto.isWithinBounds = function isWithinBounds(bbox) { return this.mouseX >= bbox.left && this.mouseX <= bbox.left + bbox.width && this.mouseY >= bbox.top && this.mouseY <= bbox.top + bbox.height; } /** * Find element children matches query */ ; _proto.findChild = function findChild(el, query) { var matches = el.matches || el.webkitMatchesSelector || el.mozMatchesSelector || el.msMatchesSelector; return Array.prototype.filter.call(el.children, function (child) { return matches.call(child, query); })[0]; }; return SimpleBar; }(); SimpleBar.defaultOptions = { autoHide: true, forceVisible: false, clickOnTrack: true, classNames: { contentEl: 'simplebar-content', contentWrapper: 'simplebar-content-wrapper', offset: 'simplebar-offset', mask: 'simplebar-mask', wrapper: 'simplebar-wrapper', placeholder: 'simplebar-placeholder', scrollbar: 'simplebar-scrollbar', track: 'simplebar-track', heightAutoObserverWrapperEl: 'simplebar-height-auto-observer-wrapper', heightAutoObserverEl: 'simplebar-height-auto-observer', visible: 'simplebar-visible', horizontal: 'simplebar-horizontal', vertical: 'simplebar-vertical', hover: 'simplebar-hover', dragging: 'simplebar-dragging' }, scrollbarMinSize: 25, scrollbarMaxSize: 0, timeout: 1000 }; SimpleBar.instances = new WeakMap(); export default SimpleBar; //# sourceMappingURL=simplebar-core.esm.js.map
var CouponEvent = require("./CouponEvent"); var ECommerceEvents = require("./constants").ECommerceEvents; //class representing coupon removed event class CouponRemovedEvent extends CouponEvent { event() { return ECommerceEvents.COUPON_REMOVED; } } module.exports = { CouponRemovedEvent: CouponRemovedEvent };
var pageComponent = webpackJsonppageComponent([22],{ /***/ 324: /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _metalComponent = __webpack_require__(0); var _metalComponent2 = _interopRequireDefault(_metalComponent); var _metalSoy = __webpack_require__(1); var _metalSoy2 = _interopRequireDefault(_metalSoy); __webpack_require__(4); __webpack_require__(5); __webpack_require__(6); __webpack_require__(7); __webpack_require__(8); __webpack_require__(9); __webpack_require__(10); __webpack_require__(11); __webpack_require__(12); __webpack_require__(13); __webpack_require__(14); __webpack_require__(15); var _nullableSoy = __webpack_require__(325); var _nullableSoy2 = _interopRequireDefault(_nullableSoy); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var dabdr = function (_Component) { _inherits(dabdr, _Component); function dabdr() { _classCallCheck(this, dabdr); return _possibleConstructorReturn(this, (dabdr.__proto__ || Object.getPrototypeOf(dabdr)).apply(this, arguments)); } return dabdr; }(_metalComponent2.default); ; _metalSoy2.default.register(dabdr, _nullableSoy2.default); exports.default = dabdr; /***/ }), /***/ 325: /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.templates = exports.dabdr = undefined; var _metalComponent = __webpack_require__(0); var _metalComponent2 = _interopRequireDefault(_metalComponent); var _metalSoy = __webpack_require__(1); var _metalSoy2 = _interopRequireDefault(_metalSoy); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /* jshint ignore:start */ var templates; goog.loadModule(function (exports) { // This file was automatically generated from nullable.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace dabdr. * @public */ goog.module('dabdr.incrementaldom'); /** @suppress {extraRequire} */ var soy = goog.require('soy'); /** @suppress {extraRequire} */ var soydata = goog.require('soydata'); /** @suppress {extraRequire} */ goog.require('goog.asserts'); /** @suppress {extraRequire} */ goog.require('soy.asserts'); /** @suppress {extraRequire} */ goog.require('goog.i18n.bidi'); /** @suppress {extraRequire} */ goog.require('goog.string'); var IncrementalDom = goog.require('incrementaldom'); var ie_open = IncrementalDom.elementOpen; var ie_close = IncrementalDom.elementClose; var ie_void = IncrementalDom.elementVoid; var ie_open_start = IncrementalDom.elementOpenStart; var ie_open_end = IncrementalDom.elementOpenEnd; var itext = IncrementalDom.text; var iattr = IncrementalDom.attr; var $templateAlias2 = _metalSoy2.default.getTemplate('ElectricCode.incrementaldom', 'render'); var $templateAlias1 = _metalSoy2.default.getTemplate('guide.incrementaldom', 'render'); /** * @param {{ * page: (?), * site: (?) * }} opt_data * @param {(null|undefined)=} opt_ignored * @param {Object<string, *>=} opt_ijData * @return {void} * @suppress {checkTypes} */ function $render(opt_data, opt_ignored, opt_ijData) { var param893 = function param893() { ie_open('h6'); var dyn55 = opt_data.page.description; if (typeof dyn55 == 'function') dyn55();else if (dyn55 != null) itext(dyn55); ie_close('h6'); ie_open('article', null, null, 'id', '1'); ie_open('h2'); itext('Feature Overview'); ie_close('h2'); ie_open('p'); itext('This feature adds support for nullable variables.'); ie_close('p'); ie_close('article'); ie_open('article', null, null, 'id', '2'); ie_open('h2'); itext('Prerequisite'); ie_close('h2'); ie_open('p'); itext('None'); ie_close('p'); ie_close('article'); ie_open('article', null, null, 'id', '3'); ie_open('h2'); itext('Sweet Apex Example'); ie_close('h2'); $templateAlias2({ code: 'public class NullableDemo {\n public static void main() {\n String s1 = \'abc\';\n Integer i1 = s1.length();\n\n String s2 = null;\n Integer i2 = s2?.length();\n\n Integer i3 = (\'a\' + \'b\')?.length();\n }\n}', mode: 'javascript' }, null, opt_ijData); ie_close('article'); ie_open('article', null, null, 'id', '4'); ie_open('h2'); itext('Transpiled Apex'); ie_close('h2'); $templateAlias2({ code: 'public class NullableDemo {\n public static void main() {\n String s1 = \'abc\';\n Integer i1 = s1.length();\n\n String s2 = null;\n Integer i2 = (s2 != null ? s2.length() : null);\n\n Integer i3 = ((\'a\' + \'b\') != null ? (\'a\' + \'b\').length() : null);\n }\n}', mode: 'javascript' }, null, opt_ijData); ie_close('article'); ie_open('article', null, null, 'id', '5'); ie_open('h2'); itext('Usage'); ie_close('h2'); ie_open('p'); itext('Use nullable variables in method invocations or field accesses.'); ie_close('p'); ie_open('p'); itext('Try not using nest nullable variables as this will increase complexity.'); ie_close('p'); ie_close('article'); ie_open('input', null, null, 'type', 'hidden', 'value', opt_data.page.title); ie_close('input'); ie_open('input', null, null, 'type', 'hidden', 'value', opt_data.site.title); ie_close('input'); }; $templateAlias1(soy.$$assignDefaults({ content: param893 }, opt_data), null, opt_ijData); } exports.render = $render; if (goog.DEBUG) { $render.soyTemplateName = 'dabdr.render'; } exports.render.params = ["page", "site"]; exports.render.types = { "page": "?", "site": "?" }; exports.templates = templates = exports; return exports; }); var dabdr = function (_Component) { _inherits(dabdr, _Component); function dabdr() { _classCallCheck(this, dabdr); return _possibleConstructorReturn(this, (dabdr.__proto__ || Object.getPrototypeOf(dabdr)).apply(this, arguments)); } return dabdr; }(_metalComponent2.default); _metalSoy2.default.register(dabdr, templates); exports.dabdr = dabdr; exports.templates = templates; exports.default = templates; /* jshint ignore:end */ /***/ }) },[324]);
//@ts-check /** * @typedef {Function} CollectorFilter * @param {...*} args * @returns {boolean|Promise<boolean>} */ /** * @typedef {object} CollectorOptions * @property {number} max * @property {number} timeIdle * @property {number} timeLimit * @property {CollectorFilter} filter */ const BaseCollector = require('./BaseCollector.js'); class MessageCollector extends BaseCollector { /** * * @param {CollectorOptions} options * @param {import('./TextChannel')} channel */ constructor(channel, options) { super(channel.client, options); this.channel = channel; const handleMessageCreate = this.handleMessageCreate.bind(this); channel.client.on('messageCreate', handleMessageCreate); this.once('end', () => { this.client.removeListener('messageCreate', handleMessageCreate); }); } /** * * @param {import('./Message')} message */ async handleMessageCreate(message) { if (!this.running) return false; if (this.channelId !== message.channel.id) return; const resFilter = await this.options.filter(message); if (!resFilter) return; if (++this.usages == this.options.max) { this.emit('collect', message); this.stop('max'); } else { if (this.options.timeIdle) { clearTimeout(this._idleTimeout); this._idleTimeout = setTimeout(() => this.stop('idle'), this.options.timeIdle); } this.emit('collect', message); } return true; } get channelId() { return this.channel.id; } get guildId() { // @ts-ignore return this.channel.guild ? this.channel.guild.id : ''; } } module.exports = MessageCollector;
export { default } from 'nypr-ui/components/nypr-tabs/nypr-tabs-tablist';
webpackJsonp([15],{"1MB4":function(e,a,s){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var t=s("O2NY"),n=s.n(t),o={data:function(){return{isActive:"1",openCashData:{money:"",openCashType:"1",selWx:"",name:"",phone:"",wx:""},rules:{money:[{required:!0,message:"请输入提现金额",trigger:"change"}],name:[{required:!0,message:"请输入姓名",trigger:"change"}],phone:[{required:!0,message:"请输入电话",trigger:"change"},{min:11,max:11,message:"电话号码格式不正确",trigger:"blur"}],wx:[{required:!0,message:"请输入微信号",trigger:"change"}]},props:{multiple:!0},userMessage:""}},created:function(){this.orgin(),this.userMsg()},methods:{userMsg:function(){var e=this,a=new URLSearchParams;a.append("uid",localStorage.getItem("uid")),a.append("upUid",localStorage.getItem("uid")),this.$http.post(this.$api.userMsg.userMsg,a,!0).then(function(a){(a.data.state="success")&&(e.userMessage=a.data.getUsers)})},orgin:function(){null==localStorage.getItem("openid")&&(n.a.sucPrompt(this.$message({message:"请绑定您的微信号",type:"success"})),this.$router.push({path:"/user/wx"}))},submitForm:function(e){var a=this;this.$refs[e].validate(function(e){if(!e)return!1;if(a.openCashData.money>a.userMessage.smallChange_money_show)n.a.sucPrompt(a.$message.error("充值金额大于提现金额"));else{var s=new URLSearchParams;s.append("uid",localStorage.getItem("uid")),s.append("usersName",a.openCashData.name),s.append("usersPhone",a.openCashData.phone),s.append("withdrawalMoney_money_show",a.openCashData.money),a.$http.post(a.$api.openCash.openCash,s,!0).then(function(e){"success"==e.data.state&&(n.a.sucPrompt(a.$message({message:"恭喜你,提现申请成功",type:"success"})),a.$router.push({path:"/funds/cash"}))})}})}}},r={render:function(){var e=this,a=e.$createElement,s=e._self._c||a;return s("div",{staticClass:"opencash"},[s("el-card",{staticClass:"opencash-warpper"},[s("div",{staticClass:"opencash-header",attrs:{slot:"header"},slot:"header"},[s("span",[e._v("提现申请")])]),e._v(" "),s("div",{staticClass:"main"},[s("el-form",{ref:"openCashData",attrs:{model:e.openCashData,rules:e.rules,"label-width":"250px"}},[s("div",{staticClass:"residue-money"},[s("div",{staticClass:"residue-money-tip"},[e._v("剩余金额")]),e._v(" "),s("div",{staticClass:"num"},[e._v(e._s(e.userMessage.smallChange_money_show)+"元")])]),e._v(" "),s("div",{staticClass:"whd-money",staticStyle:{"margin-bottom":"20px"}},[s("el-form-item",{attrs:{label:"提现金额",prop:"money"}},[s("el-input",{model:{value:e.openCashData.money,callback:function(a){e.$set(e.openCashData,"money",a)},expression:"openCashData.money"}})],1)],1),e._v(" "),s("div",{staticClass:"prompt"},[e._v("每笔提取金额最低1元,最高500元,提现手续费为1%。(注:手续费会根据微信提现规则进行调整)")]),e._v(" "),s("div",{staticClass:"whd-type"},[s("el-form-item",{attrs:{label:"提现方式",prop:"openCashType",required:""}},[s("el-radio",{attrs:{label:"1"},model:{value:e.openCashData.openCashType,callback:function(a){e.$set(e.openCashData,"openCashType",a)},expression:"openCashData.openCashType"}},[e._v("微信")])],1)],1),e._v(" "),s("div",{staticClass:"sel-wx",staticStyle:{"margin-bottom":"20px"}},[s("el-form-item",{attrs:{label:"姓名",prop:"name"}},[s("el-input",{model:{value:e.openCashData.name,callback:function(a){e.$set(e.openCashData,"name",a)},expression:"openCashData.name"}})],1)],1),e._v(" "),s("div",{staticClass:"prompt"},[e._v("*请输入微信实名认证姓名")]),e._v(" "),s("div",{staticClass:"phone block",staticStyle:{"margin-bottom":"20px"}},[s("el-form-item",{attrs:{label:"电话",prop:"phone"}},[s("el-input",{model:{value:e.openCashData.phone,callback:function(a){e.$set(e.openCashData,"phone",a)},expression:"openCashData.phone"}})],1)],1),e._v(" "),s("div",{staticClass:"phone",staticStyle:{"margin-bottom":"20px"}},[s("el-form-item",{attrs:{label:"微信号",prop:"wx"}},[s("el-input",{model:{value:e.openCashData.wx,callback:function(a){e.$set(e.openCashData,"wx",a)},expression:"openCashData.wx"}})],1)],1),e._v(" "),s("div",{staticClass:"submit-btn"},[s("el-button",{attrs:{type:"primary"},on:{click:function(a){return e.submitForm("openCashData")}}},[e._v("提交申请")])],1)])],1)])],1)},staticRenderFns:[]};var i=s("C7Lr")(o,r,!1,function(e){s("KkwW")},"data-v-a0e54e04",null);a.default=i.exports},KkwW:function(e,a){}}); //# sourceMappingURL=15.5b59926df440805141ef.js.map
function checkHasOwnProperty(string, object) { return object.hasOwnProperty(string); } module.exports = checkHasOwnProperty;
import React from 'react' import { Button, Input } from 'react-native-elements'; import { SafeAreaView, StyleSheet, Platform, Dimensions, View, StatusBar, TextInput, Text, Picker } from 'react-native' const { height, width } = Dimensions.get('window') class Launch extends React.Component { constructor(props) { super(props) this.playerRight = "" this.playerLeft = "" this.state = { score: 0 } } componentWillMount() { this.startHeaderHeight = 130 this.startHeaderMargin = 5 if (Platform.OS == 'android') { this.startHeaderHeight = 80 + StatusBar.currentHeight this.startHeaderMargin = 10 + StatusBar.currentHeight } } _playerOneInputChanged(text) { this.playerRight = text } _playerTwoInputChanged(text) { this.playerLeft = text } _launchGame() { if (this.playerRight.length > 0 && this.playerLeft.length > 0 && this.state.score > 0) { this.props.navigation.navigate("Home", { playerRight: this.playerRight, playerLeft: this.playerLeft, score: this.state.score }); this.playerRight = "" this.playerLeft = "" } } render() { return ( <SafeAreaView style={{ flex: 1 }}> <View style={{ flex: 1 }}> <View style={{ height: this.startHeaderHeight, backgroundColor: 'white', borderBottomWidth: 1, borderBottomColor: '#dddddd', alignItems: 'center', justifyContent: 'center' }}> <Text style={styles.title}>Babyfoot Connect</Text> </View> <View style={{ flex: 2 }}> <View style={{ marginTop: 50 }}> <Input style={{ margin: 17 }} placeholder='Joueur Droit' shake={true} onChangeText={(text) => this._playerOneInputChanged(text)} /> </View> <View style={{ marginTop: 50 }}> <Input placeholder='Joueur Gauche' shake={true} onChangeText={(text) => this._playerTwoInputChanged(text)} /> </View> <Text style={{ marginTop: 50, fontSize: 18, fontWeight: '700', paddingHorizontal: 17 }}>Score Limite :</Text> <View style={{ marginTop: 50, alignItems: 'center', justifyContent: 'center' }}> <Picker selectedValue={this.state.score} style={{ height: 50, width: 100, justifyContent: 'center' }} onValueChange={(itemValue, itemIndex) => this.setState({ score: itemValue }) }> <Picker.Item label="0" value="0" /> <Picker.Item label="1" value="1" /> <Picker.Item label="2" value="2" /> <Picker.Item label="3" value="3" /> <Picker.Item label="4" value="4" /> <Picker.Item label="5" value="5" /> <Picker.Item label="6" value="6" /> <Picker.Item label="7" value="7" /> <Picker.Item label="8" value="8" /> <Picker.Item label="9" value="9" /> </Picker> </View> </View> <View style={{ flex: 1, flexDirection: 'row', position: 'absolute', bottom: 5, left: 0, alignItems: 'center', justifyContent: 'center' }}> <Button buttonStyle={{ backgroundColor: '#4f9deb', }} style={{ position: 'absolute', bottom: 10, left: 0, width: 370, marginLeft: 2 }} title="Valider" onPress={() => this._launchGame()}> </Button> </View> </View> </SafeAreaView> ); } } const styles = StyleSheet.create({ container: { flex: 1, flexDirection: 'column', justifyContent: 'center', }, title: { justifyContent: 'center', zIndex: 1, fontSize: 40, fontWeight: 'bold', color: 'black', alignItems: 'center', }, textinput: { marginLeft: 5, marginRight: 5, marginTop: 10, height: 50, borderColor: '#000000', borderWidth: 1, paddingLeft: 5 }, }); export default Launch;
/** * @class * @memberof Tiny.spine */ class Vector3 { /** * * @param {number} x=0 * @param {number} y=0 * @param {number} z=0 */ constructor(x = 0, y = 0, z = 0) { /** * @type {number} * @default 0 */ this.x = x; /** * @type {number} * @default 0 */ this.y = y; /** * @type {number} * @default 0 */ this.z = z; } setFrom(v) { this.x = v.x; this.y = v.y; this.z = v.z; return this; } set(x, y, z) { this.x = x; this.y = y; this.z = z; return this; } add(v) { this.x += v.x; this.y += v.y; this.z += v.z; return this; } sub(v) { this.x -= v.x; this.y -= v.y; this.z -= v.z; return this; } scale(s) { this.x *= s; this.y *= s; this.z *= s; return this; } normalize() { let len = this.length(); if (len === 0) return this; len = 1 / len; this.x *= len; this.y *= len; this.z *= len; return this; } cross(v) { return this.set(this.y * v.z - this.z * v.y, this.z * v.x - this.x * v.z, this.x * v.y - this.y * v.x) } dot(v) { return this.x * v.x + this.y * v.y + this.z * v.z; } length() { return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z); } distance(v) { let a = v.x - this.x; let b = v.y - this.y; let c = v.z - this.z; return Math.sqrt(a * a + b * b + c * c); } } export { Vector3, };
const ConfigurableERC20 = artifacts.require("ConfigurableERC20"); const simple = artifacts.require("simple"); module.exports = function(deployer) { deployer.deploy(simple) deployer.deploy(ConfigurableERC20, "0x102e5f644e6ed79ee2a3c221fe16d8711f028952") };
/**@preserve GeneXus Java 10_3_12-110051 on February 13, 2021 7:44:4.1 * gx.evt.autoSkip=!1;gx.define("ttipopermissao",!1,function(){var n,t,i;this.ServerClass="ttipopermissao";this.PackageName="";this.setObjectType("trn");this.setOnAjaxSessionTimeout("Warn");this.hasEnterEvent=!0;this.skipOnEnter=!1;this.addKeyListener("12","'FECHAR'");this.addKeyListener("20","LAST");this.addKeyListener("19","FIRST");this.addKeyListener("16","SELECT");this.addKeyListener("13","DELETE");this.addKeyListener("9","GET");this.addKeyListener("2","PROMPT");this.addKeyListener("8","NEXT");this.addKeyListener("7","PREVIOUS");this.addKeyListener("4","CHECK");this.addKeyListener("5","REFRESH");this.addKeyListener("12","CANCEL");this.addKeyListener("1","HELP");this.SetStandaloneVars=function(){this.AV10TipoPermissaoId=gx.fn.getIntegerValue("vTIPOPERMISSAOID",".");this.AV9Erro=gx.fn.getIntegerValue("vERRO",".");this.AV14ret=gx.fn.getIntegerValue("vRET",".");this.A565TipoPermissaoUltimoUsuarioPerm=gx.fn.getIntegerValue("TIPOPERMISSAOULTIMOUSUARIOPERM",".");this.AV27Pgmdesc=gx.fn.getControlValue("vPGMDESC");this.AV26Pgmname=gx.fn.getControlValue("vPGMNAME");this.Gx_BScreen=gx.fn.getIntegerValue("vGXBSCREEN",".");this.Gx_mode=gx.fn.getControlValue("vMODE");this.AV18TipoPermissaoUsuarioFilialEmpId=gx.fn.getControlValue("vTIPOPERMISSAOUSUARIOFILIALEMPID")};this.Valid_Tipopermissaoid=function(){try{var n=gx.util.balloon.getNew("TIPOPERMISSAOID");this.AnyError=0}catch(t){}try{return n==null?!0:n.show()}catch(t){}return!0};this.Valid_Tipopermissaodescricao=function(){try{var n=gx.util.balloon.getNew("TIPOPERMISSAODESCRICAO");this.AnyError=0}catch(t){}try{return n==null?!0:n.show()}catch(t){}return!0};this.Valid_Tipopermissaoprivilegio=function(){try{var n=gx.util.balloon.getNew("TIPOPERMISSAOPRIVILEGIO");if(this.AnyError=0,!(this.A559TipoPermissaoPrivilegio=="A"||this.A559TipoPermissaoPrivilegio=="P"||this.A559TipoPermissaoPrivilegio=="N"||this.A559TipoPermissaoPrivilegio=="O"))try{n.setError("Campo Tipo de Privilégio fora do intervalo");this.AnyError=gx.num.trunc(1,0)}catch(t){}}catch(t){}try{return n==null?!0:n.show()}catch(t){}return!0};this.Valid_Tipopermissaousuarioliberado=function(){try{var n=gx.util.balloon.getNew("TIPOPERMISSAOUSUARIOLIBERADO");this.AnyError=0}catch(t){}try{return n==null?!0:n.show()}catch(t){}return!0};this.Valid_Tipopermissaousuarionaoliberad=function(){try{var n=gx.util.balloon.getNew("TIPOPERMISSAOUSUARIONAOLIBERAD");this.AnyError=0}catch(t){}try{return n==null?!0:n.show()}catch(t){}return!0};this.Valid_Tipopermissaocomentario=function(){try{var n=gx.util.balloon.getNew("TIPOPERMISSAOCOMENTARIO");this.AnyError=0}catch(t){}try{return n==null?!0:n.show()}catch(t){}return!0};this.Valid_Tipopermissaomensagemsenha=function(){try{var n=gx.util.balloon.getNew("TIPOPERMISSAOMENSAGEMSENHA");this.AnyError=0}catch(t){}try{return n==null?!0:n.show()}catch(t){}return!0};this.Valid_Tipopermissaomensagemnaopermit=function(){return gx.ajax.validSrvEvt("dyncall","valid_Tipopermissaomensagemnaopermit",["gx.O.A568TipoPermissaoId","gx.O.A557TipoPermissaoDescricao","gx.O.A559TipoPermissaoPrivilegio","gx.O.A560TipoPermissaoUsuarioLiberado","gx.O.A561TipoPermissaoUsuarioNaoLiberad","gx.O.A562TipoPermissaoComentario","gx.O.A563TipoPermissaoMensagemSenha","gx.O.A564TipoPermissaoMensagemNaoPermit","gx.O.AV9Erro","gx.O.AV14ret"],["AV14ret"]),!0};this.Valid_Usuariopermissaoid=function(){try{if(gx.fn.currentGridRowImpl(63)===0)return!0;var n=gx.util.balloon.getNew("USUARIOPERMISSAOID",gx.fn.currentGridRowImpl(63));this.AnyError=0;this.sMode70=this.Gx_mode;this.Gx_mode=gx.fn.getGridRowMode(70,63);this.standaloneModal1G70();this.standaloneNotModal1G70();gx.fn.gridDuplicateKey(65)&&(n.setError(gx.text.format(gx.getMessage("GXM_1004"),"Usuário da Permissão","","","","","","","","")),this.AnyError=gx.num.trunc(1,0))}catch(t){}try{return(this.Gx_mode=this.sMode70,n==null)?!0:n.show()}catch(t){}return!0};this.Valid_Tipopermissaousuariousuarioid=function(){return this.sMode70=this.Gx_mode,this.Gx_mode=gx.fn.getGridRowMode(70,63),gx.ajax.validSrvEvt("dyncall","valid_Tipopermissaousuariousuarioid",["gx.O.A566TipoPermissaoUsuarioUsuarioId","gx.O.A567TipoPermissaoUsuarioPrivilegio"],["A567TipoPermissaoUsuarioPrivilegio"]),this.Gx_mode=this.sMode70,!0};this.Valid_Empresaid=function(){return this.sMode70=this.Gx_mode,this.Gx_mode=gx.fn.getGridRowMode(70,63),gx.ajax.validSrvEvt("dyncall","valid_Empresaid",["gx.O.A138EmpresaId","gx.O.A568TipoPermissaoId","gx.O.A569UsuarioPermissaoId","gx.O.A566TipoPermissaoUsuarioUsuarioId","gx.O.A557TipoPermissaoDescricao","gx.O.A559TipoPermissaoPrivilegio","gx.O.A560TipoPermissaoUsuarioLiberado","gx.O.A561TipoPermissaoUsuarioNaoLiberad","gx.O.A562TipoPermissaoComentario","gx.O.A563TipoPermissaoMensagemSenha","gx.O.A564TipoPermissaoMensagemNaoPermit","gx.O.AV9Erro","gx.O.AV14ret"],["AV9Erro","AV14ret"]),this.Gx_mode=this.sMode70,!0};this.Valid_Tipopermissaousuariofilialempi=function(){try{if(gx.fn.currentGridRowImpl(63)===0)return!0;var n=gx.util.balloon.getNew("TIPOPERMISSAOUSUARIOFILIALEMPI",gx.fn.currentGridRowImpl(63));this.AnyError=0;this.sMode70=this.Gx_mode;this.Gx_mode=gx.fn.getGridRowMode(70,63)}catch(t){}try{return(this.Gx_mode=this.sMode70,n==null)?!0:n.show()}catch(t){}return!0};this.Valid_Tipopermissaousuariofilialid=function(){return this.sMode70=this.Gx_mode,this.Gx_mode=gx.fn.getGridRowMode(70,63),gx.ajax.validSrvEvt("dyncall","valid_Tipopermissaousuariofilialid",["gx.O.A6451TipoPermissaoUsuarioFilialEmpI","gx.O.A6452TipoPermissaoUsuarioFilialId","gx.O.A6453TipoPermissaoUsuarioFilialNome"],["A6453TipoPermissaoUsuarioFilialNome"]),this.Gx_mode=this.sMode70,!0};this.standaloneModal1G70=function(){this.A565TipoPermissaoUltimoUsuarioPerm=gx.num.trunc(gx.fn.serialRule("A565TipoPermissaoUltimoUsuarioPerm","A569UsuarioPermissaoId",63,1,this),0);try{this.Gx_mode=="INS"&&""==this.A6451TipoPermissaoUsuarioFilialEmpI&&this.Gx_BScreen==0&&(this.A6451TipoPermissaoUsuarioFilialEmpI=this.AV18TipoPermissaoUsuarioFilialEmpId)}catch(n){}return!0};this.standaloneNotModal1G70=function(){try{gx.fn.setCtrlProperty("USUARIOPERMISSAOID","Enabled",0)}catch(n){}try{gx.fn.setCtrlProperty("TIPOPERMISSAOUSUARIOFILIALEMPI","Enabled",0)}catch(n){}try{gx.fn.setCtrlProperty("TIPOPERMISSAOUSUARIOFILIALNOME","Enabled",0)}catch(n){}return!0};this.e121g2_client=function(){this.executeServerEvent("'FECHAR'",!1,null,!1,!1)};this.e131g2_client=function(){this.executeServerEvent("AFTER TRN",!0,null,!1,!1)};this.e141g69_client=function(){this.executeServerEvent("ENTER",!0,null,!1,!1)};this.e151g69_client=function(){this.executeServerEvent("CANCEL",!0,null,!1,!1)};this.GXValidFnc=[];n=this.GXValidFnc;this.GXCtrlIds=[3,7,10,13,15,20,22,25,27,29,32,34,36,39,41,43,46,48,51,53,56,58,59,62,64,65,66,67,68,69,70,71,72,81,83];this.GXLastCtrlId=83;this.Grid1Container=new gx.grid.grid(this,70,"UsuarioPermissao",63,"Grid1","Grid1","Grid1Container",this.CmpContext,this.IsMasterPage,"ttipopermissao",[569],!1,1,!0,!0,0,!1,!1,!1,"",0,"px","Novo registro",!0,!1,!1,null,null,!1,"",!1,[1,1,1,1]);t=this.Grid1Container;t.addSingleLineEdit("nRcdDeleted_70",64,"vNRCDDELETED_70","","","nRcdDeleted_70","int",0,"px",4,1,"right",null,[],"nRcdDeleted_70","nRcdDeleted_70",!0,0,!1,!1,"Attribute",1,"");t.addSingleLineEdit(569,65,"USUARIOPERMISSAOID","Sequência","","UsuarioPermissaoId","int",0,"px",4,4,"right",null,[],569,"UsuarioPermissaoId",!0,0,!1,!1,"Attribute",1,"");t.addSingleLineEdit(566,66,"TIPOPERMISSAOUSUARIOUSUARIOID","Usuário","","TipoPermissaoUsuarioUsuarioId","char",0,"px",12,12,"left",null,[],566,"TipoPermissaoUsuarioUsuarioId",!0,0,!1,!1,"Attribute",1,"");t.addBitmap("prompt_566","PROMPT_566",85,0,"",0,"",null,"","","gx-prompt Image","");t.addComboBox(567,67,"TIPOPERMISSAOUSUARIOPRIVILEGIO","Tipo de Privilégio","TipoPermissaoUsuarioPrivilegio","char",null,0,!0,!1,0,"px","");t.addSingleLineEdit(138,68,"EMPRESAID","Empresa","","EmpresaId","char",0,"px",10,10,"left",null,[],138,"EmpresaId",!0,0,!1,!1,"Attribute",1,"");t.addBitmap("prompt_138","PROMPT_138",86,0,"",0,"",null,"","","gx-prompt Image","");t.addSingleLineEdit(6451,69,"TIPOPERMISSAOUSUARIOFILIALEMPI","Tipo Permissao Usuario Filial Emp Id","","TipoPermissaoUsuarioFilialEmpI","char",0,"px",10,10,"left",null,[],6451,"TipoPermissaoUsuarioFilialEmpI",!1,0,!1,!1,"Attribute",1,"");t.addSingleLineEdit(6452,70,"TIPOPERMISSAOUSUARIOFILIALID","Filial","","TipoPermissaoUsuarioFilialId","int",0,"px",7,7,"right",null,[],6452,"TipoPermissaoUsuarioFilialId",!0,0,!1,!1,"Attribute",1,"");t.addBitmap("prompt_6452","PROMPT_6452",87,0,"",0,"",null,"","","gx-prompt Image","");t.addSingleLineEdit(6453,71,"TIPOPERMISSAOUSUARIOFILIALNOME","Nome Filial","","TipoPermissaoUsuarioFilialNome","svchar",0,"px",100,80,"left",null,[],6453,"TipoPermissaoUsuarioFilialNome",!0,0,!1,!1,"Attribute",1,"");this.setGrid(t);this.TABCSSContainer=gx.uc.getNew(this,6,0,"TabCss","TABCSSContainer","Tabcss");i=this.TABCSSContainer;i.setProp("Width","Width","100","str");i.setProp("Height","Height","100","str");i.addV2CFunction("AV22Tab","vTAB","SetData");i.addC2VFunction(function(n){n.ParentObject.AV22Tab=n.GetData();gx.fn.setControlValue("vTAB",n.ParentObject.AV22Tab)});i.setProp("Position","Position",1,"num");i.setProp("CookieId","Cookieid","ttipopermissao_tabcss","str");i.setProp("Visible","Visible",!0,"bool");i.setProp("Enabled","Enabled",!0,"boolean");i.setProp("Class","Class","","char");i.setC2ShowFunction(function(n){n.show()});this.setUserControl(i);n[3]={fld:"TABLE1",grid:0};n[7]={fld:"TAB1",grid:0};n[10]={fld:"TABLE2",grid:0};n[13]={fld:"TEXTBLOCK1",format:0,grid:0};n[15]={lvl:0,type:"int",len:4,dec:0,sign:!1,pic:"ZZZ9",ro:0,grid:0,gxgrid:null,fnc:this.Valid_Tipopermissaoid,isvalid:null,rgrid:[this.Grid1Container],fld:"TIPOPERMISSAOID",gxz:"Z568TipoPermissaoId",gxold:"O568TipoPermissaoId",gxvar:"A568TipoPermissaoId",ucs:[],op:[],ip:[],nacdep:[],ctrltype:"edit",v2v:function(n){gx.O.A568TipoPermissaoId=gx.num.intval(n)},v2z:function(n){gx.O.Z568TipoPermissaoId=gx.num.intval(n)},v2c:function(){gx.fn.setControlValue("TIPOPERMISSAOID",gx.O.A568TipoPermissaoId,0)},c2v:function(){gx.O.A568TipoPermissaoId=gx.num.intval(this.val())},val:function(){return gx.fn.getIntegerValue("TIPOPERMISSAOID",".")},nac:function(){return!(0==this.AV10TipoPermissaoId)}};n[20]={fld:"TEXTBLOCK2",format:0,grid:0};n[22]={lvl:0,type:"svchar",len:80,dec:0,sign:!1,ro:0,grid:0,gxgrid:null,fnc:this.Valid_Tipopermissaodescricao,isvalid:null,rgrid:[],fld:"TIPOPERMISSAODESCRICAO",gxz:"Z557TipoPermissaoDescricao",gxold:"O557TipoPermissaoDescricao",gxvar:"A557TipoPermissaoDescricao",ucs:[],op:[],ip:[],nacdep:[],ctrltype:"edit",v2v:function(n){gx.O.A557TipoPermissaoDescricao=n},v2z:function(n){gx.O.Z557TipoPermissaoDescricao=n},v2c:function(){gx.fn.setControlValue("TIPOPERMISSAODESCRICAO",gx.O.A557TipoPermissaoDescricao,0)},c2v:function(){gx.O.A557TipoPermissaoDescricao=this.val()},val:function(){return gx.fn.getControlValue("TIPOPERMISSAODESCRICAO")},nac:gx.falseFn};n[25]={fld:"TEXTBLOCK3",format:0,grid:0};n[27]={lvl:0,type:"char",len:1,dec:0,sign:!1,pic:"@!",ro:0,grid:0,gxgrid:null,fnc:this.Valid_Tipopermissaoprivilegio,isvalid:null,rgrid:[],fld:"TIPOPERMISSAOPRIVILEGIO",gxz:"Z559TipoPermissaoPrivilegio",gxold:"O559TipoPermissaoPrivilegio",gxvar:"A559TipoPermissaoPrivilegio",ucs:[],op:[27],ip:[27],nacdep:[],ctrltype:"combo",v2v:function(n){gx.O.A559TipoPermissaoPrivilegio=n},v2z:function(n){gx.O.Z559TipoPermissaoPrivilegio=n},v2c:function(){gx.fn.setComboBoxValue("TIPOPERMISSAOPRIVILEGIO",gx.O.A559TipoPermissaoPrivilegio);typeof this.dom_hdl=="function"&&this.dom_hdl.call(gx.O)},c2v:function(){gx.O.A559TipoPermissaoPrivilegio=this.val()},val:function(){return gx.fn.getControlValue("TIPOPERMISSAOPRIVILEGIO")},nac:gx.falseFn};this.declareDomainHdlr(27,function(){});n[29]={lvl:0,type:"char",len:1,dec:0,sign:!1,pic:"@!",ro:0,grid:0,gxgrid:null,fnc:null,isvalid:null,rgrid:[],fld:"TIPOPERMISSAOSNCONTROLA",gxz:"Z3138TipoPermissaoSnControla",gxold:"O3138TipoPermissaoSnControla",gxvar:"A3138TipoPermissaoSnControla",ucs:[],op:[],ip:[],nacdep:[],ctrltype:"checkbox",v2v:function(n){gx.O.A3138TipoPermissaoSnControla=n},v2z:function(n){gx.O.Z3138TipoPermissaoSnControla=n},v2c:function(){gx.fn.setCheckBoxValue("TIPOPERMISSAOSNCONTROLA",gx.O.A3138TipoPermissaoSnControla,"S");typeof this.dom_hdl=="function"&&this.dom_hdl.call(gx.O)},c2v:function(){gx.O.A3138TipoPermissaoSnControla=this.val()},val:function(){return gx.fn.getControlValue("TIPOPERMISSAOSNCONTROLA")},nac:gx.falseFn,values:["S","N"]};this.declareDomainHdlr(29,function(){});n[32]={fld:"TEXTBLOCK4",format:0,grid:0};n[34]={lvl:0,type:"char",len:1,dec:0,sign:!1,ro:0,grid:0,gxgrid:null,fnc:this.Valid_Tipopermissaousuarioliberado,isvalid:null,rgrid:[],fld:"TIPOPERMISSAOUSUARIOLIBERADO",gxz:"Z560TipoPermissaoUsuarioLiberado",gxold:"O560TipoPermissaoUsuarioLiberado",gxvar:"A560TipoPermissaoUsuarioLiberado",ucs:[],op:[],ip:[],nacdep:[],ctrltype:"combo",v2v:function(n){gx.O.A560TipoPermissaoUsuarioLiberado=n},v2z:function(n){gx.O.Z560TipoPermissaoUsuarioLiberado=n},v2c:function(){gx.fn.setComboBoxValue("TIPOPERMISSAOUSUARIOLIBERADO",gx.O.A560TipoPermissaoUsuarioLiberado)},c2v:function(){gx.O.A560TipoPermissaoUsuarioLiberado=this.val()},val:function(){return gx.fn.getControlValue("TIPOPERMISSAOUSUARIOLIBERADO")},nac:gx.falseFn};n[36]={lvl:0,type:"char",len:1,dec:0,sign:!1,pic:"@!",ro:0,grid:0,gxgrid:null,fnc:null,isvalid:null,rgrid:[],fld:"TIPOPERMISSAOSNEMPRESA",gxz:"Z558TipoPermissaoSnEmpresa",gxold:"O558TipoPermissaoSnEmpresa",gxvar:"A558TipoPermissaoSnEmpresa",ucs:[],op:[],ip:[],nacdep:[],ctrltype:"checkbox",v2v:function(n){gx.O.A558TipoPermissaoSnEmpresa=n},v2z:function(n){gx.O.Z558TipoPermissaoSnEmpresa=n},v2c:function(){gx.fn.setCheckBoxValue("TIPOPERMISSAOSNEMPRESA",gx.O.A558TipoPermissaoSnEmpresa,"S");typeof this.dom_hdl=="function"&&this.dom_hdl.call(gx.O)},c2v:function(){gx.O.A558TipoPermissaoSnEmpresa=this.val()},val:function(){return gx.fn.getControlValue("TIPOPERMISSAOSNEMPRESA")},nac:gx.falseFn,values:["S","N"]};this.declareDomainHdlr(36,function(){});n[39]={fld:"TEXTBLOCK5",format:0,grid:0};n[41]={lvl:0,type:"char",len:1,dec:0,sign:!1,ro:0,grid:0,gxgrid:null,fnc:this.Valid_Tipopermissaousuarionaoliberad,isvalid:null,rgrid:[],fld:"TIPOPERMISSAOUSUARIONAOLIBERAD",gxz:"Z561TipoPermissaoUsuarioNaoLiberad",gxold:"O561TipoPermissaoUsuarioNaoLiberad",gxvar:"A561TipoPermissaoUsuarioNaoLiberad",ucs:[],op:[],ip:[],nacdep:[],ctrltype:"combo",v2v:function(n){gx.O.A561TipoPermissaoUsuarioNaoLiberad=n},v2z:function(n){gx.O.Z561TipoPermissaoUsuarioNaoLiberad=n},v2c:function(){gx.fn.setComboBoxValue("TIPOPERMISSAOUSUARIONAOLIBERAD",gx.O.A561TipoPermissaoUsuarioNaoLiberad)},c2v:function(){gx.O.A561TipoPermissaoUsuarioNaoLiberad=this.val()},val:function(){return gx.fn.getControlValue("TIPOPERMISSAOUSUARIONAOLIBERAD")},nac:gx.falseFn};n[43]={lvl:0,type:"char",len:1,dec:0,sign:!1,pic:"@!",ro:0,grid:0,gxgrid:null,fnc:null,isvalid:null,rgrid:[],fld:"TIPOPERMISSAOSNFILIAL",gxz:"Z6450TipoPermissaoSnFilial",gxold:"O6450TipoPermissaoSnFilial",gxvar:"A6450TipoPermissaoSnFilial",ucs:[],op:[],ip:[],nacdep:[],ctrltype:"checkbox",v2v:function(n){gx.O.A6450TipoPermissaoSnFilial=n},v2z:function(n){gx.O.Z6450TipoPermissaoSnFilial=n},v2c:function(){gx.fn.setCheckBoxValue("TIPOPERMISSAOSNFILIAL",gx.O.A6450TipoPermissaoSnFilial,"S");typeof this.dom_hdl=="function"&&this.dom_hdl.call(gx.O)},c2v:function(){gx.O.A6450TipoPermissaoSnFilial=this.val()},val:function(){return gx.fn.getControlValue("TIPOPERMISSAOSNFILIAL")},nac:gx.falseFn,values:["S","N"]};this.declareDomainHdlr(43,function(){});n[46]={fld:"TEXTBLOCK6",format:0,grid:0};n[48]={lvl:0,type:"svchar",len:180,dec:0,sign:!1,ro:0,multiline:!0,grid:0,gxgrid:null,fnc:this.Valid_Tipopermissaocomentario,isvalid:null,rgrid:[],fld:"TIPOPERMISSAOCOMENTARIO",gxz:"Z562TipoPermissaoComentario",gxold:"O562TipoPermissaoComentario",gxvar:"A562TipoPermissaoComentario",ucs:[],op:[],ip:[],nacdep:[],ctrltype:"edit",v2v:function(n){gx.O.A562TipoPermissaoComentario=n},v2z:function(n){gx.O.Z562TipoPermissaoComentario=n},v2c:function(){gx.fn.setControlValue("TIPOPERMISSAOCOMENTARIO",gx.O.A562TipoPermissaoComentario,0)},c2v:function(){gx.O.A562TipoPermissaoComentario=this.val()},val:function(){return gx.fn.getControlValue("TIPOPERMISSAOCOMENTARIO")},nac:gx.falseFn};n[51]={fld:"TEXTBLOCK7",format:0,grid:0};n[53]={lvl:0,type:"svchar",len:180,dec:0,sign:!1,ro:0,multiline:!0,grid:0,gxgrid:null,fnc:this.Valid_Tipopermissaomensagemsenha,isvalid:null,rgrid:[],fld:"TIPOPERMISSAOMENSAGEMSENHA",gxz:"Z563TipoPermissaoMensagemSenha",gxold:"O563TipoPermissaoMensagemSenha",gxvar:"A563TipoPermissaoMensagemSenha",ucs:[],op:[],ip:[],nacdep:[],ctrltype:"edit",v2v:function(n){gx.O.A563TipoPermissaoMensagemSenha=n},v2z:function(n){gx.O.Z563TipoPermissaoMensagemSenha=n},v2c:function(){gx.fn.setControlValue("TIPOPERMISSAOMENSAGEMSENHA",gx.O.A563TipoPermissaoMensagemSenha,0)},c2v:function(){gx.O.A563TipoPermissaoMensagemSenha=this.val()},val:function(){return gx.fn.getControlValue("TIPOPERMISSAOMENSAGEMSENHA")},nac:gx.falseFn};n[56]={fld:"TEXTBLOCK8",format:0,grid:0};n[58]={lvl:0,type:"svchar",len:180,dec:0,sign:!1,ro:0,multiline:!0,grid:0,gxgrid:null,fnc:this.Valid_Tipopermissaomensagemnaopermit,isvalid:null,rgrid:[],fld:"TIPOPERMISSAOMENSAGEMNAOPERMIT",gxz:"Z564TipoPermissaoMensagemNaoPermit",gxold:"O564TipoPermissaoMensagemNaoPermit",gxvar:"A564TipoPermissaoMensagemNaoPermit",ucs:[],op:[],ip:[58,53,48,41,34,27,22,15],nacdep:[],ctrltype:"edit",v2v:function(n){gx.O.A564TipoPermissaoMensagemNaoPermit=n},v2z:function(n){gx.O.Z564TipoPermissaoMensagemNaoPermit=n},v2c:function(){gx.fn.setControlValue("TIPOPERMISSAOMENSAGEMNAOPERMIT",gx.O.A564TipoPermissaoMensagemNaoPermit,0)},c2v:function(){gx.O.A564TipoPermissaoMensagemNaoPermit=this.val()},val:function(){return gx.fn.getControlValue("TIPOPERMISSAOMENSAGEMNAOPERMIT")},nac:gx.falseFn};n[59]={fld:"TAB2",grid:0};n[62]={fld:"DIV1",format:2,grid:0};n[64]={lvl:70,type:"int",len:4,dec:0,sign:!1,pic:"9999",ro:0,isacc:0,grid:63,gxgrid:this.Grid1Container,fnc:null,isvalid:null,rgrid:[],fld:"vNRCDDELETED_70",gxz:"ZnRcdDeleted_70",gxold:"OnRcdDeleted_70",gxvar:"nRcdDeleted_70",ucs:[],op:[],ip:[],nacdep:[],ctrltype:"edit",inputType:"text",v2v:function(n){gx.O.nRcdDeleted_70=gx.num.intval(n)},v2z:function(n){gx.O.ZnRcdDeleted_70=gx.num.intval(n)},v2c:function(n){gx.fn.setGridControlValue("vNRCDDELETED_70",n||gx.fn.currentGridRowImpl(63),gx.O.nRcdDeleted_70,0)},c2v:function(){gx.O.nRcdDeleted_70=gx.num.intval(this.val())},val:function(n){return gx.fn.getGridIntegerValue("vNRCDDELETED_70",n||gx.fn.currentGridRowImpl(63),".")},nac:gx.falseFn};n[65]={lvl:70,type:"int",len:4,dec:0,sign:!1,pic:"ZZZ9",ro:1,isacc:1,grid:63,gxgrid:this.Grid1Container,fnc:this.Valid_Usuariopermissaoid,isvalid:null,rgrid:[],fld:"USUARIOPERMISSAOID",gxz:"Z569UsuarioPermissaoId",gxold:"O569UsuarioPermissaoId",gxvar:"A569UsuarioPermissaoId",ucs:[],op:[65,69],ip:[65,69],nacdep:[],ctrltype:"edit",inputType:"text",v2v:function(n){gx.O.A569UsuarioPermissaoId=gx.num.intval(n)},v2z:function(n){gx.O.Z569UsuarioPermissaoId=gx.num.intval(n)},v2c:function(n){gx.fn.setGridControlValue("USUARIOPERMISSAOID",n||gx.fn.currentGridRowImpl(63),gx.O.A569UsuarioPermissaoId,0)},c2v:function(){gx.O.A569UsuarioPermissaoId=gx.num.intval(this.val())},val:function(n){return gx.fn.getGridIntegerValue("USUARIOPERMISSAOID",n||gx.fn.currentGridRowImpl(63),".")},nac:gx.falseFn};n[66]={lvl:70,type:"char",len:12,dec:0,sign:!1,pic:"@!",ro:0,isacc:1,grid:63,gxgrid:this.Grid1Container,fnc:this.Valid_Tipopermissaousuariousuarioid,isvalid:null,rgrid:[],fld:"TIPOPERMISSAOUSUARIOUSUARIOID",gxz:"Z566TipoPermissaoUsuarioUsuarioId",gxold:"O566TipoPermissaoUsuarioUsuarioId",gxvar:"A566TipoPermissaoUsuarioUsuarioId",ucs:[],op:[67],ip:[67,66],nacdep:[],ctrltype:"edit",inputType:"text",autoCorrect:"1",v2v:function(n){gx.O.A566TipoPermissaoUsuarioUsuarioId=n},v2z:function(n){gx.O.Z566TipoPermissaoUsuarioUsuarioId=n},v2c:function(n){gx.fn.setGridControlValue("TIPOPERMISSAOUSUARIOUSUARIOID",n||gx.fn.currentGridRowImpl(63),gx.O.A566TipoPermissaoUsuarioUsuarioId,0);typeof this.dom_hdl=="function"&&this.dom_hdl.call(gx.O)},c2v:function(){gx.O.A566TipoPermissaoUsuarioUsuarioId=this.val()},val:function(n){return gx.fn.getGridControlValue("TIPOPERMISSAOUSUARIOUSUARIOID",n||gx.fn.currentGridRowImpl(63))},nac:gx.falseFn};n[67]={lvl:70,type:"char",len:1,dec:0,sign:!1,pic:"@!",ro:1,isacc:1,grid:63,gxgrid:this.Grid1Container,fnc:null,isvalid:null,rgrid:[],fld:"TIPOPERMISSAOUSUARIOPRIVILEGIO",gxz:"Z567TipoPermissaoUsuarioPrivilegio",gxold:"O567TipoPermissaoUsuarioPrivilegio",gxvar:"A567TipoPermissaoUsuarioPrivilegio",ucs:[],op:[],ip:[],nacdep:[],ctrltype:"combo",inputType:"text",v2v:function(n){gx.O.A567TipoPermissaoUsuarioPrivilegio=n},v2z:function(n){gx.O.Z567TipoPermissaoUsuarioPrivilegio=n},v2c:function(n){gx.fn.setGridComboBoxValue("TIPOPERMISSAOUSUARIOPRIVILEGIO",n||gx.fn.currentGridRowImpl(63),gx.O.A567TipoPermissaoUsuarioPrivilegio);typeof this.dom_hdl=="function"&&this.dom_hdl.call(gx.O)},c2v:function(){gx.O.A567TipoPermissaoUsuarioPrivilegio=this.val()},val:function(n){return gx.fn.getGridControlValue("TIPOPERMISSAOUSUARIOPRIVILEGIO",n||gx.fn.currentGridRowImpl(63))},nac:gx.falseFn};n[68]={lvl:70,type:"char",len:10,dec:0,sign:!1,pic:"@!",ro:0,isacc:1,grid:63,gxgrid:this.Grid1Container,fnc:this.Valid_Empresaid,isvalid:null,rgrid:[],fld:"EMPRESAID",gxz:"Z138EmpresaId",gxold:"O138EmpresaId",gxvar:"A138EmpresaId",ucs:[],op:[],ip:[58,53,48,41,34,27,22,66,65,15,68],nacdep:[],ctrltype:"edit",inputType:"text",autoCorrect:"1",v2v:function(n){gx.O.A138EmpresaId=n},v2z:function(n){gx.O.Z138EmpresaId=n},v2c:function(n){gx.fn.setGridControlValue("EMPRESAID",n||gx.fn.currentGridRowImpl(63),gx.O.A138EmpresaId,0)},c2v:function(){gx.O.A138EmpresaId=this.val()},val:function(n){return gx.fn.getGridControlValue("EMPRESAID",n||gx.fn.currentGridRowImpl(63))},nac:gx.falseFn};n[69]={lvl:70,type:"char",len:10,dec:0,sign:!1,pic:"@!",ro:1,isacc:1,grid:63,gxgrid:this.Grid1Container,fnc:this.Valid_Tipopermissaousuariofilialempi,isvalid:null,rgrid:[],fld:"TIPOPERMISSAOUSUARIOFILIALEMPI",gxz:"Z6451TipoPermissaoUsuarioFilialEmpI",gxold:"O6451TipoPermissaoUsuarioFilialEmpI",gxvar:"A6451TipoPermissaoUsuarioFilialEmpI",ucs:[],op:[],ip:[],nacdep:[],ctrltype:"edit",inputType:"text",autoCorrect:"1",v2v:function(n){gx.O.A6451TipoPermissaoUsuarioFilialEmpI=n},v2z:function(n){gx.O.Z6451TipoPermissaoUsuarioFilialEmpI=n},v2c:function(n){gx.fn.setGridControlValue("TIPOPERMISSAOUSUARIOFILIALEMPI",n||gx.fn.currentGridRowImpl(63),gx.O.A6451TipoPermissaoUsuarioFilialEmpI,0);typeof this.dom_hdl=="function"&&this.dom_hdl.call(gx.O)},c2v:function(){gx.O.A6451TipoPermissaoUsuarioFilialEmpI=this.val()},val:function(n){return gx.fn.getGridControlValue("TIPOPERMISSAOUSUARIOFILIALEMPI",n||gx.fn.currentGridRowImpl(63))},nac:gx.falseFn};n[70]={lvl:70,type:"int",len:7,dec:0,sign:!1,pic:"ZZZZZZ9",ro:0,isacc:1,grid:63,gxgrid:this.Grid1Container,fnc:this.Valid_Tipopermissaousuariofilialid,isvalid:null,rgrid:[],fld:"TIPOPERMISSAOUSUARIOFILIALID",gxz:"Z6452TipoPermissaoUsuarioFilialId",gxold:"O6452TipoPermissaoUsuarioFilialId",gxvar:"A6452TipoPermissaoUsuarioFilialId",ucs:[],op:[71],ip:[71,70,69],nacdep:[],ctrltype:"edit",inputType:"text",v2v:function(n){gx.O.A6452TipoPermissaoUsuarioFilialId=gx.num.intval(n)},v2z:function(n){gx.O.Z6452TipoPermissaoUsuarioFilialId=gx.num.intval(n)},v2c:function(n){gx.fn.setGridControlValue("TIPOPERMISSAOUSUARIOFILIALID",n||gx.fn.currentGridRowImpl(63),gx.O.A6452TipoPermissaoUsuarioFilialId,0)},c2v:function(){gx.O.A6452TipoPermissaoUsuarioFilialId=gx.num.intval(this.val())},val:function(n){return gx.fn.getGridIntegerValue("TIPOPERMISSAOUSUARIOFILIALID",n||gx.fn.currentGridRowImpl(63),".")},nac:gx.falseFn};n[71]={lvl:70,type:"svchar",len:100,dec:0,sign:!1,ro:1,isacc:1,grid:63,gxgrid:this.Grid1Container,fnc:null,isvalid:null,rgrid:[],fld:"TIPOPERMISSAOUSUARIOFILIALNOME",gxz:"Z6453TipoPermissaoUsuarioFilialNome",gxold:"O6453TipoPermissaoUsuarioFilialNome",gxvar:"A6453TipoPermissaoUsuarioFilialNome",ucs:[],op:[],ip:[],nacdep:[],ctrltype:"edit",inputType:"text",autoCorrect:"1",v2v:function(n){gx.O.A6453TipoPermissaoUsuarioFilialNome=n},v2z:function(n){gx.O.Z6453TipoPermissaoUsuarioFilialNome=n},v2c:function(n){gx.fn.setGridControlValue("TIPOPERMISSAOUSUARIOFILIALNOME",n||gx.fn.currentGridRowImpl(63),gx.O.A6453TipoPermissaoUsuarioFilialNome,0)},c2v:function(){gx.O.A6453TipoPermissaoUsuarioFilialNome=this.val()},val:function(n){return gx.fn.getGridControlValue("TIPOPERMISSAOUSUARIOFILIALNOME",n||gx.fn.currentGridRowImpl(63))},nac:gx.falseFn};n[72]={fld:"DIV2",format:2,grid:0};n[81]={lvl:0,type:"int",len:8,dec:0,sign:!1,pic:"ZZZZZZZ9",ro:1,grid:0,gxgrid:null,fnc:null,isvalid:null,rgrid:[],fld:"vACESSOSISTEMASEQUENCIA",gxz:"ZV17AcessoSistemaSequencia",gxold:"OV17AcessoSistemaSequencia",gxvar:"AV17AcessoSistemaSequencia",ucs:[],op:[],ip:[],nacdep:[],ctrltype:"edit",v2v:function(n){gx.O.AV17AcessoSistemaSequencia=gx.num.intval(n)},v2z:function(n){gx.O.ZV17AcessoSistemaSequencia=gx.num.intval(n)},v2c:function(){gx.fn.setControlValue("vACESSOSISTEMASEQUENCIA",gx.O.AV17AcessoSistemaSequencia,0)},c2v:function(){gx.O.AV17AcessoSistemaSequencia=gx.num.intval(this.val())},val:function(){return gx.fn.getIntegerValue("vACESSOSISTEMASEQUENCIA",".")},nac:gx.falseFn};n[83]={fld:"BTNHELP",grid:0};this.A568TipoPermissaoId=0;this.Z568TipoPermissaoId=0;this.O568TipoPermissaoId=0;this.A557TipoPermissaoDescricao="";this.Z557TipoPermissaoDescricao="";this.O557TipoPermissaoDescricao="";this.A559TipoPermissaoPrivilegio="";this.Z559TipoPermissaoPrivilegio="";this.O559TipoPermissaoPrivilegio="";this.A3138TipoPermissaoSnControla="";this.Z3138TipoPermissaoSnControla="";this.O3138TipoPermissaoSnControla="";this.A560TipoPermissaoUsuarioLiberado="";this.Z560TipoPermissaoUsuarioLiberado="";this.O560TipoPermissaoUsuarioLiberado="";this.A558TipoPermissaoSnEmpresa="";this.Z558TipoPermissaoSnEmpresa="";this.O558TipoPermissaoSnEmpresa="";this.A561TipoPermissaoUsuarioNaoLiberad="";this.Z561TipoPermissaoUsuarioNaoLiberad="";this.O561TipoPermissaoUsuarioNaoLiberad="";this.A6450TipoPermissaoSnFilial="";this.Z6450TipoPermissaoSnFilial="";this.O6450TipoPermissaoSnFilial="";this.A562TipoPermissaoComentario="";this.Z562TipoPermissaoComentario="";this.O562TipoPermissaoComentario="";this.A563TipoPermissaoMensagemSenha="";this.Z563TipoPermissaoMensagemSenha="";this.O563TipoPermissaoMensagemSenha="";this.A564TipoPermissaoMensagemNaoPermit="";this.Z564TipoPermissaoMensagemNaoPermit="";this.O564TipoPermissaoMensagemNaoPermit="";this.ZnRcdDeleted_70=0;this.OnRcdDeleted_70=0;this.Z569UsuarioPermissaoId=0;this.O569UsuarioPermissaoId=0;this.Z566TipoPermissaoUsuarioUsuarioId="";this.O566TipoPermissaoUsuarioUsuarioId="";this.Z567TipoPermissaoUsuarioPrivilegio="";this.O567TipoPermissaoUsuarioPrivilegio="";this.Z138EmpresaId="";this.O138EmpresaId="";this.Z6451TipoPermissaoUsuarioFilialEmpI="";this.O6451TipoPermissaoUsuarioFilialEmpI="";this.Z6452TipoPermissaoUsuarioFilialId=0;this.O6452TipoPermissaoUsuarioFilialId=0;this.Z6453TipoPermissaoUsuarioFilialNome="";this.O6453TipoPermissaoUsuarioFilialNome="";this.AV17AcessoSistemaSequencia=0;this.ZV17AcessoSistemaSequencia=0;this.OV17AcessoSistemaSequencia=0;this.A569UsuarioPermissaoId=0;this.A6451TipoPermissaoUsuarioFilialEmpI="";this.A566TipoPermissaoUsuarioUsuarioId="";this.A567TipoPermissaoUsuarioPrivilegio="";this.A6452TipoPermissaoUsuarioFilialId=0;this.A6453TipoPermissaoUsuarioFilialNome="";this.A138EmpresaId="";this.AV7UsrCod="";this.AV11EmpresaLogadaId="";this.AV26Pgmname="";this.AV27Pgmdesc="";this.AV12MsgErro="";this.AV17AcessoSistemaSequencia=0;this.AV16Modulo="";this.AV8Logon={};this.AV15Tabela="";this.AV18TipoPermissaoUsuarioFilialEmpId="";this.AV9Erro=0;this.AV14ret=0;this.AV10TipoPermissaoId=0;this.A568TipoPermissaoId=0;this.Gx_BScreen=0;this.A557TipoPermissaoDescricao="";this.A3138TipoPermissaoSnControla="";this.A558TipoPermissaoSnEmpresa="";this.A6450TipoPermissaoSnFilial="";this.A559TipoPermissaoPrivilegio="";this.A560TipoPermissaoUsuarioLiberado="";this.A561TipoPermissaoUsuarioNaoLiberad="";this.A562TipoPermissaoComentario="";this.A563TipoPermissaoMensagemSenha="";this.A564TipoPermissaoMensagemNaoPermit="";this.A565TipoPermissaoUltimoUsuarioPerm=0;this.AV22Tab=[];this.Gx_mode="";this.Events={e121g2_client:["'FECHAR'",!0],e131g2_client:["AFTER TRN",!0],e141g69_client:["ENTER",!0],e151g69_client:["CANCEL",!0]};this.EvtParms.ENTER=[[{postForm:!0},{av:"AV10TipoPermissaoId",fld:"vTIPOPERMISSAOID"},{av:"Gx_mode",fld:"vMODE"}],[]];this.EvtParms.REFRESH=[[],[]];this.EvtParms["'FECHAR'"]=[[{av:"AV17AcessoSistemaSequencia",fld:"vACESSOSISTEMASEQUENCIA"}],[]];this.EvtParms["AFTER TRN"]=[[{av:"Gx_mode",fld:"vMODE"},{av:"AV17AcessoSistemaSequencia",fld:"vACESSOSISTEMASEQUENCIA"}],[]];this.setPrompt("PROMPT_566",[66]);this.setPrompt("PROMPT_138",[68]);this.setPrompt("PROMPT_6452",[70]);this.EnterCtrl=["BUTTON1"];this.setVCMap("AV10TipoPermissaoId","vTIPOPERMISSAOID",0,"int");this.setVCMap("AV9Erro","vERRO",0,"int");this.setVCMap("AV14ret","vRET",0,"int");this.setVCMap("A565TipoPermissaoUltimoUsuarioPerm","TIPOPERMISSAOULTIMOUSUARIOPERM",0,"int");this.setVCMap("AV27Pgmdesc","vPGMDESC",0,"char");this.setVCMap("AV26Pgmname","vPGMNAME",0,"char");this.setVCMap("Gx_BScreen","vGXBSCREEN",0,"int");this.setVCMap("Gx_mode","vMODE",0,"char");this.setVCMap("AV18TipoPermissaoUsuarioFilialEmpId","vTIPOPERMISSAOUSUARIOFILIALEMPID",0,"char");this.InitStandaloneVars();this.LvlOlds[69]=["O565TipoPermissaoUltimoUsuarioPerm"]});gx.setParentObj(new ttipopermissao)
"use strict";function getQL(){return{operationName:"getRepoInfo",query:'\n\tquery getRepoInfo($owner: String = "Tomotoes", $weibo: String = "weibo", $gallery: String = "gallery") {\n\t\trepository(owner: $owner, name: $weibo) {\n\t\t\tissues(filterBy: {createdBy: $owner, states: OPEN}) {\n\t\t\t\ttotalCount\n\t\t\t}\n\t\t}\n\t\trepositoryOwner(login: $owner) {\n\t\t\trepository(name: $gallery) {\n\t\t\t\tdescription\n\t\t\t}\n\t\t}\n\t}\n\t'}}function getGithubCount(t,e){$.ajax({url:"https://api.github.com/graphql",type:"post",data:JSON.stringify(getQL()),headers:{Accept:"application/json",Authorization:"bearer ".concat(["9c48ed2297d7d9bf9447","6de723dbf1a6e4adeacd"].join(""))},success:t,error:e})}function initCount(){var e=sessionStorage.getItem("WEIBO-COUNT"),n=sessionStorage.getItem("PHOTO-COUNT");if(!e||!n||"null"===e||"null"===n)return getGithubCount(function(t){n=t.data.repositoryOwner.repository.description.match(/\d+/)[0],e=t.data.repository.issues.totalCount,n&&e&&(document.getElementById("weibo-count").innerText=e,document.getElementById("photo-count").innerText=n,sessionStorage.setItem("WEIBO-COUNT",e),sessionStorage.setItem("PHOTO-COUNT",n))},console.error);document.getElementById("weibo-count").innerText=e,document.getElementById("photo-count").innerText=n}initCount();var header=document.getElementById("header"),headroom=new Headroom(header,{classes:{initial:"headroom",pinned:"headroom--pinned",unpinned:"headroom--unpinned",top:"headroom--top",notTop:"headroom--not-top",bottom:"headroom--bottom",notBottom:"headroom--not-bottom",frozen:"headroom--frozen"}});headroom.init();var _slicedToArray,Strut,reduceMotion,setState,cubeIsHidden,headerIsHidden,template,parent,getParentWidth,parentWidth,directions,palette,setCubeStyles,createCube,sizes,cubes,getDistance,getRotation,getShading,shouldHide,updateSides,tick,parallaxLimit,container,start,maskEl=document.querySelector(".mask"),setNightMode=function(){maskEl.classList.add("night"),sessionStorage.setItem("night","1")},banNightMode=function(){maskEl.classList.remove("night"),sessionStorage.setItem("night","0")};function switchNightMode(){("1"===sessionStorage.getItem("night")?banNightMode:setNightMode)()}"1"===sessionStorage.getItem("night")&&setNightMode(),function(){var r,t=window||this,e=t.BLOG.even,n=t.BLOG.$,o=n("#search"),a=n("#search-wrap"),i=n("#key"),s=n("#back"),c=n("#search-panel"),u=n("#search-result"),d=n("#search-tpl").innerHTML,l="https://tomotoes.com/blog/content.json";var h=n("html"),m={show:function(){t.innerWidth<760&&h.classList.add("lock-size"),c.classList.add("in")},hide:function(){t.innerWidth<760&&h.classList.remove("lock-size"),c.classList.remove("in")}};function p(t){var e="",e=t.length?t.map(function(t){return e=d,n={title:t.title,path:"/blog".concat(t.path),date:new Date(t.date).toLocaleDateString(),tags:t.tags.map(function(t){return"<span>#".concat(t.name,"</span>")}).join("")},e.replace(/\{\w+\}/g,function(t){t=t.replace(/\{|\}/g,"");return n[t]||""});var e,n}).join(""):'<li class="tips"><p>未发现匹配文章</p></li>';u.innerHTML=e}function g(t,e){return e.lastIndex=0,e.test(t)}function f(t){var n,e,o=this.value.trim();o&&(n=new RegExp(o.replace(/[ ]/g,"|"),"gmi"),e=function(t){p(t.filter(function(t){return e=n,g((t=t).title,e)||t.tags.some(function(t){return g(t.name,e)})||g(t.text,e);var e})),m.show()},r?e(r):((o=new XMLHttpRequest).open("GET",l,!0),o.onload=function(){var t;200<=this.status&&this.status<300?(t=JSON.parse(this.response),r=t instanceof Array?t:t.posts,e(r)):console.error(this.statusText)},o.onerror=function(){console.error(this.statusText)},o.send()),t.preventDefault())}o.addEventListener(e,function(){a.classList.toggle("in"),i.value="",a.classList.contains("in")?i.focus():i.blur()}),s.addEventListener(e,function(){a.classList.remove("in"),m.hide()}),document.addEventListener(e,function(t){"key"!==t.target.id&&m.hide()}),i.addEventListener("input",f),i.addEventListener(e,f)}.call(void 0),jQuery.easing.jswing=jQuery.easing.swing,jQuery.extend(jQuery.easing,{def:"easeOutQuad",easeOutCubic:function(t,e,n,o,r){return o*((e=e/r-1)*e*e+1)+n},easeOutBounce:function(t,e,n,o,r){return(e/=r)<1/2.75?o*(7.5625*e*e)+n:e<2/2.75?o*(7.5625*(e-=1.5/2.75)*e+.75)+n:e<2.5/2.75?o*(7.5625*(e-=2.25/2.75)*e+.9375)+n:o*(7.5625*(e-=2.625/2.75)*e+.984375)+n}}),function(i){i.fn.bumpyText=function(a){return a=i.extend({bounceHeight:"1.3em",bounceUpDuration:500,bounceDownDuration:700},a),this.each(function(){var t=i(this);if(t.text()===t.html()){for(var e=t.text(),n="",o=0;o<=e.length;o++){var r=e.slice(o,o+1);n+=i.trim(r)?'<span class="bumpy-char">'.concat(r,"</span>"):r}t.html(n),t.find("span.bumpy-char").each(function(){i(this).mouseover(function(){i(this).animate({bottom:a.bounceHeight},{queue:!1,duration:a.bounceUpDuration,easing:"easeOutCubic",complete:function(){i(this).animate({bottom:0},{queue:!1,duration:a.bounceDownDuration,easing:"easeOutBounce"})}})})})}})}}(jQuery),$("#name").bumpyText(),Waves.init(),Waves.attach(".page-share li",["waves-block"]),Waves.attach(".article-tag-list-link, #page-nav a, #page-nav span",["waves-button"]),isPhone||(function(){var t=$(".sliding-bar");$(".nav > .items").hover(function(){t.offset($(this).offset())})}(),_slicedToArray=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n,o=[],r=!0,a=!1;try{for(var i,s=t[Symbol.iterator]();!(r=(i=s.next()).done)&&(o.push(i.value),!e||o.length!==e);r=!0);}catch(t){a=!0,n=t}finally{try{!r&&s.return&&s.return()}finally{if(a)throw n}}return o}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},Strut={random:function(t,e){return Math.random()*(e-t)+t},arrayRandom:function(t){return t[Math.floor(Math.random()*t.length)]},interpolate:function(t,e,n){return t*(1-n)+e*n},rangePosition:function(t,e,n){return(n-t)/(e-t)},clamp:function(t,e,n){return Math.max(Math.min(t,n),e)},queryArray:function(t,e){return e=e||document.body,Array.prototype.slice.call(e.querySelectorAll(t))},ready:function(t){"complete"==document.readyState?t():document.addEventListener("DOMContentLoaded",t)}},reduceMotion=matchMedia("(prefers-reduced-motion)").matches,setState=function(o,r){return directions.forEach(function(t){var e,n;o[t]+=r[t],Math.abs(o[t])<360||(n=360==(e=Math.max(o[t],360))?Math.abs(o[t]):360,o[t]=e-n)})},headerIsHidden=!(cubeIsHidden=function(t){return parentWidth+30<t}),template=document.getElementById("cube-template"),parent=document.getElementById("header-hero"),parentWidth=(getParentWidth=function(){return parent.getBoundingClientRect().width})(),window.addEventListener("resize",function(){return parentWidth=getParentWidth()}),directions=["x","y"],setCubeStyles=function(t){var e=t.cube,n=t.size,o=t.left,t=t.top;Object.assign(e.style,{width:"".concat(n,"px"),height:"".concat(n,"px"),left:"".concat(o,"px"),top:"".concat(t,"px")}),Object.assign(e.querySelector(".shadow").style,{filter:"blur(".concat(Math.round(.6*n),"px)"),opacity:Math.min(n/120,.4)})},createCube=function(o){var t=document.importNode(template.content,!0),e=t.querySelector(".cube"),n=directions.reduce(function(t,e){var n=o>sizes.m?.3:.6;return t[e]=Strut.random(-n,n),t},{}),r=Strut.queryArray(".sides div",e).reduce(function(t,e){return t[e.className]={side:e,hidden:!1,rotate:{x:0,y:0}},t},{});return r.top.rotate.x=90,r.bottom.rotate.x=-90,r.left.rotate.y=-90,r.right.rotate.y=90,r.back.rotate.y=-180,{fragment:t,cube:e,state:{x:0,y:0},speed:n,sides:Object.values(r)}},(cubes=[{tint:(palette={white:{color:[255,255,255],shading:[160,190,218]},orange:{color:[255,250,230],shading:[255,120,50]},green:{color:[205,255,204],shading:[0,211,136]}}).green,size:(sizes={xs:15,s:25,m:30,l:100,xl:120}).xs,left:25,top:315},{tint:palette.orange,size:sizes.s,left:230,top:535},{tint:palette.white,size:sizes.m,left:1460,top:250}].map(function(t){return Object.assign(createCube(t.size),t)})).forEach(setCubeStyles),getDistance=function(n,o){return directions.reduce(function(t,e){return t[e]=Math.abs(n[e]+o[e]),t},{})},getRotation=function(t,e,n){var o=n.x?"Z":"Y",r=0<n.x?-1:1;return"\n rotateX(".concat(t.x+n.x,"deg)\n rotate").concat(o,"(").concat(r*(t.y+n.y),"deg)\n translateZ(").concat(e/2,"px)\n ")},getShading=function(n,t,r){var e=directions.reduce(function(t,e){var n=r[e],o=n/180;return t[e]=180<n?Math.abs(2-o):o,t},{});t.x?e.y=0:90<(i=r.x)&&i<270&&directions.forEach(function(t){return e[t]=1-e[t]});var o=(e.x+e.y)/2,a=n.color.map(function(t,e){return Math.round(Strut.interpolate(t,n.shading[e],o))}),t=_slicedToArray(a,3),i=t[0],a=t[1],t=t[2];return"rgb(".concat(i,", ").concat(a,", ").concat(t,")")},shouldHide=function(t,e,n){return t?90<e&&e<270:!(e<90)&&e<270?n<90:90<n&&n<270},updateSides=function(t){var a=t.state,e=t.speed,i=t.size,s=t.tint,n=t.sides,t=t.left;headerIsHidden||cubeIsHidden(t)||(setState(a,e),n.forEach(function(t){var e=t.side,n=t.rotate,o=t.hidden,r=getDistance(a,n);shouldHide(n.x,r.x,r.y)?o||(e.hidden=!0,t.hidden=!0):(o&&(e.hidden=!1,t.hidden=!1),e.style.transform=getRotation(a,i,n),e.style.backgroundColor=getShading(s,n,r))}))},tick=function t(){cubes.forEach(updateSides),reduceMotion||requestAnimationFrame(t)},parallaxLimit=document.querySelector(".bgheader").getBoundingClientRect().height+80,window.addEventListener("scroll",throttle(function(){var n=window.scrollY;if(n<parallaxLimit)return headerIsHidden=!1,void cubes.forEach(function(t){var e=t.cube,t=t.speed;return e.style.transform="translateY(".concat(Math.abs(.5*t.x)*n,"px)")});headerIsHidden=!0},150)),(container=document.createElement("div")).className="cubes",cubes.forEach(function(t){t=t.fragment;return container.appendChild(t)}),start=function(){tick(),parent.appendChild(container)},"requestIdleCallback"in window?requestIdleCallback(start):start());
import MySQL from 'mysql2/promise' import { escape, escapeId } from 'mysql2' import createAdapter from 'resolve-storage-base' import connect from './connect' import loadEventsByCursor from './load-events-by-cursor' import loadEventsByTimestamp from './load-events-by-timestamp' import getLatestEvent from './get-latest-event' import saveEvent from './save-event' import init from './init' import drop from './drop' import dispose from './dispose' import paginateEvents from './paginate-events' import saveEventOnly from './save-event-only' import freeze from './freeze' import unfreeze from './unfreeze' import shapeEvent from './shape-event' export default createAdapter.bind(null, { connect, loadEventsByCursor, loadEventsByTimestamp, getLatestEvent, saveEvent, init, drop, dispose, paginateEvents, saveEventOnly, freeze, unfreeze, shapeEvent, MySQL, escapeId, escape })
(function(){var e={18332:function(e,t,n){"use strict";n.d(t,{T:function(){return r}});var r="https://apisimarenpkau.bpkp.go.id"},42310:function(e,t,n){"use strict";n(66992),n(88674),n(19601),n(17727);var r=n(49242),a=n(73396);function o(e,t,n,r,o,i){var u=(0,a.up)("router-view");return(0,a.wg)(),(0,a.j4)(u)}n(74916),n(15306);var i={computed:{isLoggedIn:function(){return this.$store.getters.isAuthenticated},didAutoLogout:function(){return this.$store.getters.didAutoLogout}},created:function(){this.$store.dispatch("tryLogin")},watch:{didAutoLogout:function(e,t){e&&e!==t&&this.$router.replace("/login")}}},u=n(40089);const c=(0,u.Z)(i,[["render",o]]);var s=c,l=n(48534),d=(n(36133),n(41539),n(78783),n(33948),n(70678)),p={class:"wrapper d-flex flex-column min-vh-100 bg-light"},m={class:"body flex-grow-1 px-3 pt-4 bg-white"};function f(e,t,n,r,o,i){var u=(0,a.up)("AppSidebar"),c=(0,a.up)("AppHeader"),s=(0,a.up)("router-view"),l=(0,a.up)("CContainer"),d=(0,a.up)("AppFooter");return(0,a.wg)(),(0,a.iD)("div",null,[(0,a.Wm)(u),(0,a._)("div",p,[(0,a.Wm)(c),(0,a._)("div",m,[(0,a.Wm)(l,{fluid:""},{default:(0,a.w5)((function(){return[(0,a.Wm)(s)]})),_:1})]),(0,a.Wm)(d)])])}var h=n(16947),g=n(87139),b={class:"text-sm"},v=(0,a._)("span",null,"Pusinfowas",-1),k={class:"ms-1"},w=(0,a._)("span",{class:"text-primary"}," Pengelolaan Data dan Informasi",-1),A=(0,a._)("div",{class:"ms-auto"},[(0,a._)("span",{class:"me-1"})],-1);function x(e,t,n,r,o,i){var u=(0,a.up)("CFooter");return(0,a.wg)(),(0,a.j4)(u,null,{default:(0,a.w5)((function(){return[(0,a._)("div",b,[v,(0,a._)("span",k,[(0,a.Uk)("© "+(0,g.zw)((new Date).getFullYear())+" ",1),w])]),A]})),_:1})}var C={name:"AppFooter"};const S=(0,u.Z)(C,[["render",x]]);var V=S,T=(n(69600),n(47042),n(23123),{class:"text-base font-normal text-gray-700"}),y={class:"text-sm text-gray-700"},L={class:"font-semibold inline-block mr-1"},U={class:"font-light"},_=(0,a._)("span",{class:""},"Logout",-1);function Z(e,t,n,r,o,i){var u=(0,a.up)("Loading"),c=(0,a.up)("CIcon"),s=(0,a.up)("CHeaderToggler"),l=(0,a.up)("CHeaderBrand"),d=(0,a.up)("CNavItem"),p=(0,a.up)("CButton"),m=(0,a.up)("CHeaderNav"),f=(0,a.up)("CContainer"),h=(0,a.up)("CHeaderDivider"),b=(0,a.up)("AppBreadcrumb"),v=(0,a.up)("CHeader");return(0,a.wg)(),(0,a.iD)(a.HY,null,[(0,a.Wm)(u,{active:o.loading,"onUpdate:active":t[0]||(t[0]=function(e){return o.loading=e}),"is-full-page":!0},null,8,["active"]),(0,a.Wm)(v,{position:"sticky",class:"",style:{background:"#f3f7fb"}},{default:(0,a.w5)((function(){return[(0,a.Wm)(f,{fluid:""},{default:(0,a.w5)((function(){return[(0,a.Wm)(s,{class:"ps-1",onClick:t[1]||(t[1]=function(t){return e.$store.commit("toggleSidebar")})},{default:(0,a.w5)((function(){return[(0,a.Wm)(c,{icon:"cil-menu",size:"lg"})]})),_:1}),(0,a.Wm)(l,{class:"d-lg-none"},{default:(0,a.w5)((function(){return[(0,a._)("p",T," Halo, "+(0,g.zw)(o.namaUser.split(" ").slice(0,2).join(" ")),1)]})),_:1}),(0,a.Wm)(m,null,{default:(0,a.w5)((function(){return[(0,a.Wm)(d,{class:"flex items-center hidden lg:block pt-2"},{default:(0,a.w5)((function(){return[(0,a._)("p",y,[(0,a._)("span",L,"Halo, "+(0,g.zw)(o.namaUser.split(" ").slice(0,2).join(" ")),1),(0,a._)("span",U,"("+(0,g.zw)(o.namaUnit)+")",1)])]})),_:1}),(0,a.Wm)(d,null,{default:(0,a.w5)((function(){return[(0,a.Wm)(p,{onClick:i.logout,class:"text-gray-500 hover:text-gray-700"},{default:(0,a.w5)((function(){return[(0,a.Wm)(c,{class:"mx-2",icon:"cil-account-logout",size:"md"}),_]})),_:1},8,["onClick"])]})),_:1})]})),_:1})]})),_:1}),(0,a.Wm)(h),(0,a.Wm)(f,{fluid:""},{default:(0,a.w5)((function(){return[(0,a.Wm)(b)]})),_:1})]})),_:1})],64)}n(68309);function I(e,t,n,r,o,i){var u=(0,a.up)("CBreadcrumbItem"),c=(0,a.up)("CBreadcrumb");return(0,a.wg)(),(0,a.j4)(c,{class:"d-md-down-none me-auto mb-0"},{default:(0,a.w5)((function(){return[((0,a.wg)(!0),(0,a.iD)(a.HY,null,(0,a.Ko)(r.breadcrumbs,(function(e){return(0,a.wg)(),(0,a.j4)(u,{key:e,href:e.active?"":e.path,active:e.active},{default:(0,a.w5)((function(){return[(0,a.Uk)((0,g.zw)(e.name),1)]})),_:2},1032,["href","active"])})),128))]})),_:1})}n(21249),n(92222);var P=n(44870),E={name:"AppBreadcrumb",setup:function(){var e=(0,P.iH)(),t=function(){return Ae.currentRoute.value.matched.map((function(e){return{active:e.path===Ae.currentRoute.value.fullPath,name:e.name,path:"".concat(Ae.options.history.base).concat(e.path)}}))};return Ae.afterEach((function(){e.value=t()})),(0,a.bv)((function(){e.value=t()})),{breadcrumbs:e}}};const R=(0,u.Z)(E,[["render",I]]);var M=R,N=["556 134",'\n <title>coreui vue</title>\n <g>\n <g style="fill:#1bbd93">\n <path class="cls-1" d="M347.9818,90.0869l-11.84-43.52-.0644-.1924q0-.5112.6406-.5117h1.2793a.66.66,0,0,1,.7051.5762l10.623,39.68c.042.0859.0859.1279.1289.1279.041,0,.084-.042.127-.1279l10.625-39.68a.657.657,0,0,1,.7031-.5762h1.2168a.54.54,0,0,1,.5762.7041l-11.9043,43.52a.6584.6584,0,0,1-.7041.5761h-1.4082A.6577.6577,0,0,1,347.9818,90.0869Z"/>\n <path class="cls-1" d="M382.2786,89.5751a10.9023,10.9023,0,0,1-4.3515-4.5439,14.4586,14.4586,0,0,1-1.5362-6.7842V46.5029a.5656.5656,0,0,1,.64-.64h1.2168a.5659.5659,0,0,1,.64.64v32a10.5488,10.5488,0,0,0,2.72,7.5527,10.36,10.36,0,0,0,14.3359,0,10.5493,10.5493,0,0,0,2.7207-7.5527v-32a.5655.5655,0,0,1,.64-.64h1.2159a.5666.5666,0,0,1,.6406.64V78.247a13.01,13.01,0,0,1-3.3926,9.376,11.8974,11.8974,0,0,1-9.0234,3.5527A12.8481,12.8481,0,0,1,382.2786,89.5751Z"/>\n <path class="cls-1" d="M439.5843,48.1035H419.5521a.2263.2263,0,0,0-.2559.2558V66.8554a.2259.2259,0,0,0,.2559.2559h13.8242a.5665.5665,0,0,1,.6406.64v.96a.5665.5665,0,0,1-.6406.6406H419.5521a.2263.2263,0,0,0-.2559.2559v18.56a.2259.2259,0,0,0,.2559.2559h20.0322a.5665.5665,0,0,1,.64.6406v.96a.5655.5655,0,0,1-.64.64H417.4407a.5654.5654,0,0,1-.6406-.64v-43.52a.5658.5658,0,0,1,.6406-.64h22.1436a.5659.5659,0,0,1,.64.64v.96A.5658.5658,0,0,1,439.5843,48.1035Z"/>\n <path class="cls-1" d="M454.5921,89.5117a2.8385,2.8385,0,0,1-.8-2.0489,2.9193,2.9193,0,0,1,.8-2.1113,2.7518,2.7518,0,0,1,2.0791-.832,2.8465,2.8465,0,0,1,2.9443,2.9433,2.7561,2.7561,0,0,1-.832,2.08,2.9208,2.9208,0,0,1-2.1123.8008A2.7521,2.7521,0,0,1,454.5921,89.5117Z"/>\n <path class="cls-1" d="M474.931,88.0078a11.3087,11.3087,0,0,1-3.2-8.4161v-5.44a.5655.5655,0,0,1,.64-.64h1.2158a.5662.5662,0,0,1,.6407.64v5.5039a9.1421,9.1421,0,0,0,2.5283,6.72,8.9734,8.9734,0,0,0,6.6875,2.5606,8.7916,8.7916,0,0,0,9.28-9.28V46.5029a.5655.5655,0,0,1,.64-.64h1.2158a.5656.5656,0,0,1,.64.64V79.5917a11.2541,11.2541,0,0,1-3.2315,8.4161,13.0621,13.0621,0,0,1-17.0556,0Z"/>\n <path class="cls-1" d="M512.8753,88.1035a10.4847,10.4847,0,0,1-3.36-8.128v-1.792a.5665.5665,0,0,1,.6406-.6406h1.0879a.5666.5666,0,0,1,.64.6406v1.6a8.5461,8.5461,0,0,0,2.752,6.6563,10.5361,10.5361,0,0,0,7.36,2.4961,9.8741,9.8741,0,0,0,6.9766-2.3682,8.2188,8.2188,0,0,0,2.56-6.3359,8.3952,8.3952,0,0,0-1.12-4.416,11.3752,11.3752,0,0,0-3.3281-3.3926,71.6866,71.6866,0,0,0-6.1758-3.7119,71.0151,71.0151,0,0,1-6.24-3.84,12.1824,12.1824,0,0,1-3.4238-3.68,10.2659,10.2659,0,0,1-1.28-5.3437,9.86,9.86,0,0,1,3.0723-7.7441,12.0126,12.0126,0,0,1,8.3193-2.752q5.6969,0,8.9609,3.1035a10.8247,10.8247,0,0,1,3.2637,8.2246v1.6a.5658.5658,0,0,1-.6406.64h-1.1514a.5651.5651,0,0,1-.64-.64V56.8076a8.8643,8.8643,0,0,0-2.6241-6.6885,9.9936,9.9936,0,0,0-7.2324-2.5274,9.37,9.37,0,0,0-6.5283,2.1436,7.8253,7.8253,0,0,0-2.3672,6.1123,7.8088,7.8088,0,0,0,1.0235,4.16,10.3978,10.3978,0,0,0,3.0078,3.039,63.0249,63.0249,0,0,0,5.9521,3.4883,70.7955,70.7955,0,0,1,6.72,4.2559,13.4613,13.4613,0,0,1,3.6485,3.9365,10.044,10.044,0,0,1,1.28,5.1836,10.7185,10.7185,0,0,1-3.2647,8.1924q-3.2637,3.0717-8.832,3.0722Q516.2342,91.1757,512.8753,88.1035Z"/>\n </g>\n <g style="fill:#3c4b64">\n <g>\n <path d="M99.835,36.0577l-39-22.5167a12,12,0,0,0-12,0l-39,22.5166a12.0339,12.0339,0,0,0-6,10.3924V91.4833a12.0333,12.0333,0,0,0,6,10.3923l39,22.5167a12,12,0,0,0,12,0l39-22.5167a12.0331,12.0331,0,0,0,6-10.3923V46.45A12.0334,12.0334,0,0,0,99.835,36.0577Zm-2,55.4256a4,4,0,0,1-2,3.4641l-39,22.5167a4.0006,4.0006,0,0,1-4,0l-39-22.5167a4,4,0,0,1-2-3.4641V46.45a4,4,0,0,1,2-3.4642l39-22.5166a4,4,0,0,1,4,0l39,22.5166a4,4,0,0,1,2,3.4642Z"/>\n <path d="M77.8567,82.0046h-2.866a4,4,0,0,0-1.9247.4934L55.7852,91.9833,35.835,80.4648V57.4872l19.95-11.5185,17.2893,9.4549a3.9993,3.9993,0,0,0,1.9192.4906h2.8632a2,2,0,0,0,2-2V51.2024a2,2,0,0,0-1.04-1.7547L59.628,38.9521a8.0391,8.0391,0,0,0-7.8428.09L31.8346,50.56a8.0246,8.0246,0,0,0-4,6.9287v22.976a8,8,0,0,0,4,6.9283l19.95,11.5186a8.0429,8.0429,0,0,0,7.8433.0879l19.19-10.5312a2,2,0,0,0,1.0378-1.7533v-2.71A2,2,0,0,0,77.8567,82.0046Z"/>\n </g>\n <g>\n <path d="M172.58,45.3618a15.0166,15.0166,0,0,0-15,14.9995V77.6387a15,15,0,0,0,30,0V60.3613A15.0166,15.0166,0,0,0,172.58,45.3618Zm7,32.2769a7,7,0,0,1-14,0V60.3613a7,7,0,0,1,14,0Z"/>\n <path d="M135.9138,53.4211a7.01,7.01,0,0,1,7.8681,6.0752.9894.9894,0,0,0,.9843.865h6.03a1.0108,1.0108,0,0,0,.9987-1.0971,15.0182,15.0182,0,0,0-15.7162-13.8837,15.2881,15.2881,0,0,0-14.2441,15.4163V77.2037A15.288,15.288,0,0,0,136.0792,92.62a15.0183,15.0183,0,0,0,15.7162-13.8842,1.0107,1.0107,0,0,0-.9987-1.0971h-6.03a.9894.9894,0,0,0-.9843.865,7.01,7.01,0,0,1-7.8679,6.0757,7.1642,7.1642,0,0,1-6.0789-7.1849V60.6057A7.1638,7.1638,0,0,1,135.9138,53.4211Z"/>\n <path d="M218.7572,72.9277a12.1585,12.1585,0,0,0,7.1843-11.0771V58.1494A12.1494,12.1494,0,0,0,213.7921,46H196.835a1,1,0,0,0-1,1V91a1,1,0,0,0,1,1h6a1,1,0,0,0,1-1V74h6.6216l7.9154,17.4138a1,1,0,0,0,.91.5862h6.5911a1,1,0,0,0,.91-1.4138Zm-.8157-11.0771A4.1538,4.1538,0,0,1,213.7926,66h-9.8511V54h9.8511a4.1538,4.1538,0,0,1,4.1489,4.1494Z"/>\n <path d="M260.835,46h-26a1,1,0,0,0-1,1V91a1,1,0,0,0,1,1h26a1,1,0,0,0,1-1V85a1,1,0,0,0-1-1h-19V72h13a1,1,0,0,0,1-1V65a1,1,0,0,0-1-1h-13V54h19a1,1,0,0,0,1-1V47A1,1,0,0,0,260.835,46Z"/>\n <path d="M298.835,46h-6a1,1,0,0,0-1,1V69.6475a7.0066,7.0066,0,1,1-14,0V47a1,1,0,0,0-1-1h-6a1,1,0,0,0-1,1V69.6475a15.0031,15.0031,0,1,0,30,0V47A1,1,0,0,0,298.835,46Z"/>\n <rect x="307.835" y="46" width="8" height="38" rx="1"/>\n </g>\n </g>\n </g>\n'],q=n(6216),W={name:"AppHeader",components:{AppBreadcrumb:M,Loading:q.Z},setup:function(){return{logo:N}},data:function(){return{namaUser:"",namaUnit:"",loading:!1}},mounted:function(){localStorage.namaUser&&localStorage.namaUnit&&(this.namaUser=localStorage.namaUser,this.namaUnit=localStorage.namaUnit)},methods:{logout:function(){var e=this;this.loading=!0,setTimeout((function(){e.$store.dispatch("logout"),e.$router.push({name:"login"})}),500)}}};const F=(0,u.Z)(W,[["render",Z]]);var j=F,H=(0,a._)("h4",{class:"sidebar-brand-full h4"},"SIMA PKAU",-1),B=(0,a._)("h6",{class:"sidebar-brand-narrow h6"},"BPKP",-1);function K(e,t,n,r,o,i){var u=(0,a.up)("CSidebarBrand"),c=(0,a.up)("AppSidebarNav"),s=(0,a.up)("CSidebarToggler"),l=(0,a.up)("CSidebar");return(0,a.wg)(),(0,a.j4)(l,{position:"fixed",unfoldable:r.sidebarUnfoldable,visible:r.sidebarVisible,onVisibleChange:t[1]||(t[1]=function(t){return e.$store.commit({type:"updateSidebarVisible",value:t})})},{default:(0,a.w5)((function(){return[(0,a.Wm)(u,null,{default:(0,a.w5)((function(){return[H,B]})),_:1}),(0,a.Wm)(c),(0,a.Wm)(s,{class:"d-none d-lg-flex",onClick:t[0]||(t[0]=function(t){return e.$store.commit("toggleUnfoldable")})})]})),_:1},8,["unfoldable","visible"])}var D=n(9749),O=n(95082),G=[{component:"CNavItem",name:"KAP",to:"/kap",icon:"cil-equalizer"},{component:"CNavItem",name:"PKAU",to:"/pkau",icon:"cil-control"},{component:"CNavTitle",name:"Data Referensi"},{component:"CNavItem",name:"Sektor",to:"/sektor",icon:"cil-leaf"},{component:"CNavItem",name:"Tema",to:"/tema",icon:"cil-fork"},{component:"CNavItem",name:"Topik",to:"/topik",icon:"cil-paper-plane"},{component:"CNavItem",name:"Kontributor",to:"/kontributor",icon:"cil-group"},{component:"CNavItem",name:"Export",to:"/export",icon:"cil-print"}],$=function(e){return decodeURI(e).replace(/#.*$/,"").replace(/(index)?\.(html)$/,"")},z=function(e,t){if(void 0===t)return!1;if(e.hash===t)return!0;var n=$(e.path),r=$(t);return n===r},Y=function e(t,n){return!!z(t,n.to)||!!n.items&&n.items.some((function(n){return e(t,n)}))},J=(0,a.aZ)({name:"AppSidebarNav",components:{CNavItem:h.U6,CNavGroup:h.dw,CNavTitle:h.fd},setup:function(){var e=(0,d.yj)(),t=(0,P.iH)(!0);(0,a.bv)((function(){t.value=!1}));var n=function n(r){return r.items?(0,a.h)(h.dw,(0,O.Z)({},t.value&&{visible:r.items.some((function(t){return Y(e,t)}))}),{togglerContent:function(){return[(0,a.h)((0,a.up)("CIcon"),{customClassName:"nav-icon",name:r.icon}),r.name]},default:function(){return r.items.map((function(e){return n(e)}))}}):r.to?(0,a.h)(d.rH,{to:r.to,custom:!0},{default:function(e){return(0,a.h)((0,a.up)(r.component),{active:e.isActive,href:e.href,onClick:function(){return e.navigate()}},{default:function(){return[r.icon&&(0,a.h)((0,a.up)("CIcon"),{customClassName:"nav-icon",name:r.icon}),r.name,r.badge&&(0,a.h)(h.C_,{class:"ms-auto",color:r.badge.color},{default:function(){return r.badge.text}})]}})}}):(0,a.h)((0,a.up)(r.component),{},{default:function(){return r.name}})};return function(){return(0,a.h)(h.Xk,{},{default:function(){return G.map((function(e){return n(e)}))}})}}}),Q=["556 134",'\n <title>coreui vue logo</title>\n <g>\n <g style="fill:#1bbd93">\n <path class="cls-1" d="M347.9818,90.0869l-11.84-43.52-.0644-.1924q0-.5112.6406-.5117h1.2793a.66.66,0,0,1,.7051.5762l10.623,39.68c.042.0859.0859.1279.1289.1279.041,0,.084-.042.127-.1279l10.625-39.68a.657.657,0,0,1,.7031-.5762h1.2168a.54.54,0,0,1,.5762.7041l-11.9043,43.52a.6584.6584,0,0,1-.7041.5761h-1.4082A.6577.6577,0,0,1,347.9818,90.0869Z"/>\n <path class="cls-1" d="M382.2786,89.5751a10.9023,10.9023,0,0,1-4.3515-4.5439,14.4586,14.4586,0,0,1-1.5362-6.7842V46.5029a.5656.5656,0,0,1,.64-.64h1.2168a.5659.5659,0,0,1,.64.64v32a10.5488,10.5488,0,0,0,2.72,7.5527,10.36,10.36,0,0,0,14.3359,0,10.5493,10.5493,0,0,0,2.7207-7.5527v-32a.5655.5655,0,0,1,.64-.64h1.2159a.5666.5666,0,0,1,.6406.64V78.247a13.01,13.01,0,0,1-3.3926,9.376,11.8974,11.8974,0,0,1-9.0234,3.5527A12.8481,12.8481,0,0,1,382.2786,89.5751Z"/>\n <path class="cls-1" d="M439.5843,48.1035H419.5521a.2263.2263,0,0,0-.2559.2558V66.8554a.2259.2259,0,0,0,.2559.2559h13.8242a.5665.5665,0,0,1,.6406.64v.96a.5665.5665,0,0,1-.6406.6406H419.5521a.2263.2263,0,0,0-.2559.2559v18.56a.2259.2259,0,0,0,.2559.2559h20.0322a.5665.5665,0,0,1,.64.6406v.96a.5655.5655,0,0,1-.64.64H417.4407a.5654.5654,0,0,1-.6406-.64v-43.52a.5658.5658,0,0,1,.6406-.64h22.1436a.5659.5659,0,0,1,.64.64v.96A.5658.5658,0,0,1,439.5843,48.1035Z"/>\n <path class="cls-1" d="M454.5921,89.5117a2.8385,2.8385,0,0,1-.8-2.0489,2.9193,2.9193,0,0,1,.8-2.1113,2.7518,2.7518,0,0,1,2.0791-.832,2.8465,2.8465,0,0,1,2.9443,2.9433,2.7561,2.7561,0,0,1-.832,2.08,2.9208,2.9208,0,0,1-2.1123.8008A2.7521,2.7521,0,0,1,454.5921,89.5117Z"/>\n <path class="cls-1" d="M474.931,88.0078a11.3087,11.3087,0,0,1-3.2-8.4161v-5.44a.5655.5655,0,0,1,.64-.64h1.2158a.5662.5662,0,0,1,.6407.64v5.5039a9.1421,9.1421,0,0,0,2.5283,6.72,8.9734,8.9734,0,0,0,6.6875,2.5606,8.7916,8.7916,0,0,0,9.28-9.28V46.5029a.5655.5655,0,0,1,.64-.64h1.2158a.5656.5656,0,0,1,.64.64V79.5917a11.2541,11.2541,0,0,1-3.2315,8.4161,13.0621,13.0621,0,0,1-17.0556,0Z"/>\n <path class="cls-1" d="M512.8753,88.1035a10.4847,10.4847,0,0,1-3.36-8.128v-1.792a.5665.5665,0,0,1,.6406-.6406h1.0879a.5666.5666,0,0,1,.64.6406v1.6a8.5461,8.5461,0,0,0,2.752,6.6563,10.5361,10.5361,0,0,0,7.36,2.4961,9.8741,9.8741,0,0,0,6.9766-2.3682,8.2188,8.2188,0,0,0,2.56-6.3359,8.3952,8.3952,0,0,0-1.12-4.416,11.3752,11.3752,0,0,0-3.3281-3.3926,71.6866,71.6866,0,0,0-6.1758-3.7119,71.0151,71.0151,0,0,1-6.24-3.84,12.1824,12.1824,0,0,1-3.4238-3.68,10.2659,10.2659,0,0,1-1.28-5.3437,9.86,9.86,0,0,1,3.0723-7.7441,12.0126,12.0126,0,0,1,8.3193-2.752q5.6969,0,8.9609,3.1035a10.8247,10.8247,0,0,1,3.2637,8.2246v1.6a.5658.5658,0,0,1-.6406.64h-1.1514a.5651.5651,0,0,1-.64-.64V56.8076a8.8643,8.8643,0,0,0-2.6241-6.6885,9.9936,9.9936,0,0,0-7.2324-2.5274,9.37,9.37,0,0,0-6.5283,2.1436,7.8253,7.8253,0,0,0-2.3672,6.1123,7.8088,7.8088,0,0,0,1.0235,4.16,10.3978,10.3978,0,0,0,3.0078,3.039,63.0249,63.0249,0,0,0,5.9521,3.4883,70.7955,70.7955,0,0,1,6.72,4.2559,13.4613,13.4613,0,0,1,3.6485,3.9365,10.044,10.044,0,0,1,1.28,5.1836,10.7185,10.7185,0,0,1-3.2647,8.1924q-3.2637,3.0717-8.832,3.0722Q516.2342,91.1757,512.8753,88.1035Z"/>\n </g>\n </g>\n <g style="fill: currentColor">\n <g>\n <path d="M99.835,36.0577l-39-22.5167a12,12,0,0,0-12,0l-39,22.5166a12.0339,12.0339,0,0,0-6,10.3924V91.4833a12.0333,12.0333,0,0,0,6,10.3923l39,22.5167a12,12,0,0,0,12,0l39-22.5167a12.0331,12.0331,0,0,0,6-10.3923V46.45A12.0334,12.0334,0,0,0,99.835,36.0577Zm-2,55.4256a4,4,0,0,1-2,3.4641l-39,22.5167a4.0006,4.0006,0,0,1-4,0l-39-22.5167a4,4,0,0,1-2-3.4641V46.45a4,4,0,0,1,2-3.4642l39-22.5166a4,4,0,0,1,4,0l39,22.5166a4,4,0,0,1,2,3.4642Z"/>\n <path d="M77.8567,82.0046h-2.866a4,4,0,0,0-1.9247.4934L55.7852,91.9833,35.835,80.4648V57.4872l19.95-11.5185,17.2893,9.4549a3.9993,3.9993,0,0,0,1.9192.4906h2.8632a2,2,0,0,0,2-2V51.2024a2,2,0,0,0-1.04-1.7547L59.628,38.9521a8.0391,8.0391,0,0,0-7.8428.09L31.8346,50.56a8.0246,8.0246,0,0,0-4,6.9287v22.976a8,8,0,0,0,4,6.9283l19.95,11.5186a8.0429,8.0429,0,0,0,7.8433.0879l19.19-10.5312a2,2,0,0,0,1.0378-1.7533v-2.71A2,2,0,0,0,77.8567,82.0046Z"/>\n </g>\n <g>\n <path d="M172.58,45.3618a15.0166,15.0166,0,0,0-15,14.9995V77.6387a15,15,0,0,0,30,0V60.3613A15.0166,15.0166,0,0,0,172.58,45.3618Zm7,32.2769a7,7,0,0,1-14,0V60.3613a7,7,0,0,1,14,0Z"/>\n <path d="M135.9138,53.4211a7.01,7.01,0,0,1,7.8681,6.0752.9894.9894,0,0,0,.9843.865h6.03a1.0108,1.0108,0,0,0,.9987-1.0971,15.0182,15.0182,0,0,0-15.7162-13.8837,15.2881,15.2881,0,0,0-14.2441,15.4163V77.2037A15.288,15.288,0,0,0,136.0792,92.62a15.0183,15.0183,0,0,0,15.7162-13.8842,1.0107,1.0107,0,0,0-.9987-1.0971h-6.03a.9894.9894,0,0,0-.9843.865,7.01,7.01,0,0,1-7.8679,6.0757,7.1642,7.1642,0,0,1-6.0789-7.1849V60.6057A7.1638,7.1638,0,0,1,135.9138,53.4211Z"/>\n <path d="M218.7572,72.9277a12.1585,12.1585,0,0,0,7.1843-11.0771V58.1494A12.1494,12.1494,0,0,0,213.7921,46H196.835a1,1,0,0,0-1,1V91a1,1,0,0,0,1,1h6a1,1,0,0,0,1-1V74h6.6216l7.9154,17.4138a1,1,0,0,0,.91.5862h6.5911a1,1,0,0,0,.91-1.4138Zm-.8157-11.0771A4.1538,4.1538,0,0,1,213.7926,66h-9.8511V54h9.8511a4.1538,4.1538,0,0,1,4.1489,4.1494Z"/>\n <path d="M260.835,46h-26a1,1,0,0,0-1,1V91a1,1,0,0,0,1,1h26a1,1,0,0,0,1-1V85a1,1,0,0,0-1-1h-19V72h13a1,1,0,0,0,1-1V65a1,1,0,0,0-1-1h-13V54h19a1,1,0,0,0,1-1V47A1,1,0,0,0,260.835,46Z"/>\n <path d="M298.835,46h-6a1,1,0,0,0-1,1V69.6475a7.0066,7.0066,0,1,1-14,0V47a1,1,0,0,0-1-1h-6a1,1,0,0,0-1,1V69.6475a15.0031,15.0031,0,1,0,30,0V47A1,1,0,0,0,298.835,46Z"/>\n <rect x="307.835" y="46" width="8" height="38" rx="1"/>\n </g>\n </g>\n</g>\n'],X=["160 160",'\n <title>coreui logo</title>\n <g>\n <g style="fill:#fff;">\n <path d="M125,47.091,86,24.5743a12,12,0,0,0-12,0L35,47.091a12.0336,12.0336,0,0,0-6,10.3923v45.0334a12.0335,12.0335,0,0,0,6,10.3923l39,22.5166a11.9993,11.9993,0,0,0,12,0l39-22.5166a12.0335,12.0335,0,0,0,6-10.3923V57.4833A12.0336,12.0336,0,0,0,125,47.091Zm-2,55.4257a4,4,0,0,1-2,3.464L82,128.4974a4,4,0,0,1-4,0L39,105.9807a4,4,0,0,1-2-3.464V57.4833a4,4,0,0,1,2-3.4641L78,31.5025a4,4,0,0,1,4,0l39,22.5167a4,4,0,0,1,2,3.4641Z"/>\n <path d="M103.0216,93.0379h-2.866a4,4,0,0,0-1.9246.4935L80.95,103.0167,61,91.4981V68.5206L80.95,57.002l17.2894,9.455a4,4,0,0,0,1.9192.4905h2.8632a2,2,0,0,0,2-2V62.2357a2,2,0,0,0-1.04-1.7547L84.793,49.9854a8.0391,8.0391,0,0,0-7.8428.09L57,61.5929A8.0243,8.0243,0,0,0,53,68.5216v22.976a8,8,0,0,0,4,6.9283l19.95,11.5185a8.0422,8.0422,0,0,0,7.8433.0879l19.19-10.5311a2,2,0,0,0,1.0378-1.7534v-2.71A2,2,0,0,0,103.0216,93.0379Z"/>\n </g>\n </g>\n'],ee={name:"AppSidebar",components:{AppSidebarNav:J},setup:function(){var e=(0,D.oR)();return{logoNegative:Q,sygnet:X,sidebarUnfoldable:(0,P.Fl)((function(){return e.state.sidebarUnfoldable})),sidebarVisible:(0,P.Fl)((function(){return e.state.sidebarVisible}))}}};const te=(0,u.Z)(ee,[["render",K]]);var ne=te,re={name:"DefaultLayout",components:{AppFooter:V,AppHeader:j,AppSidebar:ne,CContainer:h.KB}};const ae=(0,u.Z)(re,[["render",f]]);var oe,ie=ae,ue={setUser:function(e,t){e.token=t.token,e.didAutoLogout=!1},setAutoLogout:function(e){e.didAutoLogout=!0}},ce=n(95410),se=n.n(ce),le=n(56265),de=n.n(le),pe=n(18332),me={login:function(e,t){return(0,l.Z)(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.abrupt("return",e.dispatch("auth",(0,O.Z)((0,O.Z)({},t),{},{mode:"login"})));case 1:case"end":return n.stop()}}),n)})))()},auth:function(e,t){return(0,l.Z)(regeneratorRuntime.mark((function n(){var r,a,o,i,u,c,s;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r="https://map.bpkp.go.id/api/v3/login",n.next=3,de()({method:"POST",url:r,data:se().stringify({username:t.username,password:t.password,kelas_user:0}),headers:{"content-type":"application/x-www-form-urlencoded"}});case 3:if(a=n.sent,200!=a.status){n.next=41;break}return n.next=7,de()({method:"POST",url:pe.T+"/api/login",data:{email:"admin@admin.com",password:"password"}});case 7:return o=n.sent,n.next=10,o.data;case 10:if(i=n.sent,200==o.status){n.next=14;break}throw u=new Error(i.message||"Failed to authenticate. Check your login data."),u;case 14:return c=36e5,s=(new Date).getTime()+c,localStorage.setItem("token",i.access_token),localStorage.setItem("tokenExpiration",s),n.t0=localStorage,n.next=21,a.data.message.name;case 21:return n.t1=n.sent,n.t0.setItem.call(n.t0,"namaUser",n.t1),n.t2=localStorage,n.next=26,a.data.message.namaunit;case 26:return n.t3=n.sent,n.t2.setItem.call(n.t2,"namaUnit",n.t3),localStorage.setItem("tahun",t.tahun),n.t4=localStorage,n.next=32,a.data.message.user_nip;case 32:return n.t5=n.sent,n.t4.setItem.call(n.t4,"nip",n.t5),n.t6=localStorage,n.next=37,a.data.message.nipbaru;case 37:n.t7=n.sent,n.t6.setItem.call(n.t6,"nipbaru",n.t7),oe=setTimeout((function(){e.dispatch("autoLogout")}),c),e.commit("setUser",{token:i.access_token});case 41:case"end":return n.stop()}}),n)})))()},tryLogin:function(e){var t=localStorage.getItem("token"),n=localStorage.getItem("tokenExpiration"),r=+n-(new Date).getTime();r<0||(oe=setTimeout((function(){e.dispatch("autoLogout")}),r),t&&e.commit("setUser",{token:t}))},logout:function(e){localStorage.removeItem("token"),localStorage.removeItem("tokenExpiration"),localStorage.removeItem("namaUser"),localStorage.removeItem("namaUnit"),localStorage.removeItem("tahun"),localStorage.removeItem("nip"),localStorage.removeItem("nipbaru"),clearTimeout(oe),e.commit("setUser",{token:null})},autoLogout:function(e){e.dispatch("logout"),e.commit("setAutoLogout")}},fe={userId:function(e){return e.userId},token:function(e){return e.token},imageLink:function(e){return e.imageLink},isAuthenticated:function(e){return!!e.token},didAutoLogout:function(e){return e.didAutoLogout}},he={state:function(){return{token:null,didAutoLogout:!1}},mutations:ue,actions:me,getters:fe},ge={loadListDeputi:function(){return(0,l.Z)(regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,de()({method:"GET",baseURL:pe.T,url:"/api/listdeputi",params:{token:localStorage.getItem("token")}});case 2:return t=e.sent,e.next=5,t.data;case 5:if(n=e.sent,200==t.status){e.next=9;break}throw r=new Error(n.message||"Failed to fetch data"),r;case 9:return e.abrupt("return",n);case 10:case"end":return e.stop()}}),e)})))()},loadListRendal:function(){return(0,l.Z)(regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,de()({method:"GET",baseURL:pe.T,url:"/api/listrendal",params:{token:localStorage.getItem("token")}});case 2:return t=e.sent,e.next=5,t.data;case 5:if(n=e.sent,200==t.status){e.next=9;break}throw r=new Error(n.message||"Failed to fetch data"),r;case 9:return e.abrupt("return",n);case 10:case"end":return e.stop()}}),e)})))()},loadListSektor:function(){return(0,l.Z)(regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,de()({method:"GET",baseURL:pe.T,url:"/api/listsektor",params:{token:localStorage.getItem("token")}});case 2:return t=e.sent,e.next=5,t.data;case 5:if(n=e.sent,200==t.status){e.next=9;break}throw r=new Error(n.message||"Failed to fetch data"),r;case 9:return e.abrupt("return",n);case 10:case"end":return e.stop()}}),e)})))()},loadListTema:function(e,t){return(0,l.Z)(regeneratorRuntime.mark((function e(){var n,r,a;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,de()({method:"GET",baseURL:pe.T,url:"/api/listtema",params:{token:localStorage.getItem("token"),idSektor:t.idSektor}});case 2:return n=e.sent,e.next=5,n.data;case 5:if(r=e.sent,200==n.status){e.next=9;break}throw a=new Error(r.message||"Failed to fetch data"),a;case 9:return e.abrupt("return",r);case 10:case"end":return e.stop()}}),e)})))()},loadListTopik:function(e,t){return(0,l.Z)(regeneratorRuntime.mark((function e(){var n,r,a;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,de()({method:"GET",baseURL:pe.T,url:"/api/listtopik",params:{token:localStorage.getItem("token"),idSektor:t.idSektor,idTema:t.idTema}});case 2:return n=e.sent,e.next=5,n.data;case 5:if(r=e.sent,200==n.status){e.next=9;break}throw a=new Error(r.message||"Failed to fetch data"),a;case 9:return e.abrupt("return",r);case 10:case"end":return e.stop()}}),e)})))()},loadTopikKap:function(){return(0,l.Z)(regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,de()({method:"GET",baseURL:pe.T,url:"/api/topikkap",params:{token:localStorage.getItem("token")}});case 2:return t=e.sent,e.next=5,t.data;case 5:if(n=e.sent,200==t.status){e.next=9;break}throw r=new Error(n.message||"Failed to fetch data"),r;case 9:return e.abrupt("return",n);case 10:case"end":return e.stop()}}),e)})))()},loadTopikKapEdit:function(){return(0,l.Z)(regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,de()({method:"GET",baseURL:pe.T,url:"/api/topikkapedit",params:{token:localStorage.getItem("token")}});case 2:return t=e.sent,e.next=5,t.data;case 5:if(n=e.sent,200==t.status){e.next=9;break}throw r=new Error(n.message||"Failed to fetch data"),r;case 9:return e.abrupt("return",n);case 10:case"end":return e.stop()}}),e)})))()},loadListUnitKontributor:function(){return(0,l.Z)(regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,de()({method:"GET",baseURL:pe.T,url:"/api/listunitkontributor",params:{token:localStorage.getItem("token")}});case 2:return t=e.sent,e.next=5,t.data;case 5:if(n=e.sent,200==t.status){e.next=9;break}throw r=new Error(n.message||"Failed to fetch data"),r;case 9:return e.abrupt("return",n);case 10:case"end":return e.stop()}}),e)})))()},loadListKap:function(){return(0,l.Z)(regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,de()({method:"GET",baseURL:pe.T,url:"/api/listkap",params:{token:localStorage.getItem("token")}});case 2:return t=e.sent,e.next=5,t.data;case 5:if(n=e.sent,200==t.status){e.next=9;break}throw r=new Error(n.message||"Failed to fetch data"),r;case 9:return e.abrupt("return",n);case 10:case"end":return e.stop()}}),e)})))()},loadBidwas:function(e,t){return(0,l.Z)(regeneratorRuntime.mark((function e(){var n,r,a;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,de()({method:"GET",baseURL:pe.T,url:"/api/listbidwas",params:{token:localStorage.getItem("token"),idKontributor:t.idUnit}});case 2:return n=e.sent,e.next=5,n.data;case 5:if(r=e.sent,200==n.status){e.next=9;break}throw a=new Error(r.message||"Failed to fetch data"),a;case 9:return e.abrupt("return",r);case 10:case"end":return e.stop()}}),e)})))()},loadSelectUnitPkpt:function(e,t){return(0,l.Z)(regeneratorRuntime.mark((function e(){var n,r,a;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,de()({method:"GET",baseURL:pe.T,url:"/api/listunitkerjapkpt",params:{token:localStorage.getItem("token"),idKap:t.idKap}});case 2:return n=e.sent,e.next=5,n.data;case 5:if(r=e.sent,200==n.status){e.next=9;break}throw a=new Error(r.message||"Failed to fetch data"),a;case 9:return e.abrupt("return",r);case 10:case"end":return e.stop()}}),e)})))()}},be=(0,D.MT)({state:{sidebarVisible:"",sidebarUnfoldable:!1},mutations:{toggleSidebar:function(e){e.sidebarVisible=!e.sidebarVisible},toggleUnfoldable:function(e){e.sidebarUnfoldable=!e.sidebarUnfoldable},updateSidebarVisible:function(e,t){e.sidebarVisible=t.value}},actions:ge,modules:{auth:he}}),ve=(n(39714),n(9653),n(26833),{convertToRupiah:function(e){var t="";if(e){for(var n=e.toString().split("").reverse().join(""),r=0;r<n.length;r++)r%3==0&&(t+=n.substr(r,3)+",");return"Rp "+t.split("",t.length-1).reverse().join("")}return"Rp 0"},rupiahToNumber:function(e){return Number(e.replace(/[^0-9.-]+/g,""))},isGanjil:function(e){return e%2==1},isGenap:function(e){return e%2==0},isNullOfObjElement:function(e){return!Object.values(e).some((function(e){return null==e}))},isNipAllowToAdd:function(){return(0,l.Z)(regeneratorRuntime.mark((function e(){var t,n,r,a;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t=localStorage.getItem("nipbaru").replace(/\s+/g,""),e.next=3,de()({method:"GET",baseURL:pe.T,url:"/api/userspesial",params:{token:localStorage.getItem("token")}});case 3:return n=e.sent,e.next=6,n.data;case 6:return r=e.sent,a=r.map((function(e){return e.nipBaru.replace(/\s+/g,"")==t})),a.some((function(e){return 1==e})),e.abrupt("return",!0);case 10:case"end":return e.stop()}}),e)})))()}}),ke=[{path:"/",name:"Home",component:ie,redirect:"/kap",children:[{path:"/sektor",name:"Sektor",component:{render:function(){return(0,a.h)((0,a.up)("router-view"))}},children:[{path:"",name:"Index Sektor",component:function(){return n.e(712).then(n.bind(n,89712))},meta:{requiresAuth:!0,restricted:!1}},{path:"create",name:"Create Sektor",component:function(){return Promise.all([n.e(368),n.e(621),n.e(639)]).then(n.bind(n,51078))},meta:{requiresAuth:!0,restricted:!0}},{path:"update/:idSektor",name:"Update Sektor",component:function(){return Promise.all([n.e(368),n.e(621),n.e(679)]).then(n.bind(n,91151))},meta:{requiresAuth:!0,restricted:!0},props:!0}]},{path:"/tema",name:"Tema",component:{render:function(){return(0,a.h)((0,a.up)("router-view"))}},children:[{path:"",name:"",component:function(){return n.e(473).then(n.bind(n,87473))},meta:{requiresAuth:!0,restricted:!1}},{path:"create",name:"Create Tema",component:function(){return Promise.all([n.e(368),n.e(468),n.e(69)]).then(n.bind(n,29183))},meta:{requiresAuth:!0,restricted:!0}},{path:"update/:idTema",name:"Update Tema",component:function(){return Promise.all([n.e(368),n.e(468),n.e(876)]).then(n.bind(n,55230))},meta:{requiresAuth:!0,restricted:!0},props:!0}]},{path:"/topik",name:"Topik",component:{render:function(){return(0,a.h)((0,a.up)("router-view"))}},children:[{path:"",name:"",component:function(){return n.e(580).then(n.bind(n,63580))},meta:{requiresAuth:!0,restricted:!1}},{path:"create",name:"Create Topik",component:function(){return Promise.all([n.e(368),n.e(160),n.e(501)]).then(n.bind(n,63302))},meta:{requiresAuth:!0,restricted:!0}},{path:"update/:idTopik",name:"Update Topik",component:function(){return Promise.all([n.e(368),n.e(160),n.e(906)]).then(n.bind(n,3542))},meta:{requiresAuth:!0,restricted:!0},props:!0}]},{path:"/kontributor",name:"Kontributor",component:{render:function(){return(0,a.h)((0,a.up)("router-view"))}},children:[{path:"",name:"",component:function(){return n.e(586).then(n.bind(n,30586))},meta:{requiresAuth:!0,restricted:!1}},{path:"create",name:"Create Kontributor",component:function(){return Promise.all([n.e(368),n.e(366),n.e(101)]).then(n.bind(n,23891))},meta:{requiresAuth:!0,restricted:!0}},{path:"update/:idKontributor",name:"Update Kontributor",component:function(){return Promise.all([n.e(368),n.e(366),n.e(297)]).then(n.bind(n,9137))},meta:{requiresAuth:!0,restricted:!0},props:!0}]},{path:"/kap",name:"KAP",component:{render:function(){return(0,a.h)((0,a.up)("router-view"))}},children:[{path:"",name:"",component:function(){return n.e(490).then(n.bind(n,85490))},meta:{requiresAuth:!0,restricted:!1}},{path:"create",name:"Create KAP",component:function(){return Promise.all([n.e(368),n.e(338),n.e(340)]).then(n.bind(n,70340))},meta:{requiresAuth:!0,restricted:!0}},{path:"update/:idKap",name:"Update KAP",component:function(){return Promise.all([n.e(368),n.e(338),n.e(183)]).then(n.bind(n,8183))},meta:{requiresAuth:!0,restricted:!0},props:!0}]},{path:"/pkau",name:"PKAU",component:{render:function(){return(0,a.h)((0,a.up)("router-view"))}},children:[{path:"",name:"",component:function(){return n.e(806).then(n.bind(n,81806))},meta:{requiresAuth:!0,restricted:!1}},{path:"create",name:"Create PKAU",component:function(){return Promise.all([n.e(368),n.e(545),n.e(195)]).then(n.bind(n,77195))},meta:{requiresAuth:!0,restricted:!0}},{path:"update/:idPkpt",name:"Update PKAU",component:function(){return Promise.all([n.e(368),n.e(545),n.e(287)]).then(n.bind(n,26287))},meta:{requiresAuth:!0,restricted:!0},props:!0}]},{path:"/export",name:"Export",component:function(){return Promise.all([n.e(368),n.e(596)]).then(n.bind(n,59596))},meta:{requiresAuth:!0}}]},{path:"/login",name:"login",component:function(){return Promise.all([n.e(368),n.e(355)]).then(n.bind(n,38355))},meta:{requiresUnauth:!0,restricted:!1}},{path:"/:pathMatch(.*)*",name:"404",component:function(){return n.e(227).then(n.bind(n,19227))}}],we=(0,d.p7)({history:(0,d.r5)("/"),routes:ke,scrollBehavior:function(){return{top:0}}});we.beforeEach(function(){var e=(0,l.Z)(regeneratorRuntime.mark((function e(t,n,r){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!t.meta.requiresAuth||be.getters.isAuthenticated){e.next=4;break}r("/login"),e.next=15;break;case 4:if(!t.meta.restricted){e.next=14;break}return e.next=7,ve.isNipAllowToAdd();case 7:if(!e.sent){e.next=11;break}r(),e.next=12;break;case 11:r("/kap");case 12:e.next=15;break;case 14:r();case 15:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}());var Ae=we,xe=n(73116),Ce=n(13947),Se=n(11496),Ve=n(99585),Te=n(38857),ye=n(56009),Le=n(33657),Ue=n(47405),_e=n(10540),Ze=n(28354),Ie=n(32927),Pe=n(10257),Ee=n(60752),Re=n(43727),Me=n(48011),Ne=n(62122),qe=n(75958),We=n(69436),Fe=n(45324),je=n(45416),He=n(36945),Be=n(17062),Ke=n(9282),De=n(91139),Oe=n(82816),Ge=n(99781),$e=n(56140),ze=n(10331),Ye=n(35945),Je=n(43957),Qe=n(60661),Xe=n(9234),et=n(36529),tt=n(19786),nt=n(54421),rt=n(16769),at=n(41413),ot=n(9890),it=n(19197),ut=n(40213),ct=n(14115),st=n(49799),lt=n(42501),dt=n(37180),pt=n(33404),mt=n(64108),ft=n(51495),ht=n(27738),gt=n(50739),bt=n(20583),vt=n(29517),kt=n(34841),wt=n(80399),At=n(65727),xt=n(3890),Ct=n(60929),St=n(20733),Vt=n(85657),Tt=n(99753),yt=n(47354),Lt=n(52978),Ut=n(70320),_t=n(66444),Zt=n(52145),It=n(93534),Pt=n(77484),Et=n(50123),Rt=n(95936),Mt=n(91421),Nt=n(88713),qt=n(1574),Wt=n(33210),Ft=n(25987),jt=n(99232),Ht=n(97411),Bt=n(48868),Kt=n(69252),Dt=n(94988),Ot=n(78063),Gt=n(83955),$t=n(12887),zt=n(73306),Yt=n(56222),Jt=n(36566),Qt=n(46166),Xt=n(75327),en=n(23512),tn=n(42968),nn=n(7712),rn=n(96999),an=n(40220),on=n(7297),un=Object.assign({},{cilPrint:Xe.P,cilGroup:et.y,cilAt:tt.R,cilLeaf:nt.F,cilVector:rt.O,cilFork:at.H,cilPaperPlane:ot.p,cilEqualizer:it.$,cilControl:ut.I,cilAccountLogout:ct.V,cilArrowBottom:st.t,cilArrowRight:lt.n,cilArrowTop:dt.T,cilBan:pt.E,cilBasket:mt.o,cilBell:ft.$,cilCalculator:ht.o,cilCalendar:gt.J,cilCloudDownload:bt.j,cilChartPie:vt.M,cilCheck:kt.J,cilChevronBottom:wt.b,cilChevronTop:At.V,cilCheckCircle:xt._,cilCode:Ct.I,cilCommentSquare:St.S,cilCursor:Vt.t,cilDrop:Tt.M,cilDollar:yt.T,cilEnvelopeClosed:Lt.W,cilEnvelopeOpen:Ut.m,cilEuro:_t.z,cilGlobeAlt:Zt.e,cilGrid:It.x,cilFile:Pt.D,cilJustifyCenter:Et.h,cilLaptop:Rt.U,cilLayers:Mt.H,cilLightbulb:Nt.O,cilList:qt.A,cilLocationPin:Wt.i,cilLockLocked:Ft.U,cilMagnifyingGlass:jt.M,cilMediaPlay:Ht.B,cilMenu:Bt.N,cilMoon:Kt.S,cilNotes:Dt.E,cilOptions:Ot.t,cilPencil:Gt.l,cilPeople:$t.g,cilPuzzle:zt.Q,cilSettings:Yt.M,cilShieldAlt:Jt.t,cilSpeech:Qt.B,cilSpeedometer:Xt.h,cilStar:en.m,cilTask:tn.W,cilUser:nn.E,cilUserFemale:rn.Q,cilUserFollow:an.H,cilXCircle:on.J},{cifUs:Ge.E,cifBr:$e.N,cifIn:ze.J,cifFr:Ye.A,cifEs:Je.z,cifPl:Qe.I},{cibFacebook:Ce.t,cibTwitter:Se._,cibLinkedin:Ve.n,cibFlickr:Te.r,cibTumblr:ye.i,cibXing:Le.n,cibGithub:Ue.G,cibGoogle:_e.N,cibStackoverflow:Ze.F,cibYoutube:Ie.N,cibDribbble:Pe.x,cibInstagram:Ee.d,cibPinterest:Re.p,cibVk:Me.o,cibYahoo:Ne.s,cibBehance:qe.n,cibReddit:We.m,cibVimeo:Fe.R,cibCcMastercard:je.y,cibCcVisa:He.W,cibCcStripe:Be.I,cibCcPaypal:Ke.K,cibCcApplePay:De.D,cibCcAmex:Oe.I}),cn=(0,a._)("br",null,null,-1),sn=(0,a._)("br",null,null,-1),ln=(0,a.Uk)(" For more information please visit our official "),dn=(0,a.Uk)(" documentation of CoreUI Components Library for Vue.js "),pn=(0,a.Uk)(" . ");function mn(e,t,n,r,o,i){var u=(0,a.up)("CLink"),c=(0,a.up)("CCallout");return(0,a.wg)(),(0,a.j4)(c,{color:"info",class:"bg-white"},{default:(0,a.w5)((function(){return[(0,a.Uk)((0,g.zw)(n.content?n.content:"A Vue ".concat(n.name," component ").concat(n.plural?"have":"has"," been created as a native Vue.js version\n of Bootstrap ").concat(n.name,". ").concat(n.name," ").concat(n.plural?"are":"is"," delivered with some new features,\n variants, and unique design that matches CoreUI Design System requirements."))+" ",1),cn,sn,ln,(0,a.Wm)(u,{href:r.url,target:"_blank"},{default:(0,a.w5)((function(){return[dn]})),_:1},8,["href"]),pn]})),_:1})}var fn={vc:{Y:"4.1"}},hn={name:"DocsCallout",props:{content:{type:String,default:void 0,required:!1},href:{type:String,default:void 0,required:!1},name:{type:String,default:void 0,required:!1},plural:Boolean},setup:function(e){var t="https://coreui.io/vue/docs/".concat(fn.vc.Y,"/").concat(e.url);return{url:t}}};const gn=(0,u.Z)(hn,[["render",mn]]);var bn=gn,vn={class:"example"},kn=(0,a.Uk)(" Code ");function wn(e,t,n,r,o,i){var u=(0,a.up)("CIcon"),c=(0,a.up)("CNavLink"),s=(0,a.up)("CNavItem"),l=(0,a.up)("CNav"),d=(0,a.up)("CTabPane"),p=(0,a.up)("CTabContent");return(0,a.wg)(),(0,a.iD)("div",vn,[(0,a.Wm)(l,{variant:"tabs"},{default:(0,a.w5)((function(){return[(0,a.Wm)(s,null,{default:(0,a.w5)((function(){return[(0,a.Wm)(c,{href:"#",active:""},{default:(0,a.w5)((function(){return[(0,a.Wm)(u,{icon:"cil-media-play",class:"me-2"})]})),_:1})]})),_:1}),(0,a.Wm)(s,null,{default:(0,a.w5)((function(){return[(0,a.Wm)(c,{href:r.url,target:"_blank"},{default:(0,a.w5)((function(){return[(0,a.Wm)(u,{icon:"cil-code",class:"me-2"}),kn]})),_:1},8,["href"])]})),_:1})]})),_:1}),(0,a.Wm)(p,{class:"rounded-bottom"},{default:(0,a.w5)((function(){return[(0,a.Wm)(d,{class:"p-3 preview",visible:""},{default:(0,a.w5)((function(){return[(0,a.WI)(e.$slots,"default")]})),_:3})]})),_:3})])}var An={name:"DocsExample",props:{href:{type:String,default:void 0,required:!1}},setup:function(e){var t="https://coreui.io/vue/docs/".concat(fn.vc.Y,"/").concat(e.href);return{url:t}}};const xn=(0,u.Z)(An,[["render",wn]]);var Cn=xn,Sn=n(33199),Vn=(n(37531),n(46215)),Tn=n.n(Vn),yn=n(93670),Ln=(0,r.ri)(s);Ln.config.globalProperties.$apiAddress=pe.T,Ln.config.globalProperties.$func=ve,Ln.use(be),Ln.use(Ae),Ln.use(h.ZP),Ln.use(Sn.Z),Ln.use(Tn(),{position:"top"}),Ln.use(yn.Z),Ln.provide("icons",un),Ln.component("CIcon",xe.Z),Ln.component("DocsCallout",bn),Ln.component("DocsExample",Cn),Ln.mount("#app")},24654:function(){}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var o=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}n.m=e,function(){var e=[];n.O=function(t,r,a,o){if(!r){var i=1/0;for(l=0;l<e.length;l++){r=e[l][0],a=e[l][1],o=e[l][2];for(var u=!0,c=0;c<r.length;c++)(!1&o||i>=o)&&Object.keys(n.O).every((function(e){return n.O[e](r[c])}))?r.splice(c--,1):(u=!1,o<i&&(i=o));if(u){e.splice(l--,1);var s=a();void 0!==s&&(t=s)}}return t}o=o||0;for(var l=e.length;l>0&&e[l-1][2]>o;l--)e[l]=e[l-1];e[l]=[r,a,o]}}(),function(){n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,{a:t}),t}}(),function(){n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}}(),function(){n.f={},n.e=function(e){return Promise.all(Object.keys(n.f).reduce((function(t,r){return n.f[r](e,t),t}),[]))}}(),function(){n.u=function(e){return"js/"+e+"-legacy."+{69:"c96f70ed",101:"747e0617",160:"9c88f783",183:"02e22dda",195:"4b4e1538",227:"2bb88ef1",287:"d2559683",297:"9d09f1ac",338:"112ba6f3",340:"a976b80f",355:"417d4a19",366:"c21a879a",368:"092d153b",468:"0622167d",473:"b861c2a4",490:"6eee2854",501:"241f5130",545:"adc72b01",580:"6d0ab307",586:"3aee0f0d",596:"3d7d63d1",621:"1fa1a0d7",639:"8af82452",679:"fda46abe",712:"ae060718",806:"d41913bd",876:"451fb9d2",906:"eaa596c2"}[e]+".js"}}(),function(){n.miniCssF=function(e){return"css/"+e+"."+{69:"149fb296",101:"149fb296",297:"149fb296",355:"149fb296",501:"149fb296",639:"149fb296",679:"149fb296",876:"149fb296",906:"149fb296"}[e]+".css"}}(),function(){n.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}()}(),function(){n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}(),function(){var e={},t="@coreui/coreui-free-vue-admin-template:";n.l=function(r,a,o,i){if(e[r])e[r].push(a);else{var u,c;if(void 0!==o)for(var s=document.getElementsByTagName("script"),l=0;l<s.length;l++){var d=s[l];if(d.getAttribute("src")==r||d.getAttribute("data-webpack")==t+o){u=d;break}}u||(c=!0,u=document.createElement("script"),u.charset="utf-8",u.timeout=120,n.nc&&u.setAttribute("nonce",n.nc),u.setAttribute("data-webpack",t+o),u.src=r),e[r]=[a];var p=function(t,n){u.onerror=u.onload=null,clearTimeout(m);var a=e[r];if(delete e[r],u.parentNode&&u.parentNode.removeChild(u),a&&a.forEach((function(e){return e(n)})),t)return t(n)},m=setTimeout(p.bind(null,void 0,{type:"timeout",target:u}),12e4);u.onerror=p.bind(null,u.onerror),u.onload=p.bind(null,u.onload),c&&document.head.appendChild(u)}}}(),function(){n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}}(),function(){n.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e}}(),function(){n.p="/"}(),function(){var e=function(e,t,n,r){var a=document.createElement("link");a.rel="stylesheet",a.type="text/css";var o=function(o){if(a.onerror=a.onload=null,"load"===o.type)n();else{var i=o&&("load"===o.type?"missing":o.type),u=o&&o.target&&o.target.href||t,c=new Error("Loading CSS chunk "+e+" failed.\n("+u+")");c.code="CSS_CHUNK_LOAD_FAILED",c.type=i,c.request=u,a.parentNode.removeChild(a),r(c)}};return a.onerror=a.onload=o,a.href=t,document.head.appendChild(a),a},t=function(e,t){for(var n=document.getElementsByTagName("link"),r=0;r<n.length;r++){var a=n[r],o=a.getAttribute("data-href")||a.getAttribute("href");if("stylesheet"===a.rel&&(o===e||o===t))return a}var i=document.getElementsByTagName("style");for(r=0;r<i.length;r++){a=i[r],o=a.getAttribute("data-href");if(o===e||o===t)return a}},r=function(r){return new Promise((function(a,o){var i=n.miniCssF(r),u=n.p+i;if(t(i,u))return a();e(r,u,a,o)}))},a={143:0};n.f.miniCss=function(e,t){var n={69:1,101:1,297:1,355:1,501:1,639:1,679:1,876:1,906:1};a[e]?t.push(a[e]):0!==a[e]&&n[e]&&t.push(a[e]=r(e).then((function(){a[e]=0}),(function(t){throw delete a[e],t})))}}(),function(){var e={143:0};n.f.j=function(t,r){var a=n.o(e,t)?e[t]:void 0;if(0!==a)if(a)r.push(a[2]);else{var o=new Promise((function(n,r){a=e[t]=[n,r]}));r.push(a[2]=o);var i=n.p+n.u(t),u=new Error,c=function(r){if(n.o(e,t)&&(a=e[t],0!==a&&(e[t]=void 0),a)){var o=r&&("load"===r.type?"missing":r.type),i=r&&r.target&&r.target.src;u.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",u.name="ChunkLoadError",u.type=o,u.request=i,a[1](u)}};n.l(i,c,"chunk-"+t,t)}},n.O.j=function(t){return 0===e[t]};var t=function(t,r){var a,o,i=r[0],u=r[1],c=r[2],s=0;if(i.some((function(t){return 0!==e[t]}))){for(a in u)n.o(u,a)&&(n.m[a]=u[a]);if(c)var l=c(n)}for(t&&t(r);s<i.length;s++)o=i[s],n.o(e,o)&&e[o]&&e[o][0](),e[i[s]]=0;return n.O(l)},r=self["webpackChunk_coreui_coreui_free_vue_admin_template"]=self["webpackChunk_coreui_coreui_free_vue_admin_template"]||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))}();var r=n.O(void 0,[998],(function(){return n(42310)}));r=n.O(r)})(); //# sourceMappingURL=app-legacy.a1d1dcf5.js.map
goog.require('ol.Attribution'); goog.require('ol.Map'); goog.require('ol.View'); goog.require('ol.control'); goog.require('ol.layer.Tile'); goog.require('ol.source.OSM'); goog.require('ol.source.XYZ');
/* eslint-disable */ const React = require('react') const Uppy = require('uppy/lib/core') const Tus10 = require('uppy/lib/plugins/Tus10') const GoogleDrive = require('uppy/lib/plugins/GoogleDrive') const { Dashboard, DashboardModal, DragDrop, ProgressBar } = require('uppy/lib/react') module.exports = class App extends React.Component { constructor (props) { super(props) this.state = { showInlineDashboard: false, open: false } this.handleModalClick = this.handleModalClick.bind(this) } componentWillMount () { this.uppy = new Uppy({ autoProceed: false }) .use(Tus10, { endpoint: 'https://master.tus.io/files/' }) .use(GoogleDrive, { host: 'https://server.uppy.io' }) .run() this.uppy2 = new Uppy({ autoProceed: false }) .use(Tus10, { endpoint: 'https://master.tus.io/files/' }) .run() } componentWillUnmount () { this.uppy.close() this.uppy2.close() } handleModalClick () { this.setState({ open: !this.state.open }) } render () { const { showInlineDashboard } = this.state return ( <div> <h1>React Examples</h1> <h2>Inline Dashboard</h2> <label> <input type="checkbox" checked={showInlineDashboard} onChange={(event) => { this.setState({ showInlineDashboard: event.target.checked }) }} /> Show Dashboard </label> {showInlineDashboard && ( <Dashboard uppy={this.uppy} plugins={['GoogleDrive']} /> )} <h2>Modal Dashboard</h2> <div> <button onClick={this.handleModalClick}> {this.state.open ? 'Close dashboard' : 'Open dashboard'} </button> <DashboardModal uppy={this.uppy2} open={this.state.open} onRequestClose={() => this.setState({ open: false })} /> </div> <h2>Drag Drop Area</h2> <DragDrop uppy={this.uppy} locale={{ strings: { chooseFile: 'Boop a file', orDragDrop: 'or yoink it here' } }} /> <h2>Progress Bar</h2> <ProgressBar uppy={this.uppy} /> </div> ) } }
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.cacheActivate = void 0; const node_fetch_1 = require("node-fetch"); const dbUtil_1 = require("../common/dbUtil"); const functions_1 = require("../common/functions"); const objects_1 = require("../common/objects"); var to_json = require("xmljson").to_json; async function cacheActivate() { let sitemapNumber = 1; while (true) { try { const fetchUrl = `https://wiki.lingual-ninja.com/sitemap${sitemapNumber}.xml`; objects_1.log.add("fetchUrl: " + fetchUrl); const res = await node_fetch_1.default(fetchUrl); const xml = await res.text(); await new Promise((resolve, reject) => to_json(xml, async function (error, data) { try { const getWordIds = async () => { if (!data) return []; const objUrls = data.urlset.url; const arrUrls = Object.keys(objUrls).map(k => objUrls[k]); objects_1.log.add("sitemap arrUrls.length: " + arrUrls.length); const cachedWordIds = (await dbUtil_1.executeSelectAsync("select wordId from RelatedArticlesCache")).map(r => r === null || r === void 0 ? void 0 : r.wordId); objects_1.log.add("cachedWordIds.length: " + cachedWordIds.length); const wordIds = arrUrls .map(u => u.loc) .filter(u => u.includes("/word/")) .map(u => Number(u.split("/word/").pop())) .filter(id => !isNaN(id)) .filter(id => !cachedWordIds.includes(id)); objects_1.log.add("sitemap noncached wordIds.length: " + wordIds.length); return shuffle(wordIds); }; for (let wordId of await getWordIds()) { const url = `https://wiki.lingual-ninja.com/api/WikiWalks/getRelatedArticles?wordId=${wordId}`; objects_1.log.add("url:" + url); const res = await node_fetch_1.default(url); objects_1.log.add("status:" + res.status); const result = await res.json(); objects_1.log.add("result:" + result); objects_1.log.add("Object.keys(result):" + Object.keys(result)); await functions_1.sleepAsync(1000 * 60 * 1); //1分 } resolve(undefined); } catch (e) { reject(e); } })); sitemapNumber++; } catch (e) { sitemapNumber = 1; objects_1.log.add("error!!!: " + e + functions_1.getJapaneseDate()); } finally { objects_1.log.add("cacheActivate終了: " + functions_1.getJapaneseDate()); await functions_1.sleepAsync(1000 * 60 * 60 * 3); //3時間 } } } exports.cacheActivate = cacheActivate; const shuffle = ([...array]) => { for (let i = array.length - 1; i >= 0; i--) { const j = Math.floor(Math.random() * (i + 1)); [array[i], array[j]] = [array[j], array[i]]; } return array; }; //# sourceMappingURL=cacheActivate.js.map
import React, { Component, Fragment } from 'react' import { Router, view, params, route } from 'react-stax' import NavBar from './NavBar' import ProductList from './ProductList' import ProductEditor from './ProductEditor' import Login from './Login' import Notification, { notify } from './Notification' import appStore, * as app from './appStore' const appStyle = { maxWidth: 880, margin: '50px auto', position: 'relative', padding: 20 } const enterAnimation = elem => elem.animate( { opacity: [0, 1], transform: ['translateX(-10px)', 'none'] }, { delay: 2000, duration: 20000, fill: 'both' } ).finished const leaveAnimation = elem => elem.animate( { opacity: [1, 0], transform: ['none', 'translateX(10px)'] }, { duration: 20000, fill: 'both' } ).finished class App extends Component { onRoute = async ({ toPage }) => { if (toPage === 'product') { if (appStore.isLoggedIn) { await app.resolveProduct() } else { route({ to: '/login' }) notify('You must be logged in to access the product editor page') } } else if (toPage === 'products') { await app.search() } }; render () { return ( <Fragment> <NavBar /> <Router defaultPage='products' onRoute={this.onRoute} style={appStyle} enterAnimation={enterAnimation} leaveAnimation={leaveAnimation} shouldAnimate > <ProductList page='products' /> <ProductEditor page='product' /> <Login page='login' /> </Router> <Notification /> </Fragment> ) } } export default view(App)
!function(t){var e={};function i(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=30)}({0:function(t,e,i){var n; /*! * jQuery JavaScript Library v3.3.1 * https://jquery.com/ * * Includes Sizzle.js * https://sizzlejs.com/ * * Copyright JS Foundation and other contributors * Released under the MIT license * https://jquery.org/license * * Date: 2018-01-20T17:24Z */ /*! * jQuery JavaScript Library v3.3.1 * https://jquery.com/ * * Includes Sizzle.js * https://sizzlejs.com/ * * Copyright JS Foundation and other contributors * Released under the MIT license * https://jquery.org/license * * Date: 2018-01-20T17:24Z */ !function(e,i){"use strict";"object"==typeof t&&"object"==typeof t.exports?t.exports=e.document?i(e,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return i(t)}:i(e)}("undefined"!=typeof window?window:this,function(i,r){"use strict";var s=[],a=i.document,o=Object.getPrototypeOf,h=s.slice,u=s.concat,c=s.push,l=s.indexOf,d={},f=d.toString,p=d.hasOwnProperty,g=p.toString,m=g.call(Object),v={},_=function(t){return"function"==typeof t&&"number"!=typeof t.nodeType},x=function(t){return null!=t&&t===t.window},y={type:!0,src:!0,noModule:!0};function b(t,e,i){var n,r=(e=e||a).createElement("script");if(r.text=t,i)for(n in y)i[n]&&(r[n]=i[n]);e.head.appendChild(r).parentNode.removeChild(r)}function w(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?d[f.call(t)]||"object":typeof t}var T=function(t,e){return new T.fn.init(t,e)},E=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function C(t){var e=!!t&&"length"in t&&t.length,i=w(t);return!_(t)&&!x(t)&&("array"===i||0===e||"number"==typeof e&&e>0&&e-1 in t)}T.fn=T.prototype={jquery:"3.3.1",constructor:T,length:0,toArray:function(){return h.call(this)},get:function(t){return null==t?h.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=T.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return T.each(this,t)},map:function(t){return this.pushStack(T.map(this,function(e,i){return t.call(e,i,e)}))},slice:function(){return this.pushStack(h.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(t){var e=this.length,i=+t+(t<0?e:0);return this.pushStack(i>=0&&i<e?[this[i]]:[])},end:function(){return this.prevObject||this.constructor()},push:c,sort:s.sort,splice:s.splice},T.extend=T.fn.extend=function(){var t,e,i,n,r,s,a=arguments[0]||{},o=1,h=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[o]||{},o++),"object"==typeof a||_(a)||(a={}),o===h&&(a=this,o--);o<h;o++)if(null!=(t=arguments[o]))for(e in t)i=a[e],a!==(n=t[e])&&(u&&n&&(T.isPlainObject(n)||(r=Array.isArray(n)))?(r?(r=!1,s=i&&Array.isArray(i)?i:[]):s=i&&T.isPlainObject(i)?i:{},a[e]=T.extend(u,s,n)):void 0!==n&&(a[e]=n));return a},T.extend({expando:"jQuery"+("3.3.1"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(t){throw new Error(t)},noop:function(){},isPlainObject:function(t){var e,i;return!(!t||"[object Object]"!==f.call(t))&&(!(e=o(t))||"function"==typeof(i=p.call(e,"constructor")&&e.constructor)&&g.call(i)===m)},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},globalEval:function(t){b(t)},each:function(t,e){var i,n=0;if(C(t))for(i=t.length;n<i&&!1!==e.call(t[n],n,t[n]);n++);else for(n in t)if(!1===e.call(t[n],n,t[n]))break;return t},trim:function(t){return null==t?"":(t+"").replace(E,"")},makeArray:function(t,e){var i=e||[];return null!=t&&(C(Object(t))?T.merge(i,"string"==typeof t?[t]:t):c.call(i,t)),i},inArray:function(t,e,i){return null==e?-1:l.call(e,t,i)},merge:function(t,e){for(var i=+e.length,n=0,r=t.length;n<i;n++)t[r++]=e[n];return t.length=r,t},grep:function(t,e,i){for(var n=[],r=0,s=t.length,a=!i;r<s;r++)!e(t[r],r)!==a&&n.push(t[r]);return n},map:function(t,e,i){var n,r,s=0,a=[];if(C(t))for(n=t.length;s<n;s++)null!=(r=e(t[s],s,i))&&a.push(r);else for(s in t)null!=(r=e(t[s],s,i))&&a.push(r);return u.apply([],a)},guid:1,support:v}),"function"==typeof Symbol&&(T.fn[Symbol.iterator]=s[Symbol.iterator]),T.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(t,e){d["[object "+e+"]"]=e.toLowerCase()});var S= /*! * Sizzle CSS Selector Engine v2.3.3 * https://sizzlejs.com/ * * Copyright jQuery Foundation and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2016-08-08 */ function(t){var e,i,n,r,s,a,o,h,u,c,l,d,f,p,g,m,v,_,x,y="sizzle"+1*new Date,b=t.document,w=0,T=0,E=at(),C=at(),S=at(),D=function(t,e){return t===e&&(l=!0),0},A={}.hasOwnProperty,R=[],j=R.pop,L=R.push,P=R.push,M=R.slice,k=function(t,e){for(var i=0,n=t.length;i<n;i++)if(t[i]===e)return i;return-1},I="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",O="[\\x20\\t\\r\\n\\f]",F="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",B="\\["+O+"*("+F+")(?:"+O+"*([*^$|!~]?=)"+O+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+F+"))|)"+O+"*\\]",N=":("+F+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+B+")*)|.*)\\)|)",G=new RegExp(O+"+","g"),U=new RegExp("^"+O+"+|((?:^|[^\\\\])(?:\\\\.)*)"+O+"+$","g"),H=new RegExp("^"+O+"*,"+O+"*"),X=new RegExp("^"+O+"*([>+~]|"+O+")"+O+"*"),Y=new RegExp("="+O+"*([^\\]'\"]*?)"+O+"*\\]","g"),W=new RegExp(N),q=new RegExp("^"+F+"$"),V={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),TAG:new RegExp("^("+F+"|[*])"),ATTR:new RegExp("^"+B),PSEUDO:new RegExp("^"+N),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),bool:new RegExp("^(?:"+I+")$","i"),needsContext:new RegExp("^"+O+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)","i")},z=/^(?:input|select|textarea|button)$/i,$=/^h\d$/i,Q=/^[^{]+\{\s*\[native \w/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,K=/[+~]/,Z=new RegExp("\\\\([\\da-f]{1,6}"+O+"?|("+O+")|.)","ig"),tt=function(t,e,i){var n="0x"+e-65536;return n!=n||i?e:n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320)},et=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,it=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},nt=function(){d()},rt=_t(function(t){return!0===t.disabled&&("form"in t||"label"in t)},{dir:"parentNode",next:"legend"});try{P.apply(R=M.call(b.childNodes),b.childNodes),R[b.childNodes.length].nodeType}catch(t){P={apply:R.length?function(t,e){L.apply(t,M.call(e))}:function(t,e){for(var i=t.length,n=0;t[i++]=e[n++];);t.length=i-1}}}function st(t,e,n,r){var s,o,u,c,l,p,v,_=e&&e.ownerDocument,w=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==w&&9!==w&&11!==w)return n;if(!r&&((e?e.ownerDocument||e:b)!==f&&d(e),e=e||f,g)){if(11!==w&&(l=J.exec(t)))if(s=l[1]){if(9===w){if(!(u=e.getElementById(s)))return n;if(u.id===s)return n.push(u),n}else if(_&&(u=_.getElementById(s))&&x(e,u)&&u.id===s)return n.push(u),n}else{if(l[2])return P.apply(n,e.getElementsByTagName(t)),n;if((s=l[3])&&i.getElementsByClassName&&e.getElementsByClassName)return P.apply(n,e.getElementsByClassName(s)),n}if(i.qsa&&!S[t+" "]&&(!m||!m.test(t))){if(1!==w)_=e,v=t;else if("object"!==e.nodeName.toLowerCase()){for((c=e.getAttribute("id"))?c=c.replace(et,it):e.setAttribute("id",c=y),o=(p=a(t)).length;o--;)p[o]="#"+c+" "+vt(p[o]);v=p.join(","),_=K.test(t)&&gt(e.parentNode)||e}if(v)try{return P.apply(n,_.querySelectorAll(v)),n}catch(t){}finally{c===y&&e.removeAttribute("id")}}}return h(t.replace(U,"$1"),e,n,r)}function at(){var t=[];return function e(i,r){return t.push(i+" ")>n.cacheLength&&delete e[t.shift()],e[i+" "]=r}}function ot(t){return t[y]=!0,t}function ht(t){var e=f.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function ut(t,e){for(var i=t.split("|"),r=i.length;r--;)n.attrHandle[i[r]]=e}function ct(t,e){var i=e&&t,n=i&&1===t.nodeType&&1===e.nodeType&&t.sourceIndex-e.sourceIndex;if(n)return n;if(i)for(;i=i.nextSibling;)if(i===e)return-1;return t?1:-1}function lt(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function dt(t){return function(e){var i=e.nodeName.toLowerCase();return("input"===i||"button"===i)&&e.type===t}}function ft(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&rt(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function pt(t){return ot(function(e){return e=+e,ot(function(i,n){for(var r,s=t([],i.length,e),a=s.length;a--;)i[r=s[a]]&&(i[r]=!(n[r]=i[r]))})})}function gt(t){return t&&void 0!==t.getElementsByTagName&&t}for(e in i=st.support={},s=st.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return!!e&&"HTML"!==e.nodeName},d=st.setDocument=function(t){var e,r,a=t?t.ownerDocument||t:b;return a!==f&&9===a.nodeType&&a.documentElement?(p=(f=a).documentElement,g=!s(f),b!==f&&(r=f.defaultView)&&r.top!==r&&(r.addEventListener?r.addEventListener("unload",nt,!1):r.attachEvent&&r.attachEvent("onunload",nt)),i.attributes=ht(function(t){return t.className="i",!t.getAttribute("className")}),i.getElementsByTagName=ht(function(t){return t.appendChild(f.createComment("")),!t.getElementsByTagName("*").length}),i.getElementsByClassName=Q.test(f.getElementsByClassName),i.getById=ht(function(t){return p.appendChild(t).id=y,!f.getElementsByName||!f.getElementsByName(y).length}),i.getById?(n.filter.ID=function(t){var e=t.replace(Z,tt);return function(t){return t.getAttribute("id")===e}},n.find.ID=function(t,e){if(void 0!==e.getElementById&&g){var i=e.getElementById(t);return i?[i]:[]}}):(n.filter.ID=function(t){var e=t.replace(Z,tt);return function(t){var i=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return i&&i.value===e}},n.find.ID=function(t,e){if(void 0!==e.getElementById&&g){var i,n,r,s=e.getElementById(t);if(s){if((i=s.getAttributeNode("id"))&&i.value===t)return[s];for(r=e.getElementsByName(t),n=0;s=r[n++];)if((i=s.getAttributeNode("id"))&&i.value===t)return[s]}return[]}}),n.find.TAG=i.getElementsByTagName?function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):i.qsa?e.querySelectorAll(t):void 0}:function(t,e){var i,n=[],r=0,s=e.getElementsByTagName(t);if("*"===t){for(;i=s[r++];)1===i.nodeType&&n.push(i);return n}return s},n.find.CLASS=i.getElementsByClassName&&function(t,e){if(void 0!==e.getElementsByClassName&&g)return e.getElementsByClassName(t)},v=[],m=[],(i.qsa=Q.test(f.querySelectorAll))&&(ht(function(t){p.appendChild(t).innerHTML="<a id='"+y+"'></a><select id='"+y+"-\r\\' msallowcapture=''><option selected=''></option></select>",t.querySelectorAll("[msallowcapture^='']").length&&m.push("[*^$]="+O+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||m.push("\\["+O+"*(?:value|"+I+")"),t.querySelectorAll("[id~="+y+"-]").length||m.push("~="),t.querySelectorAll(":checked").length||m.push(":checked"),t.querySelectorAll("a#"+y+"+*").length||m.push(".#.+[+~]")}),ht(function(t){t.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var e=f.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&m.push("name"+O+"*[*^$|!~]?="),2!==t.querySelectorAll(":enabled").length&&m.push(":enabled",":disabled"),p.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&m.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),m.push(",.*:")})),(i.matchesSelector=Q.test(_=p.matches||p.webkitMatchesSelector||p.mozMatchesSelector||p.oMatchesSelector||p.msMatchesSelector))&&ht(function(t){i.disconnectedMatch=_.call(t,"*"),_.call(t,"[s!='']:x"),v.push("!=",N)}),m=m.length&&new RegExp(m.join("|")),v=v.length&&new RegExp(v.join("|")),e=Q.test(p.compareDocumentPosition),x=e||Q.test(p.contains)?function(t,e){var i=9===t.nodeType?t.documentElement:t,n=e&&e.parentNode;return t===n||!(!n||1!==n.nodeType||!(i.contains?i.contains(n):t.compareDocumentPosition&&16&t.compareDocumentPosition(n)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},D=e?function(t,e){if(t===e)return l=!0,0;var n=!t.compareDocumentPosition-!e.compareDocumentPosition;return n||(1&(n=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!i.sortDetached&&e.compareDocumentPosition(t)===n?t===f||t.ownerDocument===b&&x(b,t)?-1:e===f||e.ownerDocument===b&&x(b,e)?1:c?k(c,t)-k(c,e):0:4&n?-1:1)}:function(t,e){if(t===e)return l=!0,0;var i,n=0,r=t.parentNode,s=e.parentNode,a=[t],o=[e];if(!r||!s)return t===f?-1:e===f?1:r?-1:s?1:c?k(c,t)-k(c,e):0;if(r===s)return ct(t,e);for(i=t;i=i.parentNode;)a.unshift(i);for(i=e;i=i.parentNode;)o.unshift(i);for(;a[n]===o[n];)n++;return n?ct(a[n],o[n]):a[n]===b?-1:o[n]===b?1:0},f):f},st.matches=function(t,e){return st(t,null,null,e)},st.matchesSelector=function(t,e){if((t.ownerDocument||t)!==f&&d(t),e=e.replace(Y,"='$1']"),i.matchesSelector&&g&&!S[e+" "]&&(!v||!v.test(e))&&(!m||!m.test(e)))try{var n=_.call(t,e);if(n||i.disconnectedMatch||t.document&&11!==t.document.nodeType)return n}catch(t){}return st(e,f,null,[t]).length>0},st.contains=function(t,e){return(t.ownerDocument||t)!==f&&d(t),x(t,e)},st.attr=function(t,e){(t.ownerDocument||t)!==f&&d(t);var r=n.attrHandle[e.toLowerCase()],s=r&&A.call(n.attrHandle,e.toLowerCase())?r(t,e,!g):void 0;return void 0!==s?s:i.attributes||!g?t.getAttribute(e):(s=t.getAttributeNode(e))&&s.specified?s.value:null},st.escape=function(t){return(t+"").replace(et,it)},st.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},st.uniqueSort=function(t){var e,n=[],r=0,s=0;if(l=!i.detectDuplicates,c=!i.sortStable&&t.slice(0),t.sort(D),l){for(;e=t[s++];)e===t[s]&&(r=n.push(s));for(;r--;)t.splice(n[r],1)}return c=null,t},r=st.getText=function(t){var e,i="",n=0,s=t.nodeType;if(s){if(1===s||9===s||11===s){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)i+=r(t)}else if(3===s||4===s)return t.nodeValue}else for(;e=t[n++];)i+=r(e);return i},(n=st.selectors={cacheLength:50,createPseudo:ot,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(Z,tt),t[3]=(t[3]||t[4]||t[5]||"").replace(Z,tt),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||st.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&st.error(t[0]),t},PSEUDO:function(t){var e,i=!t[6]&&t[2];return V.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":i&&W.test(i)&&(e=a(i,!0))&&(e=i.indexOf(")",i.length-e)-i.length)&&(t[0]=t[0].slice(0,e),t[2]=i.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(Z,tt).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=E[t+" "];return e||(e=new RegExp("(^|"+O+")"+t+"("+O+"|$)"))&&E(t,function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")})},ATTR:function(t,e,i){return function(n){var r=st.attr(n,t);return null==r?"!="===e:!e||(r+="","="===e?r===i:"!="===e?r!==i:"^="===e?i&&0===r.indexOf(i):"*="===e?i&&r.indexOf(i)>-1:"$="===e?i&&r.slice(-i.length)===i:"~="===e?(" "+r.replace(G," ")+" ").indexOf(i)>-1:"|="===e&&(r===i||r.slice(0,i.length+1)===i+"-"))}},CHILD:function(t,e,i,n,r){var s="nth"!==t.slice(0,3),a="last"!==t.slice(-4),o="of-type"===e;return 1===n&&0===r?function(t){return!!t.parentNode}:function(e,i,h){var u,c,l,d,f,p,g=s!==a?"nextSibling":"previousSibling",m=e.parentNode,v=o&&e.nodeName.toLowerCase(),_=!h&&!o,x=!1;if(m){if(s){for(;g;){for(d=e;d=d[g];)if(o?d.nodeName.toLowerCase()===v:1===d.nodeType)return!1;p=g="only"===t&&!p&&"nextSibling"}return!0}if(p=[a?m.firstChild:m.lastChild],a&&_){for(x=(f=(u=(c=(l=(d=m)[y]||(d[y]={}))[d.uniqueID]||(l[d.uniqueID]={}))[t]||[])[0]===w&&u[1])&&u[2],d=f&&m.childNodes[f];d=++f&&d&&d[g]||(x=f=0)||p.pop();)if(1===d.nodeType&&++x&&d===e){c[t]=[w,f,x];break}}else if(_&&(x=f=(u=(c=(l=(d=e)[y]||(d[y]={}))[d.uniqueID]||(l[d.uniqueID]={}))[t]||[])[0]===w&&u[1]),!1===x)for(;(d=++f&&d&&d[g]||(x=f=0)||p.pop())&&((o?d.nodeName.toLowerCase()!==v:1!==d.nodeType)||!++x||(_&&((c=(l=d[y]||(d[y]={}))[d.uniqueID]||(l[d.uniqueID]={}))[t]=[w,x]),d!==e)););return(x-=r)===n||x%n==0&&x/n>=0}}},PSEUDO:function(t,e){var i,r=n.pseudos[t]||n.setFilters[t.toLowerCase()]||st.error("unsupported pseudo: "+t);return r[y]?r(e):r.length>1?(i=[t,t,"",e],n.setFilters.hasOwnProperty(t.toLowerCase())?ot(function(t,i){for(var n,s=r(t,e),a=s.length;a--;)t[n=k(t,s[a])]=!(i[n]=s[a])}):function(t){return r(t,0,i)}):r}},pseudos:{not:ot(function(t){var e=[],i=[],n=o(t.replace(U,"$1"));return n[y]?ot(function(t,e,i,r){for(var s,a=n(t,null,r,[]),o=t.length;o--;)(s=a[o])&&(t[o]=!(e[o]=s))}):function(t,r,s){return e[0]=t,n(e,null,s,i),e[0]=null,!i.pop()}}),has:ot(function(t){return function(e){return st(t,e).length>0}}),contains:ot(function(t){return t=t.replace(Z,tt),function(e){return(e.textContent||e.innerText||r(e)).indexOf(t)>-1}}),lang:ot(function(t){return q.test(t||"")||st.error("unsupported lang: "+t),t=t.replace(Z,tt).toLowerCase(),function(e){var i;do{if(i=g?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(i=i.toLowerCase())===t||0===i.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var i=t.location&&t.location.hash;return i&&i.slice(1)===e.id},root:function(t){return t===p},focus:function(t){return t===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:ft(!1),disabled:ft(!0),checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!n.pseudos.empty(t)},header:function(t){return $.test(t.nodeName)},input:function(t){return z.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:pt(function(){return[0]}),last:pt(function(t,e){return[e-1]}),eq:pt(function(t,e,i){return[i<0?i+e:i]}),even:pt(function(t,e){for(var i=0;i<e;i+=2)t.push(i);return t}),odd:pt(function(t,e){for(var i=1;i<e;i+=2)t.push(i);return t}),lt:pt(function(t,e,i){for(var n=i<0?i+e:i;--n>=0;)t.push(n);return t}),gt:pt(function(t,e,i){for(var n=i<0?i+e:i;++n<e;)t.push(n);return t})}}).pseudos.nth=n.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})n.pseudos[e]=lt(e);for(e in{submit:!0,reset:!0})n.pseudos[e]=dt(e);function mt(){}function vt(t){for(var e=0,i=t.length,n="";e<i;e++)n+=t[e].value;return n}function _t(t,e,i){var n=e.dir,r=e.next,s=r||n,a=i&&"parentNode"===s,o=T++;return e.first?function(e,i,r){for(;e=e[n];)if(1===e.nodeType||a)return t(e,i,r);return!1}:function(e,i,h){var u,c,l,d=[w,o];if(h){for(;e=e[n];)if((1===e.nodeType||a)&&t(e,i,h))return!0}else for(;e=e[n];)if(1===e.nodeType||a)if(c=(l=e[y]||(e[y]={}))[e.uniqueID]||(l[e.uniqueID]={}),r&&r===e.nodeName.toLowerCase())e=e[n]||e;else{if((u=c[s])&&u[0]===w&&u[1]===o)return d[2]=u[2];if(c[s]=d,d[2]=t(e,i,h))return!0}return!1}}function xt(t){return t.length>1?function(e,i,n){for(var r=t.length;r--;)if(!t[r](e,i,n))return!1;return!0}:t[0]}function yt(t,e,i,n,r){for(var s,a=[],o=0,h=t.length,u=null!=e;o<h;o++)(s=t[o])&&(i&&!i(s,n,r)||(a.push(s),u&&e.push(o)));return a}function bt(t,e,i,n,r,s){return n&&!n[y]&&(n=bt(n)),r&&!r[y]&&(r=bt(r,s)),ot(function(s,a,o,h){var u,c,l,d=[],f=[],p=a.length,g=s||function(t,e,i){for(var n=0,r=e.length;n<r;n++)st(t,e[n],i);return i}(e||"*",o.nodeType?[o]:o,[]),m=!t||!s&&e?g:yt(g,d,t,o,h),v=i?r||(s?t:p||n)?[]:a:m;if(i&&i(m,v,o,h),n)for(u=yt(v,f),n(u,[],o,h),c=u.length;c--;)(l=u[c])&&(v[f[c]]=!(m[f[c]]=l));if(s){if(r||t){if(r){for(u=[],c=v.length;c--;)(l=v[c])&&u.push(m[c]=l);r(null,v=[],u,h)}for(c=v.length;c--;)(l=v[c])&&(u=r?k(s,l):d[c])>-1&&(s[u]=!(a[u]=l))}}else v=yt(v===a?v.splice(p,v.length):v),r?r(null,a,v,h):P.apply(a,v)})}function wt(t){for(var e,i,r,s=t.length,a=n.relative[t[0].type],o=a||n.relative[" "],h=a?1:0,c=_t(function(t){return t===e},o,!0),l=_t(function(t){return k(e,t)>-1},o,!0),d=[function(t,i,n){var r=!a&&(n||i!==u)||((e=i).nodeType?c(t,i,n):l(t,i,n));return e=null,r}];h<s;h++)if(i=n.relative[t[h].type])d=[_t(xt(d),i)];else{if((i=n.filter[t[h].type].apply(null,t[h].matches))[y]){for(r=++h;r<s&&!n.relative[t[r].type];r++);return bt(h>1&&xt(d),h>1&&vt(t.slice(0,h-1).concat({value:" "===t[h-2].type?"*":""})).replace(U,"$1"),i,h<r&&wt(t.slice(h,r)),r<s&&wt(t=t.slice(r)),r<s&&vt(t))}d.push(i)}return xt(d)}return mt.prototype=n.filters=n.pseudos,n.setFilters=new mt,a=st.tokenize=function(t,e){var i,r,s,a,o,h,u,c=C[t+" "];if(c)return e?0:c.slice(0);for(o=t,h=[],u=n.preFilter;o;){for(a in i&&!(r=H.exec(o))||(r&&(o=o.slice(r[0].length)||o),h.push(s=[])),i=!1,(r=X.exec(o))&&(i=r.shift(),s.push({value:i,type:r[0].replace(U," ")}),o=o.slice(i.length)),n.filter)!(r=V[a].exec(o))||u[a]&&!(r=u[a](r))||(i=r.shift(),s.push({value:i,type:a,matches:r}),o=o.slice(i.length));if(!i)break}return e?o.length:o?st.error(t):C(t,h).slice(0)},o=st.compile=function(t,e){var i,r=[],s=[],o=S[t+" "];if(!o){for(e||(e=a(t)),i=e.length;i--;)(o=wt(e[i]))[y]?r.push(o):s.push(o);(o=S(t,function(t,e){var i=e.length>0,r=t.length>0,s=function(s,a,o,h,c){var l,p,m,v=0,_="0",x=s&&[],y=[],b=u,T=s||r&&n.find.TAG("*",c),E=w+=null==b?1:Math.random()||.1,C=T.length;for(c&&(u=a===f||a||c);_!==C&&null!=(l=T[_]);_++){if(r&&l){for(p=0,a||l.ownerDocument===f||(d(l),o=!g);m=t[p++];)if(m(l,a||f,o)){h.push(l);break}c&&(w=E)}i&&((l=!m&&l)&&v--,s&&x.push(l))}if(v+=_,i&&_!==v){for(p=0;m=e[p++];)m(x,y,a,o);if(s){if(v>0)for(;_--;)x[_]||y[_]||(y[_]=j.call(h));y=yt(y)}P.apply(h,y),c&&!s&&y.length>0&&v+e.length>1&&st.uniqueSort(h)}return c&&(w=E,u=b),x};return i?ot(s):s}(s,r))).selector=t}return o},h=st.select=function(t,e,i,r){var s,h,u,c,l,d="function"==typeof t&&t,f=!r&&a(t=d.selector||t);if(i=i||[],1===f.length){if((h=f[0]=f[0].slice(0)).length>2&&"ID"===(u=h[0]).type&&9===e.nodeType&&g&&n.relative[h[1].type]){if(!(e=(n.find.ID(u.matches[0].replace(Z,tt),e)||[])[0]))return i;d&&(e=e.parentNode),t=t.slice(h.shift().value.length)}for(s=V.needsContext.test(t)?0:h.length;s--&&(u=h[s],!n.relative[c=u.type]);)if((l=n.find[c])&&(r=l(u.matches[0].replace(Z,tt),K.test(h[0].type)&&gt(e.parentNode)||e))){if(h.splice(s,1),!(t=r.length&&vt(h)))return P.apply(i,r),i;break}}return(d||o(t,f))(r,e,!g,i,!e||K.test(t)&&gt(e.parentNode)||e),i},i.sortStable=y.split("").sort(D).join("")===y,i.detectDuplicates=!!l,d(),i.sortDetached=ht(function(t){return 1&t.compareDocumentPosition(f.createElement("fieldset"))}),ht(function(t){return t.innerHTML="<a href='#'></a>","#"===t.firstChild.getAttribute("href")})||ut("type|href|height|width",function(t,e,i){if(!i)return t.getAttribute(e,"type"===e.toLowerCase()?1:2)}),i.attributes&&ht(function(t){return t.innerHTML="<input/>",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")})||ut("value",function(t,e,i){if(!i&&"input"===t.nodeName.toLowerCase())return t.defaultValue}),ht(function(t){return null==t.getAttribute("disabled")})||ut(I,function(t,e,i){var n;if(!i)return!0===t[e]?e.toLowerCase():(n=t.getAttributeNode(e))&&n.specified?n.value:null}),st}(i);T.find=S,T.expr=S.selectors,T.expr[":"]=T.expr.pseudos,T.uniqueSort=T.unique=S.uniqueSort,T.text=S.getText,T.isXMLDoc=S.isXML,T.contains=S.contains,T.escapeSelector=S.escape;var D=function(t,e,i){for(var n=[],r=void 0!==i;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(r&&T(t).is(i))break;n.push(t)}return n},A=function(t,e){for(var i=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&i.push(t);return i},R=T.expr.match.needsContext;function j(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}var L=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function P(t,e,i){return _(e)?T.grep(t,function(t,n){return!!e.call(t,n,t)!==i}):e.nodeType?T.grep(t,function(t){return t===e!==i}):"string"!=typeof e?T.grep(t,function(t){return l.call(e,t)>-1!==i}):T.filter(e,t,i)}T.filter=function(t,e,i){var n=e[0];return i&&(t=":not("+t+")"),1===e.length&&1===n.nodeType?T.find.matchesSelector(n,t)?[n]:[]:T.find.matches(t,T.grep(e,function(t){return 1===t.nodeType}))},T.fn.extend({find:function(t){var e,i,n=this.length,r=this;if("string"!=typeof t)return this.pushStack(T(t).filter(function(){for(e=0;e<n;e++)if(T.contains(r[e],this))return!0}));for(i=this.pushStack([]),e=0;e<n;e++)T.find(t,r[e],i);return n>1?T.uniqueSort(i):i},filter:function(t){return this.pushStack(P(this,t||[],!1))},not:function(t){return this.pushStack(P(this,t||[],!0))},is:function(t){return!!P(this,"string"==typeof t&&R.test(t)?T(t):t||[],!1).length}});var M,k=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(T.fn.init=function(t,e,i){var n,r;if(!t)return this;if(i=i||M,"string"==typeof t){if(!(n="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:k.exec(t))||!n[1]&&e)return!e||e.jquery?(e||i).find(t):this.constructor(e).find(t);if(n[1]){if(e=e instanceof T?e[0]:e,T.merge(this,T.parseHTML(n[1],e&&e.nodeType?e.ownerDocument||e:a,!0)),L.test(n[1])&&T.isPlainObject(e))for(n in e)_(this[n])?this[n](e[n]):this.attr(n,e[n]);return this}return(r=a.getElementById(n[2]))&&(this[0]=r,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):_(t)?void 0!==i.ready?i.ready(t):t(T):T.makeArray(t,this)}).prototype=T.fn,M=T(a);var I=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};function F(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}T.fn.extend({has:function(t){var e=T(t,this),i=e.length;return this.filter(function(){for(var t=0;t<i;t++)if(T.contains(this,e[t]))return!0})},closest:function(t,e){var i,n=0,r=this.length,s=[],a="string"!=typeof t&&T(t);if(!R.test(t))for(;n<r;n++)for(i=this[n];i&&i!==e;i=i.parentNode)if(i.nodeType<11&&(a?a.index(i)>-1:1===i.nodeType&&T.find.matchesSelector(i,t))){s.push(i);break}return this.pushStack(s.length>1?T.uniqueSort(s):s)},index:function(t){return t?"string"==typeof t?l.call(T(t),this[0]):l.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(T.uniqueSort(T.merge(this.get(),T(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),T.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return D(t,"parentNode")},parentsUntil:function(t,e,i){return D(t,"parentNode",i)},next:function(t){return F(t,"nextSibling")},prev:function(t){return F(t,"previousSibling")},nextAll:function(t){return D(t,"nextSibling")},prevAll:function(t){return D(t,"previousSibling")},nextUntil:function(t,e,i){return D(t,"nextSibling",i)},prevUntil:function(t,e,i){return D(t,"previousSibling",i)},siblings:function(t){return A((t.parentNode||{}).firstChild,t)},children:function(t){return A(t.firstChild)},contents:function(t){return j(t,"iframe")?t.contentDocument:(j(t,"template")&&(t=t.content||t),T.merge([],t.childNodes))}},function(t,e){T.fn[t]=function(i,n){var r=T.map(this,e,i);return"Until"!==t.slice(-5)&&(n=i),n&&"string"==typeof n&&(r=T.filter(n,r)),this.length>1&&(O[t]||T.uniqueSort(r),I.test(t)&&r.reverse()),this.pushStack(r)}});var B=/[^\x20\t\r\n\f]+/g;function N(t){return t}function G(t){throw t}function U(t,e,i,n){var r;try{t&&_(r=t.promise)?r.call(t).done(e).fail(i):t&&_(r=t.then)?r.call(t,e,i):e.apply(void 0,[t].slice(n))}catch(t){i.apply(void 0,[t])}}T.Callbacks=function(t){t="string"==typeof t?function(t){var e={};return T.each(t.match(B)||[],function(t,i){e[i]=!0}),e}(t):T.extend({},t);var e,i,n,r,s=[],a=[],o=-1,h=function(){for(r=r||t.once,n=e=!0;a.length;o=-1)for(i=a.shift();++o<s.length;)!1===s[o].apply(i[0],i[1])&&t.stopOnFalse&&(o=s.length,i=!1);t.memory||(i=!1),e=!1,r&&(s=i?[]:"")},u={add:function(){return s&&(i&&!e&&(o=s.length-1,a.push(i)),function e(i){T.each(i,function(i,n){_(n)?t.unique&&u.has(n)||s.push(n):n&&n.length&&"string"!==w(n)&&e(n)})}(arguments),i&&!e&&h()),this},remove:function(){return T.each(arguments,function(t,e){for(var i;(i=T.inArray(e,s,i))>-1;)s.splice(i,1),i<=o&&o--}),this},has:function(t){return t?T.inArray(t,s)>-1:s.length>0},empty:function(){return s&&(s=[]),this},disable:function(){return r=a=[],s=i="",this},disabled:function(){return!s},lock:function(){return r=a=[],i||e||(s=i=""),this},locked:function(){return!!r},fireWith:function(t,i){return r||(i=[t,(i=i||[]).slice?i.slice():i],a.push(i),e||h()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!n}};return u},T.extend({Deferred:function(t){var e=[["notify","progress",T.Callbacks("memory"),T.Callbacks("memory"),2],["resolve","done",T.Callbacks("once memory"),T.Callbacks("once memory"),0,"resolved"],["reject","fail",T.Callbacks("once memory"),T.Callbacks("once memory"),1,"rejected"]],n="pending",r={state:function(){return n},always:function(){return s.done(arguments).fail(arguments),this},catch:function(t){return r.then(null,t)},pipe:function(){var t=arguments;return T.Deferred(function(i){T.each(e,function(e,n){var r=_(t[n[4]])&&t[n[4]];s[n[1]](function(){var t=r&&r.apply(this,arguments);t&&_(t.promise)?t.promise().progress(i.notify).done(i.resolve).fail(i.reject):i[n[0]+"With"](this,r?[t]:arguments)})}),t=null}).promise()},then:function(t,n,r){var s=0;function a(t,e,n,r){return function(){var o=this,h=arguments,u=function(){var i,u;if(!(t<s)){if((i=n.apply(o,h))===e.promise())throw new TypeError("Thenable self-resolution");u=i&&("object"==typeof i||"function"==typeof i)&&i.then,_(u)?r?u.call(i,a(s,e,N,r),a(s,e,G,r)):(s++,u.call(i,a(s,e,N,r),a(s,e,G,r),a(s,e,N,e.notifyWith))):(n!==N&&(o=void 0,h=[i]),(r||e.resolveWith)(o,h))}},c=r?u:function(){try{u()}catch(i){T.Deferred.exceptionHook&&T.Deferred.exceptionHook(i,c.stackTrace),t+1>=s&&(n!==G&&(o=void 0,h=[i]),e.rejectWith(o,h))}};t?c():(T.Deferred.getStackHook&&(c.stackTrace=T.Deferred.getStackHook()),i.setTimeout(c))}}return T.Deferred(function(i){e[0][3].add(a(0,i,_(r)?r:N,i.notifyWith)),e[1][3].add(a(0,i,_(t)?t:N)),e[2][3].add(a(0,i,_(n)?n:G))}).promise()},promise:function(t){return null!=t?T.extend(t,r):r}},s={};return T.each(e,function(t,i){var a=i[2],o=i[5];r[i[1]]=a.add,o&&a.add(function(){n=o},e[3-t][2].disable,e[3-t][3].disable,e[0][2].lock,e[0][3].lock),a.add(i[3].fire),s[i[0]]=function(){return s[i[0]+"With"](this===s?void 0:this,arguments),this},s[i[0]+"With"]=a.fireWith}),r.promise(s),t&&t.call(s,s),s},when:function(t){var e=arguments.length,i=e,n=Array(i),r=h.call(arguments),s=T.Deferred(),a=function(t){return function(i){n[t]=this,r[t]=arguments.length>1?h.call(arguments):i,--e||s.resolveWith(n,r)}};if(e<=1&&(U(t,s.done(a(i)).resolve,s.reject,!e),"pending"===s.state()||_(r[i]&&r[i].then)))return s.then();for(;i--;)U(r[i],a(i),s.reject);return s.promise()}});var H=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;T.Deferred.exceptionHook=function(t,e){i.console&&i.console.warn&&t&&H.test(t.name)&&i.console.warn("jQuery.Deferred exception: "+t.message,t.stack,e)},T.readyException=function(t){i.setTimeout(function(){throw t})};var X=T.Deferred();function Y(){a.removeEventListener("DOMContentLoaded",Y),i.removeEventListener("load",Y),T.ready()}T.fn.ready=function(t){return X.then(t).catch(function(t){T.readyException(t)}),this},T.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--T.readyWait:T.isReady)||(T.isReady=!0,!0!==t&&--T.readyWait>0||X.resolveWith(a,[T]))}}),T.ready.then=X.then,"complete"===a.readyState||"loading"!==a.readyState&&!a.documentElement.doScroll?i.setTimeout(T.ready):(a.addEventListener("DOMContentLoaded",Y),i.addEventListener("load",Y));var W=function(t,e,i,n,r,s,a){var o=0,h=t.length,u=null==i;if("object"===w(i))for(o in r=!0,i)W(t,e,o,i[o],!0,s,a);else if(void 0!==n&&(r=!0,_(n)||(a=!0),u&&(a?(e.call(t,n),e=null):(u=e,e=function(t,e,i){return u.call(T(t),i)})),e))for(;o<h;o++)e(t[o],i,a?n:n.call(t[o],o,e(t[o],i)));return r?t:u?e.call(t):h?e(t[0],i):s},q=/^-ms-/,V=/-([a-z])/g;function z(t,e){return e.toUpperCase()}function $(t){return t.replace(q,"ms-").replace(V,z)}var Q=function(t){return 1===t.nodeType||9===t.nodeType||!+t.nodeType};function J(){this.expando=T.expando+J.uid++}J.uid=1,J.prototype={cache:function(t){var e=t[this.expando];return e||(e={},Q(t)&&(t.nodeType?t[this.expando]=e:Object.defineProperty(t,this.expando,{value:e,configurable:!0}))),e},set:function(t,e,i){var n,r=this.cache(t);if("string"==typeof e)r[$(e)]=i;else for(n in e)r[$(n)]=e[n];return r},get:function(t,e){return void 0===e?this.cache(t):t[this.expando]&&t[this.expando][$(e)]},access:function(t,e,i){return void 0===e||e&&"string"==typeof e&&void 0===i?this.get(t,e):(this.set(t,e,i),void 0!==i?i:e)},remove:function(t,e){var i,n=t[this.expando];if(void 0!==n){if(void 0!==e){i=(e=Array.isArray(e)?e.map($):(e=$(e))in n?[e]:e.match(B)||[]).length;for(;i--;)delete n[e[i]]}(void 0===e||T.isEmptyObject(n))&&(t.nodeType?t[this.expando]=void 0:delete t[this.expando])}},hasData:function(t){var e=t[this.expando];return void 0!==e&&!T.isEmptyObject(e)}};var K=new J,Z=new J,tt=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,et=/[A-Z]/g;function it(t,e,i){var n;if(void 0===i&&1===t.nodeType)if(n="data-"+e.replace(et,"-$&").toLowerCase(),"string"==typeof(i=t.getAttribute(n))){try{i=function(t){return"true"===t||"false"!==t&&("null"===t?null:t===+t+""?+t:tt.test(t)?JSON.parse(t):t)}(i)}catch(t){}Z.set(t,e,i)}else i=void 0;return i}T.extend({hasData:function(t){return Z.hasData(t)||K.hasData(t)},data:function(t,e,i){return Z.access(t,e,i)},removeData:function(t,e){Z.remove(t,e)},_data:function(t,e,i){return K.access(t,e,i)},_removeData:function(t,e){K.remove(t,e)}}),T.fn.extend({data:function(t,e){var i,n,r,s=this[0],a=s&&s.attributes;if(void 0===t){if(this.length&&(r=Z.get(s),1===s.nodeType&&!K.get(s,"hasDataAttrs"))){for(i=a.length;i--;)a[i]&&0===(n=a[i].name).indexOf("data-")&&(n=$(n.slice(5)),it(s,n,r[n]));K.set(s,"hasDataAttrs",!0)}return r}return"object"==typeof t?this.each(function(){Z.set(this,t)}):W(this,function(e){var i;if(s&&void 0===e)return void 0!==(i=Z.get(s,t))?i:void 0!==(i=it(s,t))?i:void 0;this.each(function(){Z.set(this,t,e)})},null,e,arguments.length>1,null,!0)},removeData:function(t){return this.each(function(){Z.remove(this,t)})}}),T.extend({queue:function(t,e,i){var n;if(t)return e=(e||"fx")+"queue",n=K.get(t,e),i&&(!n||Array.isArray(i)?n=K.access(t,e,T.makeArray(i)):n.push(i)),n||[]},dequeue:function(t,e){e=e||"fx";var i=T.queue(t,e),n=i.length,r=i.shift(),s=T._queueHooks(t,e);"inprogress"===r&&(r=i.shift(),n--),r&&("fx"===e&&i.unshift("inprogress"),delete s.stop,r.call(t,function(){T.dequeue(t,e)},s)),!n&&s&&s.empty.fire()},_queueHooks:function(t,e){var i=e+"queueHooks";return K.get(t,i)||K.access(t,i,{empty:T.Callbacks("once memory").add(function(){K.remove(t,[e+"queue",i])})})}}),T.fn.extend({queue:function(t,e){var i=2;return"string"!=typeof t&&(e=t,t="fx",i--),arguments.length<i?T.queue(this[0],t):void 0===e?this:this.each(function(){var i=T.queue(this,t,e);T._queueHooks(this,t),"fx"===t&&"inprogress"!==i[0]&&T.dequeue(this,t)})},dequeue:function(t){return this.each(function(){T.dequeue(this,t)})},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,e){var i,n=1,r=T.Deferred(),s=this,a=this.length,o=function(){--n||r.resolveWith(s,[s])};for("string"!=typeof t&&(e=t,t=void 0),t=t||"fx";a--;)(i=K.get(s[a],t+"queueHooks"))&&i.empty&&(n++,i.empty.add(o));return o(),r.promise(e)}});var nt=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,rt=new RegExp("^(?:([+-])=|)("+nt+")([a-z%]*)$","i"),st=["Top","Right","Bottom","Left"],at=function(t,e){return"none"===(t=e||t).style.display||""===t.style.display&&T.contains(t.ownerDocument,t)&&"none"===T.css(t,"display")},ot=function(t,e,i,n){var r,s,a={};for(s in e)a[s]=t.style[s],t.style[s]=e[s];for(s in r=i.apply(t,n||[]),e)t.style[s]=a[s];return r};function ht(t,e,i,n){var r,s,a=20,o=n?function(){return n.cur()}:function(){return T.css(t,e,"")},h=o(),u=i&&i[3]||(T.cssNumber[e]?"":"px"),c=(T.cssNumber[e]||"px"!==u&&+h)&&rt.exec(T.css(t,e));if(c&&c[3]!==u){for(h/=2,u=u||c[3],c=+h||1;a--;)T.style(t,e,c+u),(1-s)*(1-(s=o()/h||.5))<=0&&(a=0),c/=s;c*=2,T.style(t,e,c+u),i=i||[]}return i&&(c=+c||+h||0,r=i[1]?c+(i[1]+1)*i[2]:+i[2],n&&(n.unit=u,n.start=c,n.end=r)),r}var ut={};function ct(t){var e,i=t.ownerDocument,n=t.nodeName,r=ut[n];return r||(e=i.body.appendChild(i.createElement(n)),r=T.css(e,"display"),e.parentNode.removeChild(e),"none"===r&&(r="block"),ut[n]=r,r)}function lt(t,e){for(var i,n,r=[],s=0,a=t.length;s<a;s++)(n=t[s]).style&&(i=n.style.display,e?("none"===i&&(r[s]=K.get(n,"display")||null,r[s]||(n.style.display="")),""===n.style.display&&at(n)&&(r[s]=ct(n))):"none"!==i&&(r[s]="none",K.set(n,"display",i)));for(s=0;s<a;s++)null!=r[s]&&(t[s].style.display=r[s]);return t}T.fn.extend({show:function(){return lt(this,!0)},hide:function(){return lt(this)},toggle:function(t){return"boolean"==typeof t?t?this.show():this.hide():this.each(function(){at(this)?T(this).show():T(this).hide()})}});var dt=/^(?:checkbox|radio)$/i,ft=/<([a-z][^\/\0>\x20\t\r\n\f]+)/i,pt=/^$|^module$|\/(?:java|ecma)script/i,gt={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function mt(t,e){var i;return i=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&j(t,e)?T.merge([t],i):i}function vt(t,e){for(var i=0,n=t.length;i<n;i++)K.set(t[i],"globalEval",!e||K.get(e[i],"globalEval"))}gt.optgroup=gt.option,gt.tbody=gt.tfoot=gt.colgroup=gt.caption=gt.thead,gt.th=gt.td;var _t=/<|&#?\w+;/;function xt(t,e,i,n,r){for(var s,a,o,h,u,c,l=e.createDocumentFragment(),d=[],f=0,p=t.length;f<p;f++)if((s=t[f])||0===s)if("object"===w(s))T.merge(d,s.nodeType?[s]:s);else if(_t.test(s)){for(a=a||l.appendChild(e.createElement("div")),o=(ft.exec(s)||["",""])[1].toLowerCase(),h=gt[o]||gt._default,a.innerHTML=h[1]+T.htmlPrefilter(s)+h[2],c=h[0];c--;)a=a.lastChild;T.merge(d,a.childNodes),(a=l.firstChild).textContent=""}else d.push(e.createTextNode(s));for(l.textContent="",f=0;s=d[f++];)if(n&&T.inArray(s,n)>-1)r&&r.push(s);else if(u=T.contains(s.ownerDocument,s),a=mt(l.appendChild(s),"script"),u&&vt(a),i)for(c=0;s=a[c++];)pt.test(s.type||"")&&i.push(s);return l}!function(){var t=a.createDocumentFragment().appendChild(a.createElement("div")),e=a.createElement("input");e.setAttribute("type","radio"),e.setAttribute("checked","checked"),e.setAttribute("name","t"),t.appendChild(e),v.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,t.innerHTML="<textarea>x</textarea>",v.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue}();var yt=a.documentElement,bt=/^key/,wt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Tt=/^([^.]*)(?:\.(.+)|)/;function Et(){return!0}function Ct(){return!1}function St(){try{return a.activeElement}catch(t){}}function Dt(t,e,i,n,r,s){var a,o;if("object"==typeof e){for(o in"string"!=typeof i&&(n=n||i,i=void 0),e)Dt(t,o,i,n,e[o],s);return t}if(null==n&&null==r?(r=i,n=i=void 0):null==r&&("string"==typeof i?(r=n,n=void 0):(r=n,n=i,i=void 0)),!1===r)r=Ct;else if(!r)return t;return 1===s&&(a=r,(r=function(t){return T().off(t),a.apply(this,arguments)}).guid=a.guid||(a.guid=T.guid++)),t.each(function(){T.event.add(this,e,r,n,i)})}T.event={global:{},add:function(t,e,i,n,r){var s,a,o,h,u,c,l,d,f,p,g,m=K.get(t);if(m)for(i.handler&&(i=(s=i).handler,r=s.selector),r&&T.find.matchesSelector(yt,r),i.guid||(i.guid=T.guid++),(h=m.events)||(h=m.events={}),(a=m.handle)||(a=m.handle=function(e){return void 0!==T&&T.event.triggered!==e.type?T.event.dispatch.apply(t,arguments):void 0}),u=(e=(e||"").match(B)||[""]).length;u--;)f=g=(o=Tt.exec(e[u])||[])[1],p=(o[2]||"").split(".").sort(),f&&(l=T.event.special[f]||{},f=(r?l.delegateType:l.bindType)||f,l=T.event.special[f]||{},c=T.extend({type:f,origType:g,data:n,handler:i,guid:i.guid,selector:r,needsContext:r&&T.expr.match.needsContext.test(r),namespace:p.join(".")},s),(d=h[f])||((d=h[f]=[]).delegateCount=0,l.setup&&!1!==l.setup.call(t,n,p,a)||t.addEventListener&&t.addEventListener(f,a)),l.add&&(l.add.call(t,c),c.handler.guid||(c.handler.guid=i.guid)),r?d.splice(d.delegateCount++,0,c):d.push(c),T.event.global[f]=!0)},remove:function(t,e,i,n,r){var s,a,o,h,u,c,l,d,f,p,g,m=K.hasData(t)&&K.get(t);if(m&&(h=m.events)){for(u=(e=(e||"").match(B)||[""]).length;u--;)if(f=g=(o=Tt.exec(e[u])||[])[1],p=(o[2]||"").split(".").sort(),f){for(l=T.event.special[f]||{},d=h[f=(n?l.delegateType:l.bindType)||f]||[],o=o[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=s=d.length;s--;)c=d[s],!r&&g!==c.origType||i&&i.guid!==c.guid||o&&!o.test(c.namespace)||n&&n!==c.selector&&("**"!==n||!c.selector)||(d.splice(s,1),c.selector&&d.delegateCount--,l.remove&&l.remove.call(t,c));a&&!d.length&&(l.teardown&&!1!==l.teardown.call(t,p,m.handle)||T.removeEvent(t,f,m.handle),delete h[f])}else for(f in h)T.event.remove(t,f+e[u],i,n,!0);T.isEmptyObject(h)&&K.remove(t,"handle events")}},dispatch:function(t){var e,i,n,r,s,a,o=T.event.fix(t),h=new Array(arguments.length),u=(K.get(this,"events")||{})[o.type]||[],c=T.event.special[o.type]||{};for(h[0]=o,e=1;e<arguments.length;e++)h[e]=arguments[e];if(o.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,o)){for(a=T.event.handlers.call(this,o,u),e=0;(r=a[e++])&&!o.isPropagationStopped();)for(o.currentTarget=r.elem,i=0;(s=r.handlers[i++])&&!o.isImmediatePropagationStopped();)o.rnamespace&&!o.rnamespace.test(s.namespace)||(o.handleObj=s,o.data=s.data,void 0!==(n=((T.event.special[s.origType]||{}).handle||s.handler).apply(r.elem,h))&&!1===(o.result=n)&&(o.preventDefault(),o.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,o),o.result}},handlers:function(t,e){var i,n,r,s,a,o=[],h=e.delegateCount,u=t.target;if(h&&u.nodeType&&!("click"===t.type&&t.button>=1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&("click"!==t.type||!0!==u.disabled)){for(s=[],a={},i=0;i<h;i++)void 0===a[r=(n=e[i]).selector+" "]&&(a[r]=n.needsContext?T(r,this).index(u)>-1:T.find(r,this,null,[u]).length),a[r]&&s.push(n);s.length&&o.push({elem:u,handlers:s})}return u=this,h<e.length&&o.push({elem:u,handlers:e.slice(h)}),o},addProp:function(t,e){Object.defineProperty(T.Event.prototype,t,{enumerable:!0,configurable:!0,get:_(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(t){return t[T.expando]?t:new T.Event(t)},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==St()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===St()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&j(this,"input"))return this.click(),!1},_default:function(t){return j(t.target,"a")}},beforeunload:{postDispatch:function(t){void 0!==t.result&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}}},T.removeEvent=function(t,e,i){t.removeEventListener&&t.removeEventListener(e,i)},T.Event=function(t,e){if(!(this instanceof T.Event))return new T.Event(t,e);t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||void 0===t.defaultPrevented&&!1===t.returnValue?Et:Ct,this.target=t.target&&3===t.target.nodeType?t.target.parentNode:t.target,this.currentTarget=t.currentTarget,this.relatedTarget=t.relatedTarget):this.type=t,e&&T.extend(this,e),this.timeStamp=t&&t.timeStamp||Date.now(),this[T.expando]=!0},T.Event.prototype={constructor:T.Event,isDefaultPrevented:Ct,isPropagationStopped:Ct,isImmediatePropagationStopped:Ct,isSimulated:!1,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=Et,t&&!this.isSimulated&&t.preventDefault()},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=Et,t&&!this.isSimulated&&t.stopPropagation()},stopImmediatePropagation:function(){var t=this.originalEvent;this.isImmediatePropagationStopped=Et,t&&!this.isSimulated&&t.stopImmediatePropagation(),this.stopPropagation()}},T.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(t){var e=t.button;return null==t.which&&bt.test(t.type)?null!=t.charCode?t.charCode:t.keyCode:!t.which&&void 0!==e&&wt.test(t.type)?1&e?1:2&e?3:4&e?2:0:t.which}},T.event.addProp),T.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(t,e){T.event.special[t]={delegateType:e,bindType:e,handle:function(t){var i,n=t.relatedTarget,r=t.handleObj;return n&&(n===this||T.contains(this,n))||(t.type=r.origType,i=r.handler.apply(this,arguments),t.type=e),i}}}),T.fn.extend({on:function(t,e,i,n){return Dt(this,t,e,i,n)},one:function(t,e,i,n){return Dt(this,t,e,i,n,1)},off:function(t,e,i){var n,r;if(t&&t.preventDefault&&t.handleObj)return n=t.handleObj,T(t.delegateTarget).off(n.namespace?n.origType+"."+n.namespace:n.origType,n.selector,n.handler),this;if("object"==typeof t){for(r in t)this.off(r,e,t[r]);return this}return!1!==e&&"function"!=typeof e||(i=e,e=void 0),!1===i&&(i=Ct),this.each(function(){T.event.remove(this,t,i,e)})}});var At=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,Rt=/<script|<style|<link/i,jt=/checked\s*(?:[^=]|=\s*.checked.)/i,Lt=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Pt(t,e){return j(t,"table")&&j(11!==e.nodeType?e:e.firstChild,"tr")&&T(t).children("tbody")[0]||t}function Mt(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function kt(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function It(t,e){var i,n,r,s,a,o,h,u;if(1===e.nodeType){if(K.hasData(t)&&(s=K.access(t),a=K.set(e,s),u=s.events))for(r in delete a.handle,a.events={},u)for(i=0,n=u[r].length;i<n;i++)T.event.add(e,r,u[r][i]);Z.hasData(t)&&(o=Z.access(t),h=T.extend({},o),Z.set(e,h))}}function Ot(t,e){var i=e.nodeName.toLowerCase();"input"===i&&dt.test(t.type)?e.checked=t.checked:"input"!==i&&"textarea"!==i||(e.defaultValue=t.defaultValue)}function Ft(t,e,i,n){e=u.apply([],e);var r,s,a,o,h,c,l=0,d=t.length,f=d-1,p=e[0],g=_(p);if(g||d>1&&"string"==typeof p&&!v.checkClone&&jt.test(p))return t.each(function(r){var s=t.eq(r);g&&(e[0]=p.call(this,r,s.html())),Ft(s,e,i,n)});if(d&&(s=(r=xt(e,t[0].ownerDocument,!1,t,n)).firstChild,1===r.childNodes.length&&(r=s),s||n)){for(o=(a=T.map(mt(r,"script"),Mt)).length;l<d;l++)h=r,l!==f&&(h=T.clone(h,!0,!0),o&&T.merge(a,mt(h,"script"))),i.call(t[l],h,l);if(o)for(c=a[a.length-1].ownerDocument,T.map(a,kt),l=0;l<o;l++)h=a[l],pt.test(h.type||"")&&!K.access(h,"globalEval")&&T.contains(c,h)&&(h.src&&"module"!==(h.type||"").toLowerCase()?T._evalUrl&&T._evalUrl(h.src):b(h.textContent.replace(Lt,""),c,h))}return t}function Bt(t,e,i){for(var n,r=e?T.filter(e,t):t,s=0;null!=(n=r[s]);s++)i||1!==n.nodeType||T.cleanData(mt(n)),n.parentNode&&(i&&T.contains(n.ownerDocument,n)&&vt(mt(n,"script")),n.parentNode.removeChild(n));return t}T.extend({htmlPrefilter:function(t){return t.replace(At,"<$1></$2>")},clone:function(t,e,i){var n,r,s,a,o=t.cloneNode(!0),h=T.contains(t.ownerDocument,t);if(!(v.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||T.isXMLDoc(t)))for(a=mt(o),n=0,r=(s=mt(t)).length;n<r;n++)Ot(s[n],a[n]);if(e)if(i)for(s=s||mt(t),a=a||mt(o),n=0,r=s.length;n<r;n++)It(s[n],a[n]);else It(t,o);return(a=mt(o,"script")).length>0&&vt(a,!h&&mt(t,"script")),o},cleanData:function(t){for(var e,i,n,r=T.event.special,s=0;void 0!==(i=t[s]);s++)if(Q(i)){if(e=i[K.expando]){if(e.events)for(n in e.events)r[n]?T.event.remove(i,n):T.removeEvent(i,n,e.handle);i[K.expando]=void 0}i[Z.expando]&&(i[Z.expando]=void 0)}}}),T.fn.extend({detach:function(t){return Bt(this,t,!0)},remove:function(t){return Bt(this,t)},text:function(t){return W(this,function(t){return void 0===t?T.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)})},null,t,arguments.length)},append:function(){return Ft(this,arguments,function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Pt(this,t).appendChild(t)})},prepend:function(){return Ft(this,arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=Pt(this,t);e.insertBefore(t,e.firstChild)}})},before:function(){return Ft(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this)})},after:function(){return Ft(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)})},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(T.cleanData(mt(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map(function(){return T.clone(this,t,e)})},html:function(t){return W(this,function(t){var e=this[0]||{},i=0,n=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!Rt.test(t)&&!gt[(ft.exec(t)||["",""])[1].toLowerCase()]){t=T.htmlPrefilter(t);try{for(;i<n;i++)1===(e=this[i]||{}).nodeType&&(T.cleanData(mt(e,!1)),e.innerHTML=t);e=0}catch(t){}}e&&this.empty().append(t)},null,t,arguments.length)},replaceWith:function(){var t=[];return Ft(this,arguments,function(e){var i=this.parentNode;T.inArray(this,t)<0&&(T.cleanData(mt(this)),i&&i.replaceChild(e,this))},t)}}),T.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(t,e){T.fn[t]=function(t){for(var i,n=[],r=T(t),s=r.length-1,a=0;a<=s;a++)i=a===s?this:this.clone(!0),T(r[a])[e](i),c.apply(n,i.get());return this.pushStack(n)}});var Nt=new RegExp("^("+nt+")(?!px)[a-z%]+$","i"),Gt=function(t){var e=t.ownerDocument.defaultView;return e&&e.opener||(e=i),e.getComputedStyle(t)},Ut=new RegExp(st.join("|"),"i");function Ht(t,e,i){var n,r,s,a,o=t.style;return(i=i||Gt(t))&&(""!==(a=i.getPropertyValue(e)||i[e])||T.contains(t.ownerDocument,t)||(a=T.style(t,e)),!v.pixelBoxStyles()&&Nt.test(a)&&Ut.test(e)&&(n=o.width,r=o.minWidth,s=o.maxWidth,o.minWidth=o.maxWidth=o.width=a,a=i.width,o.width=n,o.minWidth=r,o.maxWidth=s)),void 0!==a?a+"":a}function Xt(t,e){return{get:function(){if(!t())return(this.get=e).apply(this,arguments);delete this.get}}}!function(){function t(){if(c){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",c.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",yt.appendChild(u).appendChild(c);var t=i.getComputedStyle(c);n="1%"!==t.top,h=12===e(t.marginLeft),c.style.right="60%",o=36===e(t.right),r=36===e(t.width),c.style.position="absolute",s=36===c.offsetWidth||"absolute",yt.removeChild(u),c=null}}function e(t){return Math.round(parseFloat(t))}var n,r,s,o,h,u=a.createElement("div"),c=a.createElement("div");c.style&&(c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",v.clearCloneStyle="content-box"===c.style.backgroundClip,T.extend(v,{boxSizingReliable:function(){return t(),r},pixelBoxStyles:function(){return t(),o},pixelPosition:function(){return t(),n},reliableMarginLeft:function(){return t(),h},scrollboxSize:function(){return t(),s}}))}();var Yt=/^(none|table(?!-c[ea]).+)/,Wt=/^--/,qt={position:"absolute",visibility:"hidden",display:"block"},Vt={letterSpacing:"0",fontWeight:"400"},zt=["Webkit","Moz","ms"],$t=a.createElement("div").style;function Qt(t){var e=T.cssProps[t];return e||(e=T.cssProps[t]=function(t){if(t in $t)return t;for(var e=t[0].toUpperCase()+t.slice(1),i=zt.length;i--;)if((t=zt[i]+e)in $t)return t}(t)||t),e}function Jt(t,e,i){var n=rt.exec(e);return n?Math.max(0,n[2]-(i||0))+(n[3]||"px"):e}function Kt(t,e,i,n,r,s){var a="width"===e?1:0,o=0,h=0;if(i===(n?"border":"content"))return 0;for(;a<4;a+=2)"margin"===i&&(h+=T.css(t,i+st[a],!0,r)),n?("content"===i&&(h-=T.css(t,"padding"+st[a],!0,r)),"margin"!==i&&(h-=T.css(t,"border"+st[a]+"Width",!0,r))):(h+=T.css(t,"padding"+st[a],!0,r),"padding"!==i?h+=T.css(t,"border"+st[a]+"Width",!0,r):o+=T.css(t,"border"+st[a]+"Width",!0,r));return!n&&s>=0&&(h+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-s-h-o-.5))),h}function Zt(t,e,i){var n=Gt(t),r=Ht(t,e,n),s="border-box"===T.css(t,"boxSizing",!1,n),a=s;if(Nt.test(r)){if(!i)return r;r="auto"}return a=a&&(v.boxSizingReliable()||r===t.style[e]),("auto"===r||!parseFloat(r)&&"inline"===T.css(t,"display",!1,n))&&(r=t["offset"+e[0].toUpperCase()+e.slice(1)],a=!0),(r=parseFloat(r)||0)+Kt(t,e,i||(s?"border":"content"),a,n,r)+"px"}function te(t,e,i,n,r){return new te.prototype.init(t,e,i,n,r)}T.extend({cssHooks:{opacity:{get:function(t,e){if(e){var i=Ht(t,"opacity");return""===i?"1":i}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(t,e,i,n){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var r,s,a,o=$(e),h=Wt.test(e),u=t.style;if(h||(e=Qt(o)),a=T.cssHooks[e]||T.cssHooks[o],void 0===i)return a&&"get"in a&&void 0!==(r=a.get(t,!1,n))?r:u[e];"string"===(s=typeof i)&&(r=rt.exec(i))&&r[1]&&(i=ht(t,e,r),s="number"),null!=i&&i==i&&("number"===s&&(i+=r&&r[3]||(T.cssNumber[o]?"":"px")),v.clearCloneStyle||""!==i||0!==e.indexOf("background")||(u[e]="inherit"),a&&"set"in a&&void 0===(i=a.set(t,i,n))||(h?u.setProperty(e,i):u[e]=i))}},css:function(t,e,i,n){var r,s,a,o=$(e);return Wt.test(e)||(e=Qt(o)),(a=T.cssHooks[e]||T.cssHooks[o])&&"get"in a&&(r=a.get(t,!0,i)),void 0===r&&(r=Ht(t,e,n)),"normal"===r&&e in Vt&&(r=Vt[e]),""===i||i?(s=parseFloat(r),!0===i||isFinite(s)?s||0:r):r}}),T.each(["height","width"],function(t,e){T.cssHooks[e]={get:function(t,i,n){if(i)return!Yt.test(T.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?Zt(t,e,n):ot(t,qt,function(){return Zt(t,e,n)})},set:function(t,i,n){var r,s=Gt(t),a="border-box"===T.css(t,"boxSizing",!1,s),o=n&&Kt(t,e,n,a,s);return a&&v.scrollboxSize()===s.position&&(o-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(s[e])-Kt(t,e,"border",!1,s)-.5)),o&&(r=rt.exec(i))&&"px"!==(r[3]||"px")&&(t.style[e]=i,i=T.css(t,e)),Jt(0,i,o)}}}),T.cssHooks.marginLeft=Xt(v.reliableMarginLeft,function(t,e){if(e)return(parseFloat(Ht(t,"marginLeft"))||t.getBoundingClientRect().left-ot(t,{marginLeft:0},function(){return t.getBoundingClientRect().left}))+"px"}),T.each({margin:"",padding:"",border:"Width"},function(t,e){T.cssHooks[t+e]={expand:function(i){for(var n=0,r={},s="string"==typeof i?i.split(" "):[i];n<4;n++)r[t+st[n]+e]=s[n]||s[n-2]||s[0];return r}},"margin"!==t&&(T.cssHooks[t+e].set=Jt)}),T.fn.extend({css:function(t,e){return W(this,function(t,e,i){var n,r,s={},a=0;if(Array.isArray(e)){for(n=Gt(t),r=e.length;a<r;a++)s[e[a]]=T.css(t,e[a],!1,n);return s}return void 0!==i?T.style(t,e,i):T.css(t,e)},t,e,arguments.length>1)}}),T.Tween=te,te.prototype={constructor:te,init:function(t,e,i,n,r,s){this.elem=t,this.prop=i,this.easing=r||T.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=n,this.unit=s||(T.cssNumber[i]?"":"px")},cur:function(){var t=te.propHooks[this.prop];return t&&t.get?t.get(this):te.propHooks._default.get(this)},run:function(t){var e,i=te.propHooks[this.prop];return this.options.duration?this.pos=e=T.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),i&&i.set?i.set(this):te.propHooks._default.set(this),this}},te.prototype.init.prototype=te.prototype,te.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=T.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){T.fx.step[t.prop]?T.fx.step[t.prop](t):1!==t.elem.nodeType||null==t.elem.style[T.cssProps[t.prop]]&&!T.cssHooks[t.prop]?t.elem[t.prop]=t.now:T.style(t.elem,t.prop,t.now+t.unit)}}},te.propHooks.scrollTop=te.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},T.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},T.fx=te.prototype.init,T.fx.step={};var ee,ie,ne=/^(?:toggle|show|hide)$/,re=/queueHooks$/;function se(){ie&&(!1===a.hidden&&i.requestAnimationFrame?i.requestAnimationFrame(se):i.setTimeout(se,T.fx.interval),T.fx.tick())}function ae(){return i.setTimeout(function(){ee=void 0}),ee=Date.now()}function oe(t,e){var i,n=0,r={height:t};for(e=e?1:0;n<4;n+=2-e)r["margin"+(i=st[n])]=r["padding"+i]=t;return e&&(r.opacity=r.width=t),r}function he(t,e,i){for(var n,r=(ue.tweeners[e]||[]).concat(ue.tweeners["*"]),s=0,a=r.length;s<a;s++)if(n=r[s].call(i,e,t))return n}function ue(t,e,i){var n,r,s=0,a=ue.prefilters.length,o=T.Deferred().always(function(){delete h.elem}),h=function(){if(r)return!1;for(var e=ee||ae(),i=Math.max(0,u.startTime+u.duration-e),n=1-(i/u.duration||0),s=0,a=u.tweens.length;s<a;s++)u.tweens[s].run(n);return o.notifyWith(t,[u,n,i]),n<1&&a?i:(a||o.notifyWith(t,[u,1,0]),o.resolveWith(t,[u]),!1)},u=o.promise({elem:t,props:T.extend({},e),opts:T.extend(!0,{specialEasing:{},easing:T.easing._default},i),originalProperties:e,originalOptions:i,startTime:ee||ae(),duration:i.duration,tweens:[],createTween:function(e,i){var n=T.Tween(t,u.opts,e,i,u.opts.specialEasing[e]||u.opts.easing);return u.tweens.push(n),n},stop:function(e){var i=0,n=e?u.tweens.length:0;if(r)return this;for(r=!0;i<n;i++)u.tweens[i].run(1);return e?(o.notifyWith(t,[u,1,0]),o.resolveWith(t,[u,e])):o.rejectWith(t,[u,e]),this}}),c=u.props;for(!function(t,e){var i,n,r,s,a;for(i in t)if(r=e[n=$(i)],s=t[i],Array.isArray(s)&&(r=s[1],s=t[i]=s[0]),i!==n&&(t[n]=s,delete t[i]),(a=T.cssHooks[n])&&"expand"in a)for(i in s=a.expand(s),delete t[n],s)i in t||(t[i]=s[i],e[i]=r);else e[n]=r}(c,u.opts.specialEasing);s<a;s++)if(n=ue.prefilters[s].call(u,t,c,u.opts))return _(n.stop)&&(T._queueHooks(u.elem,u.opts.queue).stop=n.stop.bind(n)),n;return T.map(c,he,u),_(u.opts.start)&&u.opts.start.call(t,u),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always),T.fx.timer(T.extend(h,{elem:t,anim:u,queue:u.opts.queue})),u}T.Animation=T.extend(ue,{tweeners:{"*":[function(t,e){var i=this.createTween(t,e);return ht(i.elem,t,rt.exec(e),i),i}]},tweener:function(t,e){_(t)?(e=t,t=["*"]):t=t.match(B);for(var i,n=0,r=t.length;n<r;n++)i=t[n],ue.tweeners[i]=ue.tweeners[i]||[],ue.tweeners[i].unshift(e)},prefilters:[function(t,e,i){var n,r,s,a,o,h,u,c,l="width"in e||"height"in e,d=this,f={},p=t.style,g=t.nodeType&&at(t),m=K.get(t,"fxshow");for(n in i.queue||(null==(a=T._queueHooks(t,"fx")).unqueued&&(a.unqueued=0,o=a.empty.fire,a.empty.fire=function(){a.unqueued||o()}),a.unqueued++,d.always(function(){d.always(function(){a.unqueued--,T.queue(t,"fx").length||a.empty.fire()})})),e)if(r=e[n],ne.test(r)){if(delete e[n],s=s||"toggle"===r,r===(g?"hide":"show")){if("show"!==r||!m||void 0===m[n])continue;g=!0}f[n]=m&&m[n]||T.style(t,n)}if((h=!T.isEmptyObject(e))||!T.isEmptyObject(f))for(n in l&&1===t.nodeType&&(i.overflow=[p.overflow,p.overflowX,p.overflowY],null==(u=m&&m.display)&&(u=K.get(t,"display")),"none"===(c=T.css(t,"display"))&&(u?c=u:(lt([t],!0),u=t.style.display||u,c=T.css(t,"display"),lt([t]))),("inline"===c||"inline-block"===c&&null!=u)&&"none"===T.css(t,"float")&&(h||(d.done(function(){p.display=u}),null==u&&(c=p.display,u="none"===c?"":c)),p.display="inline-block")),i.overflow&&(p.overflow="hidden",d.always(function(){p.overflow=i.overflow[0],p.overflowX=i.overflow[1],p.overflowY=i.overflow[2]})),h=!1,f)h||(m?"hidden"in m&&(g=m.hidden):m=K.access(t,"fxshow",{display:u}),s&&(m.hidden=!g),g&&lt([t],!0),d.done(function(){for(n in g||lt([t]),K.remove(t,"fxshow"),f)T.style(t,n,f[n])})),h=he(g?m[n]:0,n,d),n in m||(m[n]=h.start,g&&(h.end=h.start,h.start=0))}],prefilter:function(t,e){e?ue.prefilters.unshift(t):ue.prefilters.push(t)}}),T.speed=function(t,e,i){var n=t&&"object"==typeof t?T.extend({},t):{complete:i||!i&&e||_(t)&&t,duration:t,easing:i&&e||e&&!_(e)&&e};return T.fx.off?n.duration=0:"number"!=typeof n.duration&&(n.duration in T.fx.speeds?n.duration=T.fx.speeds[n.duration]:n.duration=T.fx.speeds._default),null!=n.queue&&!0!==n.queue||(n.queue="fx"),n.old=n.complete,n.complete=function(){_(n.old)&&n.old.call(this),n.queue&&T.dequeue(this,n.queue)},n},T.fn.extend({fadeTo:function(t,e,i,n){return this.filter(at).css("opacity",0).show().end().animate({opacity:e},t,i,n)},animate:function(t,e,i,n){var r=T.isEmptyObject(t),s=T.speed(e,i,n),a=function(){var e=ue(this,T.extend({},t),s);(r||K.get(this,"finish"))&&e.stop(!0)};return a.finish=a,r||!1===s.queue?this.each(a):this.queue(s.queue,a)},stop:function(t,e,i){var n=function(t){var e=t.stop;delete t.stop,e(i)};return"string"!=typeof t&&(i=e,e=t,t=void 0),e&&!1!==t&&this.queue(t||"fx",[]),this.each(function(){var e=!0,r=null!=t&&t+"queueHooks",s=T.timers,a=K.get(this);if(r)a[r]&&a[r].stop&&n(a[r]);else for(r in a)a[r]&&a[r].stop&&re.test(r)&&n(a[r]);for(r=s.length;r--;)s[r].elem!==this||null!=t&&s[r].queue!==t||(s[r].anim.stop(i),e=!1,s.splice(r,1));!e&&i||T.dequeue(this,t)})},finish:function(t){return!1!==t&&(t=t||"fx"),this.each(function(){var e,i=K.get(this),n=i[t+"queue"],r=i[t+"queueHooks"],s=T.timers,a=n?n.length:0;for(i.finish=!0,T.queue(this,t,[]),r&&r.stop&&r.stop.call(this,!0),e=s.length;e--;)s[e].elem===this&&s[e].queue===t&&(s[e].anim.stop(!0),s.splice(e,1));for(e=0;e<a;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete i.finish})}}),T.each(["toggle","show","hide"],function(t,e){var i=T.fn[e];T.fn[e]=function(t,n,r){return null==t||"boolean"==typeof t?i.apply(this,arguments):this.animate(oe(e,!0),t,n,r)}}),T.each({slideDown:oe("show"),slideUp:oe("hide"),slideToggle:oe("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(t,e){T.fn[t]=function(t,i,n){return this.animate(e,t,i,n)}}),T.timers=[],T.fx.tick=function(){var t,e=0,i=T.timers;for(ee=Date.now();e<i.length;e++)(t=i[e])()||i[e]!==t||i.splice(e--,1);i.length||T.fx.stop(),ee=void 0},T.fx.timer=function(t){T.timers.push(t),T.fx.start()},T.fx.interval=13,T.fx.start=function(){ie||(ie=!0,se())},T.fx.stop=function(){ie=null},T.fx.speeds={slow:600,fast:200,_default:400},T.fn.delay=function(t,e){return t=T.fx&&T.fx.speeds[t]||t,e=e||"fx",this.queue(e,function(e,n){var r=i.setTimeout(e,t);n.stop=function(){i.clearTimeout(r)}})},function(){var t=a.createElement("input"),e=a.createElement("select").appendChild(a.createElement("option"));t.type="checkbox",v.checkOn=""!==t.value,v.optSelected=e.selected,(t=a.createElement("input")).value="t",t.type="radio",v.radioValue="t"===t.value}();var ce,le=T.expr.attrHandle;T.fn.extend({attr:function(t,e){return W(this,T.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each(function(){T.removeAttr(this,t)})}}),T.extend({attr:function(t,e,i){var n,r,s=t.nodeType;if(3!==s&&8!==s&&2!==s)return void 0===t.getAttribute?T.prop(t,e,i):(1===s&&T.isXMLDoc(t)||(r=T.attrHooks[e.toLowerCase()]||(T.expr.match.bool.test(e)?ce:void 0)),void 0!==i?null===i?void T.removeAttr(t,e):r&&"set"in r&&void 0!==(n=r.set(t,i,e))?n:(t.setAttribute(e,i+""),i):r&&"get"in r&&null!==(n=r.get(t,e))?n:null==(n=T.find.attr(t,e))?void 0:n)},attrHooks:{type:{set:function(t,e){if(!v.radioValue&&"radio"===e&&j(t,"input")){var i=t.value;return t.setAttribute("type",e),i&&(t.value=i),e}}}},removeAttr:function(t,e){var i,n=0,r=e&&e.match(B);if(r&&1===t.nodeType)for(;i=r[n++];)t.removeAttribute(i)}}),ce={set:function(t,e,i){return!1===e?T.removeAttr(t,i):t.setAttribute(i,i),i}},T.each(T.expr.match.bool.source.match(/\w+/g),function(t,e){var i=le[e]||T.find.attr;le[e]=function(t,e,n){var r,s,a=e.toLowerCase();return n||(s=le[a],le[a]=r,r=null!=i(t,e,n)?a:null,le[a]=s),r}});var de=/^(?:input|select|textarea|button)$/i,fe=/^(?:a|area)$/i;function pe(t){return(t.match(B)||[]).join(" ")}function ge(t){return t.getAttribute&&t.getAttribute("class")||""}function me(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(B)||[]}T.fn.extend({prop:function(t,e){return W(this,T.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each(function(){delete this[T.propFix[t]||t]})}}),T.extend({prop:function(t,e,i){var n,r,s=t.nodeType;if(3!==s&&8!==s&&2!==s)return 1===s&&T.isXMLDoc(t)||(e=T.propFix[e]||e,r=T.propHooks[e]),void 0!==i?r&&"set"in r&&void 0!==(n=r.set(t,i,e))?n:t[e]=i:r&&"get"in r&&null!==(n=r.get(t,e))?n:t[e]},propHooks:{tabIndex:{get:function(t){var e=T.find.attr(t,"tabindex");return e?parseInt(e,10):de.test(t.nodeName)||fe.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),v.optSelected||(T.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),T.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){T.propFix[this.toLowerCase()]=this}),T.fn.extend({addClass:function(t){var e,i,n,r,s,a,o,h=0;if(_(t))return this.each(function(e){T(this).addClass(t.call(this,e,ge(this)))});if((e=me(t)).length)for(;i=this[h++];)if(r=ge(i),n=1===i.nodeType&&" "+pe(r)+" "){for(a=0;s=e[a++];)n.indexOf(" "+s+" ")<0&&(n+=s+" ");r!==(o=pe(n))&&i.setAttribute("class",o)}return this},removeClass:function(t){var e,i,n,r,s,a,o,h=0;if(_(t))return this.each(function(e){T(this).removeClass(t.call(this,e,ge(this)))});if(!arguments.length)return this.attr("class","");if((e=me(t)).length)for(;i=this[h++];)if(r=ge(i),n=1===i.nodeType&&" "+pe(r)+" "){for(a=0;s=e[a++];)for(;n.indexOf(" "+s+" ")>-1;)n=n.replace(" "+s+" "," ");r!==(o=pe(n))&&i.setAttribute("class",o)}return this},toggleClass:function(t,e){var i=typeof t,n="string"===i||Array.isArray(t);return"boolean"==typeof e&&n?e?this.addClass(t):this.removeClass(t):_(t)?this.each(function(i){T(this).toggleClass(t.call(this,i,ge(this),e),e)}):this.each(function(){var e,r,s,a;if(n)for(r=0,s=T(this),a=me(t);e=a[r++];)s.hasClass(e)?s.removeClass(e):s.addClass(e);else void 0!==t&&"boolean"!==i||((e=ge(this))&&K.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===t?"":K.get(this,"__className__")||""))})},hasClass:function(t){var e,i,n=0;for(e=" "+t+" ";i=this[n++];)if(1===i.nodeType&&(" "+pe(ge(i))+" ").indexOf(e)>-1)return!0;return!1}});var ve=/\r/g;T.fn.extend({val:function(t){var e,i,n,r=this[0];return arguments.length?(n=_(t),this.each(function(i){var r;1===this.nodeType&&(null==(r=n?t.call(this,i,T(this).val()):t)?r="":"number"==typeof r?r+="":Array.isArray(r)&&(r=T.map(r,function(t){return null==t?"":t+""})),(e=T.valHooks[this.type]||T.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,r,"value")||(this.value=r))})):r?(e=T.valHooks[r.type]||T.valHooks[r.nodeName.toLowerCase()])&&"get"in e&&void 0!==(i=e.get(r,"value"))?i:"string"==typeof(i=r.value)?i.replace(ve,""):null==i?"":i:void 0}}),T.extend({valHooks:{option:{get:function(t){var e=T.find.attr(t,"value");return null!=e?e:pe(T.text(t))}},select:{get:function(t){var e,i,n,r=t.options,s=t.selectedIndex,a="select-one"===t.type,o=a?null:[],h=a?s+1:r.length;for(n=s<0?h:a?s:0;n<h;n++)if(((i=r[n]).selected||n===s)&&!i.disabled&&(!i.parentNode.disabled||!j(i.parentNode,"optgroup"))){if(e=T(i).val(),a)return e;o.push(e)}return o},set:function(t,e){for(var i,n,r=t.options,s=T.makeArray(e),a=r.length;a--;)((n=r[a]).selected=T.inArray(T.valHooks.option.get(n),s)>-1)&&(i=!0);return i||(t.selectedIndex=-1),s}}}}),T.each(["radio","checkbox"],function(){T.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=T.inArray(T(t).val(),e)>-1}},v.checkOn||(T.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})}),v.focusin="onfocusin"in i;var _e=/^(?:focusinfocus|focusoutblur)$/,xe=function(t){t.stopPropagation()};T.extend(T.event,{trigger:function(t,e,n,r){var s,o,h,u,c,l,d,f,g=[n||a],m=p.call(t,"type")?t.type:t,v=p.call(t,"namespace")?t.namespace.split("."):[];if(o=f=h=n=n||a,3!==n.nodeType&&8!==n.nodeType&&!_e.test(m+T.event.triggered)&&(m.indexOf(".")>-1&&(m=(v=m.split(".")).shift(),v.sort()),c=m.indexOf(":")<0&&"on"+m,(t=t[T.expando]?t:new T.Event(m,"object"==typeof t&&t)).isTrigger=r?2:3,t.namespace=v.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+v.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=n),e=null==e?[t]:T.makeArray(e,[t]),d=T.event.special[m]||{},r||!d.trigger||!1!==d.trigger.apply(n,e))){if(!r&&!d.noBubble&&!x(n)){for(u=d.delegateType||m,_e.test(u+m)||(o=o.parentNode);o;o=o.parentNode)g.push(o),h=o;h===(n.ownerDocument||a)&&g.push(h.defaultView||h.parentWindow||i)}for(s=0;(o=g[s++])&&!t.isPropagationStopped();)f=o,t.type=s>1?u:d.bindType||m,(l=(K.get(o,"events")||{})[t.type]&&K.get(o,"handle"))&&l.apply(o,e),(l=c&&o[c])&&l.apply&&Q(o)&&(t.result=l.apply(o,e),!1===t.result&&t.preventDefault());return t.type=m,r||t.isDefaultPrevented()||d._default&&!1!==d._default.apply(g.pop(),e)||!Q(n)||c&&_(n[m])&&!x(n)&&((h=n[c])&&(n[c]=null),T.event.triggered=m,t.isPropagationStopped()&&f.addEventListener(m,xe),n[m](),t.isPropagationStopped()&&f.removeEventListener(m,xe),T.event.triggered=void 0,h&&(n[c]=h)),t.result}},simulate:function(t,e,i){var n=T.extend(new T.Event,i,{type:t,isSimulated:!0});T.event.trigger(n,null,e)}}),T.fn.extend({trigger:function(t,e){return this.each(function(){T.event.trigger(t,e,this)})},triggerHandler:function(t,e){var i=this[0];if(i)return T.event.trigger(t,e,i,!0)}}),v.focusin||T.each({focus:"focusin",blur:"focusout"},function(t,e){var i=function(t){T.event.simulate(e,t.target,T.event.fix(t))};T.event.special[e]={setup:function(){var n=this.ownerDocument||this,r=K.access(n,e);r||n.addEventListener(t,i,!0),K.access(n,e,(r||0)+1)},teardown:function(){var n=this.ownerDocument||this,r=K.access(n,e)-1;r?K.access(n,e,r):(n.removeEventListener(t,i,!0),K.remove(n,e))}}});var ye=i.location,be=Date.now(),we=/\?/;T.parseXML=function(t){var e;if(!t||"string"!=typeof t)return null;try{e=(new i.DOMParser).parseFromString(t,"text/xml")}catch(t){e=void 0}return e&&!e.getElementsByTagName("parsererror").length||T.error("Invalid XML: "+t),e};var Te=/\[\]$/,Ee=/\r?\n/g,Ce=/^(?:submit|button|image|reset|file)$/i,Se=/^(?:input|select|textarea|keygen)/i;function De(t,e,i,n){var r;if(Array.isArray(e))T.each(e,function(e,r){i||Te.test(t)?n(t,r):De(t+"["+("object"==typeof r&&null!=r?e:"")+"]",r,i,n)});else if(i||"object"!==w(e))n(t,e);else for(r in e)De(t+"["+r+"]",e[r],i,n)}T.param=function(t,e){var i,n=[],r=function(t,e){var i=_(e)?e():e;n[n.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==i?"":i)};if(Array.isArray(t)||t.jquery&&!T.isPlainObject(t))T.each(t,function(){r(this.name,this.value)});else for(i in t)De(i,t[i],e,r);return n.join("&")},T.fn.extend({serialize:function(){return T.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var t=T.prop(this,"elements");return t?T.makeArray(t):this}).filter(function(){var t=this.type;return this.name&&!T(this).is(":disabled")&&Se.test(this.nodeName)&&!Ce.test(t)&&(this.checked||!dt.test(t))}).map(function(t,e){var i=T(this).val();return null==i?null:Array.isArray(i)?T.map(i,function(t){return{name:e.name,value:t.replace(Ee,"\r\n")}}):{name:e.name,value:i.replace(Ee,"\r\n")}}).get()}});var Ae=/%20/g,Re=/#.*$/,je=/([?&])_=[^&]*/,Le=/^(.*?):[ \t]*([^\r\n]*)$/gm,Pe=/^(?:GET|HEAD)$/,Me=/^\/\//,ke={},Ie={},Oe="*/".concat("*"),Fe=a.createElement("a");function Be(t){return function(e,i){"string"!=typeof e&&(i=e,e="*");var n,r=0,s=e.toLowerCase().match(B)||[];if(_(i))for(;n=s[r++];)"+"===n[0]?(n=n.slice(1)||"*",(t[n]=t[n]||[]).unshift(i)):(t[n]=t[n]||[]).push(i)}}function Ne(t,e,i,n){var r={},s=t===Ie;function a(o){var h;return r[o]=!0,T.each(t[o]||[],function(t,o){var u=o(e,i,n);return"string"!=typeof u||s||r[u]?s?!(h=u):void 0:(e.dataTypes.unshift(u),a(u),!1)}),h}return a(e.dataTypes[0])||!r["*"]&&a("*")}function Ge(t,e){var i,n,r=T.ajaxSettings.flatOptions||{};for(i in e)void 0!==e[i]&&((r[i]?t:n||(n={}))[i]=e[i]);return n&&T.extend(!0,t,n),t}Fe.href=ye.href,T.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ye.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(ye.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Oe,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":T.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?Ge(Ge(t,T.ajaxSettings),e):Ge(T.ajaxSettings,t)},ajaxPrefilter:Be(ke),ajaxTransport:Be(Ie),ajax:function(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};var n,r,s,o,h,u,c,l,d,f,p=T.ajaxSetup({},e),g=p.context||p,m=p.context&&(g.nodeType||g.jquery)?T(g):T.event,v=T.Deferred(),_=T.Callbacks("once memory"),x=p.statusCode||{},y={},b={},w="canceled",E={readyState:0,getResponseHeader:function(t){var e;if(c){if(!o)for(o={};e=Le.exec(s);)o[e[1].toLowerCase()]=e[2];e=o[t.toLowerCase()]}return null==e?null:e},getAllResponseHeaders:function(){return c?s:null},setRequestHeader:function(t,e){return null==c&&(t=b[t.toLowerCase()]=b[t.toLowerCase()]||t,y[t]=e),this},overrideMimeType:function(t){return null==c&&(p.mimeType=t),this},statusCode:function(t){var e;if(t)if(c)E.always(t[E.status]);else for(e in t)x[e]=[x[e],t[e]];return this},abort:function(t){var e=t||w;return n&&n.abort(e),C(0,e),this}};if(v.promise(E),p.url=((t||p.url||ye.href)+"").replace(Me,ye.protocol+"//"),p.type=e.method||e.type||p.method||p.type,p.dataTypes=(p.dataType||"*").toLowerCase().match(B)||[""],null==p.crossDomain){u=a.createElement("a");try{u.href=p.url,u.href=u.href,p.crossDomain=Fe.protocol+"//"+Fe.host!=u.protocol+"//"+u.host}catch(t){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=T.param(p.data,p.traditional)),Ne(ke,p,e,E),c)return E;for(d in(l=T.event&&p.global)&&0==T.active++&&T.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Pe.test(p.type),r=p.url.replace(Re,""),p.hasContent?p.data&&p.processData&&0===(p.contentType||"").indexOf("application/x-www-form-urlencoded")&&(p.data=p.data.replace(Ae,"+")):(f=p.url.slice(r.length),p.data&&(p.processData||"string"==typeof p.data)&&(r+=(we.test(r)?"&":"?")+p.data,delete p.data),!1===p.cache&&(r=r.replace(je,"$1"),f=(we.test(r)?"&":"?")+"_="+be+++f),p.url=r+f),p.ifModified&&(T.lastModified[r]&&E.setRequestHeader("If-Modified-Since",T.lastModified[r]),T.etag[r]&&E.setRequestHeader("If-None-Match",T.etag[r])),(p.data&&p.hasContent&&!1!==p.contentType||e.contentType)&&E.setRequestHeader("Content-Type",p.contentType),E.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Oe+"; q=0.01":""):p.accepts["*"]),p.headers)E.setRequestHeader(d,p.headers[d]);if(p.beforeSend&&(!1===p.beforeSend.call(g,E,p)||c))return E.abort();if(w="abort",_.add(p.complete),E.done(p.success),E.fail(p.error),n=Ne(Ie,p,e,E)){if(E.readyState=1,l&&m.trigger("ajaxSend",[E,p]),c)return E;p.async&&p.timeout>0&&(h=i.setTimeout(function(){E.abort("timeout")},p.timeout));try{c=!1,n.send(y,C)}catch(t){if(c)throw t;C(-1,t)}}else C(-1,"No Transport");function C(t,e,a,o){var u,d,f,y,b,w=e;c||(c=!0,h&&i.clearTimeout(h),n=void 0,s=o||"",E.readyState=t>0?4:0,u=t>=200&&t<300||304===t,a&&(y=function(t,e,i){for(var n,r,s,a,o=t.contents,h=t.dataTypes;"*"===h[0];)h.shift(),void 0===n&&(n=t.mimeType||e.getResponseHeader("Content-Type"));if(n)for(r in o)if(o[r]&&o[r].test(n)){h.unshift(r);break}if(h[0]in i)s=h[0];else{for(r in i){if(!h[0]||t.converters[r+" "+h[0]]){s=r;break}a||(a=r)}s=s||a}if(s)return s!==h[0]&&h.unshift(s),i[s]}(p,E,a)),y=function(t,e,i,n){var r,s,a,o,h,u={},c=t.dataTypes.slice();if(c[1])for(a in t.converters)u[a.toLowerCase()]=t.converters[a];for(s=c.shift();s;)if(t.responseFields[s]&&(i[t.responseFields[s]]=e),!h&&n&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),h=s,s=c.shift())if("*"===s)s=h;else if("*"!==h&&h!==s){if(!(a=u[h+" "+s]||u["* "+s]))for(r in u)if((o=r.split(" "))[1]===s&&(a=u[h+" "+o[0]]||u["* "+o[0]])){!0===a?a=u[r]:!0!==u[r]&&(s=o[0],c.unshift(o[1]));break}if(!0!==a)if(a&&t.throws)e=a(e);else try{e=a(e)}catch(t){return{state:"parsererror",error:a?t:"No conversion from "+h+" to "+s}}}return{state:"success",data:e}}(p,y,E,u),u?(p.ifModified&&((b=E.getResponseHeader("Last-Modified"))&&(T.lastModified[r]=b),(b=E.getResponseHeader("etag"))&&(T.etag[r]=b)),204===t||"HEAD"===p.type?w="nocontent":304===t?w="notmodified":(w=y.state,d=y.data,u=!(f=y.error))):(f=w,!t&&w||(w="error",t<0&&(t=0))),E.status=t,E.statusText=(e||w)+"",u?v.resolveWith(g,[d,w,E]):v.rejectWith(g,[E,w,f]),E.statusCode(x),x=void 0,l&&m.trigger(u?"ajaxSuccess":"ajaxError",[E,p,u?d:f]),_.fireWith(g,[E,w]),l&&(m.trigger("ajaxComplete",[E,p]),--T.active||T.event.trigger("ajaxStop")))}return E},getJSON:function(t,e,i){return T.get(t,e,i,"json")},getScript:function(t,e){return T.get(t,void 0,e,"script")}}),T.each(["get","post"],function(t,e){T[e]=function(t,i,n,r){return _(i)&&(r=r||n,n=i,i=void 0),T.ajax(T.extend({url:t,type:e,dataType:r,data:i,success:n},T.isPlainObject(t)&&t))}}),T._evalUrl=function(t){return T.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,throws:!0})},T.fn.extend({wrapAll:function(t){var e;return this[0]&&(_(t)&&(t=t.call(this[0])),e=T(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map(function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t}).append(this)),this},wrapInner:function(t){return _(t)?this.each(function(e){T(this).wrapInner(t.call(this,e))}):this.each(function(){var e=T(this),i=e.contents();i.length?i.wrapAll(t):e.append(t)})},wrap:function(t){var e=_(t);return this.each(function(i){T(this).wrapAll(e?t.call(this,i):t)})},unwrap:function(t){return this.parent(t).not("body").each(function(){T(this).replaceWith(this.childNodes)}),this}}),T.expr.pseudos.hidden=function(t){return!T.expr.pseudos.visible(t)},T.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},T.ajaxSettings.xhr=function(){try{return new i.XMLHttpRequest}catch(t){}};var Ue={0:200,1223:204},He=T.ajaxSettings.xhr();v.cors=!!He&&"withCredentials"in He,v.ajax=He=!!He,T.ajaxTransport(function(t){var e,n;if(v.cors||He&&!t.crossDomain)return{send:function(r,s){var a,o=t.xhr();if(o.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)o[a]=t.xhrFields[a];for(a in t.mimeType&&o.overrideMimeType&&o.overrideMimeType(t.mimeType),t.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest"),r)o.setRequestHeader(a,r[a]);e=function(t){return function(){e&&(e=n=o.onload=o.onerror=o.onabort=o.ontimeout=o.onreadystatechange=null,"abort"===t?o.abort():"error"===t?"number"!=typeof o.status?s(0,"error"):s(o.status,o.statusText):s(Ue[o.status]||o.status,o.statusText,"text"!==(o.responseType||"text")||"string"!=typeof o.responseText?{binary:o.response}:{text:o.responseText},o.getAllResponseHeaders()))}},o.onload=e(),n=o.onerror=o.ontimeout=e("error"),void 0!==o.onabort?o.onabort=n:o.onreadystatechange=function(){4===o.readyState&&i.setTimeout(function(){e&&n()})},e=e("abort");try{o.send(t.hasContent&&t.data||null)}catch(t){if(e)throw t}},abort:function(){e&&e()}}}),T.ajaxPrefilter(function(t){t.crossDomain&&(t.contents.script=!1)}),T.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return T.globalEval(t),t}}}),T.ajaxPrefilter("script",function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")}),T.ajaxTransport("script",function(t){var e,i;if(t.crossDomain)return{send:function(n,r){e=T("<script>").prop({charset:t.scriptCharset,src:t.url}).on("load error",i=function(t){e.remove(),i=null,t&&r("error"===t.type?404:200,t.type)}),a.head.appendChild(e[0])},abort:function(){i&&i()}}});var Xe=[],Ye=/(=)\?(?=&|$)|\?\?/;T.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=Xe.pop()||T.expando+"_"+be++;return this[t]=!0,t}}),T.ajaxPrefilter("json jsonp",function(t,e,n){var r,s,a,o=!1!==t.jsonp&&(Ye.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ye.test(t.data)&&"data");if(o||"jsonp"===t.dataTypes[0])return r=t.jsonpCallback=_(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,o?t[o]=t[o].replace(Ye,"$1"+r):!1!==t.jsonp&&(t.url+=(we.test(t.url)?"&":"?")+t.jsonp+"="+r),t.converters["script json"]=function(){return a||T.error(r+" was not called"),a[0]},t.dataTypes[0]="json",s=i[r],i[r]=function(){a=arguments},n.always(function(){void 0===s?T(i).removeProp(r):i[r]=s,t[r]&&(t.jsonpCallback=e.jsonpCallback,Xe.push(r)),a&&_(s)&&s(a[0]),a=s=void 0}),"script"}),v.createHTMLDocument=function(){var t=a.implementation.createHTMLDocument("").body;return t.innerHTML="<form></form><form></form>",2===t.childNodes.length}(),T.parseHTML=function(t,e,i){return"string"!=typeof t?[]:("boolean"==typeof e&&(i=e,e=!1),e||(v.createHTMLDocument?((n=(e=a.implementation.createHTMLDocument("")).createElement("base")).href=a.location.href,e.head.appendChild(n)):e=a),r=L.exec(t),s=!i&&[],r?[e.createElement(r[1])]:(r=xt([t],e,s),s&&s.length&&T(s).remove(),T.merge([],r.childNodes)));var n,r,s},T.fn.load=function(t,e,i){var n,r,s,a=this,o=t.indexOf(" ");return o>-1&&(n=pe(t.slice(o)),t=t.slice(0,o)),_(e)?(i=e,e=void 0):e&&"object"==typeof e&&(r="POST"),a.length>0&&T.ajax({url:t,type:r||"GET",dataType:"html",data:e}).done(function(t){s=arguments,a.html(n?T("<div>").append(T.parseHTML(t)).find(n):t)}).always(i&&function(t,e){a.each(function(){i.apply(this,s||[t.responseText,e,t])})}),this},T.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(t,e){T.fn[e]=function(t){return this.on(e,t)}}),T.expr.pseudos.animated=function(t){return T.grep(T.timers,function(e){return t===e.elem}).length},T.offset={setOffset:function(t,e,i){var n,r,s,a,o,h,u=T.css(t,"position"),c=T(t),l={};"static"===u&&(t.style.position="relative"),o=c.offset(),s=T.css(t,"top"),h=T.css(t,"left"),("absolute"===u||"fixed"===u)&&(s+h).indexOf("auto")>-1?(a=(n=c.position()).top,r=n.left):(a=parseFloat(s)||0,r=parseFloat(h)||0),_(e)&&(e=e.call(t,i,T.extend({},o))),null!=e.top&&(l.top=e.top-o.top+a),null!=e.left&&(l.left=e.left-o.left+r),"using"in e?e.using.call(t,l):c.css(l)}},T.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){T.offset.setOffset(this,t,e)});var e,i,n=this[0];return n?n.getClientRects().length?(e=n.getBoundingClientRect(),i=n.ownerDocument.defaultView,{top:e.top+i.pageYOffset,left:e.left+i.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var t,e,i,n=this[0],r={top:0,left:0};if("fixed"===T.css(n,"position"))e=n.getBoundingClientRect();else{for(e=this.offset(),i=n.ownerDocument,t=n.offsetParent||i.documentElement;t&&(t===i.body||t===i.documentElement)&&"static"===T.css(t,"position");)t=t.parentNode;t&&t!==n&&1===t.nodeType&&((r=T(t).offset()).top+=T.css(t,"borderTopWidth",!0),r.left+=T.css(t,"borderLeftWidth",!0))}return{top:e.top-r.top-T.css(n,"marginTop",!0),left:e.left-r.left-T.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent;t&&"static"===T.css(t,"position");)t=t.offsetParent;return t||yt})}}),T.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,e){var i="pageYOffset"===e;T.fn[t]=function(n){return W(this,function(t,n,r){var s;if(x(t)?s=t:9===t.nodeType&&(s=t.defaultView),void 0===r)return s?s[e]:t[n];s?s.scrollTo(i?s.pageXOffset:r,i?r:s.pageYOffset):t[n]=r},t,n,arguments.length)}}),T.each(["top","left"],function(t,e){T.cssHooks[e]=Xt(v.pixelPosition,function(t,i){if(i)return i=Ht(t,e),Nt.test(i)?T(t).position()[e]+"px":i})}),T.each({Height:"height",Width:"width"},function(t,e){T.each({padding:"inner"+t,content:e,"":"outer"+t},function(i,n){T.fn[n]=function(r,s){var a=arguments.length&&(i||"boolean"!=typeof r),o=i||(!0===r||!0===s?"margin":"border");return W(this,function(e,i,r){var s;return x(e)?0===n.indexOf("outer")?e["inner"+t]:e.document.documentElement["client"+t]:9===e.nodeType?(s=e.documentElement,Math.max(e.body["scroll"+t],s["scroll"+t],e.body["offset"+t],s["offset"+t],s["client"+t])):void 0===r?T.css(e,i,o):T.style(e,i,r,o)},e,a?r:void 0,a)}})}),T.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(t,e){T.fn[e]=function(t,i){return arguments.length>0?this.on(e,null,t,i):this.trigger(e)}}),T.fn.extend({hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)}}),T.fn.extend({bind:function(t,e,i){return this.on(t,null,e,i)},unbind:function(t,e){return this.off(t,null,e)},delegate:function(t,e,i,n){return this.on(e,t,i,n)},undelegate:function(t,e,i){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",i)}}),T.proxy=function(t,e){var i,n,r;if("string"==typeof e&&(i=t[e],e=t,t=i),_(t))return n=h.call(arguments,2),(r=function(){return t.apply(e||this,n.concat(h.call(arguments)))}).guid=t.guid=t.guid||T.guid++,r},T.holdReady=function(t){t?T.readyWait++:T.ready(!0)},T.isArray=Array.isArray,T.parseJSON=JSON.parse,T.nodeName=j,T.isFunction=_,T.isWindow=x,T.camelCase=$,T.type=w,T.now=Date.now,T.isNumeric=function(t){var e=T.type(t);return("number"===e||"string"===e)&&!isNaN(t-parseFloat(t))},void 0===(n=function(){return T}.apply(e,[]))||(t.exports=n);var We=i.jQuery,qe=i.$;return T.noConflict=function(t){return i.$===T&&(i.$=qe),t&&i.jQuery===T&&(i.jQuery=We),T},r||(i.jQuery=i.$=T),T})},1:function(t,e,i){"use strict";(function(t){function n(t){console.log("AppPreloader.initialize"),this.parentModule=t}i.d(e,"a",function(){return n}),n.prototype.initialize=function(e){void 0===e&&(e=".percentage");const i=window.performance.timing,n=-(i.loadEventEnd-i.navigationStart)/1e3%50*100,r=t(e);this.animateValue(r,0,100,n);const s=this;this.parentModule.hasVisited&&setTimeout(function(){console.log("AppPreloader.TimeCompleted"),s.parentModule.appPreloaderComplete()},n)},n.prototype.animateValue=function(e,i,n,r){const s=n-i,a=n>i?1:-1,o=Math.abs(Math.floor(r/s)),h=t(e);let u=i,c=setInterval(function(){u+=a,t(h).text("loading => "+u),u==n&&(t(h).text(""),clearInterval(c))},o)}}).call(this,i(0))},2:function(t,e,i){"use strict";i.d(e,"a",function(){return s});var n=i(0),r=i.n(n);function s(){this.transitionLayer=r()(".cd-transition-layer"),this.transitionBackground=this.transitionLayer.children(),this.modalTrigger=r()(".nav-icon"),this.modalWindow=r()(".full-menu"),this.frameProportion=1.78,this.spriteFrames=25,this.isResize=!1,this.onRequestAnimationFrameUpdate=this.setLayerDimensions.bind(this),this.initialize()}s.prototype.initialize=function(){this.setLayerDimensions(),r()(window).on("resize.transitioneffect",this.onResize.bind(this)),this.modalTrigger.on("click.modaltrigger",this.onModalTriggerClick.bind(this)),this.modalWindow.on("click.modalwindow",".modal-close",this.onModalWindowClick.bind(this))},s.prototype.onResize=function(t){this.isResize||(this.isResize=!0,window.requestAnimationFrame?window.requestAnimationFrame(this.onRequestAnimationFrameUpdate):setTimeout(this.onRequestAnimationFrameUpdate,300))},s.prototype.startSequence=function(){this.transitionLayer.addClass("closing").delay(1e3).queue(function(){r()(this).removeClass("visible closing opening").dequeue()})},s.prototype.onModalTriggerClick=function(t){t.preventDefault(),this.transitionLayer.addClass("visible opening");const e=r()(".no-cssanimations").length>0?0:600,i=this;setTimeout(function(){i.modalWindow.addClass("visible")},e)},s.prototype.onModalWindowClick=function(t){const e="webkitAnimationEnd oanimationend msAnimationEnd animationend";t.preventDefault(),this.transitionLayer.addClass("closing"),this.modalWindow.removeClass("visible");const i=this;this.transitionBackground.one(e,function(){i.transitionLayer.removeClass("closing opening visible"),i.transitionBackground.off(e)})},s.prototype.setLayerDimensions=function(){const t=r()(window).width(),e=r()(window).height();let i,n;t/e>this.frameProportion?i=(n=t)/this.frameProportion:n=(i=1.2*e)*this.frameProportion,this.transitionBackground.css({width:n*this.spriteFrames+"px",height:i+"px"}),this.isResize=!1},s.prototype.destroy=function(){this.onRequestAnimationFrameUpdate=null,r()(this.modalTrigger).off("resize.modaltrigger"),r()(this.modalWindow).off("resize.modalwindow",".modal-close"),r()(window).off("resize.transitioneffect")}},3:function(t,e){!function(e){var i="Modernizr"in e,n=e.Modernizr;!function(e,i,n){function r(t,e){return typeof t===e}function s(t){var e=T.className,i=b._config.classPrefix||"";if(E&&(e=e.baseVal),b._config.enableJSClass){var n=new RegExp("(^|\\s)"+i+"no-js(\\s|$)");e=e.replace(n,"$1"+i+"js$2")}b._config.enableClasses&&(e+=" "+i+t.join(" "+i),E?T.className.baseVal=e:T.className=e)}function a(){return"function"!=typeof i.createElement?i.createElement(arguments[0]):E?i.createElementNS.call(i,"http://www.w3.org/2000/svg",arguments[0]):i.createElement.apply(i,arguments)}function o(t,e,n,r){var s,o,h,u,c="modernizr",l=a("div"),d=function(){var t=i.body;return t||((t=a(E?"svg":"body")).fake=!0),t}();if(parseInt(n,10))for(;n--;)(h=a("div")).id=r?r[n]:c+(n+1),l.appendChild(h);return(s=a("style")).type="text/css",s.id="s"+c,(d.fake?d:l).appendChild(s),d.appendChild(l),s.styleSheet?s.styleSheet.cssText=t:s.appendChild(i.createTextNode(t)),l.id=c,d.fake&&(d.style.background="",d.style.overflow="hidden",u=T.style.overflow,T.style.overflow="hidden",T.appendChild(d)),o=e(l,t),d.fake?(d.parentNode.removeChild(d),T.style.overflow=u,T.offsetHeight):l.parentNode.removeChild(l),!!o}function h(t,e){return!!~(""+t).indexOf(e)}function u(t){return t.replace(/([A-Z])/g,function(t,e){return"-"+e.toLowerCase()}).replace(/^ms-/,"-ms-")}function c(t,i,n){var r;if("getComputedStyle"in e){r=getComputedStyle.call(e,t,i);var s=e.console;if(null!==r)n&&(r=r.getPropertyValue(n));else if(s){s[s.error?"error":"log"].call(s,"getComputedStyle returning null, its possible modernizr test results are inaccurate")}}else r=!i&&t.currentStyle&&t.currentStyle[n];return r}function l(t,i){var r=t.length;if("CSS"in e&&"supports"in e.CSS){for(;r--;)if(e.CSS.supports(u(t[r]),i))return!0;return!1}if("CSSSupportsRule"in e){for(var s=[];r--;)s.push("("+u(t[r])+":"+i+")");return o("@supports ("+(s=s.join(" or "))+") { #modernizr { position: absolute; } }",function(t){return"absolute"==c(t,null,"position")})}return n}function d(t){return t.replace(/([a-z])-([a-z])/g,function(t,e,i){return e+i.toUpperCase()}).replace(/^-/,"")}function f(t,e,i,s){function o(){c&&(delete j.style,delete j.modElem)}if(s=!r(s,"undefined")&&s,!r(i,"undefined")){var u=l(t,i);if(!r(u,"undefined"))return u}for(var c,f,p,g,m,v=["modernizr","tspan","samp"];!j.style&&v.length;)c=!0,j.modElem=a(v.shift()),j.style=j.modElem.style;for(p=t.length,f=0;p>f;f++)if(g=t[f],m=j.style[g],h(g,"-")&&(g=d(g)),j.style[g]!==n){if(s||r(i,"undefined"))return o(),"pfx"!=e||g;try{j.style[g]=i}catch(t){}if(j.style[g]!=m)return o(),"pfx"!=e||g}return o(),!1}function p(t,e){return function(){return t.apply(e,arguments)}}function g(t,e,i,n,s){var a=t.charAt(0).toUpperCase()+t.slice(1),o=(t+" "+A.join(a+" ")+a).split(" ");return r(e,"string")||r(e,"undefined")?f(o,e,n,s):function(t,e,i){var n;for(var s in t)if(t[s]in e)return!1===i?t[s]:r(n=e[t[s]],"function")?p(n,i||e):n;return!1}(o=(t+" "+L.join(a+" ")+a).split(" "),e,i)}function m(t,e){if("object"==typeof t)for(var i in t)M(t,i)&&m(i,t[i]);else{var n=(t=t.toLowerCase()).split("."),r=b[n[0]];if(2==n.length&&(r=r[n[1]]),void 0!==r)return b;e="function"==typeof e?e():e,1==n.length?b[n[0]]=e:(!b[n[0]]||b[n[0]]instanceof Boolean||(b[n[0]]=new Boolean(b[n[0]])),b[n[0]][n[1]]=e),s([(e&&0!=e?"":"no-")+n.join("-")]),b._trigger(t,e)}return b}function v(t,e){var i=t.deleteDatabase(e);i.onsuccess=function(){m("indexeddb.deletedatabase",!0)},i.onerror=function(){m("indexeddb.deletedatabase",!1)}}function _(t,e,i){return g(t,n,n,e,i)}var x=[],y={_version:"3.6.0",_config:{classPrefix:"",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(t,e){var i=this;setTimeout(function(){e(i[t])},0)},addTest:function(t,e,i){x.push({name:t,fn:e,options:i})},addAsyncTest:function(t){x.push({name:null,fn:t})}},b=function(){};b.prototype=y,b=new b;var w=[],T=i.documentElement,E="svg"===T.nodeName.toLowerCase();E||function(e,i){function n(t,e){var i=t.createElement("p"),n=t.getElementsByTagName("head")[0]||t.documentElement;return i.innerHTML="x<style>"+e+"</style>",n.insertBefore(i.lastChild,n.firstChild)}function r(){var t=b.elements;return"string"==typeof t?t.split(" "):t}function s(t){var e=y[t[_]];return e||(e={},x++,t[_]=x,y[x]=e),e}function a(t,e,n){return e||(e=i),p?e.createElement(t):(n||(n=s(e)),!(r=n.cache[t]?n.cache[t].cloneNode():v.test(t)?(n.cache[t]=n.createElem(t)).cloneNode():n.createElem(t)).canHaveChildren||m.test(t)||r.tagUrn?r:n.frag.appendChild(r));var r}function o(t,e){e.cache||(e.cache={},e.createElem=t.createElement,e.createFrag=t.createDocumentFragment,e.frag=e.createFrag()),t.createElement=function(i){return b.shivMethods?a(i,t,e):e.createElem(i)},t.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+r().join().replace(/[\w\-:]+/g,function(t){return e.createElem(t),e.frag.createElement(t),'c("'+t+'")'})+");return n}")(b,e.frag)}function h(t){t||(t=i);var e=s(t);return!b.shivCSS||f||e.hasCSS||(e.hasCSS=!!n(t,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),p||o(t,e),t}function u(t){for(var e,i=t.getElementsByTagName("*"),n=i.length,s=RegExp("^(?:"+r().join("|")+")$","i"),a=[];n--;)e=i[n],s.test(e.nodeName)&&a.push(e.applyElement(c(e)));return a}function c(t){for(var e,i=t.attributes,n=i.length,r=t.ownerDocument.createElement(T+":"+t.nodeName);n--;)(e=i[n]).specified&&r.setAttribute(e.nodeName,e.nodeValue);return r.style.cssText=t.style.cssText,r}function l(t){for(var e,i=t.split("{"),n=i.length,s=RegExp("(^|[\\s,>+~])("+r().join("|")+")(?=[[\\s,>+~#.:]|$)","gi"),a="$1"+T+"\\:$2";n--;)(e=i[n]=i[n].split("}"))[e.length-1]=e[e.length-1].replace(s,a),i[n]=e.join("}");return i.join("{")}function d(t){function e(){clearTimeout(a._removeSheetTimer),i&&i.removeNode(!0),i=null}var i,r,a=s(t),o=t.namespaces,h=t.parentWindow;return!E||t.printShived?t:(void 0===o[T]&&o.add(T),h.attachEvent("onbeforeprint",function(){e();for(var s,a,o,h=t.styleSheets,c=[],d=h.length,f=Array(d);d--;)f[d]=h[d];for(;o=f.pop();)if(!o.disabled&&w.test(o.media)){try{a=(s=o.imports).length}catch(t){a=0}for(d=0;a>d;d++)f.push(s[d]);try{c.push(o.cssText)}catch(t){}}c=l(c.reverse().join("")),r=u(t),i=n(t,c)}),h.attachEvent("onafterprint",function(){(function(t){for(var e=t.length;e--;)t[e].removeNode()})(r),clearTimeout(a._removeSheetTimer),a._removeSheetTimer=setTimeout(e,500)}),t.printShived=!0,t)}var f,p,g=e.html5||{},m=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,v=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,_="_html5shiv",x=0,y={};!function(){try{var t=i.createElement("a");t.innerHTML="<xyz></xyz>",f="hidden"in t,p=1==t.childNodes.length||function(){i.createElement("a");var t=i.createDocumentFragment();return void 0===t.cloneNode||void 0===t.createDocumentFragment||void 0===t.createElement}()}catch(t){f=!0,p=!0}}();var b={elements:g.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:"3.7.3",shivCSS:!1!==g.shivCSS,supportsUnknownElements:p,shivMethods:!1!==g.shivMethods,type:"default",shivDocument:h,createElement:a,createDocumentFragment:function(t,e){if(t||(t=i),p)return t.createDocumentFragment();for(var n=(e=e||s(t)).frag.cloneNode(),a=0,o=r(),h=o.length;h>a;a++)n.createElement(o[a]);return n},addElements:function(t,e){var i=b.elements;"string"!=typeof i&&(i=i.join(" ")),"string"!=typeof t&&(t=t.join(" ")),b.elements=i+" "+t,h(e)}};e.html5=b,h(i);var w=/^$|\b(?:all|print)\b/,T="html5shiv",E=!p&&function(){var t=i.documentElement;return!(void 0===i.namespaces||void 0===i.parentWindow||void 0===t.applyElement||void 0===t.removeNode||void 0===e.attachEvent)}();b.type+=" print",b.shivPrint=d,d(i),"object"==typeof t&&t.exports&&(t.exports=b)}(void 0!==e?e:this,i);var C=y._config.usePrefixes?" -webkit- -moz- -o- -ms- ".split(" "):["",""];y._prefixes=C;var S=y.testStyles=o;b.addTest("touchevents",function(){var t;if("ontouchstart"in e||e.DocumentTouch&&i instanceof DocumentTouch)t=!0;else{var n=["@media (",C.join("touch-enabled),("),"heartz",")","{#modernizr{top:9px;position:absolute}}"].join("");S(n,function(e){t=9===e.offsetTop})}return t}),b.addTest("applicationcache","applicationCache"in e),b.addTest("canvas",function(){var t=a("canvas");return!(!t.getContext||!t.getContext("2d"))}),b.addTest("canvastext",function(){return!1!==b.canvas&&"function"==typeof a("canvas").getContext("2d").fillText}),b.addTest("webgl",function(){var t=a("canvas"),i="probablySupportsContext"in t?"probablySupportsContext":"supportsContext";return i in t?t[i]("webgl")||t[i]("experimental-webgl"):"WebGLRenderingContext"in e}),b.addTest("geolocation","geolocation"in navigator),b.addTest("postmessage","postMessage"in e),b.addTest("websqldatabase","openDatabase"in e),b.addTest("localstorage",function(){var t="modernizr";try{return localStorage.setItem(t,t),localStorage.removeItem(t),!0}catch(t){return!1}}),b.addTest("sessionstorage",function(){var t="modernizr";try{return sessionStorage.setItem(t,t),sessionStorage.removeItem(t),!0}catch(t){return!1}});var D="Moz O ms Webkit",A=y._config.usePrefixes?D.split(" "):[];y._cssomPrefixes=A;var R={elem:a("modernizr")};b._q.push(function(){delete R.elem});var j={style:R.elem.style};b._q.unshift(function(){delete j.style});var L=y._config.usePrefixes?D.toLowerCase().split(" "):[];y._domPrefixes=L,y.testAllProps=g;var P=function(t){var i,r=C.length,s=e.CSSRule;if(void 0===s)return n;if(!t)return!1;if((i=(t=t.replace(/^@/,"")).replace(/-/g,"_").toUpperCase()+"_RULE")in s)return"@"+t;for(var a=0;r>a;a++){var o=C[a];if(o.toUpperCase()+"_"+i in s)return"@-"+o.toLowerCase()+"-"+t}return!1};y.atRule=P;var M,k=y.prefixed=function(t,e,i){return 0===t.indexOf("@")?P(t):(-1!=t.indexOf("-")&&(t=d(t)),e?g(t,e,i):g(t,"pfx"))};!function(){var t={}.hasOwnProperty;M=r(t,"undefined")||r(t.call,"undefined")?function(t,e){return e in t&&r(t.constructor.prototype[e],"undefined")}:function(e,i){return t.call(e,i)}}(),y._l={},y.on=function(t,e){this._l[t]||(this._l[t]=[]),this._l[t].push(e),b.hasOwnProperty(t)&&setTimeout(function(){b._trigger(t,b[t])},0)},y._trigger=function(t,e){if(this._l[t]){var i=this._l[t];setTimeout(function(){var t;for(t=0;t<i.length;t++)(0,i[t])(e)},0),delete this._l[t]}},b._q.push(function(){y.addTest=m}),b.addAsyncTest(function(){var t;try{t=k("indexedDB",e)}catch(t){}if(t){var i="modernizr-"+Math.random(),n=t.open(i);n.onerror=function(){n.error&&"InvalidStateError"===n.error.name?m("indexeddb",!1):(m("indexeddb",!0),v(t,i))},n.onsuccess=function(){m("indexeddb",!0),v(t,i)}}else m("indexeddb",!1)});var I=function(){var t=!("onblur"in i.documentElement);return function(e,i){var r;return!!e&&(i&&"string"!=typeof i||(i=a(i||"div")),!(r=(e="on"+e)in i)&&t&&(i.setAttribute||(i=a("div")),i.setAttribute(e,""),r="function"==typeof i[e],i[e]!==n&&(i[e]=n),i.removeAttribute(e)),r)}}();y.hasEvent=I,b.addTest("hashchange",function(){return!1!==I("hashchange",e)&&(i.documentMode===n||i.documentMode>7)}),b.addTest("history",function(){var t=navigator.userAgent;return(-1===t.indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone")||"file:"===location.protocol)&&(e.history&&"pushState"in e.history)});var O=!1;try{O="WebSocket"in e&&2===e.WebSocket.CLOSING}catch(t){}b.addTest("websockets",O),y.testAllProps=_,b.addTest("flexbox",_("flexBasis","1px",!0)),b.addTest("rgba",function(){var t=a("a").style;return t.cssText="background-color:rgba(150,255,150,.5)",(""+t.backgroundColor).indexOf("rgba")>-1}),b.addTest("hsla",function(){var t=a("a").style;return t.cssText="background-color:hsla(120,40%,100%,.5)",h(t.backgroundColor,"rgba")||h(t.backgroundColor,"hsla")}),b.addTest("multiplebgs",function(){var t=a("a").style;return t.cssText="background:url(https://),url(https://),red url(https://)",/(url\s*\(.*?){3}/.test(t.background)}),b.addTest("backgroundsize",_("backgroundSize","100%",!0)),b.addTest("borderimage",_("borderImage","url() 1",!0)),b.addTest("boxshadow",_("boxShadow","1px 1px",!0)),b.addTest("borderradius",_("borderRadius","0px",!0));var F=y.testProp=function(t,e,i){return f([t],n,e,i)};b.addTest("textshadow",F("textShadow","1px 1px")),b.addTest("cssanimations",_("animationName","a",!0)),function(){b.addTest("csscolumns",function(){var t=!1,e=_("columnCount");try{(t=!!e)&&(t=new Boolean(t))}catch(t){}return t});for(var t,e,i=["Width","Span","Fill","Gap","Rule","RuleColor","RuleStyle","RuleWidth","BreakBefore","BreakAfter","BreakInside"],n=0;n<i.length;n++)t=i[n].toLowerCase(),e=_("column"+i[n]),("breakbefore"===t||"breakafter"===t||"breakinside"==t)&&(e=e||_(i[n])),b.addTest("csscolumns."+t,e)}(),b.addTest("opacity",function(){var t=a("a").style;return t.cssText=C.join("opacity:.55;"),/^0.55$/.test(t.opacity)}),b.addTest("cssgradients",function(){for(var t,e="background-image:",i="",n=0,r=C.length-1;r>n;n++)t=0===n?"to ":"",i+=e+C[n]+"linear-gradient("+t+"left top, #9f9, white);";b._config.usePrefixes&&(i+=e+"-webkit-gradient(linear,left top,right bottom,from(#9f9),to(white));");var s=a("a").style;return s.cssText=i,(""+s.backgroundImage).indexOf("gradient")>-1}),b.addTest("cssreflections",_("boxReflect","above",!0)),b.addTest("csstransforms",function(){return-1===navigator.userAgent.indexOf("Android 2.")&&_("transform","scale(1)",!0)});var B="CSS"in e&&"supports"in e.CSS,N="supportsCSS"in e;b.addTest("supports",B||N),b.addTest("csstransforms3d",function(){return!!_("perspective","1px",!0)}),b.addTest("csstransitions",_("transition","all",!0)),function(){var t=navigator.userAgent,e=t.match(/w(eb)?osbrowser/gi),i=t.match(/windows phone/gi)&&t.match(/iemobile\/([0-9])+/gi)&&parseFloat(RegExp.$1)>=9;return e||i}()?b.addTest("fontface",!1):S('@font-face {font-family:"font";src:url("https://")}',function(t,e){var n=i.getElementById("smodernizr"),r=n.sheet||n.styleSheet,s=r?r.cssRules&&r.cssRules[0]?r.cssRules[0].cssText:r.cssText||"":"",a=/src/i.test(s)&&0===s.indexOf(e.split(" ")[0]);b.addTest("fontface",a)}),S('#modernizr{font:0/0 a}#modernizr:after{content:":)";visibility:hidden;font:7px/1 a}',function(t){b.addTest("generatedcontent",t.offsetHeight>=6)}),b.addTest("video",function(){var t=a("video"),e=!1;try{(e=!!t.canPlayType)&&((e=new Boolean(e)).ogg=t.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),e.h264=t.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),e.webm=t.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,""),e.vp9=t.canPlayType('video/webm; codecs="vp9"').replace(/^no$/,""),e.hls=t.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(/^no$/,""))}catch(t){}return e}),b.addTest("audio",function(){var t=a("audio"),e=!1;try{(e=!!t.canPlayType)&&((e=new Boolean(e)).ogg=t.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),e.mp3=t.canPlayType('audio/mpeg; codecs="mp3"').replace(/^no$/,""),e.opus=t.canPlayType('audio/ogg; codecs="opus"')||t.canPlayType('audio/webm; codecs="opus"').replace(/^no$/,""),e.wav=t.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),e.m4a=(t.canPlayType("audio/x-m4a;")||t.canPlayType("audio/aac;")).replace(/^no$/,""))}catch(t){}return e}),b.addTest("webworkers","Worker"in e),b.addTest("svg",!!i.createElementNS&&!!i.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect),b.addTest("inlinesvg",function(){var t=a("div");return t.innerHTML="<svg/>","http://www.w3.org/2000/svg"==("undefined"!=typeof SVGRect&&t.firstChild&&t.firstChild.namespaceURI)});var G={}.toString;b.addTest("smil",function(){return!!i.createElementNS&&/SVGAnimate/.test(G.call(i.createElementNS("http://www.w3.org/2000/svg","animate")))}),b.addTest("svgclippaths",function(){return!!i.createElementNS&&/SVGClipPath/.test(G.call(i.createElementNS("http://www.w3.org/2000/svg","clipPath")))}),function(){var t,e,i,n,s,a;for(var o in x)if(x.hasOwnProperty(o)){if(t=[],(e=x[o]).name&&(t.push(e.name.toLowerCase()),e.options&&e.options.aliases&&e.options.aliases.length))for(i=0;i<e.options.aliases.length;i++)t.push(e.options.aliases[i].toLowerCase());for(n=r(e.fn,"function")?e.fn():e.fn,s=0;s<t.length;s++)1===(a=t[s].split(".")).length?b[a[0]]=n:(!b[a[0]]||b[a[0]]instanceof Boolean||(b[a[0]]=new Boolean(b[a[0]])),b[a[0]][a[1]]=n),w.push((n?"":"no-")+a.join("-"))}}(),s(w),delete y.addTest,delete y.addAsyncTest;for(var U=0;U<b._q.length;U++)b._q[U]();e.Modernizr=b}(e,document),t.exports=e.Modernizr,i?e.Modernizr=n:delete e.Modernizr}(window)},30:function(t,e,i){"use strict";i.r(e);var n=i(0),r=i.n(n),s=(i(3),i(1)),a=i(2);i(4);function o(){this.hasVisited=!0,this.appPreloader=null,this.transition=null,this.initialize()}r()(document).ready(function(){new o}),o.prototype.initialize=function(){console.log("Blog.initialize");this.transition=new a.a,this.appPreloader=new s.a(this),this.appPreloader.initialize(),r()(window).on("resize.aboutview",this.onResize.bind(this))},o.prototype.onResize=function(t){this.updateHeader(),this.updateFooter()},o.prototype.appPreloaderComplete=function(){console.log("Blog.appPreloaderComplete"),this.startPreloaderOutTransition()},o.prototype.startPreloaderOutTransition=function(){console.log("Blog.startPreloaderOutTransition"),r()(".preloader").fadeOut(),this.prepareTransition(),this.initializeMenuItems(),this.onResize()},o.prototype.prepareTransition=function(){this.transition.startSequence();const t=r()(".page-title .title").text();r()(".page-title").append("<span></span>"),r()(".page-title span").append(t)},o.prototype.initializeMenuItems=function(){r()(".hassub ul").hide(),r()(".li.hassub .arrow").on("click.submenuarrow",this.subMenuButtonClick.bind(this)),r()(".nav-icon").on("click.menubutton",this.menuButtonClick.bind(this)),r()(".uptotop").on("click.uptotop",this.onScrollBackToTopClick.bind(this))},o.prototype.onScrollBackToTopClick=function(t){r()("body,html").animate({scrollTop:r()("body").scrollTop()},800)},o.prototype.subMenuButtonClick=function(t){r()("li.hassub a").not(this).next("ul").slideUp(),r()(this).next("ul").slideToggle()},o.prototype.menuButtonClick=function(t){r()(this).toggleClass("modal-close")},o.prototype.onScroll=function(t){},o.prototype.updateHeader=function(){const t=r()(".main"),e=r()(".content"),i=r()(window).height();t.css({height:i+"px"}),e.css({"margin-top":i+"px"})},o.prototype.updateFooter=function(){const t=r()(window),e=r()("body"),i=r()("footer");i.height()<t.height()?(e.css({"padding-bottom":i.height()+"px"}),i.css({position:"fixed"})):(e.css({"padding-bottom":"0"}),i.css({position:"relative"}))},o.prototype.destroy=function(){r()(window).off("resize.aboutview"),r()(".li.hassub .arrow").off("click.submenuarrow"),r()(".nav-icon").off("click.menubutton"),r()(".uptotop").off("click.uptotop")}},4:function(t,e){ /*! * EaselJS * Visit http://createjs.com/ for documentation, updates and examples. * * Copyright (c) 2010 gskinner.com, inc. * * 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: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * 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. */ window.createjs=window.createjs||{},createjs.extend=function(t,e){"use strict";function i(){this.constructor=t}return i.prototype=e.prototype,t.prototype=new i},window.createjs=window.createjs||{},createjs.promote=function(t,e){"use strict";var i=t.prototype,n=Object.getPrototypeOf&&Object.getPrototypeOf(i)||i.__proto__;if(n)for(var r in i[(e+="_")+"constructor"]=n.constructor,n)i.hasOwnProperty(r)&&"function"==typeof n[r]&&(i[e+r]=n[r]);return t},window.createjs=window.createjs||{},createjs.indexOf=function(t,e){"use strict";for(var i=0,n=t.length;i<n;i++)if(e===t[i])return i;return-1},window.createjs=window.createjs||{},function(){"use strict";function t(){throw"UID cannot be instantiated"}t._nextID=0,t.get=function(){return t._nextID++},createjs.UID=t}(),window.createjs=window.createjs||{},createjs.deprecate=function(t,e){"use strict";return function(){var i="Deprecated property or method '"+e+"'. See docs for info.";return console&&(console.warn?console.warn(i):console.log(i)),t&&t.apply(this,arguments)}},window.createjs=window.createjs||{},function(){"use strict";function t(t,e,i){this.type=t,this.target=null,this.currentTarget=null,this.eventPhase=0,this.bubbles=!!e,this.cancelable=!!i,this.timeStamp=(new Date).getTime(),this.defaultPrevented=!1,this.propagationStopped=!1,this.immediatePropagationStopped=!1,this.removed=!1}var e=t.prototype;e.preventDefault=function(){this.defaultPrevented=this.cancelable&&!0},e.stopPropagation=function(){this.propagationStopped=!0},e.stopImmediatePropagation=function(){this.immediatePropagationStopped=this.propagationStopped=!0},e.remove=function(){this.removed=!0},e.clone=function(){return new t(this.type,this.bubbles,this.cancelable)},e.set=function(t){for(var e in t)this[e]=t[e];return this},e.toString=function(){return"[Event (type="+this.type+")]"},createjs.Event=t}(),window.createjs=window.createjs||{},function(){"use strict";function t(){this._listeners=null,this._captureListeners=null}var e=t.prototype;t.initialize=function(t){t.addEventListener=e.addEventListener,t.on=e.on,t.removeEventListener=t.off=e.removeEventListener,t.removeAllEventListeners=e.removeAllEventListeners,t.hasEventListener=e.hasEventListener,t.dispatchEvent=e.dispatchEvent,t._dispatchEvent=e._dispatchEvent,t.willTrigger=e.willTrigger},e.addEventListener=function(t,e,i){var n,r=(n=i?this._captureListeners=this._captureListeners||{}:this._listeners=this._listeners||{})[t];return r&&this.removeEventListener(t,e,i),(r=n[t])?r.push(e):n[t]=[e],e},e.on=function(t,e,i,n,r,s){return e.handleEvent&&(i=i||e,e=e.handleEvent),i=i||this,this.addEventListener(t,function(t){e.call(i,t,r),n&&t.remove()},s)},e.removeEventListener=function(t,e,i){var n=i?this._captureListeners:this._listeners;if(n){var r=n[t];if(r)for(var s=0,a=r.length;s<a;s++)if(r[s]==e){1==a?delete n[t]:r.splice(s,1);break}}},e.off=e.removeEventListener,e.removeAllEventListeners=function(t){t?(this._listeners&&delete this._listeners[t],this._captureListeners&&delete this._captureListeners[t]):this._listeners=this._captureListeners=null},e.dispatchEvent=function(t,e,i){if("string"==typeof t){var n=this._listeners;if(!(e||n&&n[t]))return!0;t=new createjs.Event(t,e,i)}else t.target&&t.clone&&(t=t.clone());try{t.target=this}catch(t){}if(t.bubbles&&this.parent){for(var r=this,s=[r];r.parent;)s.push(r=r.parent);var a,o=s.length;for(a=o-1;a>=0&&!t.propagationStopped;a--)s[a]._dispatchEvent(t,1+(0==a));for(a=1;a<o&&!t.propagationStopped;a++)s[a]._dispatchEvent(t,3)}else this._dispatchEvent(t,2);return!t.defaultPrevented},e.hasEventListener=function(t){var e=this._listeners,i=this._captureListeners;return!!(e&&e[t]||i&&i[t])},e.willTrigger=function(t){for(var e=this;e;){if(e.hasEventListener(t))return!0;e=e.parent}return!1},e.toString=function(){return"[EventDispatcher]"},e._dispatchEvent=function(t,e){var i,n,r=e<=2?this._captureListeners:this._listeners;if(t&&r&&(n=r[t.type])&&(i=n.length)){try{t.currentTarget=this}catch(t){}try{t.eventPhase=0|e}catch(t){}t.removed=!1,n=n.slice();for(var s=0;s<i&&!t.immediatePropagationStopped;s++){var a=n[s];a.handleEvent?a.handleEvent(t):a(t),t.removed&&(this.off(t.type,a,1==e),t.removed=!1)}}2===e&&this._dispatchEvent(t,2.1)},createjs.EventDispatcher=t}(),window.createjs=window.createjs||{},function(){"use strict";function t(){throw"Ticker cannot be instantiated."}t.RAF_SYNCHED="synched",t.RAF="raf",t.TIMEOUT="timeout",t.timingMode=null,t.maxDelta=0,t.paused=!1,t.removeEventListener=null,t.removeAllEventListeners=null,t.dispatchEvent=null,t.hasEventListener=null,t._listeners=null,createjs.EventDispatcher.initialize(t),t._addEventListener=t.addEventListener,t.addEventListener=function(){return!t._inited&&t.init(),t._addEventListener.apply(t,arguments)},t._inited=!1,t._startTime=0,t._pausedTime=0,t._ticks=0,t._pausedTicks=0,t._interval=50,t._lastTime=0,t._times=null,t._tickTimes=null,t._timerId=null,t._raf=!0,t._setInterval=function(e){t._interval=e,t._inited&&t._setupTick()},t.setInterval=createjs.deprecate(t._setInterval,"Ticker.setInterval"),t._getInterval=function(){return t._interval},t.getInterval=createjs.deprecate(t._getInterval,"Ticker.getInterval"),t._setFPS=function(e){t._setInterval(1e3/e)},t.setFPS=createjs.deprecate(t._setFPS,"Ticker.setFPS"),t._getFPS=function(){return 1e3/t._interval},t.getFPS=createjs.deprecate(t._getFPS,"Ticker.getFPS");try{Object.defineProperties(t,{interval:{get:t._getInterval,set:t._setInterval},framerate:{get:t._getFPS,set:t._setFPS}})}catch(t){console.log(t)}t.init=function(){t._inited||(t._inited=!0,t._times=[],t._tickTimes=[],t._startTime=t._getTime(),t._times.push(t._lastTime=0),t.interval=t._interval)},t.reset=function(){if(t._raf){var e=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||window.msCancelAnimationFrame;e&&e(t._timerId)}else clearTimeout(t._timerId);t.removeAllEventListeners("tick"),t._timerId=t._times=t._tickTimes=null,t._startTime=t._lastTime=t._ticks=t._pausedTime=0,t._inited=!1},t.getMeasuredTickTime=function(e){var i=0,n=t._tickTimes;if(!n||n.length<1)return-1;e=Math.min(n.length,e||0|t._getFPS());for(var r=0;r<e;r++)i+=n[r];return i/e},t.getMeasuredFPS=function(e){var i=t._times;return!i||i.length<2?-1:(e=Math.min(i.length-1,e||0|t._getFPS()),1e3/((i[0]-i[e])/e))},t.getTime=function(e){return t._startTime?t._getTime()-(e?t._pausedTime:0):-1},t.getEventTime=function(e){return t._startTime?(t._lastTime||t._startTime)-(e?t._pausedTime:0):-1},t.getTicks=function(e){return t._ticks-(e?t._pausedTicks:0)},t._handleSynch=function(){t._timerId=null,t._setupTick(),t._getTime()-t._lastTime>=.97*(t._interval-1)&&t._tick()},t._handleRAF=function(){t._timerId=null,t._setupTick(),t._tick()},t._handleTimeout=function(){t._timerId=null,t._setupTick(),t._tick()},t._setupTick=function(){if(null==t._timerId){var e=t.timingMode;if(e==t.RAF_SYNCHED||e==t.RAF){var i=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;if(i)return t._timerId=i(e==t.RAF?t._handleRAF:t._handleSynch),void(t._raf=!0)}t._raf=!1,t._timerId=setTimeout(t._handleTimeout,t._interval)}},t._tick=function(){var e=t.paused,i=t._getTime(),n=i-t._lastTime;if(t._lastTime=i,t._ticks++,e&&(t._pausedTicks++,t._pausedTime+=n),t.hasEventListener("tick")){var r=new createjs.Event("tick"),s=t.maxDelta;r.delta=s&&n>s?s:n,r.paused=e,r.time=i,r.runTime=i-t._pausedTime,t.dispatchEvent(r)}for(t._tickTimes.unshift(t._getTime()-i);t._tickTimes.length>100;)t._tickTimes.pop();for(t._times.unshift(i);t._times.length>100;)t._times.pop()};var e=window,i=e.performance.now||e.performance.mozNow||e.performance.msNow||e.performance.oNow||e.performance.webkitNow;t._getTime=function(){return(i&&i.call(e.performance)||(new Date).getTime())-t._startTime},createjs.Ticker=t}(),window.createjs=window.createjs||{},function(){"use strict";function t(t){this.readyState=t.readyState,this._video=t,this._canvas=null,this._lastTime=-1,this.readyState<2&&t.addEventListener("canplaythrough",this._videoReady.bind(this))}var e=t.prototype;e.getImage=function(){if(!(this.readyState<2)){var t=this._canvas,e=this._video;if(t||((t=this._canvas=createjs.createCanvas?createjs.createCanvas():document.createElement("canvas")).width=e.videoWidth,t.height=e.videoHeight),e.readyState>=2&&e.currentTime!==this._lastTime){var i=t.getContext("2d");i.clearRect(0,0,t.width,t.height),i.drawImage(e,0,0,t.width,t.height),this._lastTime=e.currentTime}return t}},e._videoReady=function(){this.readyState=2},createjs.VideoBuffer=t}(),window.createjs=window.createjs||{},function(){"use strict";function t(t,e,i,n,r,s,a,o,h,u,c){this.Event_constructor(t,e,i),this.stageX=n,this.stageY=r,this.rawX=null==h?n:h,this.rawY=null==u?r:u,this.nativeEvent=s,this.pointerID=a,this.primary=!!o,this.relatedTarget=c}var e=createjs.extend(t,createjs.Event);e._get_localX=function(){return this.currentTarget.globalToLocal(this.rawX,this.rawY).x},e._get_localY=function(){return this.currentTarget.globalToLocal(this.rawX,this.rawY).y},e._get_isTouch=function(){return-1!==this.pointerID};try{Object.defineProperties(e,{localX:{get:e._get_localX},localY:{get:e._get_localY},isTouch:{get:e._get_isTouch}})}catch(t){}e.clone=function(){return new t(this.type,this.bubbles,this.cancelable,this.stageX,this.stageY,this.nativeEvent,this.pointerID,this.primary,this.rawX,this.rawY)},e.toString=function(){return"[MouseEvent (type="+this.type+" stageX="+this.stageX+" stageY="+this.stageY+")]"},createjs.MouseEvent=createjs.promote(t,"Event")}(),window.createjs=window.createjs||{},function(){"use strict";function t(t,e,i,n,r,s){this.setValues(t,e,i,n,r,s)}var e=t.prototype;t.DEG_TO_RAD=Math.PI/180,t.identity=null,e.setValues=function(t,e,i,n,r,s){return this.a=null==t?1:t,this.b=e||0,this.c=i||0,this.d=null==n?1:n,this.tx=r||0,this.ty=s||0,this},e.append=function(t,e,i,n,r,s){var a=this.a,o=this.b,h=this.c,u=this.d;return 1==t&&0==e&&0==i&&1==n||(this.a=a*t+h*e,this.b=o*t+u*e,this.c=a*i+h*n,this.d=o*i+u*n),this.tx=a*r+h*s+this.tx,this.ty=o*r+u*s+this.ty,this},e.prepend=function(t,e,i,n,r,s){var a=this.a,o=this.c,h=this.tx;return this.a=t*a+i*this.b,this.b=e*a+n*this.b,this.c=t*o+i*this.d,this.d=e*o+n*this.d,this.tx=t*h+i*this.ty+r,this.ty=e*h+n*this.ty+s,this},e.appendMatrix=function(t){return this.append(t.a,t.b,t.c,t.d,t.tx,t.ty)},e.prependMatrix=function(t){return this.prepend(t.a,t.b,t.c,t.d,t.tx,t.ty)},e.appendTransform=function(e,i,n,r,s,a,o,h,u){if(s%360)var c=s*t.DEG_TO_RAD,l=Math.cos(c),d=Math.sin(c);else l=1,d=0;return a||o?(a*=t.DEG_TO_RAD,o*=t.DEG_TO_RAD,this.append(Math.cos(o),Math.sin(o),-Math.sin(a),Math.cos(a),e,i),this.append(l*n,d*n,-d*r,l*r,0,0)):this.append(l*n,d*n,-d*r,l*r,e,i),(h||u)&&(this.tx-=h*this.a+u*this.c,this.ty-=h*this.b+u*this.d),this},e.prependTransform=function(e,i,n,r,s,a,o,h,u){if(s%360)var c=s*t.DEG_TO_RAD,l=Math.cos(c),d=Math.sin(c);else l=1,d=0;return(h||u)&&(this.tx-=h,this.ty-=u),a||o?(a*=t.DEG_TO_RAD,o*=t.DEG_TO_RAD,this.prepend(l*n,d*n,-d*r,l*r,0,0),this.prepend(Math.cos(o),Math.sin(o),-Math.sin(a),Math.cos(a),e,i)):this.prepend(l*n,d*n,-d*r,l*r,e,i),this},e.rotate=function(e){e*=t.DEG_TO_RAD;var i=Math.cos(e),n=Math.sin(e),r=this.a,s=this.b;return this.a=r*i+this.c*n,this.b=s*i+this.d*n,this.c=-r*n+this.c*i,this.d=-s*n+this.d*i,this},e.skew=function(e,i){return e*=t.DEG_TO_RAD,i*=t.DEG_TO_RAD,this.append(Math.cos(i),Math.sin(i),-Math.sin(e),Math.cos(e),0,0),this},e.scale=function(t,e){return this.a*=t,this.b*=t,this.c*=e,this.d*=e,this},e.translate=function(t,e){return this.tx+=this.a*t+this.c*e,this.ty+=this.b*t+this.d*e,this},e.identity=function(){return this.a=this.d=1,this.b=this.c=this.tx=this.ty=0,this},e.invert=function(){var t=this.a,e=this.b,i=this.c,n=this.d,r=this.tx,s=t*n-e*i;return this.a=n/s,this.b=-e/s,this.c=-i/s,this.d=t/s,this.tx=(i*this.ty-n*r)/s,this.ty=-(t*this.ty-e*r)/s,this},e.isIdentity=function(){return 0===this.tx&&0===this.ty&&1===this.a&&0===this.b&&0===this.c&&1===this.d},e.equals=function(t){return this.tx===t.tx&&this.ty===t.ty&&this.a===t.a&&this.b===t.b&&this.c===t.c&&this.d===t.d},e.transformPoint=function(t,e,i){return(i=i||{}).x=t*this.a+e*this.c+this.tx,i.y=t*this.b+e*this.d+this.ty,i},e.decompose=function(e){null==e&&(e={}),e.x=this.tx,e.y=this.ty,e.scaleX=Math.sqrt(this.a*this.a+this.b*this.b),e.scaleY=Math.sqrt(this.c*this.c+this.d*this.d);var i=Math.atan2(-this.c,this.d),n=Math.atan2(this.b,this.a);return Math.abs(1-i/n)<1e-5?(e.rotation=n/t.DEG_TO_RAD,this.a<0&&this.d>=0&&(e.rotation+=e.rotation<=0?180:-180),e.skewX=e.skewY=0):(e.skewX=i/t.DEG_TO_RAD,e.skewY=n/t.DEG_TO_RAD),e},e.copy=function(t){return this.setValues(t.a,t.b,t.c,t.d,t.tx,t.ty)},e.clone=function(){return new t(this.a,this.b,this.c,this.d,this.tx,this.ty)},e.toString=function(){return"[Matrix2D (a="+this.a+" b="+this.b+" c="+this.c+" d="+this.d+" tx="+this.tx+" ty="+this.ty+")]"},t.identity=new t,createjs.Matrix2D=t}(),window.createjs=window.createjs||{},function(){"use strict";function t(t,e,i,n,r){this.setValues(t,e,i,n,r)}var e=t.prototype;e.setValues=function(t,e,i,n,r){return this.visible=null==t||!!t,this.alpha=null==e?1:e,this.shadow=i,this.compositeOperation=n,this.matrix=r||this.matrix&&this.matrix.identity()||new createjs.Matrix2D,this},e.append=function(t,e,i,n,r){return this.alpha*=e,this.shadow=i||this.shadow,this.compositeOperation=n||this.compositeOperation,this.visible=this.visible&&t,r&&this.matrix.appendMatrix(r),this},e.prepend=function(t,e,i,n,r){return this.alpha*=e,this.shadow=this.shadow||i,this.compositeOperation=this.compositeOperation||n,this.visible=this.visible&&t,r&&this.matrix.prependMatrix(r),this},e.identity=function(){return this.visible=!0,this.alpha=1,this.shadow=this.compositeOperation=null,this.matrix.identity(),this},e.clone=function(){return new t(this.alpha,this.shadow,this.compositeOperation,this.visible,this.matrix.clone())},createjs.DisplayProps=t}(),window.createjs=window.createjs||{},function(){"use strict";function t(t,e){this.setValues(t,e)}var e=t.prototype;e.setValues=function(t,e){return this.x=t||0,this.y=e||0,this},e.copy=function(t){return this.x=t.x,this.y=t.y,this},e.clone=function(){return new t(this.x,this.y)},e.toString=function(){return"[Point (x="+this.x+" y="+this.y+")]"},createjs.Point=t}(),window.createjs=window.createjs||{},function(){"use strict";function t(t,e,i,n){this.setValues(t,e,i,n)}var e=t.prototype;e.setValues=function(t,e,i,n){return this.x=t||0,this.y=e||0,this.width=i||0,this.height=n||0,this},e.extend=function(t,e,i,n){return i=i||0,n=n||0,t+i>this.x+this.width&&(this.width=t+i-this.x),e+n>this.y+this.height&&(this.height=e+n-this.y),t<this.x&&(this.width+=this.x-t,this.x=t),e<this.y&&(this.height+=this.y-e,this.y=e),this},e.pad=function(t,e,i,n){return this.x-=e,this.y-=t,this.width+=e+n,this.height+=t+i,this},e.copy=function(t){return this.setValues(t.x,t.y,t.width,t.height)},e.contains=function(t,e,i,n){return i=i||0,n=n||0,t>=this.x&&t+i<=this.x+this.width&&e>=this.y&&e+n<=this.y+this.height},e.union=function(t){return this.clone().extend(t.x,t.y,t.width,t.height)},e.intersection=function(e){var i=e.x,n=e.y,r=i+e.width,s=n+e.height;return this.x>i&&(i=this.x),this.y>n&&(n=this.y),this.x+this.width<r&&(r=this.x+this.width),this.y+this.height<s&&(s=this.y+this.height),r<=i||s<=n?null:new t(i,n,r-i,s-n)},e.intersects=function(t){return t.x<=this.x+this.width&&this.x<=t.x+t.width&&t.y<=this.y+this.height&&this.y<=t.y+t.height},e.isEmpty=function(){return this.width<=0||this.height<=0},e.clone=function(){return new t(this.x,this.y,this.width,this.height)},e.toString=function(){return"[Rectangle (x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+")]"},createjs.Rectangle=t}(),window.createjs=window.createjs||{},function(){"use strict";function t(t,e,i,n,r,s,a){t.addEventListener&&(this.target=t,this.overLabel=null==i?"over":i,this.outLabel=null==e?"out":e,this.downLabel=null==n?"down":n,this.play=r,this._isPressed=!1,this._isOver=!1,this._enabled=!1,t.mouseChildren=!1,this.enabled=!0,this.handleEvent({}),s&&(a&&(s.actionsEnabled=!1,s.gotoAndStop&&s.gotoAndStop(a)),t.hitArea=s))}var e=t.prototype;e._setEnabled=function(t){if(t!=this._enabled){var e=this.target;this._enabled=t,t?(e.cursor="pointer",e.addEventListener("rollover",this),e.addEventListener("rollout",this),e.addEventListener("mousedown",this),e.addEventListener("pressup",this),e._reset&&(e.__reset=e._reset,e._reset=this._reset)):(e.cursor=null,e.removeEventListener("rollover",this),e.removeEventListener("rollout",this),e.removeEventListener("mousedown",this),e.removeEventListener("pressup",this),e.__reset&&(e._reset=e.__reset,delete e.__reset))}},e.setEnabled=createjs.deprecate(e._setEnabled,"ButtonHelper.setEnabled"),e._getEnabled=function(){return this._enabled},e.getEnabled=createjs.deprecate(e._getEnabled,"ButtonHelper.getEnabled");try{Object.defineProperties(e,{enabled:{get:e._getEnabled,set:e._setEnabled}})}catch(t){}e.toString=function(){return"[ButtonHelper]"},e.handleEvent=function(t){var e,i=this.target,n=t.type;"mousedown"==n?(this._isPressed=!0,e=this.downLabel):"pressup"==n?(this._isPressed=!1,e=this._isOver?this.overLabel:this.outLabel):"rollover"==n?(this._isOver=!0,e=this._isPressed?this.downLabel:this.overLabel):(this._isOver=!1,e=this._isPressed?this.overLabel:this.outLabel),this.play?i.gotoAndPlay&&i.gotoAndPlay(e):i.gotoAndStop&&i.gotoAndStop(e)},e._reset=function(){var t=this.paused;this.__reset(),this.paused=t},createjs.ButtonHelper=t}(),window.createjs=window.createjs||{},function(){"use strict";function t(t,e,i,n){this.color=t||"black",this.offsetX=e||0,this.offsetY=i||0,this.blur=n||0}var e=t.prototype;t.identity=new t("transparent",0,0,0),e.toString=function(){return"[Shadow]"},e.clone=function(){return new t(this.color,this.offsetX,this.offsetY,this.blur)},createjs.Shadow=t}(),window.createjs=window.createjs||{},function(){"use strict";function t(t){this.EventDispatcher_constructor(),this.complete=!0,this.framerate=0,this._animations=null,this._frames=null,this._images=null,this._data=null,this._loadCount=0,this._frameHeight=0,this._frameWidth=0,this._numFrames=0,this._regX=0,this._regY=0,this._spacing=0,this._margin=0,this._parseData(t)}var e=createjs.extend(t,createjs.EventDispatcher);e._getAnimations=function(){return this._animations.slice()},e.getAnimations=createjs.deprecate(e._getAnimations,"SpriteSheet.getAnimations");try{Object.defineProperties(e,{animations:{get:e._getAnimations}})}catch(t){}e.getNumFrames=function(t){if(null==t)return this._frames?this._frames.length:this._numFrames||0;var e=this._data[t];return null==e?0:e.frames.length},e.getAnimation=function(t){return this._data[t]},e.getFrame=function(t){var e;return this._frames&&(e=this._frames[t])?e:null},e.getFrameBounds=function(t,e){var i=this.getFrame(t);return i?(e||new createjs.Rectangle).setValues(-i.regX,-i.regY,i.rect.width,i.rect.height):null},e.toString=function(){return"[SpriteSheet]"},e.clone=function(){throw"SpriteSheet cannot be cloned."},e._parseData=function(t){var e,i,n,r;if(null!=t){if(this.framerate=t.framerate||0,t.images&&(i=t.images.length)>0)for(r=this._images=[],e=0;e<i;e++){var s=t.images[e];if("string"==typeof s){var a=s;(s=document.createElement("img")).src=a}r.push(s),s.getContext||s.naturalWidth||(this._loadCount++,this.complete=!1,function(t,e){s.onload=function(){t._handleImageLoad(e)}}(this,a),function(t,e){s.onerror=function(){t._handleImageError(e)}}(this,a))}if(null==t.frames);else if(Array.isArray(t.frames))for(this._frames=[],e=0,i=(r=t.frames).length;e<i;e++){var o=r[e];this._frames.push({image:this._images[o[4]?o[4]:0],rect:new createjs.Rectangle(o[0],o[1],o[2],o[3]),regX:o[5]||0,regY:o[6]||0})}else n=t.frames,this._frameWidth=n.width,this._frameHeight=n.height,this._regX=n.regX||0,this._regY=n.regY||0,this._spacing=n.spacing||0,this._margin=n.margin||0,this._numFrames=n.count,0==this._loadCount&&this._calculateFrames();var h;if(this._animations=[],null!=(n=t.animations))for(h in this._data={},n){var u={name:h},c=n[h];if("number"==typeof c)r=u.frames=[c];else if(Array.isArray(c))if(1==c.length)u.frames=[c[0]];else for(u.speed=c[3],u.next=c[2],r=u.frames=[],e=c[0];e<=c[1];e++)r.push(e);else{u.speed=c.speed,u.next=c.next;var l=c.frames;r=u.frames="number"==typeof l?[l]:l.slice(0)}!0!==u.next&&void 0!==u.next||(u.next=h),(!1===u.next||r.length<2&&u.next==h)&&(u.next=null),u.speed||(u.speed=1),this._animations.push(h),this._data[h]=u}}},e._handleImageLoad=function(t){0==--this._loadCount&&(this._calculateFrames(),this.complete=!0,this.dispatchEvent("complete"))},e._handleImageError=function(t){var e=new createjs.Event("error");e.src=t,this.dispatchEvent(e),0==--this._loadCount&&this.dispatchEvent("complete")},e._calculateFrames=function(){if(!this._frames&&0!=this._frameWidth){this._frames=[];var t=this._numFrames||1e5,e=0,i=this._frameWidth,n=this._frameHeight,r=this._spacing,s=this._margin;t:for(var a=0,o=this._images;a<o.length;a++)for(var h=o[a],u=h.width||h.naturalWidth,c=h.height||h.naturalHeight,l=s;l<=c-s-n;){for(var d=s;d<=u-s-i;){if(e>=t)break t;e++,this._frames.push({image:h,rect:new createjs.Rectangle(d,l,i,n),regX:this._regX,regY:this._regY}),d+=i+r}l+=n+r}this._numFrames=e}},createjs.SpriteSheet=createjs.promote(t,"EventDispatcher")}(),window.createjs=window.createjs||{},function(){"use strict";function t(){this.command=null,this._stroke=null,this._strokeStyle=null,this._oldStrokeStyle=null,this._strokeDash=null,this._oldStrokeDash=null,this._strokeIgnoreScale=!1,this._fill=null,this._instructions=[],this._commitIndex=0,this._activeInstructions=[],this._dirty=!1,this._storeIndex=0,this.clear()}var e=t.prototype,i=t;t.getRGB=function(t,e,i,n){return null!=t&&null==i&&(n=e,i=255&t,e=t>>8&255,t=t>>16&255),null==n?"rgb("+t+","+e+","+i+")":"rgba("+t+","+e+","+i+","+n+")"},t.getHSL=function(t,e,i,n){return null==n?"hsl("+t%360+","+e+"%,"+i+"%)":"hsla("+t%360+","+e+"%,"+i+"%,"+n+")"},t.BASE_64={A:0,B:1,C:2,D:3,E:4,F:5,G:6,H:7,I:8,J:9,K:10,L:11,M:12,N:13,O:14,P:15,Q:16,R:17,S:18,T:19,U:20,V:21,W:22,X:23,Y:24,Z:25,a:26,b:27,c:28,d:29,e:30,f:31,g:32,h:33,i:34,j:35,k:36,l:37,m:38,n:39,o:40,p:41,q:42,r:43,s:44,t:45,u:46,v:47,w:48,x:49,y:50,z:51,0:52,1:53,2:54,3:55,4:56,5:57,6:58,7:59,8:60,9:61,"+":62,"/":63},t.STROKE_CAPS_MAP=["butt","round","square"],t.STROKE_JOINTS_MAP=["miter","round","bevel"];var n=createjs.createCanvas?createjs.createCanvas():document.createElement("canvas");n.getContext&&(t._ctx=n.getContext("2d"),n.width=n.height=1),e._getInstructions=function(){return this._updateInstructions(),this._instructions},e.getInstructions=createjs.deprecate(e._getInstructions,"Graphics.getInstructions");try{Object.defineProperties(e,{instructions:{get:e._getInstructions}})}catch(t){}e.isEmpty=function(){return!(this._instructions.length||this._activeInstructions.length)},e.draw=function(t,e){this._updateInstructions();for(var i=this._instructions,n=this._storeIndex,r=i.length;n<r;n++)i[n].exec(t,e)},e.drawAsPath=function(t){this._updateInstructions();for(var e,i=this._instructions,n=this._storeIndex,r=i.length;n<r;n++)!1!==(e=i[n]).path&&e.exec(t)},e.moveTo=function(t,e){return this.append(new i.MoveTo(t,e),!0)},e.lineTo=function(t,e){return this.append(new i.LineTo(t,e))},e.arcTo=function(t,e,n,r,s){return this.append(new i.ArcTo(t,e,n,r,s))},e.arc=function(t,e,n,r,s,a){return this.append(new i.Arc(t,e,n,r,s,a))},e.quadraticCurveTo=function(t,e,n,r){return this.append(new i.QuadraticCurveTo(t,e,n,r))},e.bezierCurveTo=function(t,e,n,r,s,a){return this.append(new i.BezierCurveTo(t,e,n,r,s,a))},e.rect=function(t,e,n,r){return this.append(new i.Rect(t,e,n,r))},e.closePath=function(){return this._activeInstructions.length?this.append(new i.ClosePath):this},e.clear=function(){return this._instructions.length=this._activeInstructions.length=this._commitIndex=0,this._strokeStyle=this._oldStrokeStyle=this._stroke=this._fill=this._strokeDash=this._oldStrokeDash=null,this._dirty=this._strokeIgnoreScale=!1,this},e.beginFill=function(t){return this._setFill(t?new i.Fill(t):null)},e.beginLinearGradientFill=function(t,e,n,r,s,a){return this._setFill((new i.Fill).linearGradient(t,e,n,r,s,a))},e.beginRadialGradientFill=function(t,e,n,r,s,a,o,h){return this._setFill((new i.Fill).radialGradient(t,e,n,r,s,a,o,h))},e.beginBitmapFill=function(t,e,n){return this._setFill(new i.Fill(null,n).bitmap(t,e))},e.endFill=function(){return this.beginFill()},e.setStrokeStyle=function(t,e,n,r,s){return this._updateInstructions(!0),this._strokeStyle=this.command=new i.StrokeStyle(t,e,n,r,s),this._stroke&&(this._stroke.ignoreScale=s),this._strokeIgnoreScale=s,this},e.setStrokeDash=function(t,e){return this._updateInstructions(!0),this._strokeDash=this.command=new i.StrokeDash(t,e),this},e.beginStroke=function(t){return this._setStroke(t?new i.Stroke(t):null)},e.beginLinearGradientStroke=function(t,e,n,r,s,a){return this._setStroke((new i.Stroke).linearGradient(t,e,n,r,s,a))},e.beginRadialGradientStroke=function(t,e,n,r,s,a,o,h){return this._setStroke((new i.Stroke).radialGradient(t,e,n,r,s,a,o,h))},e.beginBitmapStroke=function(t,e){return this._setStroke((new i.Stroke).bitmap(t,e))},e.endStroke=function(){return this.beginStroke()},e.curveTo=e.quadraticCurveTo,e.drawRect=e.rect,e.drawRoundRect=function(t,e,i,n,r){return this.drawRoundRectComplex(t,e,i,n,r,r,r,r)},e.drawRoundRectComplex=function(t,e,n,r,s,a,o,h){return this.append(new i.RoundRect(t,e,n,r,s,a,o,h))},e.drawCircle=function(t,e,n){return this.append(new i.Circle(t,e,n))},e.drawEllipse=function(t,e,n,r){return this.append(new i.Ellipse(t,e,n,r))},e.drawPolyStar=function(t,e,n,r,s,a){return this.append(new i.PolyStar(t,e,n,r,s,a))},e.append=function(t,e){return this._activeInstructions.push(t),this.command=t,e||(this._dirty=!0),this},e.decodePath=function(e){for(var i=[this.moveTo,this.lineTo,this.quadraticCurveTo,this.bezierCurveTo,this.closePath],n=[2,2,4,6,0],r=0,s=e.length,a=[],o=0,h=0,u=t.BASE_64;r<s;){var c=e.charAt(r),l=u[c],d=l>>3,f=i[d];if(!f||3&l)throw"bad path data (@"+r+"): "+c;var p=n[d];d||(o=h=0),a.length=0,r++;for(var g=2+(l>>2&1),m=0;m<p;m++){var v=u[e.charAt(r)],_=v>>5?-1:1;v=(31&v)<<6|u[e.charAt(r+1)],3==g&&(v=v<<6|u[e.charAt(r+2)]),v=_*v/10,m%2?o=v+=o:h=v+=h,a[m]=v,r+=g}f.apply(this,a)}return this},e.store=function(){return this._updateInstructions(!0),this._storeIndex=this._instructions.length,this},e.unstore=function(){return this._storeIndex=0,this},e.clone=function(){var e=new t;return e.command=this.command,e._stroke=this._stroke,e._strokeStyle=this._strokeStyle,e._strokeDash=this._strokeDash,e._strokeIgnoreScale=this._strokeIgnoreScale,e._fill=this._fill,e._instructions=this._instructions.slice(),e._commitIndex=this._commitIndex,e._activeInstructions=this._activeInstructions.slice(),e._dirty=this._dirty,e._storeIndex=this._storeIndex,e},e.toString=function(){return"[Graphics]"},e.mt=e.moveTo,e.lt=e.lineTo,e.at=e.arcTo,e.bt=e.bezierCurveTo,e.qt=e.quadraticCurveTo,e.a=e.arc,e.r=e.rect,e.cp=e.closePath,e.c=e.clear,e.f=e.beginFill,e.lf=e.beginLinearGradientFill,e.rf=e.beginRadialGradientFill,e.bf=e.beginBitmapFill,e.ef=e.endFill,e.ss=e.setStrokeStyle,e.sd=e.setStrokeDash,e.s=e.beginStroke,e.ls=e.beginLinearGradientStroke,e.rs=e.beginRadialGradientStroke,e.bs=e.beginBitmapStroke,e.es=e.endStroke,e.dr=e.drawRect,e.rr=e.drawRoundRect,e.rc=e.drawRoundRectComplex,e.dc=e.drawCircle,e.de=e.drawEllipse,e.dp=e.drawPolyStar,e.p=e.decodePath,e._updateInstructions=function(e){var i=this._instructions,n=this._activeInstructions,r=this._commitIndex;if(this._dirty&&n.length){i.length=r,i.push(t.beginCmd);var s=n.length,a=i.length;i.length=a+s;for(var o=0;o<s;o++)i[o+a]=n[o];this._fill&&i.push(this._fill),this._stroke&&(this._strokeDash!==this._oldStrokeDash&&i.push(this._strokeDash),this._strokeStyle!==this._oldStrokeStyle&&i.push(this._strokeStyle),e&&(this._oldStrokeStyle=this._strokeStyle,this._oldStrokeDash=this._strokeDash),i.push(this._stroke)),this._dirty=!1}e&&(n.length=0,this._commitIndex=i.length)},e._setFill=function(t){return this._updateInstructions(!0),this.command=this._fill=t,this},e._setStroke=function(t){return this._updateInstructions(!0),(this.command=this._stroke=t)&&(t.ignoreScale=this._strokeIgnoreScale),this},(i.LineTo=function(t,e){this.x=t,this.y=e}).prototype.exec=function(t){t.lineTo(this.x,this.y)},(i.MoveTo=function(t,e){this.x=t,this.y=e}).prototype.exec=function(t){t.moveTo(this.x,this.y)},(i.ArcTo=function(t,e,i,n,r){this.x1=t,this.y1=e,this.x2=i,this.y2=n,this.radius=r}).prototype.exec=function(t){t.arcTo(this.x1,this.y1,this.x2,this.y2,this.radius)},(i.Arc=function(t,e,i,n,r,s){this.x=t,this.y=e,this.radius=i,this.startAngle=n,this.endAngle=r,this.anticlockwise=!!s}).prototype.exec=function(t){t.arc(this.x,this.y,this.radius,this.startAngle,this.endAngle,this.anticlockwise)},(i.QuadraticCurveTo=function(t,e,i,n){this.cpx=t,this.cpy=e,this.x=i,this.y=n}).prototype.exec=function(t){t.quadraticCurveTo(this.cpx,this.cpy,this.x,this.y)},(i.BezierCurveTo=function(t,e,i,n,r,s){this.cp1x=t,this.cp1y=e,this.cp2x=i,this.cp2y=n,this.x=r,this.y=s}).prototype.exec=function(t){t.bezierCurveTo(this.cp1x,this.cp1y,this.cp2x,this.cp2y,this.x,this.y)},(i.Rect=function(t,e,i,n){this.x=t,this.y=e,this.w=i,this.h=n}).prototype.exec=function(t){t.rect(this.x,this.y,this.w,this.h)},(i.ClosePath=function(){}).prototype.exec=function(t){t.closePath()},(i.BeginPath=function(){}).prototype.exec=function(t){t.beginPath()},(e=(i.Fill=function(t,e){this.style=t,this.matrix=e}).prototype).exec=function(t){if(this.style){t.fillStyle=this.style;var e=this.matrix;e&&(t.save(),t.transform(e.a,e.b,e.c,e.d,e.tx,e.ty)),t.fill(),e&&t.restore()}},e.linearGradient=function(e,i,n,r,s,a){for(var o=this.style=t._ctx.createLinearGradient(n,r,s,a),h=0,u=e.length;h<u;h++)o.addColorStop(i[h],e[h]);return o.props={colors:e,ratios:i,x0:n,y0:r,x1:s,y1:a,type:"linear"},this},e.radialGradient=function(e,i,n,r,s,a,o,h){for(var u=this.style=t._ctx.createRadialGradient(n,r,s,a,o,h),c=0,l=e.length;c<l;c++)u.addColorStop(i[c],e[c]);return u.props={colors:e,ratios:i,x0:n,y0:r,r0:s,x1:a,y1:o,r1:h,type:"radial"},this},e.bitmap=function(e,i){(e.naturalWidth||e.getContext||e.readyState>=2)&&((this.style=t._ctx.createPattern(e,i||"")).props={image:e,repetition:i,type:"bitmap"});return this},e.path=!1,(e=(i.Stroke=function(t,e){this.style=t,this.ignoreScale=e}).prototype).exec=function(t){this.style&&(t.strokeStyle=this.style,this.ignoreScale&&(t.save(),t.setTransform(1,0,0,1,0,0)),t.stroke(),this.ignoreScale&&t.restore())},e.linearGradient=i.Fill.prototype.linearGradient,e.radialGradient=i.Fill.prototype.radialGradient,e.bitmap=i.Fill.prototype.bitmap,e.path=!1,(e=(i.StrokeStyle=function(t,e,i,n,r){this.width=t,this.caps=e,this.joints=i,this.miterLimit=n,this.ignoreScale=r}).prototype).exec=function(e){e.lineWidth=null==this.width?"1":this.width,e.lineCap=null==this.caps?"butt":isNaN(this.caps)?this.caps:t.STROKE_CAPS_MAP[this.caps],e.lineJoin=null==this.joints?"miter":isNaN(this.joints)?this.joints:t.STROKE_JOINTS_MAP[this.joints],e.miterLimit=null==this.miterLimit?"10":this.miterLimit,e.ignoreScale=null!=this.ignoreScale&&this.ignoreScale},e.path=!1,(i.StrokeDash=function(t,e){this.segments=t,this.offset=e||0}).prototype.exec=function(t){t.setLineDash&&(t.setLineDash(this.segments||i.StrokeDash.EMPTY_SEGMENTS),t.lineDashOffset=this.offset||0)},i.StrokeDash.EMPTY_SEGMENTS=[],(i.RoundRect=function(t,e,i,n,r,s,a,o){this.x=t,this.y=e,this.w=i,this.h=n,this.radiusTL=r,this.radiusTR=s,this.radiusBR=a,this.radiusBL=o}).prototype.exec=function(t){var e=(h<u?h:u)/2,i=0,n=0,r=0,s=0,a=this.x,o=this.y,h=this.w,u=this.h,c=this.radiusTL,l=this.radiusTR,d=this.radiusBR,f=this.radiusBL;c<0&&(c*=i=-1),c>e&&(c=e),l<0&&(l*=n=-1),l>e&&(l=e),d<0&&(d*=r=-1),d>e&&(d=e),f<0&&(f*=s=-1),f>e&&(f=e),t.moveTo(a+h-l,o),t.arcTo(a+h+l*n,o-l*n,a+h,o+l,l),t.lineTo(a+h,o+u-d),t.arcTo(a+h+d*r,o+u+d*r,a+h-d,o+u,d),t.lineTo(a+f,o+u),t.arcTo(a-f*s,o+u+f*s,a,o+u-f,f),t.lineTo(a,o+c),t.arcTo(a-c*i,o-c*i,a+c,o,c),t.closePath()},(i.Circle=function(t,e,i){this.x=t,this.y=e,this.radius=i}).prototype.exec=function(t){t.arc(this.x,this.y,this.radius,0,2*Math.PI)},(i.Ellipse=function(t,e,i,n){this.x=t,this.y=e,this.w=i,this.h=n}).prototype.exec=function(t){var e=this.x,i=this.y,n=this.w,r=this.h,s=.5522848,a=n/2*s,o=r/2*s,h=e+n,u=i+r,c=e+n/2,l=i+r/2;t.moveTo(e,l),t.bezierCurveTo(e,l-o,c-a,i,c,i),t.bezierCurveTo(c+a,i,h,l-o,h,l),t.bezierCurveTo(h,l+o,c+a,u,c,u),t.bezierCurveTo(c-a,u,e,l+o,e,l)},(i.PolyStar=function(t,e,i,n,r,s){this.x=t,this.y=e,this.radius=i,this.sides=n,this.pointSize=r,this.angle=s}).prototype.exec=function(t){var e=this.x,i=this.y,n=this.radius,r=(this.angle||0)/180*Math.PI,s=this.sides,a=1-(this.pointSize||0),o=Math.PI/s;t.moveTo(e+Math.cos(r)*n,i+Math.sin(r)*n);for(var h=0;h<s;h++)r+=o,1!=a&&t.lineTo(e+Math.cos(r)*n*a,i+Math.sin(r)*n*a),r+=o,t.lineTo(e+Math.cos(r)*n,i+Math.sin(r)*n);t.closePath()},t.beginCmd=new i.BeginPath,createjs.Graphics=t}(),window.createjs=window.createjs||{},function(){"use strict";function t(){this.EventDispatcher_constructor(),this.alpha=1,this.cacheCanvas=null,this.bitmapCache=null,this.id=createjs.UID.get(),this.mouseEnabled=!0,this.tickEnabled=!0,this.name=null,this.parent=null,this.regX=0,this.regY=0,this.rotation=0,this.scaleX=1,this.scaleY=1,this.skewX=0,this.skewY=0,this.shadow=null,this.visible=!0,this.x=0,this.y=0,this.transformMatrix=null,this.compositeOperation=null,this.snapToPixel=!0,this.filters=null,this.mask=null,this.hitArea=null,this.cursor=null,this._props=new createjs.DisplayProps,this._rectangle=new createjs.Rectangle,this._bounds=null,this._webGLRenderStyle=t._StageGL_NONE}var e=createjs.extend(t,createjs.EventDispatcher);t._MOUSE_EVENTS=["click","dblclick","mousedown","mouseout","mouseover","pressmove","pressup","rollout","rollover"],t.suppressCrossDomainErrors=!1,t._snapToPixelEnabled=!1,t._StageGL_NONE=0,t._StageGL_SPRITE=1,t._StageGL_BITMAP=2;var i=createjs.createCanvas?createjs.createCanvas():document.createElement("canvas");i.getContext&&(t._hitTestCanvas=i,t._hitTestContext=i.getContext("2d"),i.width=i.height=1),e._getStage=function(){for(var t=this,e=createjs.Stage;t.parent;)t=t.parent;return t instanceof e?t:null},e.getStage=createjs.deprecate(e._getStage,"DisplayObject.getStage");try{Object.defineProperties(e,{stage:{get:e._getStage},cacheID:{get:function(){return this.bitmapCache&&this.bitmapCache.cacheID},set:function(t){this.bitmapCache&&(this.bitmapCache.cacheID=t)}},scale:{get:function(){return this.scaleX},set:function(t){this.scaleX=this.scaleY=t}}})}catch(t){}e.isVisible=function(){return!!(this.visible&&this.alpha>0&&0!=this.scaleX&&0!=this.scaleY)},e.draw=function(t,e){var i=this.bitmapCache;return!(!i||e)&&i.draw(t)},e.updateContext=function(e){var i=this,n=i.mask,r=i._props.matrix;n&&n.graphics&&!n.graphics.isEmpty()&&(n.getMatrix(r),e.transform(r.a,r.b,r.c,r.d,r.tx,r.ty),n.graphics.drawAsPath(e),e.clip(),r.invert(),e.transform(r.a,r.b,r.c,r.d,r.tx,r.ty)),this.getMatrix(r);var s=r.tx,a=r.ty;t._snapToPixelEnabled&&i.snapToPixel&&(s=s+(s<0?-.5:.5)|0,a=a+(a<0?-.5:.5)|0),e.transform(r.a,r.b,r.c,r.d,s,a),e.globalAlpha*=i.alpha,i.compositeOperation&&(e.globalCompositeOperation=i.compositeOperation),i.shadow&&this._applyShadow(e,i.shadow)},e.cache=function(t,e,i,n,r,s){this.bitmapCache||(this.bitmapCache=new createjs.BitmapCache),this.bitmapCache.define(this,t,e,i,n,r,s)},e.updateCache=function(t){if(!this.bitmapCache)throw"cache() must be called before updateCache()";this.bitmapCache.update(t)},e.uncache=function(){this.bitmapCache&&(this.bitmapCache.release(),this.bitmapCache=void 0)},e.getCacheDataURL=function(){return this.bitmapCache?this.bitmapCache.getDataURL():null},e.localToGlobal=function(t,e,i){return this.getConcatenatedMatrix(this._props.matrix).transformPoint(t,e,i||new createjs.Point)},e.globalToLocal=function(t,e,i){return this.getConcatenatedMatrix(this._props.matrix).invert().transformPoint(t,e,i||new createjs.Point)},e.localToLocal=function(t,e,i,n){return n=this.localToGlobal(t,e,n),i.globalToLocal(n.x,n.y,n)},e.setTransform=function(t,e,i,n,r,s,a,o,h){return this.x=t||0,this.y=e||0,this.scaleX=null==i?1:i,this.scaleY=null==n?1:n,this.rotation=r||0,this.skewX=s||0,this.skewY=a||0,this.regX=o||0,this.regY=h||0,this},e.getMatrix=function(t){var e=this,i=t&&t.identity()||new createjs.Matrix2D;return e.transformMatrix?i.copy(e.transformMatrix):i.appendTransform(e.x,e.y,e.scaleX,e.scaleY,e.rotation,e.skewX,e.skewY,e.regX,e.regY)},e.getConcatenatedMatrix=function(t){for(var e=this,i=this.getMatrix(t);e=e.parent;)i.prependMatrix(e.getMatrix(e._props.matrix));return i},e.getConcatenatedDisplayProps=function(t){t=t?t.identity():new createjs.DisplayProps;var e=this,i=e.getMatrix(t.matrix);do{t.prepend(e.visible,e.alpha,e.shadow,e.compositeOperation),e!=this&&i.prependMatrix(e.getMatrix(e._props.matrix))}while(e=e.parent);return t},e.hitTest=function(e,i){var n=t._hitTestContext;n.setTransform(1,0,0,1,-e,-i),this.draw(n);var r=this._testHit(n);return n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,2,2),r},e.set=function(t){for(var e in t)this[e]=t[e];return this},e.getBounds=function(){if(this._bounds)return this._rectangle.copy(this._bounds);var t=this.cacheCanvas;if(t){var e=this._cacheScale;return this._rectangle.setValues(this._cacheOffsetX,this._cacheOffsetY,t.width/e,t.height/e)}return null},e.getTransformedBounds=function(){return this._getBounds()},e.setBounds=function(t,e,i,n){this._bounds=null!=t?(this._bounds||new createjs.Rectangle).setValues(t,e,i,n):t},e.clone=function(){return this._cloneProps(new t)},e.toString=function(){return"[DisplayObject (name="+this.name+")]"},e._updateState=null,e._cloneProps=function(t){return t.alpha=this.alpha,t.mouseEnabled=this.mouseEnabled,t.tickEnabled=this.tickEnabled,t.name=this.name,t.regX=this.regX,t.regY=this.regY,t.rotation=this.rotation,t.scaleX=this.scaleX,t.scaleY=this.scaleY,t.shadow=this.shadow,t.skewX=this.skewX,t.skewY=this.skewY,t.visible=this.visible,t.x=this.x,t.y=this.y,t.compositeOperation=this.compositeOperation,t.snapToPixel=this.snapToPixel,t.filters=null==this.filters?null:this.filters.slice(0),t.mask=this.mask,t.hitArea=this.hitArea,t.cursor=this.cursor,t._bounds=this._bounds,t},e._applyShadow=function(t,e){e=e||Shadow.identity,t.shadowColor=e.color,t.shadowOffsetX=e.offsetX,t.shadowOffsetY=e.offsetY,t.shadowBlur=e.blur},e._tick=function(t){var e=this._listeners;e&&e.tick&&(t.target=null,t.propagationStopped=t.immediatePropagationStopped=!1,this.dispatchEvent(t))},e._testHit=function(e){try{var i=e.getImageData(0,0,1,1).data[3]>1}catch(e){if(!t.suppressCrossDomainErrors)throw"An error has occurred. This is most likely due to security restrictions on reading canvas pixel data with local or cross-domain images."}return i},e._getBounds=function(t,e){return this._transformBounds(this.getBounds(),t,e)},e._transformBounds=function(t,e,i){if(!t)return t;var n=t.x,r=t.y,s=t.width,a=t.height,o=this._props.matrix;o=i?o.identity():this.getMatrix(o),(n||r)&&o.appendTransform(0,0,1,1,0,0,0,-n,-r),e&&o.prependMatrix(e);var h=s*o.a,u=s*o.b,c=a*o.c,l=a*o.d,d=o.tx,f=o.ty,p=d,g=d,m=f,v=f;return(n=h+d)<p?p=n:n>g&&(g=n),(n=h+c+d)<p?p=n:n>g&&(g=n),(n=c+d)<p?p=n:n>g&&(g=n),(r=u+f)<m?m=r:r>v&&(v=r),(r=u+l+f)<m?m=r:r>v&&(v=r),(r=l+f)<m?m=r:r>v&&(v=r),t.setValues(p,m,g-p,v-m)},e._hasMouseEventListener=function(){for(var e=t._MOUSE_EVENTS,i=0,n=e.length;i<n;i++)if(this.hasEventListener(e[i]))return!0;return!!this.cursor},createjs.DisplayObject=createjs.promote(t,"EventDispatcher")}(),window.createjs=window.createjs||{},function(){"use strict";function t(){this.DisplayObject_constructor(),this.children=[],this.mouseChildren=!0,this.tickChildren=!0}var e=createjs.extend(t,createjs.DisplayObject);e._getNumChildren=function(){return this.children.length},e.getNumChildren=createjs.deprecate(e._getNumChildren,"Container.getNumChildren");try{Object.defineProperties(e,{numChildren:{get:e._getNumChildren}})}catch(t){}e.initialize=t,e.isVisible=function(){var t=this.cacheCanvas||this.children.length;return!!(this.visible&&this.alpha>0&&0!=this.scaleX&&0!=this.scaleY&&t)},e.draw=function(t,e){if(this.DisplayObject_draw(t,e))return!0;for(var i=this.children.slice(),n=0,r=i.length;n<r;n++){var s=i[n];s.isVisible()&&(t.save(),s.updateContext(t),s.draw(t),t.restore())}return!0},e.addChild=function(t){if(null==t)return t;var e=arguments.length;if(e>1){for(var i=0;i<e;i++)this.addChild(arguments[i]);return arguments[e-1]}var n=t.parent,r=n===this;return n&&n._removeChildAt(createjs.indexOf(n.children,t),r),t.parent=this,this.children.push(t),r||t.dispatchEvent("added"),t},e.addChildAt=function(t,e){var i=arguments.length,n=arguments[i-1];if(n<0||n>this.children.length)return arguments[i-2];if(i>2){for(var r=0;r<i-1;r++)this.addChildAt(arguments[r],n+r);return arguments[i-2]}var s=t.parent,a=s===this;return s&&s._removeChildAt(createjs.indexOf(s.children,t),a),t.parent=this,this.children.splice(e,0,t),a||t.dispatchEvent("added"),t},e.removeChild=function(t){var e=arguments.length;if(e>1){for(var i=!0,n=0;n<e;n++)i=i&&this.removeChild(arguments[n]);return i}return this._removeChildAt(createjs.indexOf(this.children,t))},e.removeChildAt=function(t){var e=arguments.length;if(e>1){for(var i=[],n=0;n<e;n++)i[n]=arguments[n];i.sort(function(t,e){return e-t});var r=!0;for(n=0;n<e;n++)r=r&&this._removeChildAt(i[n]);return r}return this._removeChildAt(t)},e.removeAllChildren=function(){for(var t=this.children;t.length;)this._removeChildAt(0)},e.getChildAt=function(t){return this.children[t]},e.getChildByName=function(t){for(var e=this.children,i=0,n=e.length;i<n;i++)if(e[i].name==t)return e[i];return null},e.sortChildren=function(t){this.children.sort(t)},e.getChildIndex=function(t){return createjs.indexOf(this.children,t)},e.swapChildrenAt=function(t,e){var i=this.children,n=i[t],r=i[e];n&&r&&(i[t]=r,i[e]=n)},e.swapChildren=function(t,e){for(var i,n,r=this.children,s=0,a=r.length;s<a&&(r[s]==t&&(i=s),r[s]==e&&(n=s),null==i||null==n);s++);s!=a&&(r[i]=e,r[n]=t)},e.setChildIndex=function(t,e){var i=this.children,n=i.length;if(!(t.parent!=this||e<0||e>=n)){for(var r=0;r<n&&i[r]!=t;r++);r!=n&&r!=e&&(i.splice(r,1),i.splice(e,0,t))}},e.contains=function(t){for(;t;){if(t==this)return!0;t=t.parent}return!1},e.hitTest=function(t,e){return null!=this.getObjectUnderPoint(t,e)},e.getObjectsUnderPoint=function(t,e,i){var n=[],r=this.localToGlobal(t,e);return this._getObjectsUnderPoint(r.x,r.y,n,i>0,1==i),n},e.getObjectUnderPoint=function(t,e,i){var n=this.localToGlobal(t,e);return this._getObjectsUnderPoint(n.x,n.y,null,i>0,1==i)},e.getBounds=function(){return this._getBounds(null,!0)},e.getTransformedBounds=function(){return this._getBounds()},e.clone=function(e){var i=this._cloneProps(new t);return e&&this._cloneChildren(i),i},e.toString=function(){return"[Container (name="+this.name+")]"},e._tick=function(t){if(this.tickChildren)for(var e=this.children.length-1;e>=0;e--){var i=this.children[e];i.tickEnabled&&i._tick&&i._tick(t)}this.DisplayObject__tick(t)},e._cloneChildren=function(t){t.children.length&&t.removeAllChildren();for(var e=t.children,i=0,n=this.children.length;i<n;i++){var r=this.children[i].clone(!0);r.parent=t,e.push(r)}},e._removeChildAt=function(t,e){if(t<0||t>this.children.length-1)return!1;var i=this.children[t];return i&&(i.parent=null),this.children.splice(t,1),e||i.dispatchEvent("removed"),!0},e._getObjectsUnderPoint=function(e,i,n,r,s,a){if(!(a=a||0)&&!this._testMask(this,e,i))return null;var o,h=createjs.DisplayObject._hitTestContext;s=s||r&&this._hasMouseEventListener();for(var u=this.children,c=u.length-1;c>=0;c--){var l=u[c],d=l.hitArea;if(l.visible&&(d||l.isVisible())&&(!r||l.mouseEnabled)&&(d||this._testMask(l,e,i)))if(!d&&l instanceof t){var f=l._getObjectsUnderPoint(e,i,n,r,s,a+1);if(!n&&f)return r&&!this.mouseChildren?this:f}else{if(r&&!s&&!l._hasMouseEventListener())continue;var p=l.getConcatenatedDisplayProps(l._props);if(o=p.matrix,d&&(o.appendMatrix(d.getMatrix(d._props.matrix)),p.alpha=d.alpha),h.globalAlpha=p.alpha,h.setTransform(o.a,o.b,o.c,o.d,o.tx-e,o.ty-i),(d||l).draw(h),!this._testHit(h))continue;if(h.setTransform(1,0,0,1,0,0),h.clearRect(0,0,2,2),!n)return r&&!this.mouseChildren?this:l;n.push(l)}}return null},e._testMask=function(t,e,i){var n=t.mask;if(!n||!n.graphics||n.graphics.isEmpty())return!0;var r=this._props.matrix,s=t.parent;r=s?s.getConcatenatedMatrix(r):r.identity(),r=n.getMatrix(n._props.matrix).prependMatrix(r);var a=createjs.DisplayObject._hitTestContext;return a.setTransform(r.a,r.b,r.c,r.d,r.tx-e,r.ty-i),n.graphics.drawAsPath(a),a.fillStyle="#000",a.fill(),!!this._testHit(a)&&(a.setTransform(1,0,0,1,0,0),a.clearRect(0,0,2,2),!0)},e._getBounds=function(t,e){var i=this.DisplayObject_getBounds();if(i)return this._transformBounds(i,t,e);var n=this._props.matrix;n=e?n.identity():this.getMatrix(n),t&&n.prependMatrix(t);for(var r=this.children.length,s=null,a=0;a<r;a++){var o=this.children[a];o.visible&&(i=o._getBounds(n))&&(s?s.extend(i.x,i.y,i.width,i.height):s=i.clone())}return s},createjs.Container=createjs.promote(t,"DisplayObject")}(),window.createjs=window.createjs||{},function(){"use strict";function t(t){this.Container_constructor(),this.autoClear=!0,this.canvas="string"==typeof t?document.getElementById(t):t,this.mouseX=0,this.mouseY=0,this.drawRect=null,this.snapToPixelEnabled=!1,this.mouseInBounds=!1,this.tickOnUpdate=!0,this.mouseMoveOutside=!1,this.preventSelection=!0,this._pointerData={},this._pointerCount=0,this._primaryPointerID=null,this._mouseOverIntervalID=null,this._nextStage=null,this._prevStage=null,this.enableDOMEvents(!0)}var e=createjs.extend(t,createjs.Container);e._get_nextStage=function(){return this._nextStage},e._set_nextStage=function(t){this._nextStage&&(this._nextStage._prevStage=null),t&&(t._prevStage=this),this._nextStage=t};try{Object.defineProperties(e,{nextStage:{get:e._get_nextStage,set:e._set_nextStage}})}catch(t){}e.update=function(t){if(this.canvas&&(this.tickOnUpdate&&this.tick(t),!1!==this.dispatchEvent("drawstart",!1,!0))){createjs.DisplayObject._snapToPixelEnabled=this.snapToPixelEnabled;var e=this.drawRect,i=this.canvas.getContext("2d");i.setTransform(1,0,0,1,0,0),this.autoClear&&(e?i.clearRect(e.x,e.y,e.width,e.height):i.clearRect(0,0,this.canvas.width+1,this.canvas.height+1)),i.save(),this.drawRect&&(i.beginPath(),i.rect(e.x,e.y,e.width,e.height),i.clip()),this.updateContext(i),this.draw(i,!1),i.restore(),this.dispatchEvent("drawend")}},e.tick=function(t){if(this.tickEnabled&&!1!==this.dispatchEvent("tickstart",!1,!0)){var e=new createjs.Event("tick");if(t)for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);this._tick(e),this.dispatchEvent("tickend")}},e.handleEvent=function(t){"tick"==t.type&&this.update(t)},e.clear=function(){if(this.canvas){var t=this.canvas.getContext("2d");t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,this.canvas.width+1,this.canvas.height+1)}},e.toDataURL=function(t,e){var i,n=this.canvas.getContext("2d"),r=this.canvas.width,s=this.canvas.height;if(t){i=n.getImageData(0,0,r,s);var a=n.globalCompositeOperation;n.globalCompositeOperation="destination-over",n.fillStyle=t,n.fillRect(0,0,r,s)}var o=this.canvas.toDataURL(e||"image/png");return t&&(n.putImageData(i,0,0),n.globalCompositeOperation=a),o},e.enableMouseOver=function(t){if(this._mouseOverIntervalID&&(clearInterval(this._mouseOverIntervalID),this._mouseOverIntervalID=null,0==t&&this._testMouseOver(!0)),null==t)t=20;else if(t<=0)return;var e=this;this._mouseOverIntervalID=setInterval(function(){e._testMouseOver()},1e3/Math.min(50,t))},e.enableDOMEvents=function(t){null==t&&(t=!0);var e,i,n=this._eventListeners;if(!t&&n){for(e in n)(i=n[e]).t.removeEventListener(e,i.f,!1);this._eventListeners=null}else if(t&&!n&&this.canvas){var r=window.addEventListener?window:document,s=this;for(e in(n=this._eventListeners={}).mouseup={t:r,f:function(t){s._handleMouseUp(t)}},n.mousemove={t:r,f:function(t){s._handleMouseMove(t)}},n.dblclick={t:this.canvas,f:function(t){s._handleDoubleClick(t)}},n.mousedown={t:this.canvas,f:function(t){s._handleMouseDown(t)}},n)(i=n[e]).t.addEventListener(e,i.f,!1)}},e.clone=function(){throw"Stage cannot be cloned."},e.toString=function(){return"[Stage (name="+this.name+")]"},e._getElementRect=function(t){var e;try{e=t.getBoundingClientRect()}catch(i){e={top:t.offsetTop,left:t.offsetLeft,width:t.offsetWidth,height:t.offsetHeight}}var i=(window.pageXOffset||document.scrollLeft||0)-(document.clientLeft||document.body.clientLeft||0),n=(window.pageYOffset||document.scrollTop||0)-(document.clientTop||document.body.clientTop||0),r=window.getComputedStyle?getComputedStyle(t,null):t.currentStyle,s=parseInt(r.paddingLeft)+parseInt(r.borderLeftWidth),a=parseInt(r.paddingTop)+parseInt(r.borderTopWidth),o=parseInt(r.paddingRight)+parseInt(r.borderRightWidth),h=parseInt(r.paddingBottom)+parseInt(r.borderBottomWidth);return{left:e.left+i+s,right:e.right+i-o,top:e.top+n+a,bottom:e.bottom+n-h}},e._getPointerData=function(t){var e=this._pointerData[t];return e||(e=this._pointerData[t]={x:0,y:0}),e},e._handleMouseMove=function(t){t||(t=window.event),this._handlePointerMove(-1,t,t.pageX,t.pageY)},e._handlePointerMove=function(t,e,i,n,r){if((!this._prevStage||void 0!==r)&&this.canvas){var s=this._nextStage,a=this._getPointerData(t),o=a.inBounds;this._updatePointerPosition(t,e,i,n),(o||a.inBounds||this.mouseMoveOutside)&&(-1===t&&a.inBounds==!o&&this._dispatchMouseEvent(this,o?"mouseleave":"mouseenter",!1,t,a,e),this._dispatchMouseEvent(this,"stagemousemove",!1,t,a,e),this._dispatchMouseEvent(a.target,"pressmove",!0,t,a,e)),s&&s._handlePointerMove(t,e,i,n,null)}},e._updatePointerPosition=function(t,e,i,n){var r=this._getElementRect(this.canvas);i-=r.left,n-=r.top;var s=this.canvas.width,a=this.canvas.height;i/=(r.right-r.left)/s,n/=(r.bottom-r.top)/a;var o=this._getPointerData(t);(o.inBounds=i>=0&&n>=0&&i<=s-1&&n<=a-1)?(o.x=i,o.y=n):this.mouseMoveOutside&&(o.x=i<0?0:i>s-1?s-1:i,o.y=n<0?0:n>a-1?a-1:n),o.posEvtObj=e,o.rawX=i,o.rawY=n,t!==this._primaryPointerID&&-1!==t||(this.mouseX=o.x,this.mouseY=o.y,this.mouseInBounds=o.inBounds)},e._handleMouseUp=function(t){this._handlePointerUp(-1,t,!1)},e._handlePointerUp=function(t,e,i,n){var r=this._nextStage,s=this._getPointerData(t);if(!this._prevStage||void 0!==n){var a=null,o=s.target;n||!o&&!r||(a=this._getObjectsUnderPoint(s.x,s.y,null,!0)),s.down&&(this._dispatchMouseEvent(this,"stagemouseup",!1,t,s,e,a),s.down=!1),a==o&&this._dispatchMouseEvent(o,"click",!0,t,s,e),this._dispatchMouseEvent(o,"pressup",!0,t,s,e),i?(t==this._primaryPointerID&&(this._primaryPointerID=null),delete this._pointerData[t]):s.target=null,r&&r._handlePointerUp(t,e,i,n||a&&this)}},e._handleMouseDown=function(t){this._handlePointerDown(-1,t,t.pageX,t.pageY)},e._handlePointerDown=function(t,e,i,n,r){this.preventSelection&&e.preventDefault(),null!=this._primaryPointerID&&-1!==t||(this._primaryPointerID=t),null!=n&&this._updatePointerPosition(t,e,i,n);var s=null,a=this._nextStage,o=this._getPointerData(t);r||(s=o.target=this._getObjectsUnderPoint(o.x,o.y,null,!0)),o.inBounds&&(this._dispatchMouseEvent(this,"stagemousedown",!1,t,o,e,s),o.down=!0),this._dispatchMouseEvent(s,"mousedown",!0,t,o,e),a&&a._handlePointerDown(t,e,i,n,r||s&&this)},e._testMouseOver=function(t,e,i){if(!this._prevStage||void 0!==e){var n=this._nextStage;if(this._mouseOverIntervalID){var r=this._getPointerData(-1);if(r&&(t||this.mouseX!=this._mouseOverX||this.mouseY!=this._mouseOverY||!this.mouseInBounds)){var s,a,o,h=r.posEvtObj,u=i||h&&h.target==this.canvas,c=null,l=-1,d="";!e&&(t||this.mouseInBounds&&u)&&(c=this._getObjectsUnderPoint(this.mouseX,this.mouseY,null,!0),this._mouseOverX=this.mouseX,this._mouseOverY=this.mouseY);var f=this._mouseOverTarget||[],p=f[f.length-1],g=this._mouseOverTarget=[];for(s=c;s;)g.unshift(s),d||(d=s.cursor),s=s.parent;for(this.canvas.style.cursor=d,!e&&i&&(i.canvas.style.cursor=d),a=0,o=g.length;a<o&&g[a]==f[a];a++)l=a;for(p!=c&&this._dispatchMouseEvent(p,"mouseout",!0,-1,r,h,c),a=f.length-1;a>l;a--)this._dispatchMouseEvent(f[a],"rollout",!1,-1,r,h,c);for(a=g.length-1;a>l;a--)this._dispatchMouseEvent(g[a],"rollover",!1,-1,r,h,p);p!=c&&this._dispatchMouseEvent(c,"mouseover",!0,-1,r,h,p),n&&n._testMouseOver(t,e||c&&this,i||u&&this)}}else n&&n._testMouseOver(t,e,i)}},e._handleDoubleClick=function(t,e){var i=null,n=this._nextStage,r=this._getPointerData(-1);e||(i=this._getObjectsUnderPoint(r.x,r.y,null,!0),this._dispatchMouseEvent(i,"dblclick",!0,-1,r,t)),n&&n._handleDoubleClick(t,e||i&&this)},e._dispatchMouseEvent=function(t,e,i,n,r,s,a){if(t&&(i||t.hasEventListener(e))){var o=new createjs.MouseEvent(e,i,!1,r.x,r.y,s,n,n===this._primaryPointerID||-1===n,r.rawX,r.rawY,a);t.dispatchEvent(o)}},createjs.Stage=createjs.promote(t,"Container")}(),window.createjs=window.createjs||{},function(){"use strict";function t(e,i){if(this.Stage_constructor(e),void 0!==i){if("object"!=typeof i)throw"Invalid options object";var n=i.premultiply,r=i.transparent,s=i.antialias,a=i.preserveBuffer,o=i.autoPurge}this.vocalDebug=!1,this._preserveBuffer=a||!1,this._antialias=s||!1,this._transparent=r||!1,this._premultiply=n||!1,this._autoPurge=void 0,this.autoPurge=o,this._viewportWidth=0,this._viewportHeight=0,this._projectionMatrix=null,this._webGLContext=null,this._clearColor={r:.5,g:.5,b:.5,a:0},this._maxCardsPerBatch=t.DEFAULT_MAX_BATCH_SIZE,this._activeShader=null,this._vertices=null,this._vertexPositionBuffer=null,this._uvs=null,this._uvPositionBuffer=null,this._indices=null,this._textureIndexBuffer=null,this._alphas=null,this._alphaBuffer=null,this._textureDictionary=[],this._textureIDs={},this._batchTextures=[],this._baseTextures=[],this._batchTextureCount=8,this._lastTextureInsert=-1,this._batchID=0,this._drawID=0,this._slotBlacklist=[],this._isDrawing=0,this._lastTrackedCanvas=0,this.isCacheControlled=!1,this._cacheContainer=new createjs.Container,this._initializeWebGL()}var e=createjs.extend(t,createjs.Stage);t.buildUVRects=function(t,e,i){if(!t||!t._frames)return null;void 0===e&&(e=-1),void 0===i&&(i=!1);for(var n=-1!=e&&i?e:0,r=-1!=e&&i?e+1:t._frames.length,s=n;s<r;s++){var a=t._frames[s];if(!(a.uvRect||a.image.width<=0||a.image.height<=0)){var o=a.rect;a.uvRect={t:o.y/a.image.height,l:o.x/a.image.width,b:(o.y+o.height)/a.image.height,r:(o.x+o.width)/a.image.width}}}return t._frames[-1!=e?e:0].uvRect||{t:0,l:0,b:1,r:1}},t.isWebGLActive=function(t){return t&&t instanceof WebGLRenderingContext&&"undefined"!=typeof WebGLRenderingContext},t.VERTEX_PROPERTY_COUNT=6,t.INDICIES_PER_CARD=6,t.DEFAULT_MAX_BATCH_SIZE=1e4,t.WEBGL_MAX_INDEX_NUM=Math.pow(2,16),t.UV_RECT={t:0,l:0,b:1,r:1};try{t.COVER_VERT=new Float32Array([-1,1,1,1,-1,-1,1,1,1,-1,-1,-1]),t.COVER_UV=new Float32Array([0,0,1,0,0,1,1,0,1,1,0,1]),t.COVER_UV_FLIP=new Float32Array([0,1,1,1,0,0,1,1,1,0,0,0])}catch(t){}t.REGULAR_VARYING_HEADER="precision mediump float;varying vec2 vTextureCoord;varying lowp float indexPicker;varying lowp float alphaValue;",t.REGULAR_VERTEX_HEADER=t.REGULAR_VARYING_HEADER+"attribute vec2 vertexPosition;attribute vec2 uvPosition;attribute lowp float textureIndex;attribute lowp float objectAlpha;uniform mat4 pMatrix;",t.REGULAR_FRAGMENT_HEADER=t.REGULAR_VARYING_HEADER+"uniform sampler2D uSampler[{{count}}];",t.REGULAR_VERTEX_BODY="void main(void) {gl_Position = vec4((vertexPosition.x * pMatrix[0][0]) + pMatrix[3][0],(vertexPosition.y * pMatrix[1][1]) + pMatrix[3][1],pMatrix[3][2],1.0);alphaValue = objectAlpha;indexPicker = textureIndex;vTextureCoord = uvPosition;}",t.REGULAR_FRAGMENT_BODY="void main(void) {vec4 color = vec4(1.0, 0.0, 0.0, 1.0);if (indexPicker <= 0.5) {color = texture2D(uSampler[0], vTextureCoord);{{alternates}}}{{fragColor}}}",t.REGULAR_FRAG_COLOR_NORMAL="gl_FragColor = vec4(color.rgb, color.a * alphaValue);",t.REGULAR_FRAG_COLOR_PREMULTIPLY="if(color.a > 0.0035) {gl_FragColor = vec4(color.rgb/color.a, color.a * alphaValue);} else {gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);}",t.PARTICLE_VERTEX_BODY=t.REGULAR_VERTEX_BODY,t.PARTICLE_FRAGMENT_BODY=t.REGULAR_FRAGMENT_BODY,t.COVER_VARYING_HEADER="precision mediump float;varying highp vec2 vRenderCoord;varying highp vec2 vTextureCoord;",t.COVER_VERTEX_HEADER=t.COVER_VARYING_HEADER+"attribute vec2 vertexPosition;attribute vec2 uvPosition;uniform float uUpright;",t.COVER_FRAGMENT_HEADER=t.COVER_VARYING_HEADER+"uniform sampler2D uSampler;",t.COVER_VERTEX_BODY="void main(void) {gl_Position = vec4(vertexPosition.x, vertexPosition.y, 0.0, 1.0);vRenderCoord = uvPosition;vTextureCoord = vec2(uvPosition.x, abs(uUpright - uvPosition.y));}",t.COVER_FRAGMENT_BODY="void main(void) {vec4 color = texture2D(uSampler, vRenderCoord);gl_FragColor = color;}",e._get_isWebGL=function(){return!!this._webGLContext},e._set_autoPurge=function(t){-1!=(t=isNaN(t)?1200:t)&&(t=t<10?10:t),this._autoPurge=t},e._get_autoPurge=function(){return Number(this._autoPurge)};try{Object.defineProperties(e,{isWebGL:{get:e._get_isWebGL},autoPurge:{get:e._get_autoPurge,set:e._set_autoPurge}})}catch(t){}e._initializeWebGL=function(){if(this.canvas){if(!this._webGLContext||this._webGLContext.canvas!==this.canvas){var t={depth:!1,alpha:this._transparent,stencil:!0,antialias:this._antialias,premultipliedAlpha:this._premultiply,preserveDrawingBuffer:this._preserveBuffer},e=this._webGLContext=this._fetchWebGLContext(this.canvas,t);if(!e)return null;this.updateSimultaneousTextureCount(e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)),this._maxTextureSlots=e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS),this._createBuffers(e),this._initTextures(e),e.disable(e.DEPTH_TEST),e.enable(e.BLEND),e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this._premultiply),this._webGLContext.clearColor(this._clearColor.r,this._clearColor.g,this._clearColor.b,this._clearColor.a),this.updateViewport(this._viewportWidth||this.canvas.width,this._viewportHeight||this.canvas.height)}}else this._webGLContext=null;return this._webGLContext},e.update=function(t){if(this.canvas){if(this.tickOnUpdate&&this.tick(t),this.dispatchEvent("drawstart"),this.autoClear&&this.clear(),this._webGLContext)this._batchDraw(this,this._webGLContext),-1==this._autoPurge||this._drawID%(this._autoPurge/2|0)||this.purgeTextures(this._autoPurge);else{var e=this.canvas.getContext("2d");e.save(),this.updateContext(e),this.draw(e,!1),e.restore()}this.dispatchEvent("drawend")}},e.clear=function(){if(this.canvas)if(t.isWebGLActive(this._webGLContext)){var e=this._webGLContext,i=this._clearColor,n=this._transparent?i.a:1;this._webGLContext.clearColor(i.r*n,i.g*n,i.b*n,n),e.clear(e.COLOR_BUFFER_BIT),this._webGLContext.clearColor(i.r,i.g,i.b,i.a)}else this.Stage_clear()},e.draw=function(e,i){if(e===this._webGLContext&&t.isWebGLActive(this._webGLContext)){var n=this._webGLContext;return this._batchDraw(this,n,i),!0}return this.Stage_draw(e,i)},e.cacheDraw=function(e,i,n){if(t.isWebGLActive(this._webGLContext)){var r=this._webGLContext;return this._cacheDraw(r,e,i,n),!0}return!1},e.protectTextureSlot=function(t,e){if(t>this._maxTextureSlots||t<0)throw"Slot outside of acceptable range";this._slotBlacklist[t]=!!e},e.getTargetRenderTexture=function(t,e,i){var n,r=!1,s=this._webGLContext;if(void 0!==t.__lastRT&&t.__lastRT===t.__rtA&&(r=!0),r?(void 0===t.__rtB?t.__rtB=this.getRenderBufferTexture(e,i):(e==t.__rtB._width&&i==t.__rtB._height||this.resizeTexture(t.__rtB,e,i),this.setTextureParams(s)),n=t.__rtB):(void 0===t.__rtA?t.__rtA=this.getRenderBufferTexture(e,i):(e==t.__rtA._width&&i==t.__rtA._height||this.resizeTexture(t.__rtA,e,i),this.setTextureParams(s)),n=t.__rtA),!n)throw"Problems creating render textures, known causes include using too much VRAM by not releasing WebGL texture instances";return t.__lastRT=n,n},e.releaseTexture=function(t){var e,i;if(t){if(t.children)for(e=0,i=t.children.length;e<i;e++)this.releaseTexture(t.children[e]);t.cacheCanvas&&t.uncache();var n=void 0;if(void 0!==t._storeID){if(t===this._textureDictionary[t._storeID])return this._killTextureObject(t),void(t._storeID=void 0);n=t}else if(2===t._webGLRenderStyle)n=t.image;else if(1===t._webGLRenderStyle){for(e=0,i=t.spriteSheet._images.length;e<i;e++)this.releaseTexture(t.spriteSheet._images[e]);return}void 0!==n?(this._killTextureObject(this._textureDictionary[n._storeID]),n._storeID=void 0):this.vocalDebug&&console.log("No associated texture found on release")}},e.purgeTextures=function(t){void 0==t&&(t=100);for(var e=this._textureDictionary,i=e.length,n=0;n<i;n++){var r=e[n];r&&(r._drawID+t<=this._drawID&&this._killTextureObject(r))}},e.updateSimultaneousTextureCount=function(t){var e=this._webGLContext,i=!1;for((t<1||isNaN(t))&&(t=1),this._batchTextureCount=t;!i;)try{this._activeShader=this._fetchShaderProgram(e),i=!0}catch(t){if(1==this._batchTextureCount)throw"Cannot compile shader "+t;this._batchTextureCount-=4,this._batchTextureCount<1&&(this._batchTextureCount=1),this.vocalDebug&&console.log("Reducing desired texture count due to errors: "+this._batchTextureCount)}},e.updateViewport=function(t,e){this._viewportWidth=0|t,this._viewportHeight=0|e;var i=this._webGLContext;i&&(i.viewport(0,0,this._viewportWidth,this._viewportHeight),this._projectionMatrix=new Float32Array([2/this._viewportWidth,0,0,0,0,-2/this._viewportHeight,1,0,0,0,1,0,-1,1,.1,0]),this._projectionMatrixFlip=new Float32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),this._projectionMatrixFlip.set(this._projectionMatrix),this._projectionMatrixFlip[5]*=-1,this._projectionMatrixFlip[13]*=-1)},e.getFilterShader=function(t){t||(t=this);var e=this._webGLContext,i=this._activeShader;if(t._builtShader)i=t._builtShader,t.shaderParamSetup&&(e.useProgram(i),t.shaderParamSetup(e,this,i));else try{i=this._fetchShaderProgram(e,"filter",t.VTX_SHADER_BODY,t.FRAG_SHADER_BODY,t.shaderParamSetup&&t.shaderParamSetup.bind(t)),t._builtShader=i,i._name=t.toString()}catch(t){console&&console.log("SHADER SWITCH FAILURE",t)}return i},e.getBaseTexture=function(t,e){var i=Math.ceil(t>0?t:1)||1,n=Math.ceil(e>0?e:1)||1,r=this._webGLContext,s=r.createTexture();return this.resizeTexture(s,i,n),this.setTextureParams(r,!1),s},e.resizeTexture=function(t,e,i){var n=this._webGLContext;n.bindTexture(n.TEXTURE_2D,t),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,e,i,0,n.RGBA,n.UNSIGNED_BYTE,null),t.width=e,t.height=i},e.getRenderBufferTexture=function(t,e){var i=this._webGLContext,n=this.getBaseTexture(t,e);if(!n)return null;var r=i.createFramebuffer();return r?(n.width=t,n.height=e,i.bindFramebuffer(i.FRAMEBUFFER,r),i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,n,0),r._renderTexture=n,n._frameBuffer=r,n._storeID=this._textureDictionary.length,this._textureDictionary[n._storeID]=n,i.bindFramebuffer(i.FRAMEBUFFER,null),n):null},e.setTextureParams=function(t,e){e&&this._antialias?(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR)):(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST)),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE)},e.setClearColor=function(t){var e,i,n,r,s;"string"==typeof t?0==t.indexOf("#")?(4==t.length&&(t="#"+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)+t.charAt(3)+t.charAt(3)),e=Number("0x"+t.slice(1,3))/255,i=Number("0x"+t.slice(3,5))/255,n=Number("0x"+t.slice(5,7))/255,r=Number("0x"+t.slice(7,9))/255):0==t.indexOf("rgba(")&&(s=t.slice(5,-1).split(","),e=Number(s[0])/255,i=Number(s[1])/255,n=Number(s[2])/255,r=Number(s[3])):(e=((4278190080&t)>>>24)/255,i=((16711680&t)>>>16)/255,n=((65280&t)>>>8)/255,r=(255&t)/255),this._clearColor.r=e||0,this._clearColor.g=i||0,this._clearColor.b=n||0,this._clearColor.a=r||0,this._webGLContext&&this._webGLContext.clearColor(this._clearColor.r,this._clearColor.g,this._clearColor.b,this._clearColor.a)},e.toString=function(){return"[StageGL (name="+this.name+")]"},e._fetchWebGLContext=function(t,e){var i;try{i=t.getContext("webgl",e)||t.getContext("experimental-webgl",e)}catch(t){}if(i)i.viewportWidth=t.width,i.viewportHeight=t.height;else{var n="Could not initialize WebGL";console.error?console.error(n):console.log(n)}return i},e._fetchShaderProgram=function(e,i,n,r,s){var a,o;switch(e.useProgram(null),i){case"filter":o=t.COVER_VERTEX_HEADER+(n||t.COVER_VERTEX_BODY),a=t.COVER_FRAGMENT_HEADER+(r||t.COVER_FRAGMENT_BODY);break;case"particle":o=t.REGULAR_VERTEX_HEADER+t.PARTICLE_VERTEX_BODY,a=t.REGULAR_FRAGMENT_HEADER+t.PARTICLE_FRAGMENT_BODY;break;case"override":o=t.REGULAR_VERTEX_HEADER+(n||t.REGULAR_VERTEX_BODY),a=t.REGULAR_FRAGMENT_HEADER+(r||t.REGULAR_FRAGMENT_BODY);break;case"regular":default:o=t.REGULAR_VERTEX_HEADER+t.REGULAR_VERTEX_BODY,a=t.REGULAR_FRAGMENT_HEADER+t.REGULAR_FRAGMENT_BODY}var h=this._createShader(e,e.VERTEX_SHADER,o),u=this._createShader(e,e.FRAGMENT_SHADER,a),c=e.createProgram();if(e.attachShader(c,h),e.attachShader(c,u),e.linkProgram(c),c._type=i,!e.getProgramParameter(c,e.LINK_STATUS))throw e.useProgram(this._activeShader),e.getProgramInfoLog(c);switch(e.useProgram(c),i){case"filter":c.vertexPositionAttribute=e.getAttribLocation(c,"vertexPosition"),e.enableVertexAttribArray(c.vertexPositionAttribute),c.uvPositionAttribute=e.getAttribLocation(c,"uvPosition"),e.enableVertexAttribArray(c.uvPositionAttribute),c.samplerUniform=e.getUniformLocation(c,"uSampler"),e.uniform1i(c.samplerUniform,0),c.uprightUniform=e.getUniformLocation(c,"uUpright"),e.uniform1f(c.uprightUniform,0),s&&s(e,this,c);break;case"override":case"particle":case"regular":default:c.vertexPositionAttribute=e.getAttribLocation(c,"vertexPosition"),e.enableVertexAttribArray(c.vertexPositionAttribute),c.uvPositionAttribute=e.getAttribLocation(c,"uvPosition"),e.enableVertexAttribArray(c.uvPositionAttribute),c.textureIndexAttribute=e.getAttribLocation(c,"textureIndex"),e.enableVertexAttribArray(c.textureIndexAttribute),c.alphaAttribute=e.getAttribLocation(c,"objectAlpha"),e.enableVertexAttribArray(c.alphaAttribute);for(var l=[],d=0;d<this._batchTextureCount;d++)l[d]=d;c.samplerData=l,c.samplerUniform=e.getUniformLocation(c,"uSampler"),e.uniform1iv(c.samplerUniform,l),c.pMatrixUniform=e.getUniformLocation(c,"pMatrix")}return e.useProgram(this._activeShader),c},e._createShader=function(e,i,n){n=n.replace(/{{count}}/g,this._batchTextureCount);for(var r="",s=1;s<this._batchTextureCount;s++)r+="} else if (indexPicker <= "+s+".5) { color = texture2D(uSampler["+s+"], vTextureCoord);";n=(n=n.replace(/{{alternates}}/g,r)).replace(/{{fragColor}}/g,this._premultiply?t.REGULAR_FRAG_COLOR_PREMULTIPLY:t.REGULAR_FRAG_COLOR_NORMAL);var a=e.createShader(i);if(e.shaderSource(a,n),e.compileShader(a),!e.getShaderParameter(a,e.COMPILE_STATUS))throw e.getShaderInfoLog(a);return a},e._createBuffers=function(e){var i,n,r,s=this._maxCardsPerBatch*t.INDICIES_PER_CARD,a=this._vertexPositionBuffer=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,a),i=2;var o=this._vertices=new Float32Array(s*i);for(n=0,r=o.length;n<r;n+=i)o[n]=o[n+1]=0;e.bufferData(e.ARRAY_BUFFER,o,e.DYNAMIC_DRAW),a.itemSize=i,a.numItems=s;var h=this._uvPositionBuffer=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,h),i=2;var u=this._uvs=new Float32Array(s*i);for(n=0,r=u.length;n<r;n+=i)u[n]=u[n+1]=0;e.bufferData(e.ARRAY_BUFFER,u,e.DYNAMIC_DRAW),h.itemSize=i,h.numItems=s;var c=this._textureIndexBuffer=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,c),i=1;var l=this._indices=new Float32Array(s*i);for(n=0,r=l.length;n<r;n++)l[n]=0;e.bufferData(e.ARRAY_BUFFER,l,e.DYNAMIC_DRAW),c.itemSize=i,c.numItems=s;var d=this._alphaBuffer=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,d),i=1;var f=this._alphas=new Float32Array(s*i);for(n=0,r=f.length;n<r;n++)f[n]=1;e.bufferData(e.ARRAY_BUFFER,f,e.DYNAMIC_DRAW),d.itemSize=i,d.numItems=s},e._initTextures=function(){this._lastTextureInsert=-1,this._textureDictionary=[],this._textureIDs={},this._baseTextures=[],this._batchTextures=[];for(var t=0;t<this._batchTextureCount;t++){var e=this.getBaseTexture();if(this._baseTextures[t]=this._batchTextures[t]=e,!e)throw"Problems creating basic textures, known causes include using too much VRAM by not releasing WebGL texture instances"}},e._loadTextureImage=function(t,e){var i=e.src;i||(e._isCanvas=!0,i=e.src="canvas_"+this._lastTrackedCanvas++);var n=this._textureIDs[i];void 0===n&&(n=this._textureIDs[i]=this._textureDictionary.length),void 0===this._textureDictionary[n]&&(this._textureDictionary[n]=this.getBaseTexture());var r=this._textureDictionary[n];if(r)r._batchID=this._batchID,r._storeID=n,r._imageData=e,this._insertTextureInBatch(t,r),e._storeID=n,e.complete||e.naturalWidth||e._isCanvas?this._updateTextureImageData(t,e):e.addEventListener("load",this._updateTextureImageData.bind(this,t,e));else{var s="Problem creating desired texture, known causes include using too much VRAM by not releasing WebGL texture instances";console.error&&console.error(s)||console.log(s),(r=this._baseTextures[0])._batchID=this._batchID,r._storeID=-1,r._imageData=r,this._insertTextureInBatch(t,r)}return r},e._updateTextureImageData=function(t,e){var i=e.width&e.width-1||e.height&e.height-1,n=this._textureDictionary[e._storeID];t.activeTexture(t.TEXTURE0+n._activeIndex),t.bindTexture(t.TEXTURE_2D,n),n.isPOT=!i,this.setTextureParams(t,n.isPOT);try{t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e)}catch(t){var r="\nAn error has occurred. This is most likely due to security restrictions on WebGL images with local or cross-domain origins";console.error?(console.error(r),console.error(t)):console&&(console.log(r),console.log(t))}e._invalid=!1,n._w=e.width,n._h=e.height,this.vocalDebug&&(i&&console.warn("NPOT(Non Power of Two) Texture: "+e.src),(e.width>t.MAX_TEXTURE_SIZE||e.height>t.MAX_TEXTURE_SIZE)&&console&&console.error("Oversized Texture: "+e.width+"x"+e.height+" vs "+t.MAX_TEXTURE_SIZE+"max"))},e._insertTextureInBatch=function(t,e){if(this._batchTextures[e._activeIndex]!==e){var i=-1,n=(this._lastTextureInsert+1)%this._batchTextureCount,r=n;do{if(this._batchTextures[r]._batchID!=this._batchID&&!this._slotBlacklist[r]){i=r;break}r=(r+1)%this._batchTextureCount}while(r!==n);-1===i&&(this.batchReason="textureOverflow",this._drawBuffers(t),this.batchCardCount=0,i=n),this._batchTextures[i]=e,e._activeIndex=i,(s=e._imageData)&&s._invalid&&void 0!==e._drawID?this._updateTextureImageData(t,s):(t.activeTexture(t.TEXTURE0+i),t.bindTexture(t.TEXTURE_2D,e),this.setTextureParams(t)),this._lastTextureInsert=i}else{var s=e._imageData;void 0!=e._storeID&&s&&s._invalid&&this._updateTextureImageData(t,s)}e._drawID=this._drawID,e._batchID=this._batchID},e._killTextureObject=function(t){if(t){var e=this._webGLContext;if(void 0!==t._storeID&&t._storeID>=0){for(var i in this._textureDictionary[t._storeID]=void 0,this._textureIDs)this._textureIDs[i]==t._storeID&&delete this._textureIDs[i];t._imageData&&(t._imageData._storeID=void 0),t._imageData=t._storeID=void 0}void 0!==t._activeIndex&&this._batchTextures[t._activeIndex]===t&&(this._batchTextures[t._activeIndex]=this._baseTextures[t._activeIndex]);try{t._frameBuffer&&e.deleteFramebuffer(t._frameBuffer),t._frameBuffer=void 0}catch(t){this.vocalDebug&&console.log(t)}try{e.deleteTexture(t)}catch(t){this.vocalDebug&&console.log(t)}}},e._backupBatchTextures=function(t,e){var i=this._webGLContext;this._backupTextures||(this._backupTextures=[]),void 0===e&&(e=this._backupTextures);for(var n=0;n<this._batchTextureCount;n++)i.activeTexture(i.TEXTURE0+n),t?this._batchTextures[n]=e[n]:(e[n]=this._batchTextures[n],this._batchTextures[n]=this._baseTextures[n]),i.bindTexture(i.TEXTURE_2D,this._batchTextures[n]),this.setTextureParams(i,this._batchTextures[n].isPOT);t&&e===this._backupTextures&&(this._backupTextures=[])},e._batchDraw=function(t,e,i){this._isDrawing>0&&this._drawBuffers(e),this._isDrawing++,this._drawID++,this.batchCardCount=0,this.depth=0,this._appendToBatchGroup(t,e,new createjs.Matrix2D,this.alpha,i),this.batchReason="drawFinish",this._drawBuffers(e),this._isDrawing--},e._cacheDraw=function(t,e,i,n){var r,s=this._activeShader,a=this._slotBlacklist,o=this._maxTextureSlots-1,h=this._viewportWidth,u=this._viewportHeight;this.protectTextureSlot(o,!0);var c=e.getMatrix();(c=c.clone()).scale(1/n.scale,1/n.scale),(c=c.invert()).translate(-n.offX/n.scale*e.scaleX,-n.offY/n.scale*e.scaleY);var l=this._cacheContainer;l.children=[e],l.transformMatrix=c,this._backupBatchTextures(!1),i&&i.length?this._drawFilters(e,i,n):this.isCacheControlled?(t.clear(t.COLOR_BUFFER_BIT),this._batchDraw(l,t,!0)):(t.activeTexture(t.TEXTURE0+o),e.cacheCanvas=this.getTargetRenderTexture(e,n._drawWidth,n._drawHeight),r=e.cacheCanvas,t.bindFramebuffer(t.FRAMEBUFFER,r._frameBuffer),this.updateViewport(n._drawWidth,n._drawHeight),this._projectionMatrix=this._projectionMatrixFlip,t.clear(t.COLOR_BUFFER_BIT),this._batchDraw(l,t,!0),t.bindFramebuffer(t.FRAMEBUFFER,null),this.updateViewport(h,u)),this._backupBatchTextures(!0),this.protectTextureSlot(o,!1),this._activeShader=s,this._slotBlacklist=a},e._drawFilters=function(t,e,i){var n,r=this._webGLContext,s=this._maxTextureSlots-1,a=this._viewportWidth,o=this._viewportHeight,h=this._cacheContainer,u=e.length;r.activeTexture(r.TEXTURE0+s),n=this.getTargetRenderTexture(t,i._drawWidth,i._drawHeight),r.bindFramebuffer(r.FRAMEBUFFER,n._frameBuffer),this.updateViewport(i._drawWidth,i._drawHeight),r.clear(r.COLOR_BUFFER_BIT),this._batchDraw(h,r,!0),r.activeTexture(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,n),this.setTextureParams(r);var c=!1,l=0,d=e[l];do{this._activeShader=this.getFilterShader(d),this._activeShader&&(r.activeTexture(r.TEXTURE0+s),n=this.getTargetRenderTexture(t,i._drawWidth,i._drawHeight),r.bindFramebuffer(r.FRAMEBUFFER,n._frameBuffer),r.viewport(0,0,i._drawWidth,i._drawHeight),r.clear(r.COLOR_BUFFER_BIT),this._drawCover(r,c),r.activeTexture(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,n),this.setTextureParams(r),(u>1||e[0]._multiPass)&&(c=!c),d=null!==d._multiPass?d._multiPass:e[++l])}while(d);this.isCacheControlled?(r.bindFramebuffer(r.FRAMEBUFFER,null),this.updateViewport(a,o),this._activeShader=this.getFilterShader(this),r.clear(r.COLOR_BUFFER_BIT),this._drawCover(r,c)):(c&&(r.activeTexture(r.TEXTURE0+s),n=this.getTargetRenderTexture(t,i._drawWidth,i._drawHeight),r.bindFramebuffer(r.FRAMEBUFFER,n._frameBuffer),this._activeShader=this.getFilterShader(this),r.viewport(0,0,i._drawWidth,i._drawHeight),r.clear(r.COLOR_BUFFER_BIT),this._drawCover(r,!c)),r.bindFramebuffer(r.FRAMEBUFFER,null),this.updateViewport(a,o),t.cacheCanvas=n)},e._appendToBatchGroup=function(e,i,n,r,s){e._glMtx||(e._glMtx=new createjs.Matrix2D);var a,o,h,u,c=e._glMtx;c.copy(n),e.transformMatrix?c.appendMatrix(e.transformMatrix):c.appendTransform(e.x,e.y,e.scaleX,e.scaleY,e.rotation,e.skewX,e.skewY,e.regX,e.regY);for(var l=e.children.length,d=0;d<l;d++){var f=e.children[d];if(f.visible&&r)if(f.cacheCanvas&&!s||(f._updateState&&f._updateState(),!f.children)){this.batchCardCount+1>this._maxCardsPerBatch&&(this.batchReason="vertexOverflow",this._drawBuffers(i),this.batchCardCount=0),f._glMtx||(f._glMtx=new createjs.Matrix2D);var p,g,m,v,_,x,y=f._glMtx;y.copy(c),f.transformMatrix?y.appendMatrix(f.transformMatrix):y.appendTransform(f.x,f.y,f.scaleX,f.scaleY,f.rotation,f.skewX,f.skewY,f.regX,f.regY);var b=f.cacheCanvas&&!s;if(2===f._webGLRenderStyle||b)m=!s&&f.cacheCanvas||f.image;else{if(1!==f._webGLRenderStyle)continue;if(null===(v=f.spriteSheet.getFrame(f.currentFrame)))continue;m=v.image}var w=this._uvs,T=this._vertices,E=this._indices,C=this._alphas;if(m){if(void 0===m._storeID)_=this._loadTextureImage(i,m),this._insertTextureInBatch(i,_);else{if(!(_=this._textureDictionary[m._storeID])){this.vocalDebug&&console.log("Texture should not be looked up while not being stored.");continue}_._batchID!==this._batchID&&this._insertTextureInBatch(i,_)}if(g=_._activeIndex,2===f._webGLRenderStyle||b)!b&&f.sourceRect?(f._uvRect||(f._uvRect={}),x=f.sourceRect,(p=f._uvRect).t=x.y/m.height,p.l=x.x/m.width,p.b=(x.y+x.height)/m.height,p.r=(x.x+x.width)/m.width,a=0,o=0,h=x.width+a,u=x.height+o):(p=t.UV_RECT,b?(a=(x=f.bitmapCache).x+x._filterOffX/x.scale,o=x.y+x._filterOffY/x.scale,h=x._drawWidth/x.scale+a,u=x._drawHeight/x.scale+o):(a=0,o=0,h=m.width+a,u=m.height+o));else if(1===f._webGLRenderStyle){var S=v.rect;(p=v.uvRect)||(p=t.buildUVRects(f.spriteSheet,f.currentFrame,!1)),a=-v.regX,o=-v.regY,h=S.width-v.regX,u=S.height-v.regY}var D=this.batchCardCount*t.INDICIES_PER_CARD,A=2*D;T[A]=a*y.a+o*y.c+y.tx,T[A+1]=a*y.b+o*y.d+y.ty,T[A+2]=a*y.a+u*y.c+y.tx,T[A+3]=a*y.b+u*y.d+y.ty,T[A+4]=h*y.a+o*y.c+y.tx,T[A+5]=h*y.b+o*y.d+y.ty,T[A+6]=T[A+2],T[A+7]=T[A+3],T[A+8]=T[A+4],T[A+9]=T[A+5],T[A+10]=h*y.a+u*y.c+y.tx,T[A+11]=h*y.b+u*y.d+y.ty,w[A]=p.l,w[A+1]=p.t,w[A+2]=p.l,w[A+3]=p.b,w[A+4]=p.r,w[A+5]=p.t,w[A+6]=p.l,w[A+7]=p.b,w[A+8]=p.r,w[A+9]=p.t,w[A+10]=p.r,w[A+11]=p.b,E[D]=E[D+1]=E[D+2]=E[D+3]=E[D+4]=E[D+5]=g,C[D]=C[D+1]=C[D+2]=C[D+3]=C[D+4]=C[D+5]=f.alpha*r,this.batchCardCount++}}else this._appendToBatchGroup(f,i,c,f.alpha*r)}},e._drawBuffers=function(e){if(!(this.batchCardCount<=0)){this.vocalDebug&&console.log("Draw["+this._drawID+":"+this._batchID+"] : "+this.batchReason);var i=this._activeShader,n=this._vertexPositionBuffer,r=this._textureIndexBuffer,s=this._uvPositionBuffer,a=this._alphaBuffer;e.useProgram(i),e.bindBuffer(e.ARRAY_BUFFER,n),e.vertexAttribPointer(i.vertexPositionAttribute,n.itemSize,e.FLOAT,!1,0,0),e.bufferSubData(e.ARRAY_BUFFER,0,this._vertices),e.bindBuffer(e.ARRAY_BUFFER,r),e.vertexAttribPointer(i.textureIndexAttribute,r.itemSize,e.FLOAT,!1,0,0),e.bufferSubData(e.ARRAY_BUFFER,0,this._indices),e.bindBuffer(e.ARRAY_BUFFER,s),e.vertexAttribPointer(i.uvPositionAttribute,s.itemSize,e.FLOAT,!1,0,0),e.bufferSubData(e.ARRAY_BUFFER,0,this._uvs),e.bindBuffer(e.ARRAY_BUFFER,a),e.vertexAttribPointer(i.alphaAttribute,a.itemSize,e.FLOAT,!1,0,0),e.bufferSubData(e.ARRAY_BUFFER,0,this._alphas),e.uniformMatrix4fv(i.pMatrixUniform,e.FALSE,this._projectionMatrix);for(var o=0;o<this._batchTextureCount;o++){var h=this._batchTextures[o];e.activeTexture(e.TEXTURE0+o),e.bindTexture(e.TEXTURE_2D,h),this.setTextureParams(e,h.isPOT)}e.drawArrays(e.TRIANGLES,0,this.batchCardCount*t.INDICIES_PER_CARD),this._batchID++}},e._drawCover=function(e,i){this._isDrawing>0&&this._drawBuffers(e),this.vocalDebug&&console.log("Draw["+this._drawID+":"+this._batchID+"] : Cover");var n=this._activeShader,r=this._vertexPositionBuffer,s=this._uvPositionBuffer;e.clear(e.COLOR_BUFFER_BIT),e.useProgram(n),e.bindBuffer(e.ARRAY_BUFFER,r),e.vertexAttribPointer(n.vertexPositionAttribute,r.itemSize,e.FLOAT,!1,0,0),e.bufferSubData(e.ARRAY_BUFFER,0,t.COVER_VERT),e.bindBuffer(e.ARRAY_BUFFER,s),e.vertexAttribPointer(n.uvPositionAttribute,s.itemSize,e.FLOAT,!1,0,0),e.bufferSubData(e.ARRAY_BUFFER,0,i?t.COVER_UV_FLIP:t.COVER_UV),e.uniform1i(n.samplerUniform,0),e.uniform1f(n.uprightUniform,i?0:1),e.drawArrays(e.TRIANGLES,0,t.INDICIES_PER_CARD)},createjs.StageGL=createjs.promote(t,"Stage")}(),window.createjs=window.createjs||{},function(){function t(t){this.DisplayObject_constructor(),"string"==typeof t?(this.image=document.createElement("img"),this.image.src=t):this.image=t,this.sourceRect=null,this._webGLRenderStyle=createjs.DisplayObject._StageGL_BITMAP}var e=createjs.extend(t,createjs.DisplayObject);e.initialize=t,e.isVisible=function(){var t=this.image,e=this.cacheCanvas||t&&(t.naturalWidth||t.getContext||t.readyState>=2);return!!(this.visible&&this.alpha>0&&0!=this.scaleX&&0!=this.scaleY&&e)},e.draw=function(t,e){if(this.DisplayObject_draw(t,e))return!0;var i=this.image,n=this.sourceRect;if(i.getImage&&(i=i.getImage()),!i)return!0;if(n){var r=n.x,s=n.y,a=r+n.width,o=s+n.height,h=0,u=0,c=i.width,l=i.height;r<0&&(h-=r,r=0),a>c&&(a=c),s<0&&(u-=s,s=0),o>l&&(o=l),t.drawImage(i,r,s,a-r,o-s,h,u,a-r,o-s)}else t.drawImage(i,0,0);return!0},e.getBounds=function(){var t=this.DisplayObject_getBounds();if(t)return t;var e=this.image,i=this.sourceRect||e;return e&&(e.naturalWidth||e.getContext||e.readyState>=2)?this._rectangle.setValues(0,0,i.width,i.height):null},e.clone=function(e){var i=this.image;i&&e&&(i=i.cloneNode());var n=new t(i);return this.sourceRect&&(n.sourceRect=this.sourceRect.clone()),this._cloneProps(n),n},e.toString=function(){return"[Bitmap (name="+this.name+")]"},createjs.Bitmap=createjs.promote(t,"DisplayObject")}(),window.createjs=window.createjs||{},function(){"use strict";function t(t,e){this.DisplayObject_constructor(),this.currentFrame=0,this.currentAnimation=null,this.paused=!0,this.spriteSheet=t,this.currentAnimationFrame=0,this.framerate=0,this._animation=null,this._currentFrame=null,this._skipAdvance=!1,this._webGLRenderStyle=createjs.DisplayObject._StageGL_SPRITE,null!=e&&this.gotoAndPlay(e)}var e=createjs.extend(t,createjs.DisplayObject);e.initialize=t,e.isVisible=function(){var t=this.cacheCanvas||this.spriteSheet.complete;return!!(this.visible&&this.alpha>0&&0!=this.scaleX&&0!=this.scaleY&&t)},e.draw=function(t,e){if(this.DisplayObject_draw(t,e))return!0;this._normalizeFrame();var i=this.spriteSheet.getFrame(0|this._currentFrame);if(!i)return!1;var n=i.rect;return n.width&&n.height&&t.drawImage(i.image,n.x,n.y,n.width,n.height,-i.regX,-i.regY,n.width,n.height),!0},e.play=function(){this.paused=!1},e.stop=function(){this.paused=!0},e.gotoAndPlay=function(t){this.paused=!1,this._skipAdvance=!0,this._goto(t)},e.gotoAndStop=function(t){this.paused=!0,this._goto(t)},e.advance=function(t){var e=this.framerate||this.spriteSheet.framerate,i=e&&null!=t?t/(1e3/e):1;this._normalizeFrame(i)},e.getBounds=function(){return this.DisplayObject_getBounds()||this.spriteSheet.getFrameBounds(this.currentFrame,this._rectangle)},e.clone=function(){return this._cloneProps(new t(this.spriteSheet))},e.toString=function(){return"[Sprite (name="+this.name+")]"},e._cloneProps=function(t){return this.DisplayObject__cloneProps(t),t.currentFrame=this.currentFrame,t.currentAnimation=this.currentAnimation,t.paused=this.paused,t.currentAnimationFrame=this.currentAnimationFrame,t.framerate=this.framerate,t._animation=this._animation,t._currentFrame=this._currentFrame,t._skipAdvance=this._skipAdvance,t},e._tick=function(t){this.paused||(this._skipAdvance||this.advance(t&&t.delta),this._skipAdvance=!1),this.DisplayObject__tick(t)},e._normalizeFrame=function(t){t=t||0;var e,i=this._animation,n=this.paused,r=this._currentFrame;if(i){var s=i.speed||1,a=this.currentAnimationFrame;if(a+t*s>=(e=i.frames.length)){var o=i.next;if(this._dispatchAnimationEnd(i,r,n,o,e-1))return;if(o)return this._goto(o,t-(e-a)/s);this.paused=!0,a=i.frames.length-1}else a+=t*s;this.currentAnimationFrame=a,this._currentFrame=i.frames[0|a]}else if((r=this._currentFrame+=t)>=(e=this.spriteSheet.getNumFrames())&&e>0&&!this._dispatchAnimationEnd(i,r,n,e-1)&&(this._currentFrame-=e)>=e)return this._normalizeFrame();r=0|this._currentFrame,this.currentFrame!=r&&(this.currentFrame=r,this.dispatchEvent("change"))},e._dispatchAnimationEnd=function(t,e,i,n,r){var s=t?t.name:null;if(this.hasEventListener("animationend")){var a=new createjs.Event("animationend");a.name=s,a.next=n,this.dispatchEvent(a)}var o=this._animation!=t||this._currentFrame!=e;return o||i||!this.paused||(this.currentAnimationFrame=r,o=!0),o},e._goto=function(t,e){if(this.currentAnimationFrame=0,isNaN(t)){var i=this.spriteSheet.getAnimation(t);i&&(this._animation=i,this.currentAnimation=t,this._normalizeFrame(e))}else this.currentAnimation=this._animation=null,this._currentFrame=t,this._normalizeFrame()},createjs.Sprite=createjs.promote(t,"DisplayObject")}(),window.createjs=window.createjs||{},function(){"use strict";function t(t){this.DisplayObject_constructor(),this.graphics=t||new createjs.Graphics}var e=createjs.extend(t,createjs.DisplayObject);e.isVisible=function(){var t=this.cacheCanvas||this.graphics&&!this.graphics.isEmpty();return!!(this.visible&&this.alpha>0&&0!=this.scaleX&&0!=this.scaleY&&t)},e.draw=function(t,e){return!!this.DisplayObject_draw(t,e)||(this.graphics.draw(t,this),!0)},e.clone=function(e){var i=e&&this.graphics?this.graphics.clone():this.graphics;return this._cloneProps(new t(i))},e.toString=function(){return"[Shape (name="+this.name+")]"},createjs.Shape=createjs.promote(t,"DisplayObject")}(),window.createjs=window.createjs||{},function(){"use strict";function t(t,e,i){this.DisplayObject_constructor(),this.text=t,this.font=e,this.color=i,this.textAlign="left",this.textBaseline="top",this.maxWidth=null,this.outline=0,this.lineHeight=0,this.lineWidth=null}var e=createjs.extend(t,createjs.DisplayObject),i=createjs.createCanvas?createjs.createCanvas():document.createElement("canvas");i.getContext&&(t._workingContext=i.getContext("2d"),i.width=i.height=1),t.H_OFFSETS={start:0,left:0,center:-.5,end:-1,right:-1},t.V_OFFSETS={top:0,hanging:-.01,middle:-.4,alphabetic:-.8,ideographic:-.85,bottom:-1},e.isVisible=function(){var t=this.cacheCanvas||null!=this.text&&""!==this.text;return!!(this.visible&&this.alpha>0&&0!=this.scaleX&&0!=this.scaleY&&t)},e.draw=function(t,e){if(this.DisplayObject_draw(t,e))return!0;var i=this.color||"#000";return this.outline?(t.strokeStyle=i,t.lineWidth=1*this.outline):t.fillStyle=i,this._drawText(this._prepContext(t)),!0},e.getMeasuredWidth=function(){return this._getMeasuredWidth(this.text)},e.getMeasuredLineHeight=function(){return 1.2*this._getMeasuredWidth("M")},e.getMeasuredHeight=function(){return this._drawText(null,{}).height},e.getBounds=function(){var e=this.DisplayObject_getBounds();if(e)return e;if(null==this.text||""===this.text)return null;var i=this._drawText(null,{}),n=this.maxWidth&&this.maxWidth<i.width?this.maxWidth:i.width,r=n*t.H_OFFSETS[this.textAlign||"left"],s=(this.lineHeight||this.getMeasuredLineHeight())*t.V_OFFSETS[this.textBaseline||"top"];return this._rectangle.setValues(r,s,n,i.height)},e.getMetrics=function(){var e={lines:[]};return e.lineHeight=this.lineHeight||this.getMeasuredLineHeight(),e.vOffset=e.lineHeight*t.V_OFFSETS[this.textBaseline||"top"],this._drawText(null,e,e.lines)},e.clone=function(){return this._cloneProps(new t(this.text,this.font,this.color))},e.toString=function(){return"[Text (text="+(this.text.length>20?this.text.substr(0,17)+"...":this.text)+")]"},e._cloneProps=function(t){return this.DisplayObject__cloneProps(t),t.textAlign=this.textAlign,t.textBaseline=this.textBaseline,t.maxWidth=this.maxWidth,t.outline=this.outline,t.lineHeight=this.lineHeight,t.lineWidth=this.lineWidth,t},e._prepContext=function(t){return t.font=this.font||"10px sans-serif",t.textAlign=this.textAlign||"left",t.textBaseline=this.textBaseline||"top",t.lineJoin="miter",t.miterLimit=2.5,t},e._drawText=function(e,i,n){var r=!!e;r||((e=t._workingContext).save(),this._prepContext(e));for(var s=this.lineHeight||this.getMeasuredLineHeight(),a=0,o=0,h=String(this.text).split(/(?:\r\n|\r|\n)/),u=0,c=h.length;u<c;u++){var l=h[u],d=null;if(null!=this.lineWidth&&(d=e.measureText(l).width)>this.lineWidth){var f=l.split(/(\s)/);l=f[0],d=e.measureText(l).width;for(var p=1,g=f.length;p<g;p+=2){var m=e.measureText(f[p]+f[p+1]).width;d+m>this.lineWidth?(r&&this._drawTextLine(e,l,o*s),n&&n.push(l),d>a&&(a=d),l=f[p+1],d=e.measureText(l).width,o++):(l+=f[p]+f[p+1],d+=m)}}r&&this._drawTextLine(e,l,o*s),n&&n.push(l),i&&null==d&&(d=e.measureText(l).width),d>a&&(a=d),o++}return i&&(i.width=a,i.height=o*s),r||e.restore(),i},e._drawTextLine=function(t,e,i){this.outline?t.strokeText(e,0,i,this.maxWidth||65535):t.fillText(e,0,i,this.maxWidth||65535)},e._getMeasuredWidth=function(e){var i=t._workingContext;i.save();var n=this._prepContext(i).measureText(e).width;return i.restore(),n},createjs.Text=createjs.promote(t,"DisplayObject")}(),this.createjs=this.createjs||{},function(){"use strict";function t(t,e){this.Container_constructor(),this.text=t||"",this.spriteSheet=e,this.lineHeight=0,this.letterSpacing=0,this.spaceWidth=0,this._oldProps={text:0,spriteSheet:0,lineHeight:0,letterSpacing:0,spaceWidth:0},this._oldStage=null,this._drawAction=null}var e=createjs.extend(t,createjs.Container);t.maxPoolSize=100,t._spritePool=[],e.draw=function(t,e){this.DisplayObject_draw(t,e)||(this._updateState(),this.Container_draw(t,e))},e.getBounds=function(){return this._updateText(),this.Container_getBounds()},e.isVisible=function(){var t=this.cacheCanvas||this.spriteSheet&&this.spriteSheet.complete&&this.text;return!!(this.visible&&this.alpha>0&&0!==this.scaleX&&0!==this.scaleY&&t)},e.clone=function(){return this._cloneProps(new t(this.text,this.spriteSheet))},e.addChild=e.addChildAt=e.removeChild=e.removeChildAt=e.removeAllChildren=function(){},e._updateState=function(){this._updateText()},e._cloneProps=function(t){return this.Container__cloneProps(t),t.lineHeight=this.lineHeight,t.letterSpacing=this.letterSpacing,t.spaceWidth=this.spaceWidth,t},e._getFrameIndex=function(t,e){var i,n=e.getAnimation(t);return n||(t!=(i=t.toUpperCase())||t!=(i=t.toLowerCase())||(i=null),i&&(n=e.getAnimation(i))),n&&n.frames[0]},e._getFrame=function(t,e){var i=this._getFrameIndex(t,e);return null==i?i:e.getFrame(i)},e._getLineHeight=function(t){var e=this._getFrame("1",t)||this._getFrame("T",t)||this._getFrame("L",t)||t.getFrame(0);return e?e.rect.height:1},e._getSpaceWidth=function(t){var e=this._getFrame("1",t)||this._getFrame("l",t)||this._getFrame("e",t)||this._getFrame("a",t)||t.getFrame(0);return e?e.rect.width:1},e._updateText=function(){var e,i=0,n=0,r=this._oldProps,s=!1,a=this.spaceWidth,o=this.lineHeight,h=this.spriteSheet,u=t._spritePool,c=this.children,l=0,d=c.length;for(var f in r)r[f]!=this[f]&&(r[f]=this[f],s=!0);if(s){var p=!!this._getFrame(" ",h);p||a||(a=this._getSpaceWidth(h)),o||(o=this._getLineHeight(h));for(var g=0,m=this.text.length;g<m;g++){var v=this.text.charAt(g);if(" "!=v||p)if("\n"!=v&&"\r"!=v){var _=this._getFrameIndex(v,h);null!=_&&(l<d?e=c[l]:(c.push(e=u.length?u.pop():new createjs.Sprite),e.parent=this,d++),e.spriteSheet=h,e.gotoAndStop(_),e.x=i,e.y=n,l++,i+=e.getBounds().width+this.letterSpacing)}else"\r"==v&&"\n"==this.text.charAt(g+1)&&g++,i=0,n+=o;else i+=a}for(;d>l;)u.push(e=c.pop()),e.parent=null,d--;u.length>t.maxPoolSize&&(u.length=t.maxPoolSize)}},createjs.BitmapText=createjs.promote(t,"Container")}(),window.createjs=window.createjs||{},function(){"use strict";function t(e){var i,n,r,s;this.Container_constructor(),!t.inited&&t.init(),e instanceof String||arguments.length>1?(i=e,n=arguments[1],r=arguments[2],s=arguments[3],null==r&&(r=-1),e=null):e&&(i=e.mode,n=e.startPosition,r=e.loop,s=e.labels),e||(e={labels:s}),this.mode=i||t.INDEPENDENT,this.startPosition=n||0,this.loop=!0===r?-1:r||0,this.currentFrame=0,this.paused=e.paused||!1,this.actionsEnabled=!0,this.autoReset=!0,this.frameBounds=this.frameBounds||e.frameBounds,this.framerate=null,e.useTicks=e.paused=!0,this.timeline=new createjs.Timeline(e),this._synchOffset=0,this._rawPosition=-1,this._bound_resolveState=this._resolveState.bind(this),this._t=0,this._managed={}}var e=createjs.extend(t,createjs.Container);t.INDEPENDENT="independent",t.SINGLE_FRAME="single",t.SYNCHED="synched",t.inited=!1,t.init=function(){t.inited||(i.install(),t.inited=!0)},e._getLabels=function(){return this.timeline.getLabels()},e.getLabels=createjs.deprecate(e._getLabels,"MovieClip.getLabels"),e._getCurrentLabel=function(){return this.timeline.currentLabel},e.getCurrentLabel=createjs.deprecate(e._getCurrentLabel,"MovieClip.getCurrentLabel"),e._getDuration=function(){return this.timeline.duration},e.getDuration=createjs.deprecate(e._getDuration,"MovieClip.getDuration");try{Object.defineProperties(e,{labels:{get:e._getLabels},currentLabel:{get:e._getCurrentLabel},totalFrames:{get:e._getDuration},duration:{get:e._getDuration}})}catch(t){}function i(){throw"MovieClipPlugin cannot be instantiated."}e.initialize=t,e.isVisible=function(){return!!(this.visible&&this.alpha>0&&0!=this.scaleX&&0!=this.scaleY)},e.draw=function(t,e){return!!this.DisplayObject_draw(t,e)||(this._updateState(),this.Container_draw(t,e),!0)},e.play=function(){this.paused=!1},e.stop=function(){this.paused=!0},e.gotoAndPlay=function(t){this.paused=!1,this._goto(t)},e.gotoAndStop=function(t){this.paused=!0,this._goto(t)},e.advance=function(e){var i=t.INDEPENDENT;if(this.mode===i){for(var n=this,r=n.framerate;(n=n.parent)&&null===r;)n.mode===i&&(r=n._framerate);if(this._framerate=r,!this.paused){var s=null!==r&&-1!==r&&null!==e?e/(1e3/r)+this._t:1,a=0|s;for(this._t=s-a;a--;)this._updateTimeline(this._rawPosition+1,!1)}}},e.clone=function(){throw"MovieClip cannot be cloned."},e.toString=function(){return"[MovieClip (name="+this.name+")]"},e._updateState=function(){-1!==this._rawPosition&&this.mode===t.INDEPENDENT||this._updateTimeline(-1)},e._tick=function(t){this.advance(t&&t.delta),this.Container__tick(t)},e._goto=function(t){var e=this.timeline.resolve(t);null!=e&&(this._t=0,this._updateTimeline(e,!0))},e._reset=function(){this._rawPosition=-1,this._t=this.currentFrame=0,this.paused=!1},e._updateTimeline=function(e,i){var n=this.mode!==t.INDEPENDENT,r=this.timeline;n&&(e=this.startPosition+(this.mode===t.SINGLE_FRAME?0:this._synchOffset)),e<0&&(e=0),(this._rawPosition!==e||n)&&(this._rawPosition=e,r.loop=this.loop,r.setPosition(e,n||!this.actionsEnabled,i,this._bound_resolveState))},e._renderFirstFrame=function(){var t=this.timeline,e=t.rawPosition;t.setPosition(0,!0,!0,this._bound_resolveState),t.rawPosition=e},e._resolveState=function(){var t=this.timeline;for(var e in this.currentFrame=t.position,this._managed)this._managed[e]=1;for(var i=t.tweens,n=0,r=i.length;n<r;n++){var s=i[n],a=s.target;if(a!==this&&!s.passive){var o=s._stepPosition;a instanceof createjs.DisplayObject?this._addManagedChild(a,o):this._setState(a.state,o)}}var h=this.children;for(n=h.length-1;n>=0;n--){var u=h[n].id;1===this._managed[u]&&(this.removeChildAt(n),delete this._managed[u])}},e._setState=function(t,e){if(t)for(var i=t.length-1;i>=0;i--){var n=t[i],r=n.t,s=n.p;for(var a in s)r[a]=s[a];this._addManagedChild(r,e)}},e._addManagedChild=function(e,i){e._off||(this.addChildAt(e,0),e instanceof t&&(e._synchOffset=i,e.mode===t.INDEPENDENT&&e.autoReset&&!this._managed[e.id]&&e._reset()),this._managed[e.id]=2)},e._getBounds=function(t,e){var i=this.DisplayObject_getBounds();return i||this.frameBounds&&(i=this._rectangle.copy(this.frameBounds[this.currentFrame])),i?this._transformBounds(i,t,e):this.Container__getBounds(t,e)},createjs.MovieClip=createjs.promote(t,"Container"),i.priority=100,i.ID="MovieClip",i.install=function(){createjs.Tween._installPlugin(i)},i.init=function(e,n,r){"startPosition"===n&&e.target instanceof t&&e._addPlugin(i)},i.step=function(t,e,i){},i.change=function(t,e,i,n,r,s){if("startPosition"===i)return 1===r?e.props[i]:e.prev.props[i]}}(),window.createjs=window.createjs||{},function(){"use strict";function t(){throw"SpriteSheetUtils cannot be instantiated"}var e=createjs.createCanvas?createjs.createCanvas():document.createElement("canvas");e.getContext&&(t._workingCanvas=e,t._workingContext=e.getContext("2d"),e.width=e.height=1),t.extractFrame=function(e,i){isNaN(i)&&(i=e.getAnimation(i).frames[0]);var n=e.getFrame(i);if(!n)return null;var r=n.rect,s=t._workingCanvas;s.width=r.width,s.height=r.height,t._workingContext.drawImage(n.image,r.x,r.y,r.width,r.height,0,0,r.width,r.height);var a=document.createElement("img");return a.src=s.toDataURL("image/png"),a},t.addFlippedFrames=createjs.deprecate(null,"SpriteSheetUtils.addFlippedFrames"),t.mergeAlpha=createjs.deprecate(null,"SpriteSheetUtils.mergeAlpha"),t._flip=function(e,i,n,r){for(var s=e._images,a=t._workingCanvas,o=t._workingContext,h=s.length/i,u=0;u<h;u++){var c=s[u];c.__tmp=u,o.setTransform(1,0,0,1,0,0),o.clearRect(0,0,a.width+1,a.height+1),a.width=c.width,a.height=c.height,o.setTransform(n?-1:1,0,0,r?-1:1,n?c.width:0,r?c.height:0),o.drawImage(c,0,0);var l=document.createElement("img");l.src=a.toDataURL("image/png"),l.width=c.width||c.naturalWidth,l.height=c.height||c.naturalHeight,s.push(l)}var d=e._frames,f=d.length/i;for(u=0;u<f;u++){var p=(c=d[u]).rect.clone(),g={image:l=s[c.image.__tmp+h*i],rect:p,regX:c.regX,regY:c.regY};n&&(p.x=(l.width||l.naturalWidth)-p.x-p.width,g.regX=p.width-c.regX),r&&(p.y=(l.height||l.naturalHeight)-p.y-p.height,g.regY=p.height-c.regY),d.push(g)}var m="_"+(n?"h":"")+(r?"v":""),v=e._animations,_=e._data,x=v.length/i;for(u=0;u<x;u++){var y=v[u],b={name:y+m,speed:(c=_[y]).speed,next:c.next,frames:[]};c.next&&(b.next+=m);for(var w=0,T=(d=c.frames).length;w<T;w++)b.frames.push(d[w]+f*i);_[b.name]=b,v.push(b.name)}},createjs.SpriteSheetUtils=t}(),window.createjs=window.createjs||{},function(){"use strict";function t(t){this.EventDispatcher_constructor(),this.maxWidth=2048,this.maxHeight=2048,this.spriteSheet=null,this.scale=1,this.padding=1,this.timeSlice=.3,this.progress=-1,this.framerate=t||0,this._frames=[],this._animations={},this._data=null,this._nextFrameIndex=0,this._index=0,this._timerID=null,this._scale=1}var e=createjs.extend(t,createjs.EventDispatcher);t.ERR_DIMENSIONS="frame dimensions exceed max spritesheet dimensions",t.ERR_RUNNING="a build is already running",e.addFrame=function(e,i,n,r,s){if(this._data)throw t.ERR_RUNNING;var a=i||e.bounds||e.nominalBounds;return!a&&e.getBounds&&(a=e.getBounds()),a?(n=n||1,this._frames.push({source:e,sourceRect:a,scale:n,funct:r,data:s,index:this._frames.length,height:a.height*n})-1):null},e.addAnimation=function(e,i,n,r){if(this._data)throw t.ERR_RUNNING;this._animations[e]={frames:i,next:n,speed:r}},e.addMovieClip=function(e,i,n,r,s,a){if(this._data)throw t.ERR_RUNNING;var o=e.frameBounds,h=i||e.bounds||e.nominalBounds;if(!h&&e.getBounds&&(h=e.getBounds()),h||o){var u,c,l=this._frames.length,d=e.timeline.duration;for(u=0;u<d;u++){var f=o&&o[u]?o[u]:h;this.addFrame(e,f,n,this._setupMovieClipFrame,{i:u,f:r,d:s})}var p=e.timeline._labels,g=[];for(var m in p)g.push({index:p[m],label:m});if(g.length)for(g.sort(function(t,e){return t.index-e.index}),u=0,c=g.length;u<c;u++){for(var v=g[u].label,_=l+g[u].index,x=l+(u==c-1?d:g[u+1].index),y=[],b=_;b<x;b++)y.push(b);a&&!(v=a(v,e,_,x))||this.addAnimation(v,y,!0)}}},e.build=function(){if(this._data)throw t.ERR_RUNNING;for(this._startBuild();this._drawNext(););return this._endBuild(),this.spriteSheet},e.buildAsync=function(e){if(this._data)throw t.ERR_RUNNING;this.timeSlice=e,this._startBuild();var i=this;this._timerID=setTimeout(function(){i._run()},50-50*Math.max(.01,Math.min(.99,this.timeSlice||.3)))},e.stopAsync=function(){clearTimeout(this._timerID),this._data=null},e.clone=function(){throw"SpriteSheetBuilder cannot be cloned."},e.toString=function(){return"[SpriteSheetBuilder]"},e._startBuild=function(){var e=this.padding||0;this.progress=0,this.spriteSheet=null,this._index=0,this._scale=this.scale;var i=[];this._data={images:[],frames:i,framerate:this.framerate,animations:this._animations};var n=this._frames.slice();if(n.sort(function(t,e){return t.height<=e.height?-1:1}),n[n.length-1].height+2*e>this.maxHeight)throw t.ERR_DIMENSIONS;for(var r=0,s=0,a=0;n.length;){var o=this._fillRow(n,r,a,i,e);if(o.w>s&&(s=o.w),r+=o.h,!o.h||!n.length){var h=createjs.createCanvas?createjs.createCanvas():document.createElement("canvas");h.width=this._getSize(s,this.maxWidth),h.height=this._getSize(r,this.maxHeight),this._data.images[a]=h,o.h||(s=r=0,a++)}}},e._setupMovieClipFrame=function(t,e){var i=t.actionsEnabled;t.actionsEnabled=!1,t.gotoAndStop(e.i),t.actionsEnabled=i,e.f&&e.f(t,e.d,e.i)},e._getSize=function(t,e){for(var i=4;Math.pow(2,++i)<t;);return Math.min(e,Math.pow(2,i))},e._fillRow=function(e,i,n,r,s){for(var a=this.maxWidth,o=this.maxHeight-(i+=s),h=s,u=0,c=e.length-1;c>=0;c--){var l=e[c],d=this._scale*l.scale,f=l.sourceRect,p=l.source,g=Math.floor(d*f.x-s),m=Math.floor(d*f.y-s),v=Math.ceil(d*f.height+2*s),_=Math.ceil(d*f.width+2*s);if(_>a)throw t.ERR_DIMENSIONS;v>o||h+_>a||(l.img=n,l.rect=new createjs.Rectangle(h,i,_,v),u=u||v,e.splice(c,1),r[l.index]=[h,i,_,v,n,Math.round(-g+d*p.regX-s),Math.round(-m+d*p.regY-s)],h+=_)}return{w:h,h:u}},e._endBuild=function(){this.spriteSheet=new createjs.SpriteSheet(this._data),this._data=null,this.progress=1,this.dispatchEvent("complete")},e._run=function(){for(var t=50*Math.max(.01,Math.min(.99,this.timeSlice||.3)),e=(new Date).getTime()+t,i=!1;e>(new Date).getTime();)if(!this._drawNext()){i=!0;break}if(i)this._endBuild();else{var n=this;this._timerID=setTimeout(function(){n._run()},50-t)}var r=this.progress=this._index/this._frames.length;if(this.hasEventListener("progress")){var s=new createjs.Event("progress");s.progress=r,this.dispatchEvent(s)}},e._drawNext=function(){var t=this._frames[this._index],e=t.scale*this._scale,i=t.rect,n=t.sourceRect,r=this._data.images[t.img].getContext("2d");return t.funct&&t.funct(t.source,t.data),r.save(),r.beginPath(),r.rect(i.x,i.y,i.width,i.height),r.clip(),r.translate(Math.ceil(i.x-n.x*e),Math.ceil(i.y-n.y*e)),r.scale(e,e),t.source.draw(r),r.restore(),++this._index<this._frames.length},createjs.SpriteSheetBuilder=createjs.promote(t,"EventDispatcher")}(),window.createjs=window.createjs||{},function(){"use strict";function t(t){this.DisplayObject_constructor(),"string"==typeof t&&(t=document.getElementById(t)),this.mouseEnabled=!1;var e=t.style;e.position="absolute",e.transformOrigin=e.WebkitTransformOrigin=e.msTransformOrigin=e.MozTransformOrigin=e.OTransformOrigin="0% 0%",this.htmlElement=t,this._oldProps=null,this._oldStage=null,this._drawAction=null}var e=createjs.extend(t,createjs.DisplayObject);e.isVisible=function(){return null!=this.htmlElement},e.draw=function(t,e){return!0},e.cache=function(){},e.uncache=function(){},e.updateCache=function(){},e.hitTest=function(){},e.localToGlobal=function(){},e.globalToLocal=function(){},e.localToLocal=function(){},e.clone=function(){throw"DOMElement cannot be cloned."},e.toString=function(){return"[DOMElement (name="+this.name+")]"},e._tick=function(t){var e=this.stage;e&&e!==this._oldStage&&(this._drawAction&&e.off("drawend",this._drawAction),this._drawAction=e.on("drawend",this._handleDrawEnd,this),this._oldStage=e),this.DisplayObject__tick(t)},e._handleDrawEnd=function(t){var e=this.htmlElement;if(e){var i=e.style,n=this.getConcatenatedDisplayProps(this._props),r=n.matrix,s=n.visible?"visible":"hidden";if(s!=i.visibility&&(i.visibility=s),n.visible){var a=this._oldProps,o=a&&a.matrix,h=1e4;if(!o||!o.equals(r)){var u="matrix("+(r.a*h|0)/h+","+(r.b*h|0)/h+","+(r.c*h|0)/h+","+(r.d*h|0)/h+","+(r.tx+.5|0);i.transform=i.WebkitTransform=i.OTransform=i.msTransform=u+","+(r.ty+.5|0)+")",i.MozTransform=u+"px,"+(r.ty+.5|0)+"px)",a||(a=this._oldProps=new createjs.DisplayProps(!0,null)),a.matrix.copy(r)}a.alpha!=n.alpha&&(i.opacity=""+(n.alpha*h|0)/h,a.alpha=n.alpha)}}},createjs.DOMElement=createjs.promote(t,"DisplayObject")}(),window.createjs=window.createjs||{},function(){"use strict";function t(){this.usesContext=!1,this._multiPass=null,this.VTX_SHADER_BODY=null,this.FRAG_SHADER_BODY=null}var e=t.prototype;e.getBounds=function(t){return t},e.shaderParamSetup=function(t,e,i){},e.applyFilter=function(t,e,i,n,r,s,a,o){s=s||t,null==a&&(a=e),null==o&&(o=i);try{var h=t.getImageData(e,i,n,r)}catch(t){return!1}return!!this._applyFilter(h)&&(s.putImageData(h,a,o),!0)},e.toString=function(){return"[Filter]"},e.clone=function(){return new t},e._applyFilter=function(t){return!0},createjs.Filter=t}(),window.createjs=window.createjs||{},function(){"use strict";function t(){this.width=void 0,this.height=void 0,this.x=void 0,this.y=void 0,this.scale=1,this.offX=0,this.offY=0,this.cacheID=0,this._filterOffX=0,this._filterOffY=0,this._cacheDataURLID=0,this._cacheDataURL=null,this._drawWidth=0,this._drawHeight=0}var e=t.prototype;t.getFilterBounds=function(t,e){e||(e=new createjs.Rectangle);var i=t.filters,n=i&&i.length;if(!!n<=0)return e;for(var r=0;r<n;r++){var s=i[r];if(s&&s.getBounds){var a=s.getBounds();a&&(0==r?e.setValues(a.x,a.y,a.width,a.height):e.extend(a.x,a.y,a.width,a.height))}}return e},e.toString=function(){return"[BitmapCache]"},e.define=function(t,e,i,n,r,s,a){if(!t)throw"No symbol to cache";this._options=a,this.target=t,this.width=n>=1?n:1,this.height=r>=1?r:1,this.x=e||0,this.y=i||0,this.scale=s||1,this.update()},e.update=function(e){if(!this.target)throw"define() must be called before update()";var i=t.getFilterBounds(this.target),n=this.target.cacheCanvas;this._drawWidth=Math.ceil(this.width*this.scale)+i.width,this._drawHeight=Math.ceil(this.height*this.scale)+i.height,n&&this._drawWidth==n.width&&this._drawHeight==n.height||this._updateSurface(),this._filterOffX=i.x,this._filterOffY=i.y,this.offX=this.x*this.scale+this._filterOffX,this.offY=this.y*this.scale+this._filterOffY,this._drawToCache(e),this.cacheID=this.cacheID?this.cacheID+1:1},e.release=function(){if(this._webGLCache)this._webGLCache.isCacheControlled||(this.__lastRT&&(this.__lastRT=void 0),this.__rtA&&this._webGLCache._killTextureObject(this.__rtA),this.__rtB&&this._webGLCache._killTextureObject(this.__rtB),this.target&&this.target.cacheCanvas&&this._webGLCache._killTextureObject(this.target.cacheCanvas)),this._webGLCache=!1;else{var t=this.target.stage;t instanceof createjs.StageGL&&t.releaseTexture(this.target.cacheCanvas)}this.target=this.target.cacheCanvas=null,this.cacheID=this._cacheDataURLID=this._cacheDataURL=void 0,this.width=this.height=this.x=this.y=this.offX=this.offY=0,this.scale=1},e.getCacheDataURL=function(){var t=this.target&&this.target.cacheCanvas;return t?(this.cacheID!=this._cacheDataURLID&&(this._cacheDataURLID=this.cacheID,this._cacheDataURL=t.toDataURL?t.toDataURL():null),this._cacheDataURL):null},e.draw=function(t){return!!this.target&&(t.drawImage(this.target.cacheCanvas,this.x+this._filterOffX/this.scale,this.y+this._filterOffY/this.scale,this._drawWidth/this.scale,this._drawHeight/this.scale),!0)},e._updateSurface=function(){if(!this._options||!this._options.useGL)return(e=this.target.cacheCanvas)||(e=this.target.cacheCanvas=createjs.createCanvas?createjs.createCanvas():document.createElement("canvas")),e.width=this._drawWidth,void(e.height=this._drawHeight);if(!this._webGLCache)if("stage"===this._options.useGL){if(!this.target.stage||!this.target.stage.isWebGL){var t="Cannot use 'stage' for cache because the object's parent stage is ";throw t+=this.target.stage?"non WebGL.":"not set, please addChild to the correct stage."}this.target.cacheCanvas=!0,this._webGLCache=this.target.stage}else if("new"===this._options.useGL)this.target.cacheCanvas=document.createElement("canvas"),this._webGLCache=new createjs.StageGL(this.target.cacheCanvas,{antialias:!0,transparent:!0,autoPurge:-1}),this._webGLCache.isCacheControlled=!0;else{if(!(this._options.useGL instanceof createjs.StageGL))throw"Invalid option provided to useGL, expected ['stage', 'new', StageGL, undefined], got "+this._options.useGL;this.target.cacheCanvas=!0,this._webGLCache=this._options.useGL,this._webGLCache.isCacheControlled=!0}var e=this.target.cacheCanvas,i=this._webGLCache;i.isCacheControlled&&(e.width=this._drawWidth,e.height=this._drawHeight,i.updateViewport(this._drawWidth,this._drawHeight)),this.target.filters?(i.getTargetRenderTexture(this.target,this._drawWidth,this._drawHeight),i.getTargetRenderTexture(this.target,this._drawWidth,this._drawHeight)):i.isCacheControlled||i.getTargetRenderTexture(this.target,this._drawWidth,this._drawHeight)},e._drawToCache=function(t){var e=this.target.cacheCanvas,i=this.target,n=this._webGLCache;if(n)n.cacheDraw(i,i.filters,this),(e=this.target.cacheCanvas).width=this._drawWidth,e.height=this._drawHeight;else{var r=e.getContext("2d");t||r.clearRect(0,0,this._drawWidth+1,this._drawHeight+1),r.save(),r.globalCompositeOperation=t,r.setTransform(this.scale,0,0,this.scale,-this._filterOffX,-this._filterOffY),r.translate(-this.x,-this.y),i.draw(r,!0),r.restore(),i.filters&&i.filters.length&&this._applyFilters(r)}e._invalid=!0},e._applyFilters=function(t){var e,i=this.target.filters,n=this._drawWidth,r=this._drawHeight,s=0,a=i[s];do{a.usesContext?(e&&(t.putImageData(e,0,0),e=null),a.applyFilter(t,0,0,n,r)):(e||(e=t.getImageData(0,0,n,r)),a._applyFilter(e)),a=null!==a._multiPass?a._multiPass:i[++s]}while(a);e&&t.putImageData(e,0,0)},createjs.BitmapCache=t}(),window.createjs=window.createjs||{},function(){"use strict";function t(t,e,i){this.Filter_constructor(),this._blurX=t,this._blurXTable=[],this._lastBlurX=null,this._blurY=e,this._blurYTable=[],this._lastBlurY=null,this._quality,this._lastQuality=null,this.FRAG_SHADER_TEMPLATE="uniform float xWeight[{{blurX}}];uniform float yWeight[{{blurY}}];uniform vec2 textureOffset;void main(void) {vec4 color = vec4(0.0);float xAdj = ({{blurX}}.0-1.0)/2.0;float yAdj = ({{blurY}}.0-1.0)/2.0;vec2 sampleOffset;for(int i=0; i<{{blurX}}; i++) {for(int j=0; j<{{blurY}}; j++) {sampleOffset = vRenderCoord + (textureOffset * vec2(float(i)-xAdj, float(j)-yAdj));color += texture2D(uSampler, sampleOffset) * (xWeight[i] * yWeight[j]);}}gl_FragColor = color.rgba;}",(isNaN(i)||i<1)&&(i=1),this.setQuality(0|i)}var e=createjs.extend(t,createjs.Filter);e.getBlurX=function(){return this._blurX},e.getBlurY=function(){return this._blurY},e.setBlurX=function(t){(isNaN(t)||t<0)&&(t=0),this._blurX=t},e.setBlurY=function(t){(isNaN(t)||t<0)&&(t=0),this._blurY=t},e.getQuality=function(){return this._quality},e.setQuality=function(t){(isNaN(t)||t<0)&&(t=0),this._quality=0|t},e._getShader=function(){var t=this._lastBlurX!==this._blurX,e=this._lastBlurY!==this._blurY,i=this._lastQuality!==this._quality;return t||e||i?((t||i)&&(this._blurXTable=this._getTable(this._blurX*this._quality)),(e||i)&&(this._blurYTable=this._getTable(this._blurY*this._quality)),this._updateShader(),this._lastBlurX=this._blurX,this._lastBlurY=this._blurY,void(this._lastQuality=this._quality)):this._compiledShader},e._setShader=function(){this._compiledShader};try{Object.defineProperties(e,{blurX:{get:e.getBlurX,set:e.setBlurX},blurY:{get:e.getBlurY,set:e.setBlurY},quality:{get:e.getQuality,set:e.setQuality},_builtShader:{get:e._getShader,set:e._setShader}})}catch(t){console.log(t)}e._getTable=function(t){if(t<=1)return[1];for(var e=[],i=Math.ceil(2*t),n=(i+=i%2?0:1)/2|0,r=-n;r<=n;r++){var s=r/n*4.2;e.push(1/Math.sqrt(2*Math.PI)*Math.pow(Math.E,-Math.pow(s,2)/4))}var a=e.reduce(function(t,e){return t+e});return e.map(function(t,e,i){return t/a})},e._updateShader=function(){if(void 0!==this._blurX&&void 0!==this._blurY){var t=this.FRAG_SHADER_TEMPLATE;t=(t=t.replace(/\{\{blurX\}\}/g,this._blurXTable.length.toFixed(0))).replace(/\{\{blurY\}\}/g,this._blurYTable.length.toFixed(0)),this.FRAG_SHADER_BODY=t}},e.shaderParamSetup=function(t,e,i){t.uniform1fv(t.getUniformLocation(i,"xWeight"),this._blurXTable),t.uniform1fv(t.getUniformLocation(i,"yWeight"),this._blurYTable),t.uniform2f(t.getUniformLocation(i,"textureOffset"),2/(e._viewportWidth*this._quality),2/(e._viewportHeight*this._quality))},t.MUL_TABLE=[1,171,205,293,57,373,79,137,241,27,391,357,41,19,283,265,497,469,443,421,25,191,365,349,335,161,155,149,9,278,269,261,505,245,475,231,449,437,213,415,405,395,193,377,369,361,353,345,169,331,325,319,313,307,301,37,145,285,281,69,271,267,263,259,509,501,493,243,479,118,465,459,113,446,55,435,429,423,209,413,51,403,199,393,97,3,379,375,371,367,363,359,355,351,347,43,85,337,333,165,327,323,5,317,157,311,77,305,303,75,297,294,73,289,287,71,141,279,277,275,68,135,67,133,33,262,260,129,511,507,503,499,495,491,61,121,481,477,237,235,467,232,115,457,227,451,7,445,221,439,218,433,215,427,425,211,419,417,207,411,409,203,202,401,399,396,197,49,389,387,385,383,95,189,47,187,93,185,23,183,91,181,45,179,89,177,11,175,87,173,345,343,341,339,337,21,167,83,331,329,327,163,81,323,321,319,159,79,315,313,39,155,309,307,153,305,303,151,75,299,149,37,295,147,73,291,145,289,287,143,285,71,141,281,35,279,139,69,275,137,273,17,271,135,269,267,133,265,33,263,131,261,130,259,129,257,1],t.SHG_TABLE=[0,9,10,11,9,12,10,11,12,9,13,13,10,9,13,13,14,14,14,14,10,13,14,14,14,13,13,13,9,14,14,14,15,14,15,14,15,15,14,15,15,15,14,15,15,15,15,15,14,15,15,15,15,15,15,12,14,15,15,13,15,15,15,15,16,16,16,15,16,14,16,16,14,16,13,16,16,16,15,16,13,16,15,16,14,9,16,16,16,16,16,16,16,16,16,13,14,16,16,15,16,16,10,16,15,16,14,16,16,14,16,16,14,16,16,14,15,16,16,16,14,15,14,15,13,16,16,15,17,17,17,17,17,17,14,15,17,17,16,16,17,16,15,17,16,17,11,17,16,17,16,17,16,17,17,16,17,17,16,17,17,16,16,17,17,17,16,14,17,17,17,17,15,16,14,16,15,16,13,16,15,16,14,16,15,16,12,16,15,16,17,17,17,17,17,13,16,15,17,17,17,16,15,17,17,17,16,15,17,17,14,16,17,17,16,17,17,16,15,17,16,14,17,16,15,17,16,17,17,16,17,15,16,17,14,17,16,15,17,16,17,13,17,16,17,17,16,17,14,17,16,17,16,17,16,17,9],e.getBounds=function(t){var e=0|this.blurX,i=0|this.blurY;if(e<=0&&i<=0)return t;var n=Math.pow(this.quality,.2);return(t||new createjs.Rectangle).pad(i*n+1,e*n+1,i*n+1,e*n+1)},e.clone=function(){return new t(this.blurX,this.blurY,this.quality)},e.toString=function(){return"[BlurFilter]"},e._applyFilter=function(e){var i=this._blurX>>1;if(isNaN(i)||i<0)return!1;var n=this._blurY>>1;if(isNaN(n)||n<0)return!1;if(0==i&&0==n)return!1;var r=this.quality;(isNaN(r)||r<1)&&(r=1),(r|=0)>3&&(r=3),r<1&&(r=1);var s=e.data,a=0,o=0,h=0,u=0,c=0,l=0,d=0,f=0,p=0,g=0,m=0,v=0,_=0,x=0,y=0,b=i+i+1|0,w=n+n+1|0,T=0|e.width,E=0|e.height,C=T-1|0,S=E-1|0,D=i+1|0,A=n+1|0,R={r:0,b:0,g:0,a:0},j=R;for(h=1;h<b;h++)j=j.n={r:0,b:0,g:0,a:0};j.n=R;var L={r:0,b:0,g:0,a:0},P=L;for(h=1;h<w;h++)P=P.n={r:0,b:0,g:0,a:0};P.n=L;for(var M=null,k=0|t.MUL_TABLE[i],I=0|t.SHG_TABLE[i],O=0|t.MUL_TABLE[n],F=0|t.SHG_TABLE[n];r-- >0;){d=l=0;var B=k,N=I;for(o=E;--o>-1;){for(f=D*(v=s[0|l]),p=D*(_=s[l+1|0]),g=D*(x=s[l+2|0]),m=D*(y=s[l+3|0]),j=R,h=D;--h>-1;)j.r=v,j.g=_,j.b=x,j.a=y,j=j.n;for(h=1;h<D;h++)u=l+((C<h?C:h)<<2)|0,f+=j.r=s[u],p+=j.g=s[u+1],g+=j.b=s[u+2],m+=j.a=s[u+3],j=j.n;for(M=R,a=0;a<T;a++)s[l++]=f*B>>>N,s[l++]=p*B>>>N,s[l++]=g*B>>>N,s[l++]=m*B>>>N,u=d+((u=a+i+1)<C?u:C)<<2,f-=M.r-(M.r=s[u]),p-=M.g-(M.g=s[u+1]),g-=M.b-(M.b=s[u+2]),m-=M.a-(M.a=s[u+3]),M=M.n;d+=T}for(B=O,N=F,a=0;a<T;a++){for(f=A*(v=s[l=a<<2|0])|0,p=A*(_=s[l+1|0])|0,g=A*(x=s[l+2|0])|0,m=A*(y=s[l+3|0])|0,P=L,h=0;h<A;h++)P.r=v,P.g=_,P.b=x,P.a=y,P=P.n;for(c=T,h=1;h<=n;h++)l=c+a<<2,f+=P.r=s[l],p+=P.g=s[l+1],g+=P.b=s[l+2],m+=P.a=s[l+3],P=P.n,h<S&&(c+=T);if(l=a,M=L,r>0)for(o=0;o<E;o++)s[(u=l<<2)+3]=y=m*B>>>N,y>0?(s[u]=f*B>>>N,s[u+1]=p*B>>>N,s[u+2]=g*B>>>N):s[u]=s[u+1]=s[u+2]=0,u=a+((u=o+A)<S?u:S)*T<<2,f-=M.r-(M.r=s[u]),p-=M.g-(M.g=s[u+1]),g-=M.b-(M.b=s[u+2]),m-=M.a-(M.a=s[u+3]),M=M.n,l+=T;else for(o=0;o<E;o++)s[(u=l<<2)+3]=y=m*B>>>N,y>0?(y=255/y,s[u]=(f*B>>>N)*y,s[u+1]=(p*B>>>N)*y,s[u+2]=(g*B>>>N)*y):s[u]=s[u+1]=s[u+2]=0,u=a+((u=o+A)<S?u:S)*T<<2,f-=M.r-(M.r=s[u]),p-=M.g-(M.g=s[u+1]),g-=M.b-(M.b=s[u+2]),m-=M.a-(M.a=s[u+3]),M=M.n,l+=T}}return!0},createjs.BlurFilter=createjs.promote(t,"Filter")}(),this.createjs=this.createjs||{},function(){"use strict";function t(t){this.Filter_constructor(),this.alphaMap=t,this._alphaMap=null,this._mapData=null,this._mapTexture=null,this.FRAG_SHADER_BODY="uniform sampler2D uAlphaSampler;void main(void) {vec4 color = texture2D(uSampler, vRenderCoord);vec4 alphaMap = texture2D(uAlphaSampler, vTextureCoord);gl_FragColor = vec4(color.rgb, color.a * (alphaMap.r * ceil(alphaMap.a)));}"}var e=createjs.extend(t,createjs.Filter);e.shaderParamSetup=function(t,e,i){this._mapTexture||(this._mapTexture=t.createTexture()),t.activeTexture(t.TEXTURE1),t.bindTexture(t.TEXTURE_2D,this._mapTexture),e.setTextureParams(t),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,this.alphaMap),t.uniform1i(t.getUniformLocation(i,"uAlphaSampler"),1)},e.clone=function(){var e=new t(this.alphaMap);return e._alphaMap=this._alphaMap,e._mapData=this._mapData,e},e.toString=function(){return"[AlphaMapFilter]"},e._applyFilter=function(t){if(!this.alphaMap)return!0;if(!this._prepAlphaMap())return!1;for(var e=t.data,i=this._mapData,n=0,r=e.length;n<r;n+=4)e[n+3]=i[n]||0;return!0},e._prepAlphaMap=function(){if(!this.alphaMap)return!1;if(this.alphaMap==this._alphaMap&&this._mapData)return!0;this._mapData=null;var t,e=this._alphaMap=this.alphaMap,i=e;e instanceof HTMLCanvasElement?t=i.getContext("2d"):((i=createjs.createCanvas?createjs.createCanvas():document.createElement("canvas")).width=e.width,i.height=e.height,(t=i.getContext("2d")).drawImage(e,0,0));try{var n=t.getImageData(0,0,e.width,e.height)}catch(t){return!1}return this._mapData=n.data,!0},createjs.AlphaMapFilter=createjs.promote(t,"Filter")}(),this.createjs=this.createjs||{},function(){"use strict";function t(t){this.Filter_constructor(),this.mask=t,this.usesContext=!0,this.FRAG_SHADER_BODY="uniform sampler2D uAlphaSampler;void main(void) {vec4 color = texture2D(uSampler, vRenderCoord);vec4 alphaMap = texture2D(uAlphaSampler, vTextureCoord);gl_FragColor = vec4(color.rgb, color.a * alphaMap.a);}"}var e=createjs.extend(t,createjs.Filter);e.shaderParamSetup=function(t,e,i){this._mapTexture||(this._mapTexture=t.createTexture()),t.activeTexture(t.TEXTURE1),t.bindTexture(t.TEXTURE_2D,this._mapTexture),e.setTextureParams(t),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,this.mask),t.uniform1i(t.getUniformLocation(i,"uAlphaSampler"),1)},e.applyFilter=function(t,e,i,n,r,s,a,o){return!this.mask||(s=s||t,null==a&&(a=e),null==o&&(o=i),s.save(),t==s&&(s.globalCompositeOperation="destination-in",s.drawImage(this.mask,a,o),s.restore(),!0))},e.clone=function(){return new t(this.mask)},e.toString=function(){return"[AlphaMaskFilter]"},createjs.AlphaMaskFilter=createjs.promote(t,"Filter")}(),window.createjs=window.createjs||{},function(){"use strict";function t(t,e,i,n,r,s,a,o){this.Filter_constructor(),this.redMultiplier=null!=t?t:1,this.greenMultiplier=null!=e?e:1,this.blueMultiplier=null!=i?i:1,this.alphaMultiplier=null!=n?n:1,this.redOffset=r||0,this.greenOffset=s||0,this.blueOffset=a||0,this.alphaOffset=o||0,this.FRAG_SHADER_BODY="uniform vec4 uColorMultiplier;uniform vec4 uColorOffset;void main(void) {vec4 color = texture2D(uSampler, vRenderCoord);gl_FragColor = (color * uColorMultiplier) + uColorOffset;}"}var e=createjs.extend(t,createjs.Filter);e.shaderParamSetup=function(t,e,i){t.uniform4f(t.getUniformLocation(i,"uColorMultiplier"),this.redMultiplier,this.greenMultiplier,this.blueMultiplier,this.alphaMultiplier),t.uniform4f(t.getUniformLocation(i,"uColorOffset"),this.redOffset/255,this.greenOffset/255,this.blueOffset/255,this.alphaOffset/255)},e.toString=function(){return"[ColorFilter]"},e.clone=function(){return new t(this.redMultiplier,this.greenMultiplier,this.blueMultiplier,this.alphaMultiplier,this.redOffset,this.greenOffset,this.blueOffset,this.alphaOffset)},e._applyFilter=function(t){for(var e=t.data,i=e.length,n=0;n<i;n+=4)e[n]=e[n]*this.redMultiplier+this.redOffset,e[n+1]=e[n+1]*this.greenMultiplier+this.greenOffset,e[n+2]=e[n+2]*this.blueMultiplier+this.blueOffset,e[n+3]=e[n+3]*this.alphaMultiplier+this.alphaOffset;return!0},createjs.ColorFilter=createjs.promote(t,"Filter")}(),window.createjs=window.createjs||{},function(){"use strict";function t(t,e,i,n){this.setColor(t,e,i,n)}var e=t.prototype;t.DELTA_INDEX=[0,.01,.02,.04,.05,.06,.07,.08,.1,.11,.12,.14,.15,.16,.17,.18,.2,.21,.22,.24,.25,.27,.28,.3,.32,.34,.36,.38,.4,.42,.44,.46,.48,.5,.53,.56,.59,.62,.65,.68,.71,.74,.77,.8,.83,.86,.89,.92,.95,.98,1,1.06,1.12,1.18,1.24,1.3,1.36,1.42,1.48,1.54,1.6,1.66,1.72,1.78,1.84,1.9,1.96,2,2.12,2.25,2.37,2.5,2.62,2.75,2.87,3,3.2,3.4,3.6,3.8,4,4.3,4.7,4.9,5,5.5,6,6.5,6.8,7,7.3,7.5,7.8,8,8.4,8.7,9,9.4,9.6,9.8,10],t.IDENTITY_MATRIX=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1],t.LENGTH=t.IDENTITY_MATRIX.length,e.setColor=function(t,e,i,n){return this.reset().adjustColor(t,e,i,n)},e.reset=function(){return this.copy(t.IDENTITY_MATRIX)},e.adjustColor=function(t,e,i,n){return this.adjustHue(n),this.adjustContrast(e),this.adjustBrightness(t),this.adjustSaturation(i)},e.adjustBrightness=function(t){return 0==t||isNaN(t)?this:(t=this._cleanValue(t,255),this._multiplyMatrix([1,0,0,0,t,0,1,0,0,t,0,0,1,0,t,0,0,0,1,0,0,0,0,0,1]),this)},e.adjustContrast=function(e){return 0==e||isNaN(e)?this:(i=(e=this._cleanValue(e,100))<0?127+e/100*127:127*(i=0==(i=e%1)?t.DELTA_INDEX[e]:t.DELTA_INDEX[e<<0]*(1-i)+t.DELTA_INDEX[1+(e<<0)]*i)+127,this._multiplyMatrix([i/127,0,0,0,.5*(127-i),0,i/127,0,0,.5*(127-i),0,0,i/127,0,.5*(127-i),0,0,0,1,0,0,0,0,0,1]),this);var i},e.adjustSaturation=function(t){if(0==t||isNaN(t))return this;var e=1+((t=this._cleanValue(t,100))>0?3*t/100:t/100);return this._multiplyMatrix([.3086*(1-e)+e,.6094*(1-e),.082*(1-e),0,0,.3086*(1-e),.6094*(1-e)+e,.082*(1-e),0,0,.3086*(1-e),.6094*(1-e),.082*(1-e)+e,0,0,0,0,0,1,0,0,0,0,0,1]),this},e.adjustHue=function(t){if(0==t||isNaN(t))return this;t=this._cleanValue(t,180)/180*Math.PI;var e=Math.cos(t),i=Math.sin(t);return this._multiplyMatrix([.213+.787*e+-.213*i,.715+-.715*e+-.715*i,.072+-.072*e+.928*i,0,0,.213+-.213*e+.143*i,.715+e*(1-.715)+.14*i,.072+-.072*e+-.283*i,0,0,.213+-.213*e+-.787*i,.715+-.715*e+.715*i,.072+.928*e+.072*i,0,0,0,0,0,1,0,0,0,0,0,1]),this},e.concat=function(e){return(e=this._fixMatrix(e)).length!=t.LENGTH?this:(this._multiplyMatrix(e),this)},e.clone=function(){return(new t).copy(this)},e.toArray=function(){for(var e=[],i=0,n=t.LENGTH;i<n;i++)e[i]=this[i];return e},e.copy=function(e){for(var i=t.LENGTH,n=0;n<i;n++)this[n]=e[n];return this},e.toString=function(){return"[ColorMatrix]"},e._multiplyMatrix=function(t){var e,i,n,r=[];for(e=0;e<5;e++){for(i=0;i<5;i++)r[i]=this[i+5*e];for(i=0;i<5;i++){var s=0;for(n=0;n<5;n++)s+=t[i+5*n]*r[n];this[i+5*e]=s}}},e._cleanValue=function(t,e){return Math.min(e,Math.max(-e,t))},e._fixMatrix=function(e){return e instanceof t&&(e=e.toArray()),e.length<t.LENGTH?e=e.slice(0,e.length).concat(t.IDENTITY_MATRIX.slice(e.length,t.LENGTH)):e.length>t.LENGTH&&(e=e.slice(0,t.LENGTH)),e},createjs.ColorMatrix=t}(),window.createjs=window.createjs||{},function(){"use strict";function t(t){this.Filter_constructor(),this.matrix=t,this.FRAG_SHADER_BODY="uniform mat4 uColorMatrix;uniform vec4 uColorMatrixOffset;void main(void) {vec4 color = texture2D(uSampler, vRenderCoord);mat4 m = uColorMatrix;vec4 newColor = vec4(0,0,0,0);newColor.r = color.r*m[0][0] + color.g*m[0][1] + color.b*m[0][2] + color.a*m[0][3];newColor.g = color.r*m[1][0] + color.g*m[1][1] + color.b*m[1][2] + color.a*m[1][3];newColor.b = color.r*m[2][0] + color.g*m[2][1] + color.b*m[2][2] + color.a*m[2][3];newColor.a = color.r*m[3][0] + color.g*m[3][1] + color.b*m[3][2] + color.a*m[3][3];gl_FragColor = newColor + uColorMatrixOffset;}"}var e=createjs.extend(t,createjs.Filter);e.shaderParamSetup=function(t,e,i){var n=this.matrix,r=new Float32Array([n[0],n[1],n[2],n[3],n[5],n[6],n[7],n[8],n[10],n[11],n[12],n[13],n[15],n[16],n[17],n[18]]);t.uniformMatrix4fv(t.getUniformLocation(i,"uColorMatrix"),!1,r),t.uniform4f(t.getUniformLocation(i,"uColorMatrixOffset"),n[4]/255,n[9]/255,n[14]/255,n[19]/255)},e.toString=function(){return"[ColorMatrixFilter]"},e.clone=function(){return new t(this.matrix)},e._applyFilter=function(t){for(var e,i,n,r,s=t.data,a=s.length,o=this.matrix,h=o[0],u=o[1],c=o[2],l=o[3],d=o[4],f=o[5],p=o[6],g=o[7],m=o[8],v=o[9],_=o[10],x=o[11],y=o[12],b=o[13],w=o[14],T=o[15],E=o[16],C=o[17],S=o[18],D=o[19],A=0;A<a;A+=4)e=s[A],i=s[A+1],n=s[A+2],r=s[A+3],s[A]=e*h+i*u+n*c+r*l+d,s[A+1]=e*f+i*p+n*g+r*m+v,s[A+2]=e*_+i*x+n*y+r*b+w,s[A+3]=e*T+i*E+n*C+r*S+D;return!0},createjs.ColorMatrixFilter=createjs.promote(t,"Filter")}(),window.createjs=window.createjs||{},function(){"use strict";function t(){throw"Touch cannot be instantiated"}t.isSupported=function(){return!!("ontouchstart"in window||window.navigator.msPointerEnabled&&window.navigator.msMaxTouchPoints>0||window.navigator.pointerEnabled&&window.navigator.maxTouchPoints>0)},t.enable=function(e,i,n){return!!(e&&e.canvas&&t.isSupported())&&(!!e.__touch||(e.__touch={pointers:{},multitouch:!i,preventDefault:!n,count:0},"ontouchstart"in window?t._IOS_enable(e):(window.navigator.msPointerEnabled||window.navigator.pointerEnabled)&&t._IE_enable(e),!0))},t.disable=function(e){e&&("ontouchstart"in window?t._IOS_disable(e):(window.navigator.msPointerEnabled||window.navigator.pointerEnabled)&&t._IE_disable(e),delete e.__touch)},t._IOS_enable=function(e){var i=e.canvas,n=e.__touch.f=function(i){t._IOS_handleEvent(e,i)};i.addEventListener("touchstart",n,!1),i.addEventListener("touchmove",n,!1),i.addEventListener("touchend",n,!1),i.addEventListener("touchcancel",n,!1)},t._IOS_disable=function(t){var e=t.canvas;if(e){var i=t.__touch.f;e.removeEventListener("touchstart",i,!1),e.removeEventListener("touchmove",i,!1),e.removeEventListener("touchend",i,!1),e.removeEventListener("touchcancel",i,!1)}},t._IOS_handleEvent=function(t,e){if(t){t.__touch.preventDefault&&e.preventDefault&&e.preventDefault();for(var i=e.changedTouches,n=e.type,r=0,s=i.length;r<s;r++){var a=i[r],o=a.identifier;a.target==t.canvas&&("touchstart"==n?this._handleStart(t,o,e,a.pageX,a.pageY):"touchmove"==n?this._handleMove(t,o,e,a.pageX,a.pageY):"touchend"!=n&&"touchcancel"!=n||this._handleEnd(t,o,e))}}},t._IE_enable=function(e){var i=e.canvas,n=e.__touch.f=function(i){t._IE_handleEvent(e,i)};void 0===window.navigator.pointerEnabled?(i.addEventListener("MSPointerDown",n,!1),window.addEventListener("MSPointerMove",n,!1),window.addEventListener("MSPointerUp",n,!1),window.addEventListener("MSPointerCancel",n,!1),e.__touch.preventDefault&&(i.style.msTouchAction="none")):(i.addEventListener("pointerdown",n,!1),window.addEventListener("pointermove",n,!1),window.addEventListener("pointerup",n,!1),window.addEventListener("pointercancel",n,!1),e.__touch.preventDefault&&(i.style.touchAction="none")),e.__touch.activeIDs={}},t._IE_disable=function(t){var e=t.__touch.f;void 0===window.navigator.pointerEnabled?(window.removeEventListener("MSPointerMove",e,!1),window.removeEventListener("MSPointerUp",e,!1),window.removeEventListener("MSPointerCancel",e,!1),t.canvas&&t.canvas.removeEventListener("MSPointerDown",e,!1)):(window.removeEventListener("pointermove",e,!1),window.removeEventListener("pointerup",e,!1),window.removeEventListener("pointercancel",e,!1),t.canvas&&t.canvas.removeEventListener("pointerdown",e,!1))},t._IE_handleEvent=function(t,e){if(t){t.__touch.preventDefault&&e.preventDefault&&e.preventDefault();var i=e.type,n=e.pointerId,r=t.__touch.activeIDs;if("MSPointerDown"==i||"pointerdown"==i){if(e.srcElement!=t.canvas)return;r[n]=!0,this._handleStart(t,n,e,e.pageX,e.pageY)}else r[n]&&("MSPointerMove"==i||"pointermove"==i?this._handleMove(t,n,e,e.pageX,e.pageY):"MSPointerUp"!=i&&"MSPointerCancel"!=i&&"pointerup"!=i&&"pointercancel"!=i||(delete r[n],this._handleEnd(t,n,e)))}},t._handleStart=function(t,e,i,n,r){var s=t.__touch;if(s.multitouch||!s.count){var a=s.pointers;a[e]||(a[e]=!0,s.count++,t._handlePointerDown(e,i,n,r))}},t._handleMove=function(t,e,i,n,r){t.__touch.pointers[e]&&t._handlePointerMove(e,i,n,r)},t._handleEnd=function(t,e,i){var n=t.__touch,r=n.pointers;r[e]&&(n.count--,t._handlePointerUp(e,i,!0),delete r[e])},createjs.Touch=t}(),this.createjs=this.createjs||{},function(){"use strict";var t=createjs.EaselJS=createjs.EaselJS||{};t.version="1.0.0",t.buildDate="Thu, 14 Sep 2017 19:47:53 GMT"}()}});
define({ root: ({ serviceUrl: "Set service url:", minIntSpacingLabel: "Minimum Interval Spacing", lineOpacityLabel: "Line Opacity", labelOpacityLabel: "Label Opacity", centerLabelOpacityLabel: "Center Label Opacity", gridZonePlacementLabel: "Grid Zone Label Placement", verticalLineLabels: "Vertical Line Labels", styleHeaderLabel: "Style", indexHeaderLabel: "Index", colorHeaderLabel: "Color", fontSizeHeaderLabel: "Font Size", lineWidthHeaderLabel: "Line Width", horizontalLabel: "Horizontal", verticalLabel: "Vertical", upperLeftLabel: "Upper Left", upperRightLabel: "Upper Right", lowerLeftLabel: "Lower Left", lowerRightLabel: "Lower Right", centerLabel: "Center" }), "ar": 1, "bs": 1, "cs": 1, "da": 1, "de": 1, "el": 1, "es": 1, "et": 1, "fi": 1, "fr": 1, "he": 1, "hi": 1, "hr": 1, "it": 1, "id": 1, "ja": 1, "ko": 1, "lt": 1, "lv": 1, "nb": 1, "nl": 1, "pl": 1, "pt-br": 1, "pt-pt": 1, "ro": 1, "ru": 1, "sr": 1, "sv": 1, "th": 1, "tr": 1, "vi": 1, "zh-cn": 1, "zh-hk": 1, "zh-tw": 1 });
import Component from '@ember/component'; import Ember from 'ember'; import { reads } from '@ember/object/computed'; import config from 'travis/config/environment'; import Visibility from 'visibilityjs'; import { inject as service } from '@ember/service'; export default Component.extend({ store: service(), updateTimesService: service('updateTimes'), queuedJobs: reads('jobs'), init() { this._super(...arguments); if (!Ember.testing) { return Visibility.every(config.intervals.updateTimes, this.updateTimes.bind(this)); } }, updateTimes() { this.updateTimesService.push(this.jobs); } });
module.exports = { root: true, extends: 'supermind', rules: { 'import/no-commonjs': 'off', 'import/unambiguous': 'off' } }
// the contract property is an enumeration const ChangePropertyPrototype = require('../../properties/changePrototype').ChangePropertyPrototype; const CONTRACT_TYPE = ['Permanent', 'Temporary', 'Pool/Bank', 'Agency', 'Other']; exports.WorkerContractProperty = class WorkerContractProperty extends ChangePropertyPrototype { constructor() { super('Contract'); } static clone() { return new WorkerContractProperty(); } // concrete implementations async restoreFromJson(document) { if (document.contract) { if (CONTRACT_TYPE.includes(document.contract)) { this.property = document.contract; } else { this.property = null; } } } restorePropertyFromSequelize(document) { return document.ContractValue; } savePropertyToSequelize() { return { ContractValue: this.property }; } isEqual(currentValue, newValue) { // contract is a simple (enum'd) string return currentValue && newValue && currentValue === newValue; } toJSON(withHistory=false, showPropertyHistoryOnly=true, wdfEffectiveDate = false ) { if (wdfEffectiveDate) { return this._savedAt ? this._savedAt > wdfEffectiveDate : false; } if (!withHistory) { // simple form return { contract: this.property }; } return { contract : { currentValue: this.property, ... this.changePropsToJSON(showPropertyHistoryOnly) } }; } };
import Log from '../../../libraries/Log'; import TagUtils from '../../../utils/TagUtils'; /** * Manages tags for the TaggingContainer */ export default class TagManager { constructor(context) { // local tags from tagging container this.tagsFromTaggingContainer = {}; this.remoteTags = {}; this.context = context; } /** * @returns Promise resolving TagsObject if successful, {} if no change detected, null if failed */ async sendTags() { Log.info("Category Slidedown Local Tags:", this.tagsFromTaggingContainer); const localTagsConvertedToApi = TagUtils.convertTagsBooleansToApi(this.tagsFromTaggingContainer); const finalTagsObject = TagUtils.getObjectDifference(localTagsConvertedToApi, this.remoteTags); const shouldSendUpdate = !TagUtils.isTagObjectEmpty(finalTagsObject); if (shouldSendUpdate) { return await OneSignal.sendTags(finalTagsObject); } Log.warn("OneSignal: no change detected in Category preferences. Skipping tag update."); // no change detected, return {} return finalTagsObject; } /** * @param {TagsObject} tags - values of type "boolean" * @returns void */ storeTagValuesToUpdate(tags) { this.tagsFromTaggingContainer = tags; } /** * @param {TagsObject} remoteTags - values of type "number" * @returns void */ storeRemotePlayerTags(remoteTags) { this.context.tagManager.remoteTags = remoteTags; } } //# sourceMappingURL=TagManager.js.map
angular.module('chainid.app') .filter('truncate', function () { 'use strict'; return function (text, length, end) { if (isNaN(length)) { length = 10; } if (end === undefined) { end = '...'; } if (text.length <= length || text.length - end.length <= length) { return text; } else { return String(text).substring(0, length - end.length) + end; } }; }) .filter('truncatelr', function () { 'use strict'; return function (text, max, left, right) { max = isNaN(max) ? 50 : max; left = isNaN(left) ? 25 : left; right = isNaN(right) ? 25 : right; if (text.length <= max) { return text; } else { return text.substring(0, left) + '[...]' + text.substring(text.length - right, text.length); } }; }) .filter('capitalize', function () { 'use strict'; return function (text) { return _.capitalize(text); }; }) .filter('stripprotocol', function() { 'use strict'; return function (url) { return url.replace(/.*?:\/\//g, ''); }; }) .filter('humansize', function () { 'use strict'; return function (bytes, round, base) { if (!round) { round = 1; } if (!base) { base = 10; } if (bytes || bytes === 0) { return filesize(bytes, {base: base, round: round}); } }; }) .filter('getisodatefromtimestamp', function () { 'use strict'; return function (timestamp) { return moment.unix(timestamp).format('YYYY-MM-DD HH:mm:ss'); }; }) .filter('getisodate', function () { 'use strict'; return function (date) { return moment(date).format('YYYY-MM-DD HH:mm:ss'); }; }) .filter('key', function () { 'use strict'; return function (pair, separator) { return pair.slice(0, pair.indexOf(separator)); }; }) .filter('value', function () { 'use strict'; return function (pair, separator) { return pair.slice(pair.indexOf(separator) + 1); }; }) .filter('emptyobject', function () { 'use strict'; return function (obj) { return _.isEmpty(obj); }; }) .filter('ipaddress', function () { 'use strict'; return function (ip) { return ip.slice(0, ip.indexOf('/')); }; }) .filter('arraytostr', function () { 'use strict'; return function (arr, separator) { if (arr) { return _.join(arr, separator); } return ''; }; }) .filter('ownershipicon', function () { 'use strict'; return function (ownership) { switch (ownership) { case 'private': return 'fa fa-eye-slash'; case 'administrators': return 'fa fa-eye-slash'; case 'restricted': return 'fa fa-users'; default: return 'fa fa-eye'; } }; });
define({"topics" : [{"title":"Viewing Record Header Attributes","href":"datacollector\/UserGuide\/Processors\/JavaScript.html#concept_zvs_whh_cy","attributes": {"data-id":"concept_zvs_whh_cy",},"menu": {"hasChildren":false,},"tocID":"concept_zvs_whh_cy-d46e71556","topics":[]}]});
import React, { Component } from 'react'; import { ListView, Alert, DeviceEventEmitter, } from 'react-native'; import { Icon } from 'react-native-elements'; import { NavigationActions, StackNavigator } from 'react-navigation'; import Page from '../../components/Page'; import Shares from '../../components/Shares'; import { list } from '../../services/account'; import { checkAuth, isLoginin } from '../../utils/permission'; import styles from './index.style'; class ShareListScreen extends Component { static navigationOptions = ({ navigation, screenProps }) => { const { state, setParams, navigate } = navigation; return { title: 'Shares', headerLeft: <Icon name="view-headline" containerStyle={styles.nav.leftWrapper} onPress={async () => { if (await isLoginin()) { navigate('DrawerOpen'); } else { screenProps.redirectLogin(); } }} />, headerRight: <Icon name="add" containerStyle={styles.nav.rightWrapper} onPress={async () => { if (await isLoginin()) { screenProps.redirect(NavigationActions.navigate({ routeName: 'ShareAdd', })); } else { screenProps.redirectLogin(); } }} />, headerVisible: true, tabBarLabel: 'Shares', tabBarIcon: ({ tintColor }) => <Icon name="share" iconStyle={{ color: tintColor }} />, } } constructor(props) { super(props); this.state = { accounts: [], loading: true, loadSuccess: true, } this.init = this.init.bind(this); this.fetchData = this.fetchData.bind(this); } componentDidMount() { this.subscription = DeviceEventEmitter.addListener('ShareRefresh', this.init); } componentWillUnmount() { if (this.loading) { clearTimeout(this.loading); } if (this.subscription) { this.subscription.remove(); } } async init() { this.fetchData(); } fetchData() { this.loading = setTimeout(async () => { const { data, err } = await list(); if (err) { this.setState({ loading: false, loadSuccess: false, }) return false; } this.setState({ accounts: data, loading: false, loadSuccess: true, }) }, 100); } render() { return ( <Page {...this.props} init={this.init} loading={this.state.loading} > <Shares screenProps={this.props.screenProps} loading={this.state.loading} loadSuccess={this.state.loadSuccess} accounts={this.state.accounts} loadFailTip={{ tip: '加载失败', subTip: '很抱歉,加载账号分享列表失败', }} emptyTip={{ tip: '还未有人分享哦!', subTip: '点击右上角Add按钮,成为第一个分享者吧!', }} onRefresh={this.init} /> </Page> ); } } const ShareListStack = StackNavigator({ ShareList: { screen: ShareListScreen, }, }); export default ShareListStack;
"use strict"; var KTMenu = function(elementId, options) { // Main object var the = this; var init = false; // Get element object var element = KTUtil.get(elementId); var body = KTUtil.get('body'); if (!element) { return; } // Default options var defaultOptions = { // scrollable area with Perfect Scroll scroll: { rememberPosition: false }, // accordion submenu mode accordion: { slideSpeed: 200, // accordion toggle slide speed in milliseconds autoScroll: false, // enable auto scrolling(focus) to the clicked menu item autoScrollSpeed: 1200, expandAll: true // allow having multiple expanded accordions in the menu }, // dropdown submenu mode dropdown: { timeout: 500 // timeout in milliseconds to show and hide the hoverable submenu dropdown } }; //////////////////////////// // ** Private Methods ** // //////////////////////////// var Plugin = { /** * Run plugin * @returns {KTMenu} */ construct: function(options) { if (KTUtil.data(element).has('menu')) { the = KTUtil.data(element).get('menu'); } else { // reset menu Plugin.init(options); // reset menu Plugin.reset(); // build menu Plugin.build(); KTUtil.data(element).set('menu', the); } return the; }, /** * Handles submenu click toggle * @returns {KTMenu} */ init: function(options) { the.events = []; the.eventHandlers = {}; // merge default and user defined options the.options = KTUtil.deepExtend({}, defaultOptions, options); // pause menu the.pauseDropdownHoverTime = 0; the.uid = KTUtil.getUniqueID(); }, update: function(options) { // merge default and user defined options the.options = KTUtil.deepExtend({}, defaultOptions, options); // pause menu the.pauseDropdownHoverTime = 0; // reset menu Plugin.reset(); the.eventHandlers = {}; // build menu Plugin.build(); KTUtil.data(element).set('menu', the); }, reload: function() { // reset menu Plugin.reset(); // build menu Plugin.build(); // reset submenu props Plugin.resetSubmenuProps(); }, /** * Reset menu * @returns {KTMenu} */ build: function() { // General accordion submenu toggle the.eventHandlers['event_1'] = KTUtil.on( element, '.kt-menu__toggle', 'click', Plugin.handleSubmenuAccordion); // Dropdown mode(hoverable) if (Plugin.getSubmenuMode() === 'dropdown' || Plugin.isConditionalSubmenuDropdown()) { // dropdown submenu - hover toggle the.eventHandlers['event_2'] = KTUtil.on( element, '[data-ktmenu-submenu-toggle="hover"]', 'mouseover', Plugin.handleSubmenuDrodownHoverEnter); the.eventHandlers['event_3'] = KTUtil.on( element, '[data-ktmenu-submenu-toggle="hover"]', 'mouseout', Plugin.handleSubmenuDrodownHoverExit); // dropdown submenu - click toggle the.eventHandlers['event_4'] = KTUtil.on( element, '[data-ktmenu-submenu-toggle="click"] > .kt-menu__toggle, [data-ktmenu-submenu-toggle="click"] > .kt-menu__link .kt-menu__toggle', 'click', Plugin.handleSubmenuDropdownClick); the.eventHandlers['event_5'] = KTUtil.on( element, '[data-ktmenu-submenu-toggle="tab"] > .kt-menu__toggle, [data-ktmenu-submenu-toggle="tab"] > .kt-menu__link .kt-menu__toggle', 'click', Plugin.handleSubmenuDropdownTabClick); } // handle link click the.eventHandlers['event_6'] = KTUtil.on(element, '.kt-menu__item > .kt-menu__link:not(.kt-menu__toggle):not(.kt-menu__link--toggle-skip)', 'click', Plugin.handleLinkClick); // Init scrollable menu if (the.options.scroll && the.options.scroll.height) { Plugin.scrollInit(); } }, /** * Reset menu * @returns {KTMenu} */ reset: function() { KTUtil.off( element, 'click', the.eventHandlers['event_1']); // dropdown submenu - hover toggle KTUtil.off( element, 'mouseover', the.eventHandlers['event_2']); KTUtil.off( element, 'mouseout', the.eventHandlers['event_3']); // dropdown submenu - click toggle KTUtil.off( element, 'click', the.eventHandlers['event_4']); KTUtil.off( element, 'click', the.eventHandlers['event_5']); // handle link click KTUtil.off(element, 'click', the.eventHandlers['event_6']); }, /** * Init scroll menu * */ scrollInit: function() { if ( the.options.scroll && the.options.scroll.height ) { KTUtil.scrollDestroy(element); KTUtil.scrollInit(element, {disableForMobile: true, resetHeightOnDestroy: true, handleWindowResize: true, height: the.options.scroll.height, rememberPosition: the.options.scroll.rememberPosition}); } else { KTUtil.scrollDestroy(element); } }, /** * Update scroll menu */ scrollUpdate: function() { if ( the.options.scroll && the.options.scroll.height ) { KTUtil.scrollUpdate(element); } }, /** * Scroll top */ scrollTop: function() { if ( the.options.scroll && the.options.scroll.height ) { KTUtil.scrollTop(element); } }, /** * Get submenu mode for current breakpoint and menu state * @returns {KTMenu} */ getSubmenuMode: function(el) { if ( KTUtil.isInResponsiveRange('desktop') ) { if (el && KTUtil.hasAttr(el, 'data-ktmenu-submenu-toggle') && KTUtil.attr(el, 'data-ktmenu-submenu-toggle') == 'hover') { return 'dropdown'; } if ( KTUtil.isset(the.options.submenu, 'desktop.state.body') ) { if ( KTUtil.hasClasses(body, the.options.submenu.desktop.state.body) ) { return the.options.submenu.desktop.state.mode; } else { return the.options.submenu.desktop.default; } } else if ( KTUtil.isset(the.options.submenu, 'desktop') ) { return the.options.submenu.desktop; } } else if ( KTUtil.isInResponsiveRange('tablet') && KTUtil.isset(the.options.submenu, 'tablet') ) { return the.options.submenu.tablet; } else if ( KTUtil.isInResponsiveRange('mobile') && KTUtil.isset(the.options.submenu, 'mobile') ) { return the.options.submenu.mobile; } else { return false; } }, /** * Get submenu mode for current breakpoint and menu state * @returns {KTMenu} */ isConditionalSubmenuDropdown: function() { if ( KTUtil.isInResponsiveRange('desktop') && KTUtil.isset(the.options.submenu, 'desktop.state.body') ) { return true; } else { return false; } }, /** * Reset submenu attributes * @returns {KTMenu} */ resetSubmenuProps: function(e) { var submenus = KTUtil.findAll(element, '.kt-menu__submenu'); if ( submenus ) { for (var i = 0, len = submenus.length; i < len; i++) { KTUtil.css(submenus[0], 'display', ''); KTUtil.css(submenus[0], 'overflow', ''); } } }, /** * Handles submenu hover toggle * @returns {KTMenu} */ handleSubmenuDrodownHoverEnter: function(e) { if ( Plugin.getSubmenuMode(this) === 'accordion' ) { return; } if ( the.resumeDropdownHover() === false ) { return; } var item = this; if ( item.getAttribute('data-hover') == '1' ) { item.removeAttribute('data-hover'); clearTimeout( item.getAttribute('data-timeout') ); item.removeAttribute('data-timeout'); //Plugin.hideSubmenuDropdown(item, false); } // console.log('test!'); Plugin.showSubmenuDropdown(item); }, /** * Handles submenu hover toggle * @returns {KTMenu} */ handleSubmenuDrodownHoverExit: function(e) { if ( the.resumeDropdownHover() === false ) { return; } if ( Plugin.getSubmenuMode(this) === 'accordion' ) { return; } var item = this; var time = the.options.dropdown.timeout; var timeout = setTimeout(function() { if ( item.getAttribute('data-hover') == '1' ) { Plugin.hideSubmenuDropdown(item, true); } }, time); item.setAttribute('data-hover', '1'); item.setAttribute('data-timeout', timeout); }, /** * Handles submenu click toggle * @returns {KTMenu} */ handleSubmenuDropdownClick: function(e) { if ( Plugin.getSubmenuMode(this) === 'accordion' ) { return; } var item = this.closest('.kt-menu__item'); if ( item.getAttribute('data-ktmenu-submenu-mode') == 'accordion' ) { return; } if ( KTUtil.hasClass(item, 'kt-menu__item--hover') === false ) { KTUtil.addClass(item, 'kt-menu__item--open-dropdown'); Plugin.showSubmenuDropdown(item); } else { KTUtil.removeClass(item, 'kt-menu__item--open-dropdown' ); Plugin.hideSubmenuDropdown(item, true); } e.preventDefault(); }, /** * Handles tab click toggle * @returns {KTMenu} */ handleSubmenuDropdownTabClick: function(e) { if (Plugin.getSubmenuMode(this) === 'accordion') { return; } var item = this.closest('.kt-menu__item'); if (item.getAttribute('data-ktmenu-submenu-mode') == 'accordion') { return; } if (KTUtil.hasClass(item, 'kt-menu__item--hover') == false) { KTUtil.addClass(item, 'kt-menu__item--open-dropdown'); Plugin.showSubmenuDropdown(item); } e.preventDefault(); }, /** * Handles link click * @returns {KTMenu} */ handleLinkClick: function(e) { var submenu = this.closest('.kt-menu__item.kt-menu__item--submenu'); // if ( submenu && Plugin.getSubmenuMode(submenu) === 'dropdown' ) { Plugin.hideSubmenuDropdowns(); } }, /** * Handles submenu dropdown close on link click * @returns {KTMenu} */ handleSubmenuDropdownClose: function(e, el) { // exit if its not submenu dropdown mode if (Plugin.getSubmenuMode(el) === 'accordion') { return; } var shown = element.querySelectorAll('.kt-menu__item.kt-menu__item--submenu.kt-menu__item--hover:not(.kt-menu__item--tabs)'); // check if currently clicked link's parent item ha if (shown.length > 0 && KTUtil.hasClass(el, 'kt-menu__toggle') === false && el.querySelectorAll('.kt-menu__toggle').length === 0) { // close opened dropdown menus for (var i = 0, len = shown.length; i < len; i++) { Plugin.hideSubmenuDropdown(shown[0], true); } } }, /** * helper functions * @returns {KTMenu} */ handleSubmenuAccordion: function(e, el) { var query; var item = el ? el : this; if ( Plugin.getSubmenuMode(el) === 'dropdown' && (query = item.closest('.kt-menu__item') ) ) { if (query.getAttribute('data-ktmenu-submenu-mode') != 'accordion' ) { e.preventDefault(); return; } } var li = item.closest('.kt-menu__item'); var submenu = KTUtil.child(li, '.kt-menu__submenu, .kt-menu__inner'); if (KTUtil.hasClass(item.closest('.kt-menu__item'), 'kt-menu__item--open-always')) { return; } if ( li && submenu ) { e.preventDefault(); var speed = the.options.accordion.slideSpeed; var hasClosables = false; if ( KTUtil.hasClass(li, 'kt-menu__item--open') === false ) { // hide other accordions if ( the.options.accordion.expandAll === false ) { var subnav = item.closest('.kt-menu__nav, .kt-menu__subnav'); var closables = KTUtil.children(subnav, '.kt-menu__item.kt-menu__item--open.kt-menu__item--submenu:not(.kt-menu__item--here):not(.kt-menu__item--open-always)'); if ( subnav && closables ) { for (var i = 0, len = closables.length; i < len; i++) { var el_ = closables[0]; var submenu_ = KTUtil.child(el_, '.kt-menu__submenu'); if ( submenu_ ) { KTUtil.slideUp(submenu_, speed, function() { Plugin.scrollUpdate(); KTUtil.removeClass(el_, 'kt-menu__item--open'); }); } } } } KTUtil.slideDown(submenu, speed, function() { Plugin.scrollToItem(item); Plugin.scrollUpdate(); Plugin.eventTrigger('submenuToggle', submenu); }); KTUtil.addClass(li, 'kt-menu__item--open'); } else { KTUtil.slideUp(submenu, speed, function() { Plugin.scrollToItem(item); Plugin.eventTrigger('submenuToggle', submenu); }); KTUtil.removeClass(li, 'kt-menu__item--open'); } } }, /** * scroll to item function * @returns {KTMenu} */ scrollToItem: function(item) { // handle auto scroll for accordion submenus if ( KTUtil.isInResponsiveRange('desktop') && the.options.accordion.autoScroll && element.getAttribute('data-ktmenu-scroll') !== '1' ) { KTUtil.scrollTo(item, the.options.accordion.autoScrollSpeed); } }, /** * Hide submenu dropdown * @returns {KTMenu} */ hideSubmenuDropdown: function(item, classAlso) { // remove submenu activation class if ( classAlso ) { KTUtil.removeClass(item, 'kt-menu__item--hover'); KTUtil.removeClass(item, 'kt-menu__item--active-tab'); } // clear timeout item.removeAttribute('data-hover'); if ( item.getAttribute('data-ktmenu-dropdown-toggle-class') ) { KTUtil.removeClass(body, item.getAttribute('data-ktmenu-dropdown-toggle-class')); } var timeout = item.getAttribute('data-timeout'); item.removeAttribute('data-timeout'); clearTimeout(timeout); }, /** * Hide submenu dropdowns * @returns {KTMenu} */ hideSubmenuDropdowns: function() { var items; if ( items = element.querySelectorAll('.kt-menu__item--submenu.kt-menu__item--hover:not(.kt-menu__item--tabs):not([data-ktmenu-submenu-toggle="tab"])') ) { for (var j = 0, cnt = items.length; j < cnt; j++) { Plugin.hideSubmenuDropdown(items[j], true); } } }, /** * helper functions * @returns {KTMenu} */ showSubmenuDropdown: function(item) { // close active submenus var list = element.querySelectorAll('.kt-menu__item--submenu.kt-menu__item--hover, .kt-menu__item--submenu.kt-menu__item--active-tab'); if ( list ) { for (var i = 0, len = list.length; i < len; i++) { var el = list[i]; if ( item !== el && el.contains(item) === false && item.contains(el) === false ) { Plugin.hideSubmenuDropdown(el, true); } } } // add submenu activation class KTUtil.addClass(item, 'kt-menu__item--hover'); if ( item.getAttribute('data-ktmenu-dropdown-toggle-class') ) { KTUtil.addClass(body, item.getAttribute('data-ktmenu-dropdown-toggle-class')); } }, /** * Handles submenu slide toggle * @returns {KTMenu} */ createSubmenuDropdownClickDropoff: function(el) { var query; var zIndex = (query = KTUtil.child(el, '.kt-menu__submenu') ? KTUtil.css(query, 'z-index') : 0) - 1; var dropoff = document.createElement('<div class="kt-menu__dropoff" style="background: transparent; position: fixed; top: 0; bottom: 0; left: 0; right: 0; z-index: ' + zIndex + '"></div>'); body.appendChild(dropoff); KTUtil.addEvent(dropoff, 'click', function(e) { e.stopPropagation(); e.preventDefault(); KTUtil.remove(this); Plugin.hideSubmenuDropdown(el, true); }); }, /** * Handles submenu hover toggle * @returns {KTMenu} */ pauseDropdownHover: function(time) { var date = new Date(); the.pauseDropdownHoverTime = date.getTime() + time; }, /** * Handles submenu hover toggle * @returns {KTMenu} */ resumeDropdownHover: function() { var date = new Date(); return (date.getTime() > the.pauseDropdownHoverTime ? true : false); }, /** * Reset menu's current active item * @returns {KTMenu} */ resetActiveItem: function(item) { var list; var parents; list = element.querySelectorAll('.kt-menu__item--active'); for (var i = 0, len = list.length; i < len; i++) { var el = list[0]; KTUtil.removeClass(el, 'kt-menu__item--active'); KTUtil.hide( KTUtil.child(el, '.kt-menu__submenu') ); parents = KTUtil.parents(el, '.kt-menu__item--submenu') || []; for (var i_ = 0, len_ = parents.length; i_ < len_; i_++) { var el_ = parents[i]; KTUtil.removeClass(el_, 'kt-menu__item--open'); KTUtil.hide( KTUtil.child(el_, '.kt-menu__submenu') ); } } // close open submenus if ( the.options.accordion.expandAll === false ) { if ( list = element.querySelectorAll('.kt-menu__item--open') ) { for (var i = 0, len = list.length; i < len; i++) { KTUtil.removeClass(parents[0], 'kt-menu__item--open'); } } } }, /** * Sets menu's active item * @returns {KTMenu} */ setActiveItem: function(item) { // reset current active item Plugin.resetActiveItem(); var parents = KTUtil.parents(item, '.kt-menu__item--submenu') || []; for (var i = 0, len = parents.length; i < len; i++) { KTUtil.addClass(KTUtil.get(parents[i]), 'kt-menu__item--open'); } KTUtil.addClass(KTUtil.get(item), 'kt-menu__item--active'); }, /** * Returns page breadcrumbs for the menu's active item * @returns {KTMenu} */ getBreadcrumbs: function(item) { var query; var breadcrumbs = []; var link = KTUtil.child(item, '.kt-menu__link'); breadcrumbs.push({ text: (query = KTUtil.child(link, '.kt-menu__link-text') ? query.innerHTML : ''), title: link.getAttribute('title'), href: link.getAttribute('href') }); var parents = KTUtil.parents(item, '.kt-menu__item--submenu'); for (var i = 0, len = parents.length; i < len; i++) { var submenuLink = KTUtil.child(parents[i], '.kt-menu__link'); breadcrumbs.push({ text: (query = KTUtil.child(submenuLink, '.kt-menu__link-text') ? query.innerHTML : ''), title: submenuLink.getAttribute('title'), href: submenuLink.getAttribute('href') }); } return breadcrumbs.reverse(); }, /** * Returns page title for the menu's active item * @returns {KTMenu} */ getPageTitle: function(item) { var query; return (query = KTUtil.child(item, '.kt-menu__link-text') ? query.innerHTML : ''); }, /** * Trigger events */ eventTrigger: function(name, args) { for (var i = 0; i < the.events.length; i++ ) { var event = the.events[i]; if ( event.name == name ) { if ( event.one == true ) { if ( event.fired == false ) { the.events[i].fired = true; event.handler.call(this, the, args); } } else { event.handler.call(this, the, args); } } } }, addEvent: function(name, handler, one) { the.events.push({ name: name, handler: handler, one: one, fired: false }); }, removeEvent: function(name) { if (the.events[name]) { delete the.events[name]; } } }; ////////////////////////// // ** Public Methods ** // ////////////////////////// /** * Set default options */ the.setDefaults = function(options) { defaultOptions = options; }; /** * Update scroll */ the.scrollUpdate = function() { return Plugin.scrollUpdate(); }; /** * Re-init scroll */ the.scrollReInit = function() { return Plugin.scrollInit(); }; /** * Scroll top */ the.scrollTop = function() { return Plugin.scrollTop(); }; /** * Set active menu item */ the.setActiveItem = function(item) { return Plugin.setActiveItem(item); }; the.reload = function() { return Plugin.reload(); }; the.update = function(options) { return Plugin.update(options); }; /** * Set breadcrumb for menu item */ the.getBreadcrumbs = function(item) { return Plugin.getBreadcrumbs(item); }; /** * Set page title for menu item */ the.getPageTitle = function(item) { return Plugin.getPageTitle(item); }; /** * Get submenu mode */ the.getSubmenuMode = function(el) { return Plugin.getSubmenuMode(el); }; /** * Hide dropdown * @returns {Object} */ the.hideDropdown = function(item) { Plugin.hideSubmenuDropdown(item, true); }; /** * Hide dropdowns * @returns {Object} */ the.hideDropdowns = function() { Plugin.hideSubmenuDropdowns(); }; /** * Disable menu for given time * @returns {Object} */ the.pauseDropdownHover = function(time) { Plugin.pauseDropdownHover(time); }; /** * Disable menu for given time * @returns {Object} */ the.resumeDropdownHover = function() { return Plugin.resumeDropdownHover(); }; /** * Register event */ the.on = function(name, handler) { return Plugin.addEvent(name, handler); }; the.off = function(name) { return Plugin.removeEvent(name); }; the.one = function(name, handler) { return Plugin.addEvent(name, handler, true); }; /////////////////////////////// // ** Plugin Construction ** // /////////////////////////////// // Run plugin Plugin.construct.apply(the, [options]); // Handle plugin on window resize KTUtil.addResizeHandler(function() { if (init) { the.reload(); } }); // Init done init = true; // Return plugin instance return the; }; // Plugin global lazy initialization document.addEventListener("click", function (e) { var body = KTUtil.get('body'); var query; if ( query = body.querySelectorAll('.kt-menu__nav .kt-menu__item.kt-menu__item--submenu.kt-menu__item--hover:not(.kt-menu__item--tabs)[data-ktmenu-submenu-toggle="click"]') ) { for (var i = 0, len = query.length; i < len; i++) { var element = query[i].closest('.kt-menu__nav').parentNode; if ( element ) { var the = KTUtil.data(element).get('menu'); if ( !the ) { break; } if ( !the || the.getSubmenuMode() !== 'dropdown' ) { break; } if ( e.target !== element && element.contains(e.target) === false ) { the.hideDropdowns(); } } } } });
var _ = require('lodash'); var async = require('async'); var deep = require('deep-get-set'); module.exports = function(self, options) { // These properties have special meaning in Apostrophe docs and are not // acceptable for use as top-level area names self.forbiddenAreas = [ '_id', 'title', 'slug', 'titleSort', 'docPermissions', 'tags', 'type', 'path', 'rank', 'level' ]; self.widgetManagers = {}; // Set the manager object for the given widget type name. The manager is // expected to provide `sanitize`, `output` and `load` methods. Normally // this method is called for you when you extend the `apostrophe-widgets` // module, which is recommended. self.setWidgetManager = function(name, manager) { self.widgetManagers[name] = manager; }; // Get the manager object for the given widget type name. self.getWidgetManager = function(name) { return self.widgetManagers[name]; }; // Print warning message about a missing widget type — only once per run per type. self.warnMissingWidgetType = function(name) { if (!self.missingWidgetTypes) { self.missingWidgetTypes = {}; } if (!self.missingWidgetTypes[name]) { self.apos.utils.error('WARNING: widget type ' + name + ' exists in content but is not configured'); self.missingWidgetTypes[name] = true; } }; // Render the given `area` object via `area.html`, passing the // specified `options` to the template. Called for you by the // `apos.area` and `apos.singleton` template helpers. self.renderArea = function(area, options) { // Ability to disable editing for a specific request if (self.apos.templates.contextReq.disableEditing) { if (area._edit && (options.edit !== false)) { area._disabledEditing = true; } area._edit = false; } return self.partial('area', { area: area, options: options, widgetManagers: self.widgetManagers }); }; // Sanitize an array of items intended to become // the `items` property of an area. Invokes the // sanitize method for each widget's manager. Widgets // with no manager are discarded. Invoked for you by // the routes that save areas and by the implementation // of the `area` schema field type. self.sanitizeItems = function(req, items, callback) { var result = []; return async.eachSeries(items, function(item, callback) { if ((typeof (item) !== 'object') || (typeof (item.type) !== 'string')) { return setImmediate(callback); } var manager = self.getWidgetManager(item.type); if (!manager) { self.warnMissingWidgetType(item.type); return setImmediate(callback); } return manager.sanitize(req, item, function(err, item) { if (err) { return callback(err); } result.push(item); return callback(null); }); }, function(err) { if (err) { return callback(err); } return callback(null, result); }); }; // Renders markup for a widget of the given `type`. The actual // content of the widget is passed in `data`. The callback is // invoked with `(null, html)` on success. Invoked by the // `render-widget` route, which is used to update a widget on the // page after it is saved. self.renderWidget = function(req, type, data, options, callback) { var manager = self.getWidgetManager(type); if (!manager) { // No manager available - possibly a stale widget in the database // of a type no longer in the project self.warnMissingWidgetType(type); return callback(null, ''); } data.type = type; var render; if (!manager.options.wrapperTemplate) { render = _.partial(self.render, req, 'widget'); } else { render = _.partial(manager.render, req, manager.options.wrapperTemplate); } try { return callback(null, render({ widget: data, dataFiltered: manager.filterForDataAttribute(data), options: options, manager: manager, output: function() { return manager.output(data, options); } })); } catch (e) { self.apos.utils.error(e); self.apos.utils.error(e.stack); self.apos.utils.error('^^^^ LOOK UP HERE FOR THE ERROR IN YOUR WIDGET OUTPUT METHOD'); return callback(e); } }; // Update or create an area at the specified // dot path in the document with the specified // id, if we have permission to do so. The change is // saved in the database before the callback is invoked. The // `items` array is NOT sanitized here; you should call // `sanitizeItems` first. Called for you by the // `save-area` route. self.saveArea = function(req, docId, dotPath, items, callback) { var doc; return async.series({ find: function(callback) { return self.apos.docs.find(req, { _id: docId }) .permission('edit-doc') .published(null) .toObject(function(err, _doc) { if (err) { self.apos.utils.error(err); return callback(err); } if (!_doc) { return callback(new Error('notfound')); } doc = _doc; return callback(null); } ); }, update: function(callback) { var components = dotPath.split(/\./); if (_.contains(self.forbiddenAreas, components[0])) { return callback(new Error('forbidden')); } // If it's not a top level property, it's // always okay - unless it already exists // and is not an area. if (components.length > 1) { var existing = deep(doc, dotPath); if (existing && (existing.type !== 'area')) { return callback(new Error('forbidden')); } } var existingArea = deep(doc, dotPath); var existingItems = (existingArea && existingArea.items) || []; if (_.isEqual(self.apos.utils.clonePermanent(items), self.apos.utils.clonePermanent(existingItems))) { // No real change — don't waste a version and clutter the database. // Sometimes only the server-side sanitizers can tell accurately that // nothing has changed. -Tom return setImmediate(callback); } deep(doc, dotPath, { type: 'area', items: items }); return self.apos.docs.update(req, doc, callback); } }, function(err) { return callback(err); }); }; // Lock, sanitize and save the area described by `areaInfo` on behalf // of `req`. // // `areaInfo` must have `items`, `docId` and `dotPath` // parameters. For bc, if `req.htmlPageId` is not present // then advisory locking is not performed. // // Note that the area is not unlocked. This method is designed // for autosave operations, which continue until the page // is unloaded, at which time the `save-areas-and-unlock` // route will be accessed. // // This method performs sanitization of all properties of // `areaInfo` before trusting it, so passing `req.body` // is a safe thing to do. self.lockSanitizeAndSaveArea = function(req, areaInfo, callback) { if (typeof (areaInfo) !== 'object') { return callback(new Error('areaInfo is not an object')); } var items = Array.isArray(areaInfo.items) ? areaInfo.items : []; var docId = self.apos.launder.id(areaInfo.docId); var dotPath = self.apos.launder.string(areaInfo.dotPath); if (!(items && options && docId && dotPath)) { return callback(new Error('Area is missing one or more required parameters for saving')); } if (!dotPath.match(/^[\w.]+$/)) { return callback(new Error('Invalid dotpath: ' + dotPath + '. Make sure your area or singleton name uses only alphanumeric characters.')); } return async.series([ lock, sanitizeItems, saveArea ], callback); function lock(callback) { if (!(req.htmlPageId && req.user)) { // Some consumers of this API might not participate // in advisory locking. Also, make sure we have a // valid user to minimize the risk of a DOS attack // via nuisance locking return callback(null); } return self.apos.docs.lock(req, docId, req.htmlPageId, callback); } function sanitizeItems(callback) { return self.sanitizeItems(req, items, function(err, _items) { items = _items; return callback(err); }); } function saveArea(callback) { return self.saveArea(req, docId, dotPath, items, callback); } }; // Walk the areas in a doc. Your iterator function is invoked once // for each area found, and receives the // area object and the dot-notation path to that object. // note that areas can be deeply nested in docs via // array schemas. // // If the iterator explicitly returns `false`, the area // is *removed* from the page object, otherwise no // modifications are made. This happens in memory only; // the database is not modified. self.walk = function(doc, iterator) { return self.apos.docs.walk(doc, function(o, k, v, dotPath) { if (v && (v.type === 'area')) { return iterator(v, dotPath); } }); }; // If the schema corresponding to the given doc's // `type` property has an `options` property for the // given field `name`, return that property. This is used // to conveniently default to the `options` already configured // for a particular area in the schema when working with // `apostrophe-pieces` in a page template. self.getSchemaOptions = function(doc, name) { var manager = self.apos.docs.getManager(doc.type); if (!manager) { // This happens if we try to find the schema options for an area in // a widget or something else that isn't a top level doc type, or // the projection did not include type. // // TODO: a better solution to the entire option-forwarding problem? -Tom return {}; } var schema = manager.schema; var field = _.find(schema, 'name', name); if (!(field && field.options)) { return {}; } return field.options; }; self.richTextWidgetTypes = []; // Returns the rich text markup of all rich text widgets // within the provided doc or area, concatenated as a single string. // // By default the rich text contents of the widgets are joined with // a newline between. You may pass your own `options.delimiter` string if // you wish a different delimiter or the empty string. You may also pass // an HTML element name like `div` via `options.wrapper` to wrap each // one in a `<div>...</div>` block. Of course, there may already be a div // in the rich txt (but then again there may not). // // Also available as a helper via `apos.areas.richText(area, options)` in templates. // // Content will be retrieved from any widget type that supplies a // `getRichText` method. self.richText = function(within, options) { options = options || {}; function test(attachment) { if ((!attachment) || (typeof (attachment) !== 'object')) { return false; } if (!_.contains(self.richTextWidgetTypes, attachment.type)) { return false; } return true; } var winners = []; if (!within) { return ''; } self.apos.docs.walk(within, function(o, key, value, dotPath, ancestors) { if (test(value)) { winners.push(value); } }); if (options.wrapper) { return _.map(winners, function(winner) { return '<' + options.wrapper + '>' + winner.content + '</' + options.wrapper + '>'; }).join(''); } var delimiter = (options.delimiter !== undefined) ? options.delimiter : '\n'; return _.pluck(winners, 'content').join(delimiter); }; // Returns the plaintext contents of all rich text widgets // within the provided doc or area, concatenated as a single string. // // By default the rich text contents of the various widgets are joined with // a newline between. You may pass your own `options.delimiter` string if // you wish a different delimiter or the empty string. // // Whitespace is trimmed off the leading and trailing edges of the string, and // consecutive newlines are condensed to one, to better match reasonable expectations // re: text that began as HTML. // // Pass `options.limit` to limit the number of characters. This method will // return fewer characters in order to avoid cutting off in mid-word. // // By default, three periods (`...`) follow a truncated string. If you prefer, // set `options.ellipsis` to a different suffix, which may be the empty string // if you wish. // // Also available as a helper via `apos.areas.plaintext(area, options)` in templates. // // Content will be retrieved from any widget type that supplies a // `getRichText` method. self.plaintext = function(within, options) { options = options || {}; var richText = self.richText(within, options); var plaintext = self.apos.utils.htmlToPlaintext(richText).trim(); plaintext = plaintext.replace(/\n+/g, '\n'); if (!options.limit) { return plaintext; } var ellipsis = '...'; if (options.ellipsis !== undefined) { ellipsis = options.ellipsis; } return self.apos.utils.truncatePlaintext(plaintext, options.limit, ellipsis); }; // Very handy for imports of all kinds: convert plaintext to an area with // one `apostrophe-rich-text` widget if it is not blank, otherwise an empty area. null and // undefined are tolerated and converted to empty areas. self.fromPlaintext = function(plaintext) { var area = { type: 'area', items: [] }; if (plaintext && plaintext.length) { plaintext = plaintext.toString(); area.items.push({ _id: self.apos.utils.generateId(), type: 'apostrophe-rich-text', content: self.apos.utils.escapeHtml(plaintext, true) }); } return area; }; // Convert HTML to an area with one 'apostrophe-rich-text' widget, otherwise // an empty area. null and undefined are tolerated and converted to empty areas. self.fromRichText = function (html) { var area = { type: 'area', items: [] }; if (html && html.length) { html = html.toString(); area.items.push({ _id: self.apos.utils.generateId(), type: 'apostrophe-rich-text', content: html }); } return area; }; // When all modules are ready and all widget managers therefore should have been // added, determine the list of rich text widgets for purposes of the // apos.areas.richText() method which returns just the rich text of the area self.modulesReady = function() { _.each(self.widgetManagers, function(manager, name) { if (manager.getRichText) { self.richTextWidgetTypes.push(name); } }); }; // Load widgets which were deferred until as late as possible. Only // comes into play if `req.deferWidgetLoading` was set to true for // the request. Invoked after the last `pageBeforeSend` handler, and // also at the end of the `apostrophe-global` middleware. self.loadDeferredWidgets = function(req, callback) { if (!req.deferWidgetLoading) { return callback(null); } req.loadingDeferredWidgets = true; return async.eachSeries(_.keys(req.deferredWidgets), function(type, callback) { var manager = self.getWidgetManager(type); if (!manager) { self.warnMissingWidgetType(type); return setImmediate(callback); } return manager.load(req, req.deferredWidgets[type], callback); }, callback); }; // This method is called when rendering widgets in an area, // to add top-level controls to them, such as the movement arrows // and the edit pencil. It can be extended to add more controls in // a context-sensitive way, or configured via the addWidgetControlGroups // option (see the source, TODO: document the format in detail) self.widgetControlGroups = function(req, widget, options) { options = options || {}; var controlGroups = ([ { classes: '', controls: [ { icon: 'arrows', action: 'drag-item' }, { icon: 'arrow-up', action: 'move-item', value: 'up' }, { icon: 'arrow-down', action: 'move-item', value: 'down' }, { icon: 'clone', action: 'clone-item' } ] }, { classes: 'apos-button-group--data', controls: [ { label: '$editLabel', action: 'edit-item' } ] }, { classes: '', controls: [ { icon: 'trash', action: 'trash-item' } ] } ] || self.options.widgetControlGroups).concat(self.options.addWidgetControlGroups || []); controlGroups = _.cloneDeep(controlGroups); controlGroups = _.filter(controlGroups, function(controlGroup) { controlGroup.controls = _.filter(controlGroup.controls || [], function(control) { var action; if (options.controls && (options.controls.movable === false)) { action = control.action; if ((action === 'move-item') || (action === 'drag-item')) { return false; } } if ((options.controls && options.controls.removable === false)) { action = control.action; if (action === 'trash-item') { return false; } } var manager = widget && self.getWidgetManager(widget.type); if (manager && manager.options.contextualOnly) { action = control.action; if (action === 'edit-item') { return false; } } return true; }); return controlGroup.controls.length > 0; }); return controlGroups; }; // Returns true if the named area in the given `doc` is empty. // // Alternate syntax: `{ area: doc.areaname, ... more options }` // // An area is empty if it has no widgets in it, or when // all of the widgets in it return true when their // `isEmpty()` methods are interrogated. For instance, // if an area only contains a rich text widget and that // widget. A widget with no `isEmpty()` method is never empty. self.isEmpty = function(doc, name) { var area; if (arguments.length === 2) { area = doc[name]; } else { // "doc" is an options object area = doc.area; } if (!area) { return true; } return !_.some(area.items, function(item) { var manager = self.getWidgetManager(item.type); if (manager && manager.isEmpty) { return !manager.isEmpty(item); } else { return true; } }); }; // merge new methods with all apostrophe-cursors self.apos.define('apostrophe-cursor', require('./cursor.js')); };
"use strict"; const opsgenie = require('../../'); require('../configure'); let delete_incident_json = { identifier: "cf6de3ed-a789-4941-8bc1-b5eb3b24003a", // should be custom to your created incident identifierType: "id" }; opsgenie.incident.delete(delete_incident_json, function (error, user) { if (error) { console.error(error); } else { console.log("Delete Incident Response"); console.log(user); } });
/*! This file is auto-generated */ this.wp=this.wp||{},this.wp.editWidgets=function(e){var t={};function r(c){if(t[c])return t[c].exports;var n=t[c]={i:c,l:!1,exports:{}};return e[c].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,c){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:c})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var c=Object.create(null);if(r.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(c,n,function(t){return e[t]}.bind(null,n));return c},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s="F35A")}({"//Lo":function(e,t,r){"use strict";var c=r("GRId"),n=r("Tqx9");const i=Object(c.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(n.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"}));t.a=i},"1ZqX":function(e,t){e.exports=window.wp.data},"6aBm":function(e,t){e.exports=window.wp.mediaUtils},Cg8A:function(e,t,r){"use strict";var c=r("GRId"),n=r("Tqx9");const i=Object(c.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(n.Path,{fillRule:"evenodd",d:"M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z",clipRule:"evenodd"}));t.a=i},F35A:function(e,t,r){"use strict";r.r(t),r.d(t,"initialize",(function(){return gt}));var c={};r.r(c),r.d(c,"persistStubPost",(function(){return B})),r.d(c,"saveEditedWidgetAreas",(function(){return C})),r.d(c,"saveWidgetAreas",(function(){return R})),r.d(c,"saveWidgetArea",(function(){return W})),r.d(c,"setWidgetIdForClientId",(function(){return L})),r.d(c,"setWidgetAreasOpenState",(function(){return P})),r.d(c,"setIsWidgetAreaOpen",(function(){return M})),r.d(c,"setIsInserterOpened",(function(){return G})),r.d(c,"closeGeneralSidebar",(function(){return D})),r.d(c,"moveBlockToWidgetArea",(function(){return F})),r.d(c,"__unstableToggleFeature",(function(){return V}));var n={};r.r(n),r.d(n,"getWidgetAreas",(function(){return U})),r.d(n,"getWidgets",(function(){return q}));var i={};r.r(i),r.d(i,"getWidgets",(function(){return z})),r.d(i,"getWidget",(function(){return H})),r.d(i,"getWidgetAreas",(function(){return K})),r.d(i,"getWidgetAreaForWidgetId",(function(){return Q})),r.d(i,"getEditedWidgetAreas",(function(){return Y})),r.d(i,"getReferenceWidgetBlocks",(function(){return J})),r.d(i,"isSavingWidgetAreas",(function(){return X})),r.d(i,"getIsWidgetAreaOpen",(function(){return Z})),r.d(i,"isInserterOpened",(function(){return $})),r.d(i,"canInsertBlockInWidgetArea",(function(){return ee})),r.d(i,"__unstableIsFeatureActive",(function(){return te}));var o={};r.r(o),r.d(o,"metadata",(function(){return pe})),r.d(o,"name",(function(){return Oe})),r.d(o,"settings",(function(){return je}));var a=r("GRId"),s=r("HSyU"),l=r("QyPg"),d=r("jZUy"),u=r("GLVC"),b=r("ywyh"),m=r.n(b),g=r("1ZqX"),p=r("YLtl");const O=Object(p.flow)([g.combineReducers,(j={features:{fixedToolbar:!1,welcomeGuide:!0,showBlockBreadcrumbs:!0,themeStyles:!0}},e=>(t=j,r)=>e(t,r))])({features:(e,t)=>"TOGGLE_FEATURE"===t.type?{...e,[t.feature]:!e[t.feature]}:e});var j,f=Object(g.combineReducers)({blockInserterPanel:function(e=!1,t){switch(t.type){case"SET_IS_INSERTER_OPENED":return t.value}return e},widgetAreasOpenState:function(e={},t){const{type:r}=t;switch(r){case"SET_WIDGET_AREAS_OPEN_STATE":return t.widgetAreasOpenState;case"SET_IS_WIDGET_AREA_OPEN":{const{clientId:r,isOpen:c}=t;return{...e,[r]:c}}default:return e}},preferences:O});const _="root",h=e=>"widget-area-"+e;const w="core/edit-widgets";function E(e,t,...r){return{type:"SELECT",registryName:e,selectorName:t,args:r}}function y(e,t,...r){return{type:"DISPATCH",registryName:e,actionName:t,args:r}}const v={AWAIT_PROMISE:({promise:e})=>e,SELECT:Object(g.createRegistryControl)(e=>({registryName:t,selectorName:r,args:c})=>e.select(t)[r](...c)),GET_PENDING_ACTIONS:Object(g.createRegistryControl)(e=>({postId:t})=>{var r;return(null===(r=k(e).processingQueue[t])||void 0===r?void 0:r.pendingActions)||[]}),IS_PROCESSING_POST:Object(g.createRegistryControl)(e=>({postId:t})=>{var r;return null===(r=k(e).processingQueue[t])||void 0===r?void 0:r.inProgress}),DISPATCH:Object(g.createRegistryControl)(e=>({registryName:t,actionName:r,args:c})=>e.dispatch(t)[r](...c)),RESOLVE_WIDGET_AREAS:Object(g.createRegistryControl)(e=>({query:t})=>e.resolveSelect("core").getEntityRecords(_,"sidebar",t)),RESOLVE_WIDGETS:Object(g.createRegistryControl)(e=>({query:t})=>e.resolveSelect("core").getEntityRecords("root","widget",t))},k=e=>e.stores[w].store.getState();var S=v,I=r("l3Sj"),A=r("onLe"),x=r("U60i");function T(e){if("block"===e.id_base){const t=Object(s.parse)(e.instance.raw.content);return t.length?Object(u.addWidgetIdToBlock)(t[0],e.id):Object(u.addWidgetIdToBlock)(Object(s.createBlock)("core/paragraph",{},[]),e.id)}let t;return t=e._embedded.about[0].is_multi?{idBase:e.id_base,instance:e.instance}:{id:e.id},Object(u.addWidgetIdToBlock)(Object(s.createBlock)("core/legacy-widget",t,[]),e.id)}function N(e,t={}){let r;var c,n,i;"core/legacy-widget"===e.name&&(e.attributes.id||e.attributes.instance)?r={...t,id:null!==(c=e.attributes.id)&&void 0!==c?c:t.id,id_base:null!==(n=e.attributes.idBase)&&void 0!==n?n:t.id_base,instance:null!==(i=e.attributes.instance)&&void 0!==i?i:t.instance}:r={...t,id_base:"block",instance:{raw:{content:Object(s.serialize)(e)}}};return delete r.rendered,delete r.rendered_form,r}const B=function*(e,t){const r=((e,t)=>({id:e,slug:e,status:"draft",type:"page",blocks:t,meta:{widgetAreaId:e}}))(e,t);return yield y("core","receiveEntityRecords",_,"postType",r,{id:r.id},!1),r};function*C(){const e=yield E(w,"getEditedWidgetAreas");if(null!=e&&e.length)try{yield*R(e),yield y(A.store,"createSuccessNotice",Object(I.__)("Widgets saved."),{type:"snackbar"})}catch(e){yield y(A.store,"createErrorNotice",Object(I.sprintf)(Object(I.__)("There was an error. %s"),e.message),{type:"snackbar"})}}function*R(e){try{for(const t of e)yield*W(t.id)}finally{yield y("core","finishResolution","getEntityRecord",_,"sidebar",{per_page:-1})}}function*W(e){const t=yield E(w,"getWidgets"),r=yield E("core","getEditedEntityRecord",_,"postType",h(e)),c=Object.values(t).filter(({sidebar:t})=>t===e),n=[],i=r.blocks.filter(e=>{const{id:t}=e.attributes;if("core/legacy-widget"===e.name&&t){if(n.includes(t))return!1;n.push(t)}return!0}),o=[];for(const e of c){(yield E(w,"getWidgetAreaForWidgetId",e.id))||o.push(e)}const a=[],s=[],l=[];for(let r=0;r<i.length;r++){const c=i[r],n=Object(u.getWidgetIdFromBlock)(c),o=t[n],d=N(c,o);if(l.push(n),o){yield y("core","editEntityRecord","root","widget",n,{...d,sidebar:e},{undoIgnore:!0});if(!(yield E("core","hasEditsForEntityRecord","root","widget",n)))continue;s.push(({saveEditedEntityRecord:e})=>e("root","widget",n))}else s.push(({saveEntityRecord:t})=>t("root","widget",{...d,sidebar:e}));a.push({block:c,position:r,clientId:c.clientId})}for(const e of o)s.push(({deleteEntityRecord:t})=>t("root","widget",e.id,{force:!0}));const d=(yield y("core","__experimentalBatch",s)).filter(e=>!e.hasOwnProperty("deleted")),b=[];for(let e=0;e<d.length;e++){const t=d[e],{block:c,position:n}=a[e];r.blocks[n].attributes.__internalWidgetId=t.id;var m;if(yield E("core","getLastEntitySaveError","root","widget",t.id))b.push((null===(m=c.attributes)||void 0===m?void 0:m.name)||(null==c?void 0:c.name));l[n]||(l[n]=t.id)}if(b.length)throw new Error(Object(I.sprintf)(Object(I.__)("Could not save the following widgets: %s."),b.join(", ")));yield y("core","editEntityRecord",_,"sidebar",e,{widgets:l},{undoIgnore:!0}),yield*function*(e){const t=yield E("core","getLastEntitySaveError",_,"sidebar",e);yield y("core","saveEditedEntityRecord",_,"sidebar",e);const r=yield E("core","getLastEntitySaveError",_,"sidebar",e);if(r&&t!==r)throw new Error(r)}(e),yield y("core","receiveEntityRecords",_,"postType",r,void 0)}function L(e,t){return{type:"SET_WIDGET_ID_FOR_CLIENT_ID",clientId:e,widgetId:t}}function P(e){return{type:"SET_WIDGET_AREAS_OPEN_STATE",widgetAreasOpenState:e}}function M(e,t){return{type:"SET_IS_WIDGET_AREA_OPEN",clientId:e,isOpen:t}}function G(e){return{type:"SET_IS_INSERTER_OPENED",value:e}}function*D(){yield y(x.g.name,"disableComplementaryArea",w)}function*F(e,t){const r=yield E("core/block-editor","getBlockRootClientId",[e]),c=(yield E("core/block-editor","getBlocks")).find(({attributes:e})=>e.id===t).clientId,n=(yield E("core/block-editor","getBlockOrder",c)).length;(yield E(w,"getIsWidgetAreaOpen",c))||(yield y(w,"setIsWidgetAreaOpen",c,!0)),yield y("core/block-editor","moveBlocksToPosition",[e],r,c,n)}function V(e){return{type:"TOGGLE_FEATURE",feature:e}}function*U(){const e={per_page:-1};yield function(e={per_page:-1}){return{type:"RESOLVE_WIDGET_AREAS",query:e}}(e);const t=[],r=(yield E("core","getEntityRecords",_,"sidebar",e)).sort((e,t)=>"wp_inactive_widgets"===e.id?1:"wp_inactive_widgets"===t.id?-1:0);for(const e of r)t.push(Object(s.createBlock)("core/widget-area",{id:e.id,name:e.name})),e.widgets.length||(yield B(h(e.id),[]));const c={};t.forEach((e,t)=>{c[e.clientId]=0===t}),yield P(c),yield B("widget-areas",t)}function*q(){const e={per_page:-1,_embed:"about"};yield function(e={per_page:-1,_embed:"about"}){return{type:"RESOLVE_WIDGETS",query:e}}(e);const t=yield E("core","getEntityRecords","root","widget",e),r={};for(const e of t){const t=T(e);r[e.sidebar]=r[e.sidebar]||[],r[e.sidebar].push(t)}for(const e in r)r.hasOwnProperty(e)&&(yield B(h(e),r[e]))}const z=Object(g.createRegistrySelector)(e=>()=>{const t=e("core").getEntityRecords("root","widget",{per_page:-1,_embed:"about"});return Object(p.keyBy)(t,"id")}),H=Object(g.createRegistrySelector)(e=>(t,r)=>e(w).getWidgets()[r]),K=Object(g.createRegistrySelector)(e=>()=>{const t={per_page:-1};return e("core").getEntityRecords(_,"sidebar",t)}),Q=Object(g.createRegistrySelector)(e=>(t,r)=>e(w).getWidgetAreas().find(t=>e("core").getEditedEntityRecord(_,"postType",h(t.id)).blocks.map(e=>Object(u.getWidgetIdFromBlock)(e)).includes(r))),Y=Object(g.createRegistrySelector)(e=>(t,r)=>{let c=e(w).getWidgetAreas();return c?(r&&(c=c.filter(({id:e})=>r.includes(e))),c.filter(({id:t})=>e("core").hasEditsForEntityRecord(_,"postType",h(t))).map(({id:t})=>e("core").getEditedEntityRecord(_,"sidebar",t))):[]}),J=Object(g.createRegistrySelector)(e=>(t,r=null)=>{const c=[],n=e(w).getWidgetAreas();for(const t of n){const n=e("core").getEditedEntityRecord(_,"postType",h(t.id));for(const e of n.blocks){var i;"core/legacy-widget"!==e.name||r&&(null===(i=e.attributes)||void 0===i?void 0:i.referenceWidgetName)!==r||c.push(e)}}return c}),X=Object(g.createRegistrySelector)(e=>()=>{var t;const r=null===(t=e(w).getWidgetAreas())||void 0===t?void 0:t.map(({id:e})=>e);if(!r)return!1;for(const t of r){if(e("core").isSavingEntityRecord(_,"sidebar",t))return!0}const c=[...Object.keys(e(w).getWidgets()),void 0];for(const t of c){if(e("core").isSavingEntityRecord("root","widget",t))return!0}return!1}),Z=(e,t)=>{const{widgetAreasOpenState:r}=e;return!!r[t]};function $(e){return!!e.blockInserterPanel}const ee=Object(g.createRegistrySelector)(e=>(t,r)=>{const c=e("core/block-editor").getBlocks(),[n]=c;return e("core/block-editor").canInsertBlockType(r,n.clientId)});function te(e,t){return Object(p.get)(e.preferences.features,[t],!1)}const re={reducer:f,controls:S,selectors:i,resolvers:n,actions:c,persist:["preferences"]},ce=Object(g.createReduxStore)(w,re);Object(g.registerStore)(w,re),m.a.use((function(e,t){var r;return 0===(null===(r=e.path)||void 0===r?void 0:r.indexOf("/wp/v2/types/widget-area"))?Promise.resolve({}):t(e)}));var ne=r("axFQ"),ie=r("K9lf"),oe=r("g56x");const ae=Object(ie.createHigherOrderComponent)(e=>t=>{const r=Object(u.getWidgetIdFromBlock)(t),c=t.name,{widgetAreas:n,currentWidgetAreaId:i,canInsertBlockInWidgetArea:o}=Object(g.useSelect)(e=>{var t;if("core/widget-area"===c)return{};const n=e(ce);return{widgetAreas:n.getWidgetAreas(),currentWidgetAreaId:r?null===(t=n.getWidgetAreaForWidgetId(r))||void 0===t?void 0:t.id:void 0,canInsertBlockInWidgetArea:n.canInsertBlockInWidgetArea(c)}},[r,c]),{moveBlockToWidgetArea:s}=Object(g.useDispatch)(ce),l=(null==n?void 0:n.length)>1,d="core/widget-area"!==c&&l&&o;return Object(a.createElement)(a.Fragment,null,Object(a.createElement)(e,t),d&&Object(a.createElement)(ne.BlockControls,null,Object(a.createElement)(u.MoveToWidgetArea,{widgetAreas:n,currentWidgetAreaId:i,onSelect:e=>{s(t.clientId,e)}})))},"withMoveToWidgetAreaToolbarItem");Object(oe.addFilter)("editor.BlockEdit","core/edit-widgets/block-edit",ae);var se=r("6aBm");Object(oe.addFilter)("editor.MediaUpload","core/edit-widgets/replace-media-upload",()=>se.MediaUpload);var le=r("tI+e"),de=r("TSYQ"),ue=r.n(de);var be=e=>{const[t,r]=Object(a.useState)(!1);return Object(a.useEffect)(()=>{const{ownerDocument:t}=e.current;function c(e){i(e)}function n(){r(!1)}function i(t){e.current.contains(t.target)?r(!0):r(!1)}return t.addEventListener("dragstart",c),t.addEventListener("dragend",n),t.addEventListener("dragenter",i),()=>{t.removeEventListener("dragstart",c),t.removeEventListener("dragend",n),t.removeEventListener("dragenter",i)}},[]),t};function me(){const[e,t,r]=Object(d.useEntityBlockEditor)("root","postType"),c=Object(a.useRef)(),n=be(c),i=Object(ne.__experimentalUseInnerBlocksProps)({ref:c},{value:e,onInput:t,onChange:r,templateLock:!1,renderAppender:ne.InnerBlocks.ButtonBlockAppender});return Object(a.createElement)("div",{className:ue()("wp-block-widget-area__inner-blocks block-editor-inner-blocks editor-styles-wrapper",{"wp-block-widget-area__highlight-drop-zone":n})},Object(a.createElement)("div",i))}const ge=e=>{const[t,r]=Object(a.useState)(!1);return Object(a.useEffect)(()=>{const{ownerDocument:t}=e.current;function c(){r(!0)}function n(){r(!1)}return t.addEventListener("dragstart",c),t.addEventListener("dragend",n),()=>{t.removeEventListener("dragstart",c),t.removeEventListener("dragend",n)}},[]),t},pe={name:"core/widget-area",category:"widgets",attributes:{id:{type:"string"},name:{type:"string"}},supports:{html:!1,inserter:!1,customClassName:!1,reusable:!1,__experimentalToolbar:!1,__experimentalParentSelector:!1},editorStyle:"wp-block-widget-area-editor",style:"wp-block-widget-area"},{name:Oe}=pe,je={title:Object(I.__)("Widget Area"),description:Object(I.__)("A widget area container."),__experimentalLabel:({name:e})=>e,edit:function({clientId:e,className:t,attributes:{id:r,name:c}}){const n=Object(g.useSelect)(t=>t(ce).getIsWidgetAreaOpen(e),[e]),{setIsWidgetAreaOpen:i}=Object(g.useDispatch)(ce),o=Object(a.useRef)(),s=Object(a.useCallback)(t=>i(e,t),[e]),l=ge(o),u=be(o),[b,m]=Object(a.useState)(!1);return Object(a.useEffect)(()=>{l?u&&!n?(s(!0),m(!0)):!u&&n&&b&&s(!1):m(!1)},[n,l,u,b]),Object(a.createElement)(le.Panel,{className:t,ref:o},Object(a.createElement)(le.PanelBody,{title:c,opened:n,onToggle:()=>{i(e,!n)},scrollAfterOpen:!l},({opened:e})=>Object(a.createElement)(le.__unstableDisclosureContent,{className:"wp-block-widget-area__panel-body-content",visible:e},Object(a.createElement)(d.EntityProvider,{kind:"root",type:"postType",id:"widget-area-"+r},Object(a.createElement)(me,null)))))}};var fe=r("TvNi"),_e=r("wx14"),he=r("diJD"),we=r("hF7m");function Ee(){const{redo:e,undo:t}=Object(g.useDispatch)("core"),{saveEditedWidgetAreas:r}=Object(g.useDispatch)(ce);return Object(we.useShortcut)("core/edit-widgets/undo",e=>{t(),e.preventDefault()},{bindGlobal:!0}),Object(we.useShortcut)("core/edit-widgets/redo",t=>{e(),t.preventDefault()},{bindGlobal:!0}),Object(we.useShortcut)("core/edit-widgets/save",e=>{e.preventDefault(),r()},{bindGlobal:!0}),null}Ee.Register=function(){const{registerShortcut:e}=Object(g.useDispatch)(we.store);return Object(a.useEffect)(()=>{e({name:"core/edit-widgets/undo",category:"global",description:Object(I.__)("Undo your last changes."),keyCombination:{modifier:"primary",character:"z"}}),e({name:"core/edit-widgets/redo",category:"global",description:Object(I.__)("Redo your last undo."),keyCombination:{modifier:"primaryShift",character:"z"}}),e({name:"core/edit-widgets/save",category:"global",description:Object(I.__)("Save your changes."),keyCombination:{modifier:"primary",character:"s"}}),e({name:"core/edit-widgets/keyboard-shortcuts",category:"main",description:Object(I.__)("Display these keyboard shortcuts."),keyCombination:{modifier:"access",character:"h"}}),e({name:"core/edit-widgets/next-region",category:"global",description:Object(I.__)("Navigate to the next part of the editor."),keyCombination:{modifier:"ctrl",character:"`"},aliases:[{modifier:"access",character:"n"}]}),e({name:"core/edit-widgets/previous-region",category:"global",description:Object(I.__)("Navigate to the previous part of the editor."),keyCombination:{modifier:"ctrlShift",character:"`"},aliases:[{modifier:"access",character:"p"}]})},[e]),null};var ye=Ee;var ve=()=>Object(g.useSelect)(e=>{var t;const{getBlockSelectionEnd:r,getBlockParents:c,getBlockName:n}=e("core/block-editor"),i=r();if("core/widget-area"===n(i))return i;const o=c(i).find(e=>"core/widget-area"===n(e));if(o)return o;const{getEntityRecord:a}=e("core"),s=a(_,"postType","widget-areas");return null==s||null===(t=s.blocks[0])||void 0===t?void 0:t.clientId},[]);function ke({blockEditorSettings:e,children:t,...r}){const{hasUploadPermissions:c,reusableBlocks:n,isFixedToolbarActive:i,keepCaretInsideBlock:o}=Object(g.useSelect)(e=>({hasUploadPermissions:Object(p.defaultTo)(e("core").canUser("create","media"),!0),widgetAreas:e(ce).getWidgetAreas(),widgets:e(ce).getWidgets(),reusableBlocks:[],isFixedToolbarActive:e(ce).__unstableIsFeatureActive("fixedToolbar"),keepCaretInsideBlock:e(ce).__unstableIsFeatureActive("keepCaretInsideBlock")}),[]),{setIsInserterOpened:s}=Object(g.useDispatch)(ce),l=Object(a.useMemo)(()=>{let t;return c&&(t=({onError:t,...r})=>{Object(se.uploadMedia)({wpAllowedMimeTypes:e.allowedMimeTypes,onError:({message:e})=>t(e),...r})}),{...e,__experimentalReusableBlocks:n,hasFixedToolbar:i,keepCaretInsideBlock:o,mediaUpload:t,templateLock:"all",__experimentalSetIsInserterOpened:s}},[e,i,o,c,n,s]),u=ve(),[b,m,O]=Object(d.useEntityBlockEditor)(_,"postType",{id:"widget-areas"});return Object(a.createElement)(a.Fragment,null,Object(a.createElement)(ne.BlockEditorKeyboardShortcuts.Register,null),Object(a.createElement)(ye.Register,null),Object(a.createElement)(le.SlotFillProvider,null,Object(a.createElement)(ne.BlockEditorProvider,Object(_e.a)({value:b,onInput:m,onChange:O,settings:l,useSubRegistry:!1},r),t,Object(a.createElement)(he.ReusableBlocksMenuItems,{rootClientId:u}))))}var Se=r("Cg8A"),Ie=r("//Lo"),Ae=r("Mmq9");function xe({selectedWidgetAreaId:e}){const t=Object(g.useSelect)(e=>e(ce).getWidgetAreas(),[]),r=Object(a.useMemo)(()=>e&&(null==t?void 0:t.find(t=>t.id===e)),[e,t]);let c;return c=r?"wp_inactive_widgets"===e?Object(I.__)("Blocks in this Widget Area will not be displayed in your site."):r.description:Object(I.__)("Widget Areas are global parts in your site’s layout that can accept blocks. These vary by theme, but are typically parts like your Sidebar or Footer."),Object(a.createElement)("div",{className:"edit-widgets-widget-areas"},Object(a.createElement)("div",{className:"edit-widgets-widget-areas__top-container"},Object(a.createElement)(ne.BlockIcon,{icon:Ie.a}),Object(a.createElement)("div",null,Object(a.createElement)("p",null,c),0===(null==t?void 0:t.length)&&Object(a.createElement)("p",null,Object(I.__)("Your theme does not contain any Widget Areas.")),!r&&Object(a.createElement)(le.Button,{href:Object(Ae.addQueryArgs)("customize.php",{"autofocus[panel]":"widgets",return:window.location.pathname}),isTertiary:!0},Object(I.__)("Manage with live preview")))))}const Te=a.Platform.select({web:!0,native:!1});function Ne({identifier:e,label:t,isActive:r}){const{enableComplementaryArea:c}=Object(g.useDispatch)(x.g);return Object(a.createElement)(le.Button,{onClick:()=>c(ce.name,e),className:ue()("edit-widgets-sidebar__panel-tab",{"is-active":r}),"aria-label":r?Object(I.sprintf)(Object(I.__)("%s (selected)"),t):t,"data-label":t},t)}function Be(){const{enableComplementaryArea:e}=Object(g.useDispatch)(x.g),{currentArea:t,hasSelectedNonAreaBlock:r,isGeneralSidebarOpen:c,selectedWidgetAreaBlock:n}=Object(g.useSelect)(e=>{const{getSelectedBlock:t,getBlock:r,getBlockParentsByBlockName:c}=e(ne.store),{getActiveComplementaryArea:n}=e(x.g),i=t(),o=n(ce.name);let a,s=o;return s||(s=i?"edit-widgets/block-inspector":"edit-widgets/block-areas"),i&&(a="core/widget-area"===i.name?i:r(c(i.clientId,"core/widget-area")[0])),{currentArea:s,hasSelectedNonAreaBlock:!(!i||"core/widget-area"===i.name),isGeneralSidebarOpen:!!o,selectedWidgetAreaBlock:a}},[]);return Object(a.useEffect)(()=>{r&&"edit-widgets/block-areas"===t&&c&&e("core/edit-widgets","edit-widgets/block-inspector"),!r&&"edit-widgets/block-inspector"===t&&c&&e("core/edit-widgets","edit-widgets/block-areas")},[r,e]),Object(a.createElement)(x.b,{className:"edit-widgets-sidebar",header:Object(a.createElement)("ul",null,Object(a.createElement)("li",null,Object(a.createElement)(Ne,{identifier:"edit-widgets/block-areas",label:n?n.attributes.name:Object(I.__)("Widget Areas"),isActive:"edit-widgets/block-areas"===t})),Object(a.createElement)("li",null,Object(a.createElement)(Ne,{identifier:"edit-widgets/block-inspector",label:Object(I.__)("Block"),isActive:"edit-widgets/block-inspector"===t}))),headerClassName:"edit-widgets-sidebar__panel-tabs",title:Object(I.__)("Settings"),closeLabel:Object(I.__)("Close settings"),scope:"core/edit-widgets",identifier:t,icon:Se.a,isActiveByDefault:Te},"edit-widgets/block-areas"===t&&Object(a.createElement)(xe,{selectedWidgetAreaId:null==n?void 0:n.attributes.id}),"edit-widgets/block-inspector"===t&&(r?Object(a.createElement)(ne.BlockInspector,null):Object(a.createElement)("span",{className:"block-editor-block-inspector__no-blocks"},Object(I.__)("No block selected."))))}var Ce=r("w95h"),Re=r("Q4Sy");var We=function(){const{hasEditedWidgetAreaIds:e,isSaving:t}=Object(g.useSelect)(e=>{var t;const{getEditedWidgetAreas:r,isSavingWidgetAreas:c}=e(ce);return{hasEditedWidgetAreaIds:(null===(t=r())||void 0===t?void 0:t.length)>0,isSaving:c()}},[]),{saveEditedWidgetAreas:r}=Object(g.useDispatch)(ce);return Object(a.createElement)(le.Button,{isPrimary:!0,isBusy:t,"aria-disabled":t,onClick:t?void 0:r,disabled:!e},t?Object(I.__)("Saving…"):Object(I.__)("Update"))},Le=r("Ntru"),Pe=r("K2cm"),Me=r("RxS6");function Ge(){const e=Object(g.useSelect)(e=>e(d.store).hasUndo()),{undo:t}=Object(g.useDispatch)(d.store);return Object(a.createElement)(le.ToolbarButton,{icon:Object(I.isRTL)()?Pe.a:Le.a,label:Object(I.__)("Undo"),shortcut:Me.displayShortcut.primary("z"),"aria-disabled":!e,onClick:e?t:void 0})}function De(){const e=Object(g.useSelect)(e=>e(d.store).hasRedo()),{redo:t}=Object(g.useDispatch)(d.store);return Object(a.createElement)(le.ToolbarButton,{icon:Object(I.isRTL)()?Le.a:Pe.a,label:Object(I.__)("Redo"),shortcut:Me.displayShortcut.primaryShift("z"),"aria-disabled":!e,onClick:e?t:void 0})}var Fe=r("VKE3"),Ve=r("K+tz"),Ue=r("RMJe"),qe=r("gdqT");function ze({label:e,info:t,messageActivated:r,messageDeactivated:c,shortcut:n,feature:i}){const o=Object(g.useSelect)(e=>e(ce).__unstableIsFeatureActive(i),[i]),{__unstableToggleFeature:s}=Object(g.useDispatch)(ce);return Object(a.createElement)(le.MenuItem,{icon:o&&Ue.a,isSelected:o,onClick:()=>{s(i),o?Object(qe.speak)(c||Object(I.__)("Feature deactivated")):Object(qe.speak)(r||Object(I.__)("Feature activated"))},role:"menuitemcheckbox",info:t,shortcut:n},e)}const He=[{keyCombination:{modifier:"primary",character:"b"},description:Object(I.__)("Make the selected text bold.")},{keyCombination:{modifier:"primary",character:"i"},description:Object(I.__)("Make the selected text italic.")},{keyCombination:{modifier:"primary",character:"k"},description:Object(I.__)("Convert the selected text into a link.")},{keyCombination:{modifier:"primaryShift",character:"k"},description:Object(I.__)("Remove a link.")},{keyCombination:{modifier:"primary",character:"u"},description:Object(I.__)("Underline the selected text.")}];function Ke({keyCombination:e,forceAriaLabel:t}){const r=e.modifier?Me.displayShortcutList[e.modifier](e.character):e.character,c=e.modifier?Me.shortcutAriaLabel[e.modifier](e.character):e.character;return Object(a.createElement)("kbd",{className:"edit-widgets-keyboard-shortcut-help-modal__shortcut-key-combination","aria-label":t||c},Object(p.castArray)(r).map((e,t)=>"+"===e?Object(a.createElement)(a.Fragment,{key:t},e):Object(a.createElement)("kbd",{key:t,className:"edit-widgets-keyboard-shortcut-help-modal__shortcut-key"},e)))}var Qe=function({description:e,keyCombination:t,aliases:r=[],ariaLabel:c}){return Object(a.createElement)(a.Fragment,null,Object(a.createElement)("div",{className:"edit-widgets-keyboard-shortcut-help-modal__shortcut-description"},e),Object(a.createElement)("div",{className:"edit-widgets-keyboard-shortcut-help-modal__shortcut-term"},Object(a.createElement)(Ke,{keyCombination:t,forceAriaLabel:c}),r.map((e,t)=>Object(a.createElement)(Ke,{keyCombination:e,forceAriaLabel:c,key:t}))))};var Ye=function({name:e}){const{keyCombination:t,description:r,aliases:c}=Object(g.useSelect)(t=>{const{getShortcutKeyCombination:r,getShortcutDescription:c,getShortcutAliases:n}=t(we.store);return{keyCombination:r(e),aliases:n(e),description:c(e)}});return t?Object(a.createElement)(Qe,{keyCombination:t,description:r,aliases:c}):null};const Je=({shortcuts:e})=>Object(a.createElement)("ul",{className:"edit-widgets-keyboard-shortcut-help-modal__shortcut-list",role:"list"},e.map((e,t)=>Object(a.createElement)("li",{className:"edit-widgets-keyboard-shortcut-help-modal__shortcut",key:t},Object(p.isString)(e)?Object(a.createElement)(Ye,{name:e}):Object(a.createElement)(Qe,e)))),Xe=({title:e,shortcuts:t,className:r})=>Object(a.createElement)("section",{className:ue()("edit-widgets-keyboard-shortcut-help-modal__section",r)},!!e&&Object(a.createElement)("h2",{className:"edit-widgets-keyboard-shortcut-help-modal__section-title"},e),Object(a.createElement)(Je,{shortcuts:t})),Ze=({title:e,categoryName:t,additionalShortcuts:r=[]})=>{const c=Object(g.useSelect)(e=>e(we.store).getCategoryShortcuts(t),[t]);return Object(a.createElement)(Xe,{title:e,shortcuts:c.concat(r)})};function $e({isModalActive:e,toggleModal:t}){return Object(we.useShortcut)("core/edit-widgets/keyboard-shortcuts",t,{bindGlobal:!0}),e?Object(a.createElement)(le.Modal,{className:"edit-widgets-keyboard-shortcut-help-modal",title:Object(I.__)("Keyboard shortcuts"),closeLabel:Object(I.__)("Close"),onRequestClose:t},Object(a.createElement)(Xe,{className:"edit-widgets-keyboard-shortcut-help-modal__main-shortcuts",shortcuts:["core/edit-widgets/keyboard-shortcuts"]}),Object(a.createElement)(Ze,{title:Object(I.__)("Global shortcuts"),categoryName:"global"}),Object(a.createElement)(Ze,{title:Object(I.__)("Selection shortcuts"),categoryName:"selection"}),Object(a.createElement)(Ze,{title:Object(I.__)("Block shortcuts"),categoryName:"block",additionalShortcuts:[{keyCombination:{character:"/"},description:Object(I.__)("Change the block type after adding a new paragraph."),ariaLabel:Object(I.__)("Forward-slash")}]}),Object(a.createElement)(Xe,{title:Object(I.__)("Text formatting"),shortcuts:He})):null}const et={className:"edit-widgets-more-menu__content",position:"bottom left"},tt={tooltipPosition:"bottom"};function rt(){const[e,t]=Object(a.useState)(!1),r=()=>t(!e);Object(we.useShortcut)("core/edit-widgets/keyboard-shortcuts",r,{bindGlobal:!0});const c=Object(ie.useViewportMatch)("medium");return Object(a.createElement)(a.Fragment,null,Object(a.createElement)(le.DropdownMenu,{className:"edit-widgets-more-menu",icon:Fe.a,label:Object(I.__)("Options"),popoverProps:et,toggleProps:tt},()=>Object(a.createElement)(a.Fragment,null,c&&Object(a.createElement)(le.MenuGroup,{label:Object(I._x)("View","noun")},Object(a.createElement)(ze,{feature:"fixedToolbar",label:Object(I.__)("Top toolbar"),info:Object(I.__)("Access all block and document tools in a single place"),messageActivated:Object(I.__)("Top toolbar activated"),messageDeactivated:Object(I.__)("Top toolbar deactivated")})),Object(a.createElement)(le.MenuGroup,{label:Object(I.__)("Tools")},Object(a.createElement)(le.MenuItem,{onClick:()=>{t(!0)},shortcut:Me.displayShortcut.access("h")},Object(I.__)("Keyboard shortcuts")),Object(a.createElement)(ze,{feature:"welcomeGuide",label:Object(I.__)("Welcome Guide")}),Object(a.createElement)(le.MenuItem,{role:"menuitem",icon:Ve.a,href:Object(I.__)("https://wordpress.org/support/article/wordpress-editor/"),target:"_blank",rel:"noopener noreferrer"},Object(I.__)("Help"),Object(a.createElement)(le.VisuallyHidden,{as:"span"},Object(I.__)("(opens in a new tab)")))),Object(a.createElement)(le.MenuGroup,{label:Object(I.__)("Preferences")},Object(a.createElement)(ze,{feature:"keepCaretInsideBlock",label:Object(I.__)("Contain text cursor inside block"),info:Object(I.__)("Aids screen readers by stopping text caret from leaving blocks."),messageActivated:Object(I.__)("Contain text cursor inside block activated"),messageDeactivated:Object(I.__)("Contain text cursor inside block deactivated")}),Object(a.createElement)(ze,{feature:"themeStyles",info:Object(I.__)("Make the editor look like your theme."),label:Object(I.__)("Use theme styles")}),c&&Object(a.createElement)(ze,{feature:"showBlockBreadcrumbs",label:Object(I.__)("Display block breadcrumbs"),info:Object(I.__)("Shows block breadcrumbs at the bottom of the editor."),messageActivated:Object(I.__)("Display block breadcrumbs activated"),messageDeactivated:Object(I.__)("Display block breadcrumbs deactivated")})))),Object(a.createElement)($e,{isModalActive:e,toggleModal:r}))}var ct=function(){const e=Object(ie.useViewportMatch)("medium"),t=Object(a.useRef)(),r=ve(),c=Object(g.useSelect)(e=>e(ce).getIsWidgetAreaOpen(r),[r]),n=Object(g.useSelect)(e=>e(ce).isInserterOpened()),{setIsWidgetAreaOpen:i,setIsInserterOpened:o}=Object(g.useDispatch)(ce),{selectBlock:s}=Object(g.useDispatch)(ne.store);return Object(a.createElement)(a.Fragment,null,Object(a.createElement)("div",{className:"edit-widgets-header"},Object(a.createElement)("div",{className:"edit-widgets-header__navigable-toolbar-wrapper"},e&&Object(a.createElement)("h1",{className:"edit-widgets-header__title"},Object(I.__)("Widgets")),!e&&Object(a.createElement)(le.VisuallyHidden,{as:"h1",className:"edit-widgets-header__title"},Object(I.__)("Widgets")),Object(a.createElement)(ne.NavigableToolbar,{className:"edit-widgets-header-toolbar","aria-label":Object(I.__)("Document tools")},Object(a.createElement)(le.ToolbarItem,{ref:t,as:le.Button,className:"edit-widgets-header-toolbar__inserter-toggle",isPrimary:!0,isPressed:n,onMouseDown:e=>{e.preventDefault()},onClick:()=>{n?t.current.focus():(c||(s(r),i(r,!0)),window.requestAnimationFrame(()=>o(!0)))},icon:Re.a,label:Object(I._x)("Add block","Generic label for block inserter button")}),e&&Object(a.createElement)(a.Fragment,null,Object(a.createElement)(Ge,null),Object(a.createElement)(De,null),Object(a.createElement)(le.ToolbarItem,{as:ne.BlockNavigationDropdown})))),Object(a.createElement)("div",{className:"edit-widgets-header__actions"},Object(a.createElement)(We,null),Object(a.createElement)(x.f.Slot,{scope:"core/edit-widgets"}),Object(a.createElement)(rt,null))))};var nt=function(){const{removeNotice:e}=Object(g.useDispatch)(A.store),{notices:t}=Object(g.useSelect)(e=>({notices:e(A.store).getNotices()}),[]),r=Object(p.filter)(t,{isDismissible:!0,type:"default"}),c=Object(p.filter)(t,{isDismissible:!1,type:"default"}),n=Object(p.filter)(t,{type:"snackbar"});return Object(a.createElement)(a.Fragment,null,Object(a.createElement)(le.NoticeList,{notices:c,className:"edit-widgets-notices__pinned"}),Object(a.createElement)(le.NoticeList,{notices:r,className:"edit-widgets-notices__dismissible",onRemove:e}),Object(a.createElement)(le.SnackbarList,{notices:n,className:"edit-widgets-notices__snackbar",onRemove:e}))};function it({blockEditorSettings:e}){const{hasThemeStyles:t}=Object(g.useSelect)(e=>({hasThemeStyles:e(ce).__unstableIsFeatureActive("themeStyles")})),r=Object(a.useMemo)(()=>t?e.styles:[],[e,t]);return Object(a.createElement)("div",{className:"edit-widgets-block-editor"},Object(a.createElement)(nt,null),Object(a.createElement)(ne.BlockTools,null,Object(a.createElement)(ye,null),Object(a.createElement)(ne.BlockEditorKeyboardShortcuts,null),Object(a.createElement)(ne.__unstableEditorStyles,{styles:r}),Object(a.createElement)(ne.BlockSelectionClearer,null,Object(a.createElement)(ne.WritingFlow,null,Object(a.createElement)(ne.ObserveTyping,null,Object(a.createElement)(ne.BlockList,{className:"edit-widgets-main-block-list"}))))))}var ot=()=>{const e=Object(g.useSelect)(e=>{var t;const{getEntityRecord:r}=e("core"),c=r(_,"postType","widget-areas");return null==c||null===(t=c.blocks[0])||void 0===t?void 0:t.clientId},[]);return Object(g.useSelect)(t=>{const{getBlockRootClientId:r,getBlockSelectionEnd:c,getBlockOrder:n,getBlockIndex:i}=t(ne.store),o=c()||e,a=r(o);return o&&""===a?{rootClientId:o,insertionIndex:n(o).length}:{rootClientId:a,insertionIndex:i(o,a)+1}},[e])};const at={header:Object(I.__)("Widgets top bar"),body:Object(I.__)("Widgets and blocks"),sidebar:Object(I.__)("Widgets settings"),footer:Object(I.__)("Widgets footer")};var st=function({blockEditorSettings:e}){const t=Object(ie.useViewportMatch)("medium","<"),r=Object(ie.useViewportMatch)("huge",">="),{setIsInserterOpened:c,closeGeneralSidebar:n}=Object(g.useDispatch)(ce),{rootClientId:i,insertionIndex:o}=ot(),{hasBlockBreadCrumbsEnabled:s,hasSidebarEnabled:l,isInserterOpened:d,previousShortcut:u,nextShortcut:b}=Object(g.useSelect)(e=>({hasSidebarEnabled:!!e(x.g).getActiveComplementaryArea(ce.name),isInserterOpened:!!e(ce).isInserterOpened(),hasBlockBreadCrumbsEnabled:e(ce).__unstableIsFeatureActive("showBlockBreadcrumbs"),previousShortcut:e(we.store).getAllShortcutRawKeyCombinations("core/edit-widgets/previous-region"),nextShortcut:e(we.store).getAllShortcutRawKeyCombinations("core/edit-widgets/next-region")}),[]);Object(a.useEffect)(()=>{l&&!r&&c(!1)},[l,r]),Object(a.useEffect)(()=>{d&&!r&&n()},[d,r]);const[m,p]=Object(ie.__experimentalUseDialog)({onClose:()=>c(!1)});return Object(a.createElement)(x.e,{labels:at,header:Object(a.createElement)(ct,null),secondarySidebar:d&&Object(a.createElement)("div",Object(_e.a)({ref:m},p,{className:"edit-widgets-layout__inserter-panel"}),Object(a.createElement)("div",{className:"edit-widgets-layout__inserter-panel-header"},Object(a.createElement)(le.Button,{icon:Ce.a,onClick:()=>c(!1)})),Object(a.createElement)("div",{className:"edit-widgets-layout__inserter-panel-content"},Object(a.createElement)(ne.__experimentalLibrary,{showInserterHelpPanel:!0,shouldFocusBlock:t,rootClientId:i,__experimentalInsertionIndex:o}))),sidebar:l&&Object(a.createElement)(x.b.Slot,{scope:"core/edit-widgets"}),content:Object(a.createElement)(it,{blockEditorSettings:e}),footer:s&&!t&&Object(a.createElement)("div",{className:"edit-widgets-layout__footer"},Object(a.createElement)(ne.BlockBreadcrumb,{rootLabelText:Object(I.__)("Widgets")})),shortcuts:{previous:u,next:b}})};function lt(){const e=Object(g.useSelect)(e=>{const{getEditedWidgetAreas:t}=e(ce),r=t();return(null==r?void 0:r.length)>0},[]);return Object(a.useEffect)(()=>{const t=t=>{if(e)return t.returnValue=Object(I.__)("You have unsaved changes. If you proceed, they will be lost."),t.returnValue};return window.addEventListener("beforeunload",t),()=>{window.removeEventListener("beforeunload",t)}},[e]),null}function dt(){var e;const t=Object(g.useSelect)(e=>e(ce).__unstableIsFeatureActive("welcomeGuide"),[]),{__unstableToggleFeature:r}=Object(g.useDispatch)(ce),c=Object(g.useSelect)(e=>e(ce).getWidgetAreas({per_page:-1}));if(!t)return null;const n=null==c?void 0:c.every(e=>"wp_inactive_widgets"===e.id||e.widgets.every(e=>e.startsWith("block-"))),i=null!==(e=null==c?void 0:c.filter(e=>"wp_inactive_widgets"!==e.id).length)&&void 0!==e?e:0;return Object(a.createElement)(le.Guide,{className:"edit-widgets-welcome-guide",contentLabel:Object(I.__)("Welcome to block Widgets"),finishButtonText:Object(I.__)("Get started"),onFinish:()=>r("welcomeGuide"),pages:[{image:Object(a.createElement)(ut,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-canvas.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-canvas.gif"}),content:Object(a.createElement)(a.Fragment,null,Object(a.createElement)("h1",{className:"edit-widgets-welcome-guide__heading"},Object(I.__)("Welcome to block Widgets")),n?Object(a.createElement)(a.Fragment,null,Object(a.createElement)("p",{className:"edit-widgets-welcome-guide__text"},Object(I.sprintf)(Object(I._n)("Your theme provides %s “block” area for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how they’ll look on your site.","Your theme provides %s different “block” areas for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how they’ll look on your site.",i),i))):Object(a.createElement)(a.Fragment,null,Object(a.createElement)("p",{className:"edit-widgets-welcome-guide__text"},Object(I.__)("You can now add any block to your site’s widget areas. Don’t worry, all of your favorite widgets still work flawlessly.")),Object(a.createElement)("p",{className:"edit-widgets-welcome-guide__text"},Object(a.createElement)("strong",null,Object(I.__)("Want to stick with the old widgets?"))," ",Object(a.createElement)(le.ExternalLink,{href:Object(I.__)("https://wordpress.org/plugins/classic-widgets/")},Object(I.__)("Get the Classic Widgets plugin.")))))},{image:Object(a.createElement)(ut,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-editor.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-editor.gif"}),content:Object(a.createElement)(a.Fragment,null,Object(a.createElement)("h1",{className:"edit-widgets-welcome-guide__heading"},Object(I.__)("Make each block your own")),Object(a.createElement)("p",{className:"edit-widgets-welcome-guide__text"},Object(I.__)("Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected.")))},{image:Object(a.createElement)(ut,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-library.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-library.gif"}),content:Object(a.createElement)(a.Fragment,null,Object(a.createElement)("h1",{className:"edit-widgets-welcome-guide__heading"},Object(I.__)("Get to know the block library")),Object(a.createElement)("p",{className:"edit-widgets-welcome-guide__text"},Object(a.createInterpolateElement)(Object(I.__)("All of the blocks available to you live in the block library. You’ll find it wherever you see the <InserterIconImage /> icon."),{InserterIconImage:Object(a.createElement)("img",{className:"edit-widgets-welcome-guide__inserter-icon",alt:Object(I.__)("inserter"),src:"data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='18' height='18' rx='2' fill='%231E1E1E'/%3E%3Cpath d='M9.22727 4V14M4 8.77273H14' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E%0A"})})))},{image:Object(a.createElement)(ut,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.gif"}),content:Object(a.createElement)(a.Fragment,null,Object(a.createElement)("h1",{className:"edit-widgets-welcome-guide__heading"},Object(I.__)("Learn how to use the block editor")),Object(a.createElement)("p",{className:"edit-widgets-welcome-guide__text"},Object(I.__)("New to the block editor? Want to learn more about using it? "),Object(a.createElement)(le.ExternalLink,{href:Object(I.__)("https://wordpress.org/support/article/wordpress-editor/")},Object(I.__)("Here's a detailed guide."))))}]})}function ut({nonAnimatedSrc:e,animatedSrc:t}){return Object(a.createElement)("picture",{className:"edit-widgets-welcome-guide__image"},Object(a.createElement)("source",{srcSet:e,media:"(prefers-reduced-motion: reduce)"}),Object(a.createElement)("img",{src:t,width:"312",height:"240",alt:""}))}var bt=function({blockEditorSettings:e}){return Object(a.createElement)(ke,{blockEditorSettings:e},Object(a.createElement)(st,{blockEditorSettings:e}),Object(a.createElement)(Be,null),Object(a.createElement)(le.Popover.Slot,null),Object(a.createElement)(fe.PluginArea,null),Object(a.createElement)(lt,null),Object(a.createElement)(dt,null))};const mt=["core/more","core/freeform","core/block"];function gt(e,t){const r=Object(l.__experimentalGetCoreBlocks)().filter(e=>!(mt.includes(e.name)||e.name.startsWith("core/post")||e.name.startsWith("core/query")||e.name.startsWith("core/site")));Object(l.registerCoreBlocks)(r),Object(u.registerLegacyWidgetBlock)(),Object(u.registerLegacyWidgetVariations)(t),pt(o),t.__experimentalFetchLinkSuggestions=(e,r)=>Object(d.__experimentalFetchLinkSuggestions)(e,r,t),Object(a.render)(Object(a.createElement)(bt,{blockEditorSettings:t}),document.getElementById(e))}const pt=e=>{if(!e)return;const{metadata:t,settings:r,name:c}=e;t&&Object(s.unstable__bootstrapServerSideBlockDefinitions)({[c]:t}),Object(s.registerBlockType)(c,r)}},GLVC:function(e,t){e.exports=window.wp.widgets},GRId:function(e,t){e.exports=window.wp.element},HSyU:function(e,t){e.exports=window.wp.blocks},"K+tz":function(e,t,r){"use strict";var c=r("GRId"),n=r("Tqx9");const i=Object(c.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(n.Path,{d:"M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z"}));t.a=i},K2cm:function(e,t,r){"use strict";var c=r("GRId"),n=r("Tqx9");const i=Object(c.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(n.Path,{d:"M15.6 6.5l-1.1 1 2.9 3.3H8c-.9 0-1.7.3-2.3.9-1.4 1.5-1.4 4.2-1.4 5.6v.2h1.5v-.3c0-1.1 0-3.5 1-4.5.3-.3.7-.5 1.3-.5h9.2L14.5 15l1.1 1.1 4.6-4.6-4.6-5z"}));t.a=i},K9lf:function(e,t){e.exports=window.wp.compose},KEfo:function(e,t){e.exports=window.wp.viewport},Mmq9:function(e,t){e.exports=window.wp.url},Ntru:function(e,t,r){"use strict";var c=r("GRId"),n=r("Tqx9");const i=Object(c.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(n.Path,{d:"M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z"}));t.a=i},Q4Sy:function(e,t,r){"use strict";var c=r("GRId"),n=r("Tqx9");const i=Object(c.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(n.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"}));t.a=i},QyPg:function(e,t){e.exports=window.wp.blockLibrary},RMJe:function(e,t,r){"use strict";var c=r("GRId"),n=r("Tqx9");const i=Object(c.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(n.Path,{d:"M18.3 5.6L9.9 16.9l-4.6-3.4-.9 1.2 5.8 4.3 9.3-12.6z"}));t.a=i},RxS6:function(e,t){e.exports=window.wp.keycodes},TSYQ:function(e,t,r){var c; /*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */!function(){"use strict";var r={}.hasOwnProperty;function n(){for(var e=[],t=0;t<arguments.length;t++){var c=arguments[t];if(c){var i=typeof c;if("string"===i||"number"===i)e.push(c);else if(Array.isArray(c)){if(c.length){var o=n.apply(null,c);o&&e.push(o)}}else if("object"===i)if(c.toString===Object.prototype.toString)for(var a in c)r.call(c,a)&&c[a]&&e.push(a);else e.push(c.toString())}}return e.join(" ")}e.exports?(n.default=n,e.exports=n):void 0===(c=function(){return n}.apply(t,[]))||(e.exports=c)}()},Tqx9:function(e,t){e.exports=window.wp.primitives},TvNi:function(e,t){e.exports=window.wp.plugins},U60i:function(e,t,r){"use strict";r.d(t,"g",(function(){return j})),r.d(t,"b",(function(){return F})),r.d(t,"c",(function(){return L})),r.d(t,"d",(function(){return U})),r.d(t,"e",(function(){return z})),r.d(t,"f",(function(){return M})),r.d(t,"a",(function(){return R}));var c={};r.r(c),r.d(c,"enableComplementaryArea",(function(){return d})),r.d(c,"disableComplementaryArea",(function(){return u})),r.d(c,"pinItem",(function(){return m})),r.d(c,"unpinItem",(function(){return g}));var n={};r.r(n),r.d(n,"getActiveComplementaryArea",(function(){return p})),r.d(n,"isItemPinned",(function(){return O}));var i=r("1ZqX"),o=r("YLtl");const a=Object(i.combineReducers)({singleEnableItems:function(e={},{type:t,itemType:r,scope:c,item:n}){return"SET_SINGLE_ENABLE_ITEM"===t&&r&&c?{...e,[r]:{...e[r],[c]:n||null}}:e},multipleEnableItems:function(e={},{type:t,itemType:r,scope:c,item:n,isEnable:i}){if("SET_MULTIPLE_ENABLE_ITEM"!==t||!r||!c||!n||Object(o.get)(e,[r,c,n])===i)return e;const a=e[r]||{},s=a[c]||{};return{...e,[r]:{...a,[c]:{...s,[n]:i||!1}}}}});var s=Object(i.combineReducers)({enableItems:a});function l(e,t,r){return{type:"SET_SINGLE_ENABLE_ITEM",itemType:e,scope:t,item:r}}function d(e,t){return l("complementaryArea",e,t)}function u(e){return l("complementaryArea",e,void 0)}function b(e,t,r,c){return{type:"SET_MULTIPLE_ENABLE_ITEM",itemType:e,scope:t,item:r,isEnable:c}}function m(e,t){return b("pinnedItems",e,t,!0)}function g(e,t){return b("pinnedItems",e,t,!1)}function p(e,t){return function(e,t,r){return Object(o.get)(e.enableItems.singleEnableItems,[t,r])}(e,"complementaryArea",t)}function O(e,t,r){return!1!==function(e,t,r,c){return Object(o.get)(e.enableItems.multipleEnableItems,[t,r,c])}(e,"pinnedItems",t,r)}const j=Object(i.createReduxStore)("core/interface",{reducer:s,actions:c,selectors:n,persist:["enableItems"]});Object(i.registerStore)("core/interface",{reducer:s,actions:c,selectors:n,persist:["enableItems"]});var f=r("wx14"),_=r("GRId"),h=r("TSYQ"),w=r.n(h),E=r("tI+e"),y=r("l3Sj"),v=r("RMJe"),k=r("URob"),S=r("Xxwi"),I=r("KEfo"),A=r("bWcr"),x=r("TvNi"),T=Object(x.withPluginContext)((e,t)=>({icon:t.icon||e.icon,identifier:t.identifier||`${e.name}/${t.name}`}));var N=T((function({as:e=E.Button,scope:t,identifier:r,icon:c,selectedIcon:n,...a}){const s=e,l=Object(i.useSelect)(e=>e(j).getActiveComplementaryArea(t)===r,[r]),{enableComplementaryArea:d,disableComplementaryArea:u}=Object(i.useDispatch)(j);return Object(_.createElement)(s,Object(f.a)({icon:n&&l?n:c,onClick:()=>{l?u(t):d(t,r)}},Object(o.omit)(a,["name"])))}));var B=({smallScreenTitle:e,children:t,className:r,toggleButtonProps:c})=>{const n=Object(_.createElement)(N,Object(f.a)({icon:A.a},c));return Object(_.createElement)(_.Fragment,null,Object(_.createElement)("div",{className:"components-panel__header interface-complementary-area-header__small"},e&&Object(_.createElement)("span",{className:"interface-complementary-area-header__small-title"},e),n),Object(_.createElement)("div",{className:w()("components-panel__header","interface-complementary-area-header",r),tabIndex:-1},t,n))};function C({name:e,as:t=E.Button,onClick:r,...c}){return Object(_.createElement)(E.Fill,{name:e},({onClick:e})=>Object(_.createElement)(t,Object(f.a)({onClick:r||e?(...t)=>{(r||o.noop)(...t),(e||o.noop)(...t)}:void 0},c)))}C.Slot=function({name:e,as:t=E.ButtonGroup,fillProps:r={},bubblesVirtually:c,...n}){return Object(_.createElement)(E.Slot,{name:e,bubblesVirtually:c,fillProps:r},e=>{if(Object(o.isEmpty)(_.Children.toArray(e)))return null;const r=[];_.Children.forEach(e,({props:{__unstableExplicitMenuItem:e,__unstableTarget:t}})=>{t&&e&&r.push(t)});const c=_.Children.map(e,e=>!e.props.__unstableExplicitMenuItem&&r.includes(e.props.__unstableTarget)?null:e);return Object(_.createElement)(t,n,c)})};var R=C;const W=e=>Object(_.createElement)(E.MenuItem,Object(o.omit)(e,["__unstableExplicitMenuItem","__unstableTarget"]));function L({scope:e,target:t,__unstableExplicitMenuItem:r,...c}){return Object(_.createElement)(N,Object(f.a)({as:c=>Object(_.createElement)(R,Object(f.a)({__unstableExplicitMenuItem:r,__unstableTarget:`${e}/${t}`,as:W,name:e+"/plugin-more-menu"},c)),role:"menuitemcheckbox",selectedIcon:v.a,name:t,scope:e},c))}function P({scope:e,...t}){return Object(_.createElement)(E.Fill,Object(f.a)({name:"PinnedItems/"+e},t))}P.Slot=function({scope:e,className:t,...r}){return Object(_.createElement)(E.Slot,Object(f.a)({name:"PinnedItems/"+e},r),e=>!Object(o.isEmpty)(e)&&Object(_.createElement)("div",{className:w()(t,"interface-pinned-items")},e))};var M=P;function G({scope:e,children:t,className:r}){return Object(_.createElement)(E.Fill,{name:"ComplementaryArea/"+e},Object(_.createElement)("div",{className:r},t))}const D=T((function({children:e,className:t,closeLabel:r=Object(y.__)("Close plugin"),identifier:c,header:n,headerClassName:o,icon:a,isPinnable:s=!0,panelClassName:l,scope:d,name:u,smallScreenTitle:b,title:m,toggleShortcut:g,isActiveByDefault:p,showIconLabels:O=!1}){const{isActive:f,isPinned:h,activeArea:A,isSmall:x,isLarge:T}=Object(i.useSelect)(e=>{const{getActiveComplementaryArea:t,isItemPinned:r}=e(j),n=t(d);return{isActive:n===c,isPinned:r(d,c),activeArea:n,isSmall:e(I.store).isViewportMatch("< medium"),isLarge:e(I.store).isViewportMatch("large")}},[c,d]);!function(e,t,r,c,n){const o=Object(_.useRef)(!1),a=Object(_.useRef)(!1),{enableComplementaryArea:s,disableComplementaryArea:l}=Object(i.useDispatch)(j);Object(_.useEffect)(()=>{c&&n&&!o.current?(l(e),a.current=!0):a.current&&!n&&o.current?(a.current=!1,s(e,t)):a.current&&r&&r!==t&&(a.current=!1),n!==o.current&&(o.current=n)},[c,n,e,t,r])}(d,c,A,f,x);const{enableComplementaryArea:C,disableComplementaryArea:R,pinItem:W,unpinItem:P}=Object(i.useDispatch)(j);return Object(_.useEffect)(()=>{p&&void 0===A&&!x&&C(d,c)},[A,p,d,c,x]),Object(_.createElement)(_.Fragment,null,s&&Object(_.createElement)(M,{scope:d},h&&Object(_.createElement)(N,{scope:d,identifier:c,isPressed:f&&(!O||T),"aria-expanded":f,label:m,icon:O?v.a:a,showTooltip:!O,isTertiary:O})),u&&s&&Object(_.createElement)(L,{target:u,scope:d,icon:a},m),f&&Object(_.createElement)(G,{className:w()("interface-complementary-area",t),scope:d},Object(_.createElement)(B,{className:o,closeLabel:r,onClose:()=>R(d),smallScreenTitle:b,toggleButtonProps:{label:r,shortcut:g,scope:d,identifier:c}},n||Object(_.createElement)(_.Fragment,null,Object(_.createElement)("strong",null,m),s&&Object(_.createElement)(E.Button,{className:"interface-complementary-area__pin-unpin-item",icon:h?k.a:S.a,label:h?Object(y.__)("Unpin from toolbar"):Object(y.__)("Pin to toolbar"),onClick:()=>(h?P:W)(d,c),isPressed:h,"aria-expanded":h}))),Object(_.createElement)(E.Panel,{className:l},e)))}));D.Slot=function({scope:e,...t}){return Object(_.createElement)(E.Slot,Object(f.a)({name:"ComplementaryArea/"+e},t))};var F=D;class V extends _.Component{componentDidMount(){this.isSticky=!1,this.sync(),document.body.classList.contains("sticky-menu")&&(this.isSticky=!0,document.body.classList.remove("sticky-menu"))}componentWillUnmount(){this.isSticky&&document.body.classList.add("sticky-menu"),this.props.isActive&&document.body.classList.remove("is-fullscreen-mode")}componentDidUpdate(e){this.props.isActive!==e.isActive&&this.sync()}sync(){const{isActive:e}=this.props;e?document.body.classList.add("is-fullscreen-mode"):document.body.classList.remove("is-fullscreen-mode")}render(){return null}}var U=V,q=r("K9lf");var z=Object(_.forwardRef)((function({footer:e,header:t,sidebar:r,secondarySidebar:c,content:n,drawer:i,actions:o,labels:a,className:s,shortcuts:l},d){const u=Object(_.useRef)(),b=Object(E.__unstableUseNavigateRegions)(u,l);!function(e){Object(_.useEffect)(()=>{const t=document&&document.querySelector(`html:not(.${e})`);if(t)return t.classList.toggle(e),()=>{t.classList.toggle(e)}},[e])}("interface-interface-skeleton__html-container");const m={...{drawer:Object(y.__)("Drawer"),header:Object(y.__)("Header"),body:Object(y.__)("Content"),secondarySidebar:Object(y.__)("Block Library"),sidebar:Object(y.__)("Settings"),actions:Object(y.__)("Publish"),footer:Object(y.__)("Footer")},...a};return Object(_.createElement)("div",{ref:Object(q.useMergeRefs)([d,u]),className:w()(s,"interface-interface-skeleton",b,!!e&&"has-footer")},!!i&&Object(_.createElement)("div",{className:"interface-interface-skeleton__drawer",role:"region","aria-label":m.drawer},i),Object(_.createElement)("div",{className:"interface-interface-skeleton__editor"},!!t&&Object(_.createElement)("div",{className:"interface-interface-skeleton__header",role:"region","aria-label":m.header,tabIndex:"-1"},t),Object(_.createElement)("div",{className:"interface-interface-skeleton__body"},!!c&&Object(_.createElement)("div",{className:"interface-interface-skeleton__secondary-sidebar",role:"region","aria-label":m.secondarySidebar,tabIndex:"-1"},c),Object(_.createElement)("div",{className:"interface-interface-skeleton__content",role:"region","aria-label":m.body,tabIndex:"-1"},n),!!r&&Object(_.createElement)("div",{className:"interface-interface-skeleton__sidebar",role:"region","aria-label":m.sidebar,tabIndex:"-1"},r),!!o&&Object(_.createElement)("div",{className:"interface-interface-skeleton__actions",role:"region","aria-label":m.actions,tabIndex:"-1"},o))),!!e&&Object(_.createElement)("div",{className:"interface-interface-skeleton__footer",role:"region","aria-label":m.footer,tabIndex:"-1"},e))}))},URob:function(e,t,r){"use strict";var c=r("GRId"),n=r("Tqx9");const i=Object(c.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(n.Path,{d:"M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z"}));t.a=i},VKE3:function(e,t,r){"use strict";var c=r("GRId"),n=r("Tqx9");const i=Object(c.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(n.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"}));t.a=i},Xxwi:function(e,t,r){"use strict";var c=r("GRId"),n=r("Tqx9");const i=Object(c.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(n.Path,{fillRule:"evenodd",d:"M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z",clipRule:"evenodd"}));t.a=i},YLtl:function(e,t){e.exports=window.lodash},axFQ:function(e,t){e.exports=window.wp.blockEditor},bWcr:function(e,t,r){"use strict";var c=r("GRId"),n=r("Tqx9");const i=Object(c.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(n.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"}));t.a=i},diJD:function(e,t){e.exports=window.wp.reusableBlocks},g56x:function(e,t){e.exports=window.wp.hooks},gdqT:function(e,t){e.exports=window.wp.a11y},hF7m:function(e,t){e.exports=window.wp.keyboardShortcuts},jZUy:function(e,t){e.exports=window.wp.coreData},l3Sj:function(e,t){e.exports=window.wp.i18n},onLe:function(e,t){e.exports=window.wp.notices},"tI+e":function(e,t){e.exports=window.wp.components},w95h:function(e,t,r){"use strict";var c=r("GRId"),n=r("Tqx9");const i=Object(c.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(n.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));t.a=i},wx14:function(e,t,r){"use strict";function c(){return(c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var c in r)Object.prototype.hasOwnProperty.call(r,c)&&(e[c]=r[c])}return e}).apply(this,arguments)}r.d(t,"a",(function(){return c}))},ywyh:function(e,t){e.exports=window.wp.apiFetch}});
"use strict"; const Syntax = require("./Syntax"); /* after change orders set where company.id = orders.id_client */ class CacheReverseExpression extends Syntax { parse(coach) { coach.expectWord("after"); coach.skipSpace(); coach.expectWord("change"); coach.skipSpace(); this.table = coach.parseTableLink(); this.addChild(this.table); coach.skipSpace(); if ( coach.isWord("as") ) { coach.expectWord("as"); coach.skipSpace(); this.as = coach.parseObjectName(); coach.skipSpace(); } coach.expectWord("set"); coach.skipSpace(); coach.expectWord("where"); coach.skipSpace(); this.expression = coach.parseExpression(); this.addChild(this.expression); } is(coach) { return coach.isWord("after"); } clone() { let clone = new CacheReverseExpression(); clone.table = this.table.clone(); clone.addChild(clone.table); if ( this.as ) { clone.as = this.as.clone(); clone.addChild(clone.as); } clone.expression = this.expression.clone(); clone.addChild(clone.expression); return clone; } toString() { let out = ""; out += "after change "; out += this.table.toString(); if ( this.as ) { out += " as "; out += this.as.toString(); } out += " set where "; out += this.expression.toString(); return out; } } module.exports = CacheReverseExpression;
/* */ var makeString = require("./helper/makeString"); module.exports = function(str, substr) { str = makeString(str); substr = makeString(substr); if (str.length === 0 || substr.length === 0) return 0; return str.split(substr).length - 1; };
// @flow import RNPermissions from 'react-native-permissions' export type Permission = 'bluetooth' | 'camera' | 'contacts' | 'photos' export type PermissionStatus = 'authorized' | 'denied' | 'restricted' | 'undetermined' export const CAMERA = 'camera' export const BLUETOOTH = 'bluetooth' export const CONTACTS = 'contacts' export const PHOTOS = 'photos' export const AUTHORIZED = 'authorized' export const DENIED = 'denied' export const RESTRICTED = 'restricted' export const UNDETERMINED = 'undetermined' export const request = (permission: Permission): Promise<PermissionStatus> => { return RNPermissions.check(permission).then(status => { if (status === UNDETERMINED) { return RNPermissions.request(permission) } return Promise.resolve(status) }) } export const isAuthorized = (permissionStatus: PermissionStatus) => { return permissionStatus === AUTHORIZED }
import React from 'react'; import Head from 'next/head'; import PropTypes from 'prop-types'; import dynamic from 'next/dynamic'; const WagtailUserbar = dynamic(() => import('../../components/WagtailUserbar')); const BasePage = ({ children, seo, wagtailUserbar }) => { const { seoHtmlTitle, seoMetaDescription, seoOgTitle, seoOgDescription, seoOgUrl, seoOgImage, seoOgType, seoTwitterTitle, seoTwitterDescription, seoTwitterUrl, seoTwitterImage, seoMetaRobots, canonicalLink, } = seo; return ( <> <Head> <title>{seoHtmlTitle}</title> <link rel="icon" href="/favicon.ico" /> {!!seoMetaDescription && ( <meta name="description" content={seoMetaDescription} /> )} {!!seoOgTitle && ( <meta property="og:title" content={seoOgTitle} /> )} {!!seoOgDescription && ( <meta property="og:description" content={seoOgDescription} /> )} {!!seoOgUrl && <meta property="og:url" content={seoOgUrl} />} {!!seoOgImage && ( <meta property="og:image" content={seoOgImage} /> )} {!!seoOgType && <meta property="og:type" content={seoOgType} />} {!!seoTwitterTitle && ( <meta property="twitter:title" content={seoTwitterTitle} /> )} {!!seoTwitterDescription && ( <meta property="twitter:description" content={seoTwitterDescription} /> )} {!!seoTwitterUrl && ( <meta property="twitter:url" content={seoTwitterUrl} /> )} {!!seoTwitterImage && ( <meta property="twitter:image" content={seoTwitterImage} /> )} <meta name="robots" content={seoMetaRobots} /> {!!canonicalLink && ( <link rel="canonical" href={canonicalLink} /> )} </Head> <div className="BasePage">{children}</div> {!!wagtailUserbar && <WagtailUserbar {...wagtailUserbar} />} </> ); }; BasePage.defaultProps = { seo: {}, }; BasePage.propTypes = { children: PropTypes.node, seo: PropTypes.shape({ seoHtmlTitle: PropTypes.string, seoMetaDescription: PropTypes.string, seoOgTitle: PropTypes.string, seoOgDescription: PropTypes.string, seoOgUrl: PropTypes.string, seoTwitterTitle: PropTypes.string, seoMetaRobots: PropTypes.string, }), wagtailUserbar: PropTypes.shape({ html: PropTypes.string, }), }; export default BasePage;
import { FontAwesome, Label, React, ResponsiveButton, getLabel } from '../imports'; export const CancelDialog = (confirm, cancel) => ({ title: getLabel('LABEL_CANCEL_CONFIRMATION_TITLE'), body: <Label label="LABEL_CANCEL_CONFIRMATION" />, footer: (<div> <ResponsiveButton icon={<FontAwesome name="check" />} onClick={confirm} className="btn btn-primary" label={getLabel('LABEL_YES')} /> <ResponsiveButton icon={<FontAwesome name="times" />} onClick={cancel} className="btn btn-danger" label={getLabel('LABEL_NO')} /> </div>) });
import React, { Component } from 'react' import { Link } from 'react-router' import sty from './MenuBar.scss' import MenuButton from '../../components/MenuButton/MenuButton.js' export default class MenuBar extends Component { static propTypes = { mobileNavIsOpen: React.PropTypes.bool.isRequired, toggleMenu: React.PropTypes.func.isRequired, menuLinks: React.PropTypes.array.isRequired, dropDownLinks: React.PropTypes.array.isRequired, dropDownActivate: React.PropTypes.func.isRequired, dropDownStatus: React.PropTypes.bool.isRequired }; render() { return ( <div className={sty.container}> <div className={sty.brand}> <Link to='/'>Peel3r</Link> </div> <nav role='navigation' className={sty.navigation}> {this.renderMenuLinks()} </nav> <div className={sty.mobileNavTrigger}> <MenuButton navStatus={this.props.mobileNavIsOpen} onClick={this.handleMenuClick}/> </div> </div> ) } renderMenuLinks = () => { const { menuLinks } = this.props return ( menuLinks.map((link, index) => <Link to={`/${link}`} activeClassName={sty.activeLink} key={index} > {link} </Link> ) ) }; // toggle sidebar on click of hamburger menu handleMenuClick = () => { this.props.toggleMenu() }; }
/*! * Start Bootstrap - Grayscale v3.3.7+1 (http://startbootstrap.com/template-overviews/grayscale) * Copyright 2013-2016 Start Bootstrap * Licensed under MIT (https://github.com/BlackrockDigital/startbootstrap/blob/gh-pages/LICENSE) */ function collapseNavbar(){$(".navbar").offset().top>50?$(".navbar-fixed-top").addClass("top-nav-collapse"):$(".navbar-fixed-top").removeClass("top-nav-collapse")}function init(){var e={zoom:15,center:new google.maps.LatLng(40.67,(-73.94)),disableDefaultUI:!0,scrollwheel:!1,draggable:!1,styles:[{featureType:"water",elementType:"geometry",stylers:[{color:"#000000"},{lightness:17}]},{featureType:"landscape",elementType:"geometry",stylers:[{color:"#000000"},{lightness:20}]},{featureType:"road.highway",elementType:"geometry.fill",stylers:[{color:"#000000"},{lightness:17}]},{featureType:"road.highway",elementType:"geometry.stroke",stylers:[{color:"#000000"},{lightness:29},{weight:.2}]},{featureType:"road.arterial",elementType:"geometry",stylers:[{color:"#000000"},{lightness:18}]},{featureType:"road.local",elementType:"geometry",stylers:[{color:"#000000"},{lightness:16}]},{featureType:"poi",elementType:"geometry",stylers:[{color:"#000000"},{lightness:21}]},{elementType:"labels.text.stroke",stylers:[{visibility:"on"},{color:"#000000"},{lightness:16}]},{elementType:"labels.text.fill",stylers:[{saturation:36},{color:"#000000"},{lightness:40}]},{elementType:"labels.icon",stylers:[{visibility:"off"}]},{featureType:"transit",elementType:"geometry",stylers:[{color:"#000000"},{lightness:19}]},{featureType:"administrative",elementType:"geometry.fill",stylers:[{color:"#000000"},{lightness:20}]},{featureType:"administrative",elementType:"geometry.stroke",stylers:[{color:"#000000"},{lightness:17},{weight:1.2}]}]},t=document.getElementById("map");map=new google.maps.Map(t,e);var l="themes/Grayscale/img/map-marker.png",o=new google.maps.LatLng(40.67,(-73.94));new google.maps.Marker({position:o,map:map,icon:l})}$(window).scroll(collapseNavbar),$(document).ready(collapseNavbar),$(function(){$("a.page-scroll").bind("click",function(e){var t=$(this);$("html, body").stop().animate({scrollTop:$(t.attr("href")).offset().top},1500,"easeInOutExpo"),e.preventDefault()})}),$(".navbar-collapse ul li a").click(function(){$(this).closest(".collapse").collapse("toggle")});var map=null;google.maps.event.addDomListener(window,"load",init),google.maps.event.addDomListener(window,"resize",function(){map.setCenter(new google.maps.LatLng(40.67,(-73.94)))});
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _react = _interopRequireDefault(require("react")); var _createSvgIcon = _interopRequireDefault(require("./utils/createSvgIcon")); var _default = (0, _createSvgIcon.default)(_react.default.createElement(_react.default.Fragment, null, _react.default.createElement("path", { fill: "none", d: "M0 0h24v24H0V0z" }), _react.default.createElement("g", null, _react.default.createElement("path", { d: "M2 5c-.55 0-1 .45-1 1v15c0 1.1.9 2 2 2h15c.55 0 1-.45 1-1s-.45-1-1-1H4c-.55 0-1-.45-1-1V6c0-.55-.45-1-1-1zm12 7V8c0-1.1-.9-2-2-2h-1c-1.1 0-2 .9-2 2v1c0 1.1.9 2 2 2h1v1h-2c-.55 0-1 .45-1 1s.45 1 1 1h2c1.1 0 2-.9 2-2zm-3-3V8h1v1h-1zm10-8H7c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2zm-1 16H8c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1h12c.55 0 1 .45 1 1v12c0 .55-.45 1-1 1zm1-7c0-.55-.45-1-1-1h-1V8c0-.55-.45-1-1-1s-1 .45-1 1v1h-1c-.55 0-1 .45-1 1s.45 1 1 1h1v1c0 .55.45 1 1 1s1-.45 1-1v-1h1c.55 0 1-.45 1-1z" }))), 'Filter9PlusRounded'); exports.default = _default;
import ExpressionLanguages from './ExpressionLanguages'; export default { __init__: [ 'expressionLanguages' ], expressionLanguages: [ 'type', ExpressionLanguages ] };
// META: script=/resources/WebIDLParser.js // META: script=/resources/idlharness.js // https://w3c.github.io/gamepad/ 'use strict'; idl_test( ['gamepad'], ['dom', 'html'], idl_array => { idl_array.add_objects({ GamepadEvent: ['new GamepadEvent("gamepad")'], Navigator: ['navigator'] }); } );
import axios from "axios"; import React, { useEffect, useState } from "react"; import { FaChevronDown, FaMarker } from "react-icons/fa"; import ProfilePic from "../../../assest/image/userDone.png"; import ImagePreview from "../../Register/components/ImagePreview"; const UserDeatils = () => { const [user, setUser] = useState([]); const [total, setTotal] = useState(""); const [pic, setPic] = useState(""); // fetch random user useEffect(() => { axios .post("/home/drivers/rand") .then((res) => { setUser(res.data.data[0]); }) .catch((err) => err); }, []); // console.log(user); // fetch picture useEffect(() => { axios .post("/home/driver/picture", { id: user.id }) .then((res) => { setPic(res.data.data); localStorage.setItem("d_id", user.id); }) .catch((err) => err); }, [user]); console.log("pic:", pic); // fetch total offense useEffect(() => { axios .post("/home/drivers/count", { id: user.id }) .then((res) => { setTotal(res.data.data); }) .catch((err) => err); }, [user]); // console.log(total); const myDate = new Date(user.created_at); return ( <> <div className="page_sub_content"> <div className="profile_edit"> <div className="img_des_box"> <img src={pic} /> </div> <div className="profile_button"> <h1>{user.surname + " " + user.firstname}</h1> <p> {user.email} </p> </div> <div className="offense_box"> <h1> {total} </h1> <p>Offense Records</p> <p> <span> <FaChevronDown /> </span> </p> </div> </div> <form action="" className="profile_details"> <div className="form_group"> <p> <label htmlFor="">Phone number</label> <input disabled type="text" value={user.phone} /> </p> <p> <label htmlFor="">Registration date</label> <input disabled type="text" value={myDate.toLocaleDateString()} /> </p> </div> <p> <label htmlFor="">Address</label> <input disabled type="text" value={user.lga + "," + user.state} /> </p> <div className="form_group"> <p> <label htmlFor="">Date of birth</label> <input disabled type="text" value={user.birth} /> </p> <p> <label htmlFor="">Gender</label> <input disabled type="text" value={user.gender} /> </p> </div> <div className="form_group"> <p> <label htmlFor="">NIN</label> <input disabled type="text" value={user.nin} /> </p> <p> <label htmlFor="" style={{ opacity: "0" }}> .. </label> <input disabled type="button" value="Edit Profile" className="submit_btn" /> </p> </div> </form> </div> </> ); }; export default UserDeatils;
(function(){ var mio = window.mio = window.mio || {}; mio.util = (function(){ var pub = {}; var loadImageCallbacks = {}; window.d = pub.d = function() { if (typeof console !== "undefined") { try { console.log.apply(this, arguments); } catch (e) { if (e.name === "TypeError") { console.log(arguments); } } } }; pub.gid = function(eId) { return document.getElementById(eId); }; pub.loadImage = function(url, callback) { if (!loadImageCallbacks[url]) { loadImageCallbacks[url] = []; var image = new Image(); image.onload = function() { for (var i in loadImageCallbacks[url]) { loadImageCallbacks[url][i](image); } delete loadImageCallbacks[url]; // Delete URL from loadActions }; image.src = url; } // Call each callback for this URL loadImageCallbacks[url].push(callback); }; pub.createElt = function(tagName, opts) { var opts = opts || {}; var elt = document.createElement(tagName); // InnerHTML / textContent if (opts.htmlContent) { elt.innerHTML = opts.htmlContent; } else if (opts.content) { if (typeof opts.content === 'string') { elt.innerHTML = opts.content; } else if (opts.content.nodeType == 1) { elt.appendChild(opts.content); } } // Events if (!!opts.events) { for (var eventName in opts.events) { elt.addEventListener(eventName, opts.events[eventName], false); } } // Id if (!!opts.id) { elt.id = opts.id; } // Attributes if (!!opts.attributes) { for (var attr in opts.attributes) { elt.setAttribute(attr, opts.attributes[attr]); } } return elt; }; pub.getSprite = function(img, callback) { callback(img); }; return pub; })(); })();
'use strict'; exports.createChangeTracker = createChangeTracker; function createChangeTracker() { let modified = false; return value => modified = modified || !!value; } exports.createArrowFunctionExpression = createArrowFunctionExpression; function createArrowFunctionExpression(j, fn, force_block_statement) { let body = fn.body; let is_expression = body.type === 'Expression'; if (body.type === 'BlockStatement' && body.body.length === 1) { const statement = fn.body.body[0]; if (!force_block_statement && statement.type === 'ReturnStatement') { body = statement.argument; is_expression = true; } } return j.arrowFunctionExpression(fn.params, body, is_expression); } exports.containsThisExpression = containsThisExpression; function containsThisExpression(j, path) { const this_expressions = j(path).find(j.ThisExpression); const immediate_descendants = inOwnFunctionScope(this_expressions, path); return immediate_descendants.size() > 0; } exports.containsArgumentsIdentifier = containsArgumentsIdentifier; function containsArgumentsIdentifier(j, path) { const arguments_identifiers = j(path).find(j.Identifier, { name: 'arguments' }); const immediate_descendants = inOwnFunctionScope(arguments_identifiers, path); return immediate_descendants.size() > 0; } function inOwnFunctionScope(collection, scope) { return collection.filter(path => { for (let p = path.parent; p && p !== scope && p.value !== scope; p = p.parent) { if (p.value.type === 'FunctionExpression' || p.value.type === 'FunctionDeclaration') { return false; } } return true; }); }
const getters = { language: state => state.app.language, sidebar: state => state.app.sidebar, device: state => state.app.device, token: state => state.user.token, avatar: state => state.user.avatar, name: state => state.user.name, roles: state => state.user.roles, permission_routers: state => state.permission.routers, addRouters: state => state.permission.addRouters, website: state => state.common.website, isLock: state => state.user.isLock, lockPasswd: state => state.user.lockPasswd, isFullScren: state => state.common.isFullScren, visitedViews: state => state.tagsView.visitedViews, cachedViews: state => state.tagsView.cachedViews, userId: state => state.user.userid, browserHeaderTitle: state => state.user.browserHeaderTitle, errorLogs: state => state.errorLog.logs } export default getters
/*! * OpenUI5 * (c) Copyright 2009-2021 SAP SE or an SAP affiliate company. * Licensed under the Apache License, Version 2.0 - see LICENSE.txt. */ sap.ui.define(['sap/base/assert','../Device','./Control','./_IconRegistry','./InvisibleText','./library',"./IconRenderer","sap/ui/events/KeyCodes","sap/ui/thirdparty/jquery","sap/base/Log"],function(a,D,C,_,I,l,b,K,q,L){"use strict";var c=l.IconColor;var d=l.CSSColor;var i=function(v){if(v!=null&&v!==""&&!d.isValid(v)&&!(v in c)){L.error("\""+v+"\" is not of type sap.ui.core.CSSColor nor of type sap.ui.core.IconColor.");return false;}else{return true;}};var e=C.extend("sap.ui.core.Icon",{metadata:{interfaces:["sap.ui.core.IFormContent"],library:"sap.ui.core",designtime:"sap/ui/core/designtime/Icon.designtime",properties:{src:{type:"sap.ui.core.URI",group:"Data",defaultValue:null},size:{type:"sap.ui.core.CSSSize",group:"Dimension",defaultValue:null},color:{type:"string",group:"Appearance",defaultValue:null},hoverColor:{type:"string",group:"Appearance",defaultValue:null},activeColor:{type:"string",group:"Appearance",defaultValue:null},width:{type:"sap.ui.core.CSSSize",group:"Dimension",defaultValue:null},height:{type:"sap.ui.core.CSSSize",group:"Dimension",defaultValue:null},backgroundColor:{type:"string",group:"Appearance",defaultValue:null},hoverBackgroundColor:{type:"string",group:"Appearance",defaultValue:null},activeBackgroundColor:{type:"string",group:"Appearance",defaultValue:null},decorative:{type:"boolean",group:"Accessibility",defaultValue:true},useIconTooltip:{type:"boolean",group:"Accessibility",defaultValue:true},alt:{type:"string",group:"Accessibility",defaultValue:null},noTabStop:{type:"boolean",group:"Accessibility",defaultValue:false}},aggregations:{_invisibleText:{type:"sap.ui.core.InvisibleText",multiple:false,visibility:"hidden"}},associations:{ariaLabelledBy:{type:"sap.ui.core.Control",multiple:true,singularName:"ariaLabelledBy"}},events:{press:{}}},renderer:b});e.prototype[D.support.touch?"ontouchstart":"onmousedown"]=function(E){if(this.hasListeners("press")){E.setMarked();}var A=this.getActiveColor(),s=this.getActiveBackgroundColor(),$;if(A||s){if(!E.targetTouches||(E.targetTouches&&E.targetTouches.length===1)){$=this.$();$.addClass("sapUiIconActive");if(A){this._addColorClass(A,"color");}if(s){this._addColorClass(s,"background-color");}}}};e.prototype[D.support.touch?"ontouchend":"onmouseup"]=function(E){if(!E.targetTouches||(E.targetTouches&&E.targetTouches.length===0)){this.$().removeClass("sapUiIconActive");this._restoreColors(D.system.desktop?"hover":undefined);}};e.prototype.onmouseover=function(){var h=this.getHoverColor(),H=this.getHoverBackgroundColor();if(h){this._addColorClass(h,"color");}if(H){this._addColorClass(H,"background-color");}};e.prototype.onmouseout=function(){this._restoreColors();};e.prototype[D.support.touch&&!D.system.desktop?"ontap":"onclick"]=function(E){if(this.hasListeners("press")){E.setMarked();}this.firePress({});};e.prototype.onkeydown=function(E){if(E.which===K.SPACE||E.which===K.ENTER){E.preventDefault();var $=this.$(),A=this.getActiveColor(),s=this.getActiveBackgroundColor();$.addClass("sapUiIconActive");if(A){this._addColorClass(A,"color");}if(s){this._addColorClass(s,"background-color");}}};e.prototype.onkeyup=function(E){if(E.which===K.SPACE||E.which===K.ENTER){this.$().removeClass("sapUiIconActive");this._restoreColors();this.firePress({});}};e.prototype._restoreColors=function(m){var s,B;if(m==="hover"){s=this.getHoverColor();B=this.getHoverBackgroundColor();}s=s||this.getColor();B=B||this.getBackgroundColor();this._addColorClass(s||"","color");this._addColorClass(B||"","background-color");};e.prototype._addColorClass=function(s,f){var $=this.$(),t=this;var g="";if(f==="color"){g="sapUiIconColor";}else if(f==="background-color"){g="sapUiIconBGColor";}else{return;}q.each(c,function(p,P){t.removeStyleClass(g+P);});if(s in c){$.css(f,"");this.addStyleClass(g+s);}else{$.css(f,s);}};e.prototype.setSrc=function(s){a(s==null||_.isIconURI(s),this+": Property 'src' (value: '"+s+"') should be a valid Icon URI (sap-icon://...)");return this.setProperty("src",s);};e.prototype.setColor=function(s){if(i(s)){this.setProperty("color",s,true);this._addColorClass(s,"color");}return this;};e.prototype.setActiveColor=function(s){if(i(s)){this.setProperty("activeColor",s,true);}return this;};e.prototype.setHoverColor=function(s){if(i(s)){this.setProperty("hoverColor",s,true);}return this;};e.prototype.setBackgroundColor=function(s){if(i(s)){this.setProperty("backgroundColor",s,true);this._addColorClass(s,"background-color");}return this;};e.prototype.setActiveBackgroundColor=function(s){if(i(s)){this.setProperty("activeBackgroundColor",s,true);}return this;};e.prototype.setHoverBackgroundColor=function(s){if(i(s)){this.setProperty("hoverBackgroundColor",s,true);}return this;};e.prototype.attachEvent=function(E){C.prototype.attachEvent.apply(this,arguments);if(E=="press"&&this.hasListeners("press")){this.invalidate();}return this;};e.prototype.detachEvent=function(E){C.prototype.detachEvent.apply(this,arguments);if(E=="press"&&!this.hasListeners("press")){this.invalidate();}return this;};e.prototype._getOutputTitle=function(o){var t=this.getTooltip_AsString(),u=this.getUseIconTooltip();if(t||(u&&o&&o.text)){return t||o.text;}};e.prototype._getIconLabel=function(o){var A=this.getAlt(),t=this.getTooltip_AsString(),u=this.getUseIconTooltip(),s=A||t||(u&&o&&(o.text||o.name));if(s){return s;}};e.prototype._createInvisibleText=function(t){var o=this.getAggregation("_invisibleText");if(!o){o=new I(this.getId()+"-label",{text:t});this.setAggregation("_invisibleText",o,true);}else{o.setProperty("text",t,true);}return o;};e.prototype._getAccessibilityAttributes=function(o){var f=this.getAriaLabelledBy(),A={},s=this._getIconLabel(o),g;if(this.getDecorative()){A.role="presentation";A.hidden="true";}else if(this.hasListeners("press")){A.role="button";}else{A.role="img";}if(f.length>0){if(s){g=this._createInvisibleText(s);f.push(g.getId());}A.labelledby=f.join(" ");}else if(s){A.label=s;}return A;};e.prototype.getAccessibilityInfo=function(){if(this.getDecorative()){return null;}var h=this.hasListeners("press");var o=_.getIconInfo(this.getSrc(),undefined,"sync");return{role:h?"button":"img",type:sap.ui.getCore().getLibraryResourceBundle("sap.ui.core").getText(h?"ACC_CTR_TYPE_BUTTON":"ACC_CTR_TYPE_IMAGE"),description:this.getAlt()||this.getTooltip_AsString()||(o?o.text||o.name:""),focusable:h};};return e;});
/* @preserve * Leaflet Control Geocoder 1.8.3 * https://github.com/perliedman/leaflet-control-geocoder * * Copyright (c) 2012 sa3m (https://github.com/sa3m) * Copyright (c) 2018 Per Liedman * All rights reserved. */ this.L = this.L || {}; this.L.Control = this.L.Control || {}; this.L.Control.Geocoder = (function (L) { 'use strict'; L = L && L.hasOwnProperty('default') ? L['default'] : L; var lastCallbackId = 0; // Adapted from handlebars.js // https://github.com/wycats/handlebars.js/ var badChars = /[&<>"'`]/g; var possible = /[&<>"'`]/; var escape = { '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#x27;', '`': '&#x60;' }; function escapeChar(chr) { return escape[chr]; } function htmlEscape(string) { if (string == null) { return ''; } else if (!string) { return string + ''; } // Force a string conversion as this will be done by the append regardless and // the regex test will do this transparently behind the scenes, causing issues if // an object's to string has escaped characters in it. string = '' + string; if (!possible.test(string)) { return string; } return string.replace(badChars, escapeChar); } function jsonp(url, params, callback, context, jsonpParam) { var callbackId = '_l_geocoder_' + lastCallbackId++; params[jsonpParam || 'callback'] = callbackId; window[callbackId] = L.Util.bind(callback, context); var script = document.createElement('script'); script.type = 'text/javascript'; script.src = url + getParamString(params); script.id = callbackId; document.getElementsByTagName('head')[0].appendChild(script); } function getJSON(url, params, callback) { var xmlHttp = new XMLHttpRequest(); xmlHttp.onreadystatechange = function() { if (xmlHttp.readyState !== 4) { return; } var message; if (xmlHttp.status !== 200 && xmlHttp.status !== 304) { message = ''; } else if (typeof xmlHttp.response === 'string') { // IE doesn't parse JSON responses even with responseType: 'json'. try { message = JSON.parse(xmlHttp.response); } catch (e) { // Not a JSON response message = xmlHttp.response; } } else { message = xmlHttp.response; } callback(message); }; xmlHttp.open('GET', url + getParamString(params), true); xmlHttp.responseType = 'json'; xmlHttp.setRequestHeader('Accept', 'application/json'); xmlHttp.send(null); } function template(str, data) { return str.replace(/\{ *([\w_]+) *\}/g, function(str, key) { var value = data[key]; if (value === undefined) { value = ''; } else if (typeof value === 'function') { value = value(data); } return htmlEscape(value); }); } function getParamString(obj, existingUrl, uppercase) { var params = []; for (var i in obj) { var key = encodeURIComponent(uppercase ? i.toUpperCase() : i); var value = obj[i]; if (!L.Util.isArray(value)) { params.push(key + '=' + encodeURIComponent(value)); } else { for (var j = 0; j < value.length; j++) { params.push(key + '=' + encodeURIComponent(value[j])); } } } return (!existingUrl || existingUrl.indexOf('?') === -1 ? '?' : '&') + params.join('&'); } var ArcGis = L.Class.extend({ options: { service_url: 'https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer' }, initialize: function(accessToken, options) { L.setOptions(this, options); this._accessToken = accessToken; }, geocode: function(query, cb, context) { var params = { SingleLine: query, outFields: 'Addr_Type', forStorage: false, maxLocations: 10, f: 'json' }; if (this._key && this._key.length) { params.token = this._key; } getJSON( this.options.service_url + '/findAddressCandidates', L.extend(params, this.options.geocodingQueryParams), function(data) { var results = [], loc, latLng, latLngBounds; if (data.candidates && data.candidates.length) { for (var i = 0; i <= data.candidates.length - 1; i++) { loc = data.candidates[i]; latLng = L.latLng(loc.location.y, loc.location.x); latLngBounds = L.latLngBounds( L.latLng(loc.extent.ymax, loc.extent.xmax), L.latLng(loc.extent.ymin, loc.extent.xmin) ); results[i] = { name: loc.address, bbox: latLngBounds, center: latLng }; } } cb.call(context, results); } ); }, suggest: function(query, cb, context) { return this.geocode(query, cb, context); }, reverse: function(location, scale, cb, context) { var params = { location: encodeURIComponent(location.lng) + ',' + encodeURIComponent(location.lat), distance: 100, f: 'json' }; getJSON(this.options.service_url + '/reverseGeocode', params, function(data) { var result = [], loc; if (data && !data.error) { loc = L.latLng(data.location.y, data.location.x); result.push({ name: data.address.Match_addr, center: loc, bounds: L.latLngBounds(loc, loc) }); } cb.call(context, result); }); } }); function arcgis(accessToken, options) { return new ArcGis(accessToken, options); } var Bing = L.Class.extend({ initialize: function(key) { this.key = key; }, geocode: function(query, cb, context) { jsonp( 'https://dev.virtualearth.net/REST/v1/Locations', { query: query, key: this.key }, function(data) { var results = []; if (data.resourceSets.length > 0) { for (var i = data.resourceSets[0].resources.length - 1; i >= 0; i--) { var resource = data.resourceSets[0].resources[i], bbox = resource.bbox; results[i] = { name: resource.name, bbox: L.latLngBounds([bbox[0], bbox[1]], [bbox[2], bbox[3]]), center: L.latLng(resource.point.coordinates) }; } } cb.call(context, results); }, this, 'jsonp' ); }, reverse: function(location, scale, cb, context) { jsonp( '//dev.virtualearth.net/REST/v1/Locations/' + location.lat + ',' + location.lng, { key: this.key }, function(data) { var results = []; for (var i = data.resourceSets[0].resources.length - 1; i >= 0; i--) { var resource = data.resourceSets[0].resources[i], bbox = resource.bbox; results[i] = { name: resource.name, bbox: L.latLngBounds([bbox[0], bbox[1]], [bbox[2], bbox[3]]), center: L.latLng(resource.point.coordinates) }; } cb.call(context, results); }, this, 'jsonp' ); } }); function bing(key) { return new Bing(key); } var Google = L.Class.extend({ options: { serviceUrl: 'https://maps.googleapis.com/maps/api/geocode/json', geocodingQueryParams: {}, reverseQueryParams: {} }, initialize: function(key, options) { this._key = key; L.setOptions(this, options); // Backwards compatibility this.options.serviceUrl = this.options.service_url || this.options.serviceUrl; }, geocode: function(query, cb, context) { var params = { address: query }; if (this._key && this._key.length) { params.key = this._key; } params = L.Util.extend(params, this.options.geocodingQueryParams); getJSON(this.options.serviceUrl, params, function(data) { var results = [], loc, latLng, latLngBounds; if (data.results && data.results.length) { for (var i = 0; i <= data.results.length - 1; i++) { loc = data.results[i]; latLng = L.latLng(loc.geometry.location); latLngBounds = L.latLngBounds( L.latLng(loc.geometry.viewport.northeast), L.latLng(loc.geometry.viewport.southwest) ); results[i] = { name: loc.formatted_address, bbox: latLngBounds, center: latLng, properties: loc.address_components }; } } cb.call(context, results); }); }, reverse: function(location, scale, cb, context) { var params = { latlng: encodeURIComponent(location.lat) + ',' + encodeURIComponent(location.lng) }; params = L.Util.extend(params, this.options.reverseQueryParams); if (this._key && this._key.length) { params.key = this._key; } getJSON(this.options.serviceUrl, params, function(data) { var results = [], loc, latLng, latLngBounds; if (data.results && data.results.length) { for (var i = 0; i <= data.results.length - 1; i++) { loc = data.results[i]; latLng = L.latLng(loc.geometry.location); latLngBounds = L.latLngBounds( L.latLng(loc.geometry.viewport.northeast), L.latLng(loc.geometry.viewport.southwest) ); results[i] = { name: loc.formatted_address, bbox: latLngBounds, center: latLng, properties: loc.address_components }; } } cb.call(context, results); }); } }); function google(key, options) { return new Google(key, options); } var HERE = L.Class.extend({ options: { geocodeUrl: 'http://geocoder.api.here.com/6.2/geocode.json', reverseGeocodeUrl: 'http://reverse.geocoder.api.here.com/6.2/reversegeocode.json', app_id: '<insert your app_id here>', app_code: '<insert your app_code here>', geocodingQueryParams: {}, reverseQueryParams: {} }, initialize: function(options) { L.setOptions(this, options); }, geocode: function(query, cb, context) { var params = { searchtext: query, gen: 9, app_id: this.options.app_id, app_code: this.options.app_code, jsonattributes: 1 }; params = L.Util.extend(params, this.options.geocodingQueryParams); this.getJSON(this.options.geocodeUrl, params, cb, context); }, reverse: function(location, scale, cb, context) { var params = { prox: encodeURIComponent(location.lat) + ',' + encodeURIComponent(location.lng), mode: 'retrieveAddresses', app_id: this.options.app_id, app_code: this.options.app_code, gen: 9, jsonattributes: 1 }; params = L.Util.extend(params, this.options.reverseQueryParams); this.getJSON(this.options.reverseGeocodeUrl, params, cb, context); }, getJSON: function(url, params, cb, context) { getJSON(url, params, function(data) { var results = [], loc, latLng, latLngBounds; if (data.response.view && data.response.view.length) { for (var i = 0; i <= data.response.view[0].result.length - 1; i++) { loc = data.response.view[0].result[i].location; latLng = L.latLng(loc.displayPosition.latitude, loc.displayPosition.longitude); latLngBounds = L.latLngBounds( L.latLng(loc.mapView.topLeft.latitude, loc.mapView.topLeft.longitude), L.latLng(loc.mapView.bottomRight.latitude, loc.mapView.bottomRight.longitude) ); results[i] = { name: loc.address.label, bbox: latLngBounds, center: latLng }; } } cb.call(context, results); }); } }); function here(options) { return new HERE(options); } var LatLng = L.Class.extend({ options: { // the next geocoder to use next: undefined, sizeInMeters: 10000 }, initialize: function(options) { L.Util.setOptions(this, options); }, geocode: function(query, cb, context) { var match; var center; // regex from https://github.com/openstreetmap/openstreetmap-website/blob/master/app/controllers/geocoder_controller.rb if ((match = query.match(/^([NS])\s*(\d{1,3}(?:\.\d*)?)\W*([EW])\s*(\d{1,3}(?:\.\d*)?)$/))) { // [NSEW] decimal degrees center = L.latLng( (/N/i.test(match[1]) ? 1 : -1) * parseFloat(match[2]), (/E/i.test(match[3]) ? 1 : -1) * parseFloat(match[4]) ); } else if ( (match = query.match(/^(\d{1,3}(?:\.\d*)?)\s*([NS])\W*(\d{1,3}(?:\.\d*)?)\s*([EW])$/)) ) { // decimal degrees [NSEW] center = L.latLng( (/N/i.test(match[2]) ? 1 : -1) * parseFloat(match[1]), (/E/i.test(match[4]) ? 1 : -1) * parseFloat(match[3]) ); } else if ( (match = query.match( /^([NS])\s*(\d{1,3})°?\s*(\d{1,3}(?:\.\d*)?)?['′]?\W*([EW])\s*(\d{1,3})°?\s*(\d{1,3}(?:\.\d*)?)?['′]?$/ )) ) { // [NSEW] degrees, decimal minutes center = L.latLng( (/N/i.test(match[1]) ? 1 : -1) * (parseFloat(match[2]) + parseFloat(match[3] / 60)), (/E/i.test(match[4]) ? 1 : -1) * (parseFloat(match[5]) + parseFloat(match[6] / 60)) ); } else if ( (match = query.match( /^(\d{1,3})°?\s*(\d{1,3}(?:\.\d*)?)?['′]?\s*([NS])\W*(\d{1,3})°?\s*(\d{1,3}(?:\.\d*)?)?['′]?\s*([EW])$/ )) ) { // degrees, decimal minutes [NSEW] center = L.latLng( (/N/i.test(match[3]) ? 1 : -1) * (parseFloat(match[1]) + parseFloat(match[2] / 60)), (/E/i.test(match[6]) ? 1 : -1) * (parseFloat(match[4]) + parseFloat(match[5] / 60)) ); } else if ( (match = query.match( /^([NS])\s*(\d{1,3})°?\s*(\d{1,2})['′]?\s*(\d{1,3}(?:\.\d*)?)?["″]?\W*([EW])\s*(\d{1,3})°?\s*(\d{1,2})['′]?\s*(\d{1,3}(?:\.\d*)?)?["″]?$/ )) ) { // [NSEW] degrees, minutes, decimal seconds center = L.latLng( (/N/i.test(match[1]) ? 1 : -1) * (parseFloat(match[2]) + parseFloat(match[3] / 60 + parseFloat(match[4] / 3600))), (/E/i.test(match[5]) ? 1 : -1) * (parseFloat(match[6]) + parseFloat(match[7] / 60) + parseFloat(match[8] / 3600)) ); } else if ( (match = query.match( /^(\d{1,3})°?\s*(\d{1,2})['′]?\s*(\d{1,3}(?:\.\d*)?)?["″]\s*([NS])\W*(\d{1,3})°?\s*(\d{1,2})['′]?\s*(\d{1,3}(?:\.\d*)?)?["″]?\s*([EW])$/ )) ) { // degrees, minutes, decimal seconds [NSEW] center = L.latLng( (/N/i.test(match[4]) ? 1 : -1) * (parseFloat(match[1]) + parseFloat(match[2] / 60 + parseFloat(match[3] / 3600))), (/E/i.test(match[8]) ? 1 : -1) * (parseFloat(match[5]) + parseFloat(match[6] / 60) + parseFloat(match[7] / 3600)) ); } else if ( (match = query.match(/^\s*([+-]?\d+(?:\.\d*)?)\s*[\s,]\s*([+-]?\d+(?:\.\d*)?)\s*$/)) ) { center = L.latLng(parseFloat(match[1]), parseFloat(match[2])); } if (center) { var results = [ { name: query, center: center, bbox: center.toBounds(this.options.sizeInMeters) } ]; cb.call(context, results); } else if (this.options.next) { this.options.next.geocode(query, cb, context); } } }); function latLng(options) { return new LatLng(options); } var Mapbox = L.Class.extend({ options: { serviceUrl: 'https://api.mapbox.com/geocoding/v5/mapbox.places/', geocodingQueryParams: {}, reverseQueryParams: {} }, initialize: function(accessToken, options) { L.setOptions(this, options); this.options.geocodingQueryParams.access_token = accessToken; this.options.reverseQueryParams.access_token = accessToken; }, geocode: function(query, cb, context) { var params = this.options.geocodingQueryParams; if ( params.proximity !== undefined && params.proximity.lat !== undefined && params.proximity.lng !== undefined ) { params.proximity = params.proximity.lng + ',' + params.proximity.lat; } getJSON(this.options.serviceUrl + encodeURIComponent(query) + '.json', params, function(data) { var results = [], loc, latLng, latLngBounds; if (data.features && data.features.length) { for (var i = 0; i <= data.features.length - 1; i++) { loc = data.features[i]; latLng = L.latLng(loc.center.reverse()); if (loc.bbox) { latLngBounds = L.latLngBounds( L.latLng(loc.bbox.slice(0, 2).reverse()), L.latLng(loc.bbox.slice(2, 4).reverse()) ); } else { latLngBounds = L.latLngBounds(latLng, latLng); } var properties = { text: loc.text, address: loc.address }; for (var j = 0; j < (loc.context || []).length; j++) { var id = loc.context[j].id.split('.')[0]; properties[id] = loc.context[j].text; } results[i] = { name: loc.place_name, bbox: latLngBounds, center: latLng, properties: properties }; } } cb.call(context, results); }); }, suggest: function(query, cb, context) { return this.geocode(query, cb, context); }, reverse: function(location, scale, cb, context) { getJSON( this.options.serviceUrl + encodeURIComponent(location.lng) + ',' + encodeURIComponent(location.lat) + '.json', this.options.reverseQueryParams, function(data) { var results = [], loc, latLng, latLngBounds; if (data.features && data.features.length) { for (var i = 0; i <= data.features.length - 1; i++) { loc = data.features[i]; latLng = L.latLng(loc.center.reverse()); if (loc.bbox) { latLngBounds = L.latLngBounds( L.latLng(loc.bbox.slice(0, 2).reverse()), L.latLng(loc.bbox.slice(2, 4).reverse()) ); } else { latLngBounds = L.latLngBounds(latLng, latLng); } results[i] = { name: loc.place_name, bbox: latLngBounds, center: latLng }; } } cb.call(context, results); } ); } }); function mapbox(accessToken, options) { return new Mapbox(accessToken, options); } var MapQuest = L.Class.extend({ options: { serviceUrl: 'https://www.mapquestapi.com/geocoding/v1' }, initialize: function(key, options) { // MapQuest seems to provide URI encoded API keys, // so to avoid encoding them twice, we decode them here this._key = decodeURIComponent(key); L.Util.setOptions(this, options); }, _formatName: function() { var r = [], i; for (i = 0; i < arguments.length; i++) { if (arguments[i]) { r.push(arguments[i]); } } return r.join(', '); }, geocode: function(query, cb, context) { getJSON( this.options.serviceUrl + '/address', { key: this._key, location: query, limit: 5, outFormat: 'json' }, L.bind(function(data) { var results = [], loc, latLng; if (data.results && data.results[0].locations) { for (var i = data.results[0].locations.length - 1; i >= 0; i--) { loc = data.results[0].locations[i]; latLng = L.latLng(loc.latLng); results[i] = { name: this._formatName(loc.street, loc.adminArea4, loc.adminArea3, loc.adminArea1), bbox: L.latLngBounds(latLng, latLng), center: latLng }; } } cb.call(context, results); }, this) ); }, reverse: function(location, scale, cb, context) { getJSON( this.options.serviceUrl + '/reverse', { key: this._key, location: location.lat + ',' + location.lng, outputFormat: 'json' }, L.bind(function(data) { var results = [], loc, latLng; if (data.results && data.results[0].locations) { for (var i = data.results[0].locations.length - 1; i >= 0; i--) { loc = data.results[0].locations[i]; latLng = L.latLng(loc.latLng); results[i] = { name: this._formatName(loc.street, loc.adminArea4, loc.adminArea3, loc.adminArea1), bbox: L.latLngBounds(latLng, latLng), center: latLng }; } } cb.call(context, results); }, this) ); } }); function mapQuest(key, options) { return new MapQuest(key, options); } var Neutrino = L.Class.extend({ options: { userId: '<insert your userId here>', apiKey: '<insert your apiKey here>', serviceUrl: 'https://neutrinoapi.com/' }, initialize: function(options) { L.Util.setOptions(this, options); }, // https://www.neutrinoapi.com/api/geocode-address/ geocode: function(query, cb, context) { getJSON( this.options.serviceUrl + 'geocode-address', { apiKey: this.options.apiKey, userId: this.options.userId, //get three words and make a dot based string address: query.split(/\s+/).join('.') }, function(data) { var results = [], latLng, latLngBounds; if (data.locations) { data.geometry = data.locations[0]; latLng = L.latLng(data.geometry['latitude'], data.geometry['longitude']); latLngBounds = L.latLngBounds(latLng, latLng); results[0] = { name: data.geometry.address, bbox: latLngBounds, center: latLng }; } cb.call(context, results); } ); }, suggest: function(query, cb, context) { return this.geocode(query, cb, context); }, // https://www.neutrinoapi.com/api/geocode-reverse/ reverse: function(location, scale, cb, context) { getJSON( this.options.serviceUrl + 'geocode-reverse', { apiKey: this.options.apiKey, userId: this.options.userId, latitude: location.lat, longitude: location.lng }, function(data) { var results = [], latLng, latLngBounds; if (data.status.status == 200 && data.found) { latLng = L.latLng(location.lat, location.lng); latLngBounds = L.latLngBounds(latLng, latLng); results[0] = { name: data.address, bbox: latLngBounds, center: latLng }; } cb.call(context, results); } ); } }); function neutrino(accessToken) { return new Neutrino(accessToken); } var Nominatim = L.Class.extend({ options: { serviceUrl: 'https://nominatim.openstreetmap.org/', geocodingQueryParams: {}, reverseQueryParams: {}, htmlTemplate: function(r) { var a = r.address, parts = []; if (a.road || a.building) { parts.push('{building} {road} {house_number}'); } if (a.city || a.town || a.village || a.hamlet) { parts.push( '<span class="' + (parts.length > 0 ? 'leaflet-control-geocoder-address-detail' : '') + '">{postcode} {city} {town} {village} {hamlet}</span>' ); } if (a.state || a.country) { parts.push( '<span class="' + (parts.length > 0 ? 'leaflet-control-geocoder-address-context' : '') + '">{state} {country}</span>' ); } return template(parts.join('<br/>'), a, true); } }, initialize: function(options) { L.Util.setOptions(this, options); }, geocode: function(query, cb, context) { getJSON( this.options.serviceUrl + 'search', L.extend( { q: query, limit: 5, format: 'json', addressdetails: 1 }, this.options.geocodingQueryParams ), L.bind(function(data) { var results = []; for (var i = data.length - 1; i >= 0; i--) { var bbox = data[i].boundingbox; for (var j = 0; j < 4; j++) bbox[j] = parseFloat(bbox[j]); results[i] = { icon: data[i].icon, name: data[i].display_name, html: this.options.htmlTemplate ? this.options.htmlTemplate(data[i]) : undefined, bbox: L.latLngBounds([bbox[0], bbox[2]], [bbox[1], bbox[3]]), center: L.latLng(data[i].lat, data[i].lon), properties: data[i] }; } cb.call(context, results); }, this) ); }, reverse: function(location, scale, cb, context) { getJSON( this.options.serviceUrl + 'reverse', L.extend( { lat: location.lat, lon: location.lng, zoom: Math.round(Math.log(scale / 256) / Math.log(2)), addressdetails: 1, format: 'json' }, this.options.reverseQueryParams ), L.bind(function(data) { var result = [], loc; if (data && data.lat && data.lon) { loc = L.latLng(data.lat, data.lon); result.push({ name: data.display_name, html: this.options.htmlTemplate ? this.options.htmlTemplate(data) : undefined, center: loc, bounds: L.latLngBounds(loc, loc), properties: data }); } cb.call(context, result); }, this) ); } }); function nominatim(options) { return new Nominatim(options); } var OpenLocationCode = L.Class.extend({ options: { OpenLocationCode: undefined, codeLength: undefined }, initialize: function(options) { L.setOptions(this, options); }, geocode: function(query, cb, context) { try { var decoded = this.options.OpenLocationCode.decode(query); var result = { name: query, center: L.latLng(decoded.latitudeCenter, decoded.longitudeCenter), bbox: L.latLngBounds( L.latLng(decoded.latitudeLo, decoded.longitudeLo), L.latLng(decoded.latitudeHi, decoded.longitudeHi) ) }; cb.call(context, [result]); } catch (e) { console.warn(e); // eslint-disable-line no-console cb.call(context, []); } }, reverse: function(location, scale, cb, context) { try { var code = this.options.OpenLocationCode.encode( location.lat, location.lng, this.options.codeLength ); var result = { name: code, center: L.latLng(location.lat, location.lng), bbox: L.latLngBounds( L.latLng(location.lat, location.lng), L.latLng(location.lat, location.lng) ) }; cb.call(context, [result]); } catch (e) { console.warn(e); // eslint-disable-line no-console cb.call(context, []); } } }); function openLocationCode(options) { return new OpenLocationCode(options); } var Pelias = L.Class.extend({ options: { serviceUrl: 'https://api.geocode.earth/v1', geocodingQueryParams: {}, reverseQueryParams: {} }, initialize: function(apiKey, options) { L.Util.setOptions(this, options); this._apiKey = apiKey; this._lastSuggest = 0; }, geocode: function(query, cb, context) { var _this = this; getJSON( this.options.serviceUrl + '/search', L.extend( { api_key: this._apiKey, text: query }, this.options.geocodingQueryParams ), function(data) { cb.call(context, _this._parseResults(data, 'bbox')); } ); }, suggest: function(query, cb, context) { var _this = this; getJSON( this.options.serviceUrl + '/autocomplete', L.extend( { api_key: this._apiKey, text: query }, this.options.geocodingQueryParams ), L.bind(function(data) { if (data.geocoding.timestamp > this._lastSuggest) { this._lastSuggest = data.geocoding.timestamp; cb.call(context, _this._parseResults(data, 'bbox')); } }, this) ); }, reverse: function(location, scale, cb, context) { var _this = this; getJSON( this.options.serviceUrl + '/reverse', L.extend( { api_key: this._apiKey, 'point.lat': location.lat, 'point.lon': location.lng }, this.options.reverseQueryParams ), function(data) { cb.call(context, _this._parseResults(data, 'bounds')); } ); }, _parseResults: function(data, bboxname) { var results = []; L.geoJson(data, { pointToLayer: function(feature, latlng) { return L.circleMarker(latlng); }, onEachFeature: function(feature, layer) { var result = {}, bbox, center; if (layer.getBounds) { bbox = layer.getBounds(); center = bbox.getCenter(); } else if (layer.feature.bbox) { center = layer.getLatLng(); bbox = L.latLngBounds( L.GeoJSON.coordsToLatLng(layer.feature.bbox.slice(0, 2)), L.GeoJSON.coordsToLatLng(layer.feature.bbox.slice(2, 4)) ); } else { center = layer.getLatLng(); bbox = L.latLngBounds(center, center); } result.name = layer.feature.properties.label; result.center = center; result[bboxname] = bbox; result.properties = layer.feature.properties; results.push(result); } }); return results; } }); function pelias(apiKey, options) { return new Pelias(apiKey, options); } var GeocodeEarth = Pelias; var geocodeEarth = pelias; var Mapzen = Pelias; // r.i.p. var mapzen = pelias; var Openrouteservice = Mapzen.extend({ options: { serviceUrl: 'https://api.openrouteservice.org/geocode' } }); function openrouteservice(apiKey, options) { return new Openrouteservice(apiKey, options); } var Photon = L.Class.extend({ options: { serviceUrl: 'https://photon.komoot.de/api/', reverseUrl: 'https://photon.komoot.de/reverse/', nameProperties: ['name', 'street', 'suburb', 'hamlet', 'town', 'city', 'state', 'country'] }, initialize: function(options) { L.setOptions(this, options); }, geocode: function(query, cb, context) { var params = L.extend( { q: query }, this.options.geocodingQueryParams ); getJSON( this.options.serviceUrl, params, L.bind(function(data) { cb.call(context, this._decodeFeatures(data)); }, this) ); }, suggest: function(query, cb, context) { return this.geocode(query, cb, context); }, reverse: function(latLng, scale, cb, context) { var params = L.extend( { lat: latLng.lat, lon: latLng.lng }, this.options.reverseQueryParams ); getJSON( this.options.reverseUrl, params, L.bind(function(data) { cb.call(context, this._decodeFeatures(data)); }, this) ); }, _decodeFeatures: function(data) { var results = [], i, f, c, latLng, extent, bbox; if (data && data.features) { for (i = 0; i < data.features.length; i++) { f = data.features[i]; c = f.geometry.coordinates; latLng = L.latLng(c[1], c[0]); extent = f.properties.extent; if (extent) { bbox = L.latLngBounds([extent[1], extent[0]], [extent[3], extent[2]]); } else { bbox = L.latLngBounds(latLng, latLng); } results.push({ name: this._decodeFeatureName(f), html: this.options.htmlTemplate ? this.options.htmlTemplate(f) : undefined, center: latLng, bbox: bbox, properties: f.properties }); } } return results; }, _decodeFeatureName: function(f) { return (this.options.nameProperties || []) .map(function(p) { return f.properties[p]; }) .filter(function(v) { return !!v; }) .join(', '); } }); function photon(options) { return new Photon(options); } var What3Words = L.Class.extend({ options: { serviceUrl: 'https://api.what3words.com/v2/' }, initialize: function(accessToken) { this._accessToken = accessToken; }, geocode: function(query, cb, context) { //get three words and make a dot based string getJSON( this.options.serviceUrl + 'forward', { key: this._accessToken, addr: query.split(/\s+/).join('.') }, function(data) { var results = [], latLng, latLngBounds; if (data.geometry) { latLng = L.latLng(data.geometry['lat'], data.geometry['lng']); latLngBounds = L.latLngBounds(latLng, latLng); results[0] = { name: data.words, bbox: latLngBounds, center: latLng }; } cb.call(context, results); } ); }, suggest: function(query, cb, context) { return this.geocode(query, cb, context); }, reverse: function(location, scale, cb, context) { getJSON( this.options.serviceUrl + 'reverse', { key: this._accessToken, coords: [location.lat, location.lng].join(',') }, function(data) { var results = [], latLng, latLngBounds; if (data.status.status == 200) { latLng = L.latLng(data.geometry['lat'], data.geometry['lng']); latLngBounds = L.latLngBounds(latLng, latLng); results[0] = { name: data.words, bbox: latLngBounds, center: latLng }; } cb.call(context, results); } ); } }); function what3words(accessToken) { return new What3Words(accessToken); } var geocoders = /*#__PURE__*/Object.freeze({ ArcGis: ArcGis, arcgis: arcgis, Bing: Bing, bing: bing, Google: Google, google: google, HERE: HERE, here: here, LatLng: LatLng, latLng: latLng, Mapbox: Mapbox, mapbox: mapbox, MapQuest: MapQuest, mapQuest: mapQuest, Neutrino: Neutrino, neutrino: neutrino, Nominatim: Nominatim, nominatim: nominatim, OpenLocationCode: OpenLocationCode, openLocationCode: openLocationCode, Pelias: Pelias, pelias: pelias, GeocodeEarth: GeocodeEarth, geocodeEarth: geocodeEarth, Mapzen: Mapzen, mapzen: mapzen, Openrouteservice: Openrouteservice, openrouteservice: openrouteservice, Photon: Photon, photon: photon, What3Words: What3Words, what3words: what3words }); var Geocoder = L.Control.extend({ options: { showUniqueResult: true, showResultIcons: false, collapsed: true, expand: 'touch', // options: touch, click, anythingelse position: 'topright', placeholder: 'Search...', errorMessage: 'Nothing found.', queryMinLength: 1, suggestMinLength: 3, suggestTimeout: 250, defaultMarkGeocode: true }, includes: L.Evented.prototype || L.Mixin.Events, initialize: function(options) { L.Util.setOptions(this, options); if (!this.options.geocoder) { this.options.geocoder = new Nominatim(); } this._requestCount = 0; }, addThrobberClass: function() { L.DomUtil.addClass(this._container, 'leaflet-control-geocoder-throbber'); }, removeThrobberClass: function() { L.DomUtil.removeClass(this._container, 'leaflet-control-geocoder-throbber'); }, onAdd: function(map) { var className = 'leaflet-control-geocoder', container = L.DomUtil.create('div', className + ' leaflet-bar'), icon = L.DomUtil.create('button', className + '-icon', container), form = (this._form = L.DomUtil.create('div', className + '-form', container)), input; this._map = map; this._container = container; icon.innerHTML = '&nbsp;'; icon.type = 'button'; input = this._input = L.DomUtil.create('input', '', form); input.type = 'text'; input.placeholder = this.options.placeholder; L.DomEvent.disableClickPropagation(input); this._errorElement = L.DomUtil.create('div', className + '-form-no-error', container); this._errorElement.innerHTML = this.options.errorMessage; this._alts = L.DomUtil.create( 'ul', className + '-alternatives leaflet-control-geocoder-alternatives-minimized', container ); L.DomEvent.disableClickPropagation(this._alts); L.DomEvent.addListener(input, 'keydown', this._keydown, this); if (this.options.geocoder.suggest) { L.DomEvent.addListener(input, 'input', this._change, this); } L.DomEvent.addListener( input, 'blur', function() { if (this.options.collapsed && !this._preventBlurCollapse) { this._collapse(); } this._preventBlurCollapse = false; }, this ); if (this.options.collapsed) { if (this.options.expand === 'click') { L.DomEvent.addListener( container, 'click', function(e) { if (e.button === 0 && e.detail !== 2) { this._toggle(); } }, this ); } else if (L.Browser.touch && this.options.expand === 'touch') { L.DomEvent.addListener( container, 'touchstart mousedown', function(e) { this._toggle(); e.preventDefault(); // mobile: clicking focuses the icon, so UI expands and immediately collapses e.stopPropagation(); }, this ); } else { L.DomEvent.addListener(container, 'mouseover', this._expand, this); L.DomEvent.addListener(container, 'mouseout', this._collapse, this); this._map.on('movestart', this._collapse, this); } } else { this._expand(); if (L.Browser.touch) { L.DomEvent.addListener( container, 'touchstart', function() { this._geocode(); }, this ); } else { L.DomEvent.addListener( container, 'click', function() { this._geocode(); }, this ); } } if (this.options.defaultMarkGeocode) { this.on('markgeocode', this.markGeocode, this); } this.on('startgeocode', this.addThrobberClass, this); this.on('finishgeocode', this.removeThrobberClass, this); this.on('startsuggest', this.addThrobberClass, this); this.on('finishsuggest', this.removeThrobberClass, this); L.DomEvent.disableClickPropagation(container); return container; }, _geocodeResult: function(results, suggest) { if (!suggest && this.options.showUniqueResult && results.length === 1) { this._geocodeResultSelected(results[0]); } else if (results.length > 0) { this._alts.innerHTML = ''; this._results = results; L.DomUtil.removeClass(this._alts, 'leaflet-control-geocoder-alternatives-minimized'); L.DomUtil.addClass(this._container, 'leaflet-control-geocoder-options-open'); for (var i = 0; i < results.length; i++) { this._alts.appendChild(this._createAlt(results[i], i)); } } else { L.DomUtil.addClass(this._container, 'leaflet-control-geocoder-options-error'); L.DomUtil.addClass(this._errorElement, 'leaflet-control-geocoder-error'); } }, markGeocode: function(result) { result = result.geocode || result; this._map.fitBounds(result.bbox); if (this._geocodeMarker) { this._map.removeLayer(this._geocodeMarker); } this._geocodeMarker = new L.Marker(result.center) .bindPopup(result.html || result.name) .addTo(this._map) .openPopup(); return this; }, _geocode: function(suggest) { var value = this._input.value; if (!suggest && value.length < this.options.queryMinLength) { return; } var requestCount = ++this._requestCount, mode = suggest ? 'suggest' : 'geocode', eventData = { input: value }; this._lastGeocode = value; if (!suggest) { this._clearResults(); } this.fire('start' + mode, eventData); this.options.geocoder[mode]( value, function(results) { if (requestCount === this._requestCount) { eventData.results = results; this.fire('finish' + mode, eventData); this._geocodeResult(results, suggest); } }, this ); }, _geocodeResultSelected: function(result) { this.fire('markgeocode', { geocode: result }); }, _toggle: function() { if (L.DomUtil.hasClass(this._container, 'leaflet-control-geocoder-expanded')) { this._collapse(); } else { this._expand(); } }, _expand: function() { L.DomUtil.addClass(this._container, 'leaflet-control-geocoder-expanded'); this._input.select(); this.fire('expand'); }, _collapse: function() { L.DomUtil.removeClass(this._container, 'leaflet-control-geocoder-expanded'); L.DomUtil.addClass(this._alts, 'leaflet-control-geocoder-alternatives-minimized'); L.DomUtil.removeClass(this._errorElement, 'leaflet-control-geocoder-error'); L.DomUtil.removeClass(this._container, 'leaflet-control-geocoder-options-open'); L.DomUtil.removeClass(this._container, 'leaflet-control-geocoder-options-error'); this._input.blur(); // mobile: keyboard shouldn't stay expanded this.fire('collapse'); }, _clearResults: function() { L.DomUtil.addClass(this._alts, 'leaflet-control-geocoder-alternatives-minimized'); this._selection = null; L.DomUtil.removeClass(this._errorElement, 'leaflet-control-geocoder-error'); L.DomUtil.removeClass(this._container, 'leaflet-control-geocoder-options-open'); L.DomUtil.removeClass(this._container, 'leaflet-control-geocoder-options-error'); }, _createAlt: function(result, index) { var li = L.DomUtil.create('li', ''), a = L.DomUtil.create('a', '', li), icon = this.options.showResultIcons && result.icon ? L.DomUtil.create('img', '', a) : null, text = result.html ? undefined : document.createTextNode(result.name), mouseDownHandler = function mouseDownHandler(e) { // In some browsers, a click will fire on the map if the control is // collapsed directly after mousedown. To work around this, we // wait until the click is completed, and _then_ collapse the // control. Messy, but this is the workaround I could come up with // for #142. this._preventBlurCollapse = true; L.DomEvent.stop(e); this._geocodeResultSelected(result); L.DomEvent.on( li, 'click', function() { if (this.options.collapsed) { this._collapse(); } else { this._clearResults(); } }, this ); }; if (icon) { icon.src = result.icon; } li.setAttribute('data-result-index', index); if (result.html) { a.innerHTML = a.innerHTML + result.html; } else { a.appendChild(text); } // Use mousedown and not click, since click will fire _after_ blur, // causing the control to have collapsed and removed the items // before the click can fire. L.DomEvent.addListener(li, 'mousedown touchstart', mouseDownHandler, this); return li; }, _keydown: function(e) { var _this = this, select = function select(dir) { if (_this._selection) { L.DomUtil.removeClass(_this._selection, 'leaflet-control-geocoder-selected'); _this._selection = _this._selection[dir > 0 ? 'nextSibling' : 'previousSibling']; } if (!_this._selection) { _this._selection = _this._alts[dir > 0 ? 'firstChild' : 'lastChild']; } if (_this._selection) { L.DomUtil.addClass(_this._selection, 'leaflet-control-geocoder-selected'); } }; switch (e.keyCode) { // Escape case 27: if (this.options.collapsed) { this._collapse(); } else { this._clearResults(); } break; // Up case 38: select(-1); break; // Up case 40: select(1); break; // Enter case 13: if (this._selection) { var index = parseInt(this._selection.getAttribute('data-result-index'), 10); this._geocodeResultSelected(this._results[index]); this._clearResults(); } else { this._geocode(); } break; default: return; } L.DomEvent.preventDefault(e); }, _change: function() { var v = this._input.value; if (v !== this._lastGeocode) { clearTimeout(this._suggestTimeout); if (v.length >= this.options.suggestMinLength) { this._suggestTimeout = setTimeout( L.bind(function() { this._geocode(true); }, this), this.options.suggestTimeout ); } else { this._clearResults(); } } } }); function geocoder(options) { return new Geocoder(options); } L.Util.extend(Geocoder, geocoders); L.Util.extend(L.Control, { Geocoder: Geocoder, geocoder: geocoder }); return Geocoder; }(L)); //# sourceMappingURL=Control.Geocoder.js.map
// ----------------------------------------------------------------------- // Eros Fratini - eros@recoding.it // jqprint 0.3 // // - 19/06/2009 - some new implementations, added Opera support // - 11/05/2009 - first sketch // // Printing plug-in for jQuery, evolution of jPrintArea: http://plugins.jquery.com/project/jPrintArea // requires jQuery 1.3.x // // Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php //------------------------------------------------------------------------ (function ($) { var opt; $.fn.jqprint = function (options) { opt = $.extend({}, $.fn.jqprint.defaults, options); var $element = (this instanceof jQuery) ? this : $(this); if (opt.operaSupport && $.browser.opera) { var tab = window.open("", "jqPrint-preview"); tab.document.open(); var doc = tab.document; } else { var $iframe = $("<iframe />"); if (!opt.debug) { $iframe.css({position: "absolute", width: "0px", height: "0px", left: "-600px", top: "-600px"}); } $iframe.appendTo("body"); var doc = $iframe[0].contentWindow.document; } if (opt.importCSS) { if ($("link[media=print]").length > 0) { $("link[media=print]").each(function () { doc.write("<link type='text/css' rel='stylesheet' href='" + $(this).attr("href") + "' media='print' />"); }); } else { $("link").each(function () { doc.write("<link type='text/css' rel='stylesheet' href='" + $(this).attr("href") + "' />"); }); } } if (opt.printContainer) { doc.write($element.outer()); } else { $element.each(function () { doc.write($(this).html()); }); } doc.close(); (opt.operaSupport && $.browser.opera ? tab : $iframe[0].contentWindow).focus(); setTimeout(function () { (opt.operaSupport && $.browser.opera ? tab : $iframe[0].contentWindow).print(); if (tab) { tab.close(); } }, 1000); } $.fn.jqprint.defaults = { debug: false, importCSS: true, printContainer: true, operaSupport: true }; // Thanks to 9__, found at http://users.livejournal.com/9__/380664.html jQuery.fn.outer = function () { return $($('<div></div>').html(this.clone())).html(); } })(jQuery);
var Polyline = require('../../../../src/geo/geometry-models/polyline'); var SharedTestsForPathViews = require('./shared-tests-for-path-views'); var createMapView = require('./create-map-view'); var CoordinatesComparator = require('./coordinates-comparator'); module.exports = function (MapView, PathView) { SharedTestsForPathViews.call(this, Polyline, MapView, PathView); describe('expandable polylines', function () { beforeEach(function () { this.mapView = createMapView(MapView); this.mapView.render(); this.geometry = new Polyline({ editable: true, expandable: true }, { latlngs: [ [0, 0], [10, 0], [10, 10], [0, 10] ] }); this.geometryView = new PathView({ model: this.geometry, mapView: this.mapView }); this.geometryView.render(); }); it('should render markers for each vertex, the path, and middle points', function () { var paths = this.mapView.getPaths(); var markers = this.mapView.getMarkers(); expect(paths.length).toEqual(1); expect(markers.length).toEqual(7); // 4 markers + 3 middle points // Markers expect(markers[0].getCoordinates()).toEqual({ lat: 0, lng: 0 }); expect(markers[0].isDraggable()).toBe(true); expect(markers[1].getCoordinates()).toEqual({ lat: 10, lng: 0 }); expect(markers[1].isDraggable()).toBe(true); expect(markers[2].getCoordinates()).toEqual({ lat: 10, lng: 10 }); expect(markers[2].isDraggable()).toBe(true); expect(markers[3].getCoordinates()).toEqual({ lat: 0, lng: 10 }); expect(markers[3].isDraggable()).toBe(true); // Middle points // Coordinates have different precissions and we just check they are similar expect(CoordinatesComparator.areCoordinatesSimilar( [ markers[4].getCoordinates() ], [ { lat: 5, lng: 0 } ]) ).toBeTruthy(); expect(markers[4].isDraggable()).toBe(true); expect(CoordinatesComparator.areCoordinatesSimilar( [ markers[5].getCoordinates() ], [ { lat: 10, lng: 5 } ]) ).toBeTruthy(); expect(markers[5].isDraggable()).toBe(true); expect(CoordinatesComparator.areCoordinatesSimilar( [ markers[6].getCoordinates() ], [ { lat: 5, lng: 10 } ]) ).toBeTruthy(); expect(markers[6].isDraggable()).toBe(true); expect(paths[0].getCoordinates()).toEqual([ { lat: 0, lng: 0 }, { lat: 10, lng: 0 }, { lat: 10, lng: 10 }, { lat: 0, lng: 10 } ]); }); it('should re-render middle points when map is zoomed', function () { spyOn(this.mapView, 'removeMarker'); spyOn(this.mapView, 'addMarker'); this.mapView.trigger('zoomend'); expect(this.mapView.removeMarker.calls.count()).toEqual(3); expect(this.mapView.addMarker.calls.count()).toEqual(3); }); }); };
let getCellsFromMetadata = function(nbCells) { let arrCell = []; for (let [i, nbCell] of nbCells.entries()) { if (nbCell.metadata.autorun) { arrCell.push(i); } } return arrCell; };
import Camera from '../camera/index.js'; import RigidBody from '../physics/rigidbody.js'; import {rotateAroundY} from '../math/index.js'; function Player() { this.camera = new Camera(this, 70.0); this.rigidbody = new RigidBody(this); this.position = vec3.fromValues(-6.0, -13.0, -10.0); this.turnAngle = 0.0; this.rotation = quat.create(); this.moveAxis = [0.0, 0.0]; this.currentMoveSpeed = [0.0, 0.0]; document.addEventListener('keydown', (event) => this.keyHandler(event, true), false); document.addEventListener('keyup', (event) => this.keyHandler(event, false), false); document.addEventListener('mousemove', (event) => this.mouseMoved(event), false); } Player.prototype.keyHandler = function(event, value) { if (event.keyCode == 68) { this.moveAxis[0] = value ? -1.0 : 0.0; } else if (event.keyCode == 65) { this.moveAxis[0] = value ? 1.0 : 0.0; } else if (event.keyCode == 83) { this.moveAxis[1] = value ? -1.0 : 0.0; } else if (event.keyCode == 87) { this.moveAxis[1] = value ? 1.0 : 0.0; } }; const ROTATE_SPEED = 0.02; Player.prototype.mouseMoved = function(event) { const deltaTurn = -event.movementX * ROTATE_SPEED; quat.rotateY(this.rotation, this.rotation, deltaTurn); this.turnAngle += deltaTurn; this.camera.rotate(-event.movementY * ROTATE_SPEED); }; const MAX_MOVE_SPEED = 8.0; const MOVE_ACCELERATION = MAX_MOVE_SPEED * 4.0; const DECELERATION_RATE = MAX_MOVE_SPEED * 2.0; Player.prototype.update = function(deltaTime) { const movement = vec3.fromValues(0.0, 0.0, 0.0); if (this.moveAxis[0] == 0.0) { this.currentMoveSpeed[0] -= (this.currentMoveSpeed[0] * DECELERATION_RATE * deltaTime); } else { this.currentMoveSpeed[0] += this.moveAxis[0] * MOVE_ACCELERATION * deltaTime; } this.currentMoveSpeed[0] = Math.min(MAX_MOVE_SPEED, Math.max(-MAX_MOVE_SPEED, this.currentMoveSpeed[0])); movement[0] = this.currentMoveSpeed[0] * deltaTime; if (this.moveAxis[1] == 0.0) { this.currentMoveSpeed[1] -= (this.currentMoveSpeed[1] * DECELERATION_RATE * deltaTime); } else { this.currentMoveSpeed[1] += this.moveAxis[1] * MOVE_ACCELERATION * deltaTime; } this.currentMoveSpeed[1] = Math.min(MAX_MOVE_SPEED, Math.max(-MAX_MOVE_SPEED, this.currentMoveSpeed[1])); movement[2] = this.currentMoveSpeed[1] * deltaTime; vec3.add(this.position, this.position, rotateAroundY(movement, this.turnAngle)); }; Player.prototype.getPosition = function() { return this.position; }; Player.prototype.getRotation = function() { return this.rotation; }; export {Player as default};
import { roseColor, primaryColor, infoColor, successColor, warningColor, dangerColor } from "assets/jss/material-kit-react.js"; const navPillsStyle = theme => ({ root: { marginTop: "20px", paddingLeft: "0", marginBottom: "0", overflow: "visible !important", lineHeight: "24px", textTransform: "uppercase", fontSize: "12px", fontWeight: "500", position: "relative", display: "block", color: "inherit" }, flexContainer: { [theme.breakpoints.down("md")]: { display: "flex", flexWrap: "wrap" } }, displayNone: { display: "none !important" }, fixed: { overflow: "visible !important" }, horizontalDisplay: { display: "block" }, pills: { float: "left", position: "relative", display: "block", borderRadius: "30px", minWidth: "100px", textAlign: "center", transition: "all .3s", padding: "10px 15px", color: "#555555", height: "auto", opacity: "1", maxWidth: "100%", margin: "0 5px" }, pillsWithIcons: { borderRadius: "4px" }, tabIcon: { width: "30px", height: "30px", display: "block", margin: "15px 0 !important", "&, & *": { letterSpacing: "normal !important" } }, horizontalPills: { width: "100%", float: "none !important", "& + button": { margin: "10px 0" } }, contentWrapper: { marginTop: "20px" }, primary: { "&,&:hover": { color: "#FFFFFF", backgroundColor: primaryColor, boxShadow: "0 4px 20px 0px rgba(0, 0, 0, 0.14), 0 7px 10px -5px rgba(0, 61, 51, 0.4)" } }, info: { "&,&:hover": { color: "#FFFFFF", backgroundColor: infoColor, boxShadow: "0 4px 20px 0px rgba(0, 0, 0, 0.14), 0 7px 10px -5px rgba(76, 175, 80, 0.4)" } }, success: { "&,&:hover": { color: "#FFFFFF", backgroundColor: successColor, boxShadow: "0 2px 2px 0 rgba(76, 175, 80, 0.14), 0 3px 1px -2px rgba(76, 175, 80, 0.2), 0 1px 5px 0 rgba(76, 175, 80, 0.12)" } }, warning: { "&,&:hover": { color: "#FFFFFF", backgroundColor: warningColor, boxShadow: "0 4px 20px 0px rgba(0, 0, 0, 0.14), 0 7px 10px -5px rgba(255, 152, 0, 0.4)" } }, danger: { "&,&:hover": { color: "#FFFFFF", backgroundColor: dangerColor, boxShadow: "0 4px 20px 0px rgba(0, 0, 0, 0.14), 0 7px 10px -5px rgba(255, 152, 0, 0.4)" } }, rose: { "&,&:hover": { color: "#FFFFFF", backgroundColor: roseColor, boxShadow: "0 4px 20px 0px rgba(0, 0, 0, 0.14), 0 7px 10px -5px rgba(233, 30, 99, 0.4)" } }, alignCenter: { alignItems: "center", justifyContent: "center" }, tabWrapper: { color: "inherit", position: "relative", fontSize: "12px", lineHeight: "24px", fontWeight: "500", textTransform: "uppercase", "&,& *": { letterSpacing: "normal" } } }); export default navPillsStyle;
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); var crypto_1 = tslib_1.__importDefault(require("crypto")); var ShopifyErrors = tslib_1.__importStar(require("../error")); /** * A timing safe string comparison utility. * * @param strA any string, array of strings, or object with string values * @param strB any string, array of strings, or object with string values */ function safeCompare(strA, strB) { if (typeof strA === typeof strB) { var buffA = void 0; var buffB = void 0; if (typeof strA === 'object' && typeof strB === 'object') { buffA = Buffer.from(JSON.stringify(strA)); buffB = Buffer.from(JSON.stringify(strB)); } else { buffA = Buffer.from(strA); buffB = Buffer.from(strB); } if (buffA.length === buffB.length) { return crypto_1.default.timingSafeEqual(buffA, buffB); } } else { throw new ShopifyErrors.SafeCompareError("Mismatched data types provided: " + typeof strA + " and " + typeof strB); } return false; } exports.default = safeCompare;
import 'babel-polyfill'; import 'es6-shim'; import 'isomorphic-fetch'; import './containers/Root/StartUp.spec';
/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @format * @emails oncall+relay */ 'use strict'; const GraphQLCompilerContext = require('../../../core/GraphQLCompilerContext'); const GraphQLIRPrinter = require('../../../core/GraphQLIRPrinter'); const RelayViewerHandleTransform = require('../RelayViewerHandleTransform'); const {buildASTSchema, parse} = require('graphql'); const { TestSchema, generateTestsFromFixtures, parseGraphQLText, } = require('relay-test-utils'); describe('RelayViewerHandleTransform', () => { generateTestsFromFixtures( `${__dirname}/fixtures/viewer-handle-transform`, text => { const {definitions} = parseGraphQLText(TestSchema, text); const context = new GraphQLCompilerContext(TestSchema) .addAll(definitions) .applyTransforms([RelayViewerHandleTransform.transform]); const documents = []; context.forEachDocument(doc => { documents.push(GraphQLIRPrinter.print(doc)); }); return documents.join('\n'); }, ); it('ignores schemas where viewer is not an object', () => { const schema = buildASTSchema( parse(` type Query { viewer: Viewer } scalar Viewer `), {assumeValid: true}, ); const text = ` query TestQuery { viewer } `; const {definitions} = parseGraphQLText(schema, text); const context = new GraphQLCompilerContext(schema) .addAll(definitions) .applyTransforms([RelayViewerHandleTransform.transform]); const TestQuery = context.getRoot('TestQuery'); const viewer = TestQuery.selections[0]; expect(viewer.name).toBe('viewer'); expect(viewer.kind).toBe('ScalarField'); // No handle is added expect(viewer.handles).toBe(undefined); }); it('ignores schemas where viewer has an id', () => { const schema = buildASTSchema( parse(` type Query { viewer: Viewer } type Viewer { id: ID! } `), {assumeValid: true}, ); const text = ` query TestQuery { viewer { id } } `; const {definitions} = parseGraphQLText(schema, text); const context = new GraphQLCompilerContext(schema) .addAll(definitions) .applyTransforms([RelayViewerHandleTransform.transform]); const TestQuery = context.getRoot('TestQuery'); const viewer = TestQuery.selections[0]; expect(viewer.name).toBe('viewer'); expect(viewer.kind).toBe('LinkedField'); // No handle is added expect(viewer.handles).toBe(undefined); }); });
var searchData= [ ['aabb_352',['AABB',['../classmingfx_1_1_a_a_b_b.html',1,'mingfx']]] ];
import React from "react" import { InputLabel, FormGroup, TextField, Grid, Select, MenuItem, } from "@material-ui/core" export const getRangeFilterOptions = fieldLabel => { return { filter: true, filterType: "custom", filterOptions: { names: [], logic(value, filters) { /** * Necessary for clearing non number values * and parsing to number (e.g. localized restricted price "(R) 1,000") */ const clearedValue = typeof value === "string" ? parseInt(value.replace(/[\D]/gi, ""), 10) : value if (filters[0] && filters[1]) { return clearedValue < filters[0] || clearedValue > filters[1] } else if (filters[0]) { return clearedValue < filters[0] } else if (filters[1]) { return clearedValue > filters[1] } return false }, display: (filters, onChange, filterIndex, column) => ( <RangeFilter filters={filters} onChange={onChange} filterIndex={filterIndex} column={column} fieldLabel={fieldLabel} /> ), }, customFilterListOptions: { render: filterVal => { if (filterVal[0] && filterVal[1]) { return `Min ${fieldLabel}: ${filterVal[0]}, Max ${fieldLabel}: ${filterVal[1]}` } else if (filterVal[0]) { return `Min ${fieldLabel}: ${filterVal[0]}` } else if (filterVal[1]) { return `Max ${fieldLabel}: ${filterVal[1]}` } return [] }, update: (filterList, filterPos, index) => { if (filterPos === 0) { filterList[index].splice(filterPos, 1, "") } else if (filterPos === 1) { filterList[index].splice(filterPos, 1) } else if (filterPos === -1) { filterList[index] = [] } return filterList }, }, } } const PriceFilterOperator = Object.freeze({ GT: 0, GTE: 1, LT: 2, LTE: 3, toString: val => { switch (val) { case PriceFilterOperator.GT: return ">" case PriceFilterOperator.GTE: return ">=" case PriceFilterOperator.LT: return "<" case PriceFilterOperator.LTE: return "<=" default: throw Error(`Invalid price filter operator value: ${val}`) } }, }) function debounce(fn, delay) { var timer = null return function() { var context = this, args = arguments clearTimeout(timer) timer = setTimeout(function() { fn.apply(context, args) }, delay) } } class RangeFilter extends React.Component { state = { minVal: this.props.filters[this.props.filterIndex][0] || "", maxVal: this.props.filters[this.props.filterIndex][1] || "", } constructor(props) { super(props) props.filters[props.filterIndex] = ["", ""] } debouncedChange = debounce(this.props.onChange, 400) static getDerivedStateFromProps(props, state) { let { filters, filterIndex } = props let [minVal, maxVal] = filters[filterIndex] if ( (minVal === null || typeof minVal === "undefined") && (maxVal === null || typeof maxVal === "undefined") ) { filters[filterIndex] = ["", ""] return { minVal: "", maxVal: "" } } else return null } render() { let { filterIndex, column, fieldLabel } = this.props return ( <Grid xs={12}> <InputLabel shrink>{fieldLabel}</InputLabel> <FormGroup row style={{ justifyContent: "space-between", marginTop: 16 }}> <TextField style={{ flex: "0 1 45%", }} type="number" placeholder="Min" value={this.state.minVal} onChange={evt => { this.setState({ minVal: evt.target.value }) this.debouncedChange( [evt.target.value, this.state.maxVal], filterIndex, column ) }} /> <TextField style={{ flex: "0 1 45%", }} type="number" placeholder="Max" value={this.state.maxVal} onChange={evt => { this.setState({ maxVal: evt.target.value }) this.debouncedChange( [this.state.minVal, evt.target.value], filterIndex, column ) }} /> </FormGroup> </Grid> ) } } class PriceFilter extends React.Component { state = { operator: this.props.filters[this.props.filterIndex][0] || PriceFilterOperator.GTE, amount: this.props.filters[this.props.filterIndex][1] || "", } constructor(props) { super(props) props.filters[props.filterIndex] = [PriceFilterOperator.GTE, ""] } debouncedChange = debounce(this.props.onChange, 400) static getDerivedStateFromProps(props, state) { let { filters, filterIndex } = props let [operator, amount] = filters[filterIndex] //set initial values if ( (operator === null || typeof operator === "undefined") && (amount === null || typeof amount === "undefined") ) { //need to set value in props as well, otherwise this will be triggered again after //a reset, which causes the state-based updating on the amount field to fail the first time filters[filterIndex] = [PriceFilterOperator.GTE, ""] return { operator: PriceFilterOperator.GTE, amount: "" } } else return null } render() { let { filterIndex, column } = this.props return ( <Grid xs={12}> <InputLabel shrink>Price</InputLabel> <FormGroup row style={{ justifyContent: "space-between", marginTop: 16 }}> <Select style={{ flex: "0 1 20%", textAlign: "center", }} value={this.state.operator} onChange={evt => { this.setState({ operator: evt.target.value }) this.debouncedChange( [evt.target.value, this.state.amount], filterIndex, column ) }} > <MenuItem value={PriceFilterOperator.GT}>&gt;</MenuItem> <MenuItem value={PriceFilterOperator.GTE}>&gt;=</MenuItem> <MenuItem value={PriceFilterOperator.LT}>&lt;</MenuItem> <MenuItem value={PriceFilterOperator.LTE}>&lt;=</MenuItem> </Select> <TextField style={{ flex: "0 1 75%" }} type="number" value={this.state.amount} onChange={evt => { this.setState({ amount: evt.target.value }) this.debouncedChange( [this.state.operator, evt.target.value], filterIndex, column ) }} /> </FormGroup> </Grid> ) } } export const PRICE_FILTER_OPTIONS = { filter: true, filterType: "custom", customFilterListOptions: { render: filterVal => filterVal[1] === "" ? [] : `${PriceFilterOperator.toString(filterVal[0])} ${filterVal[1]}`, }, filterOptions: { display: (filters, onChange, filterIndex, column) => { return ( <PriceFilter filters={filters} onChange={onChange} filterIndex={filterIndex} column={column} /> ) }, logic: (price, filter) => { price = Number(price.replace(/\D/g, "")) let [operator, amount] = filter let include = true //skip filtering if user hasn't actually entered anything if (amount !== null && typeof amount !== "undefined") { switch (operator) { case PriceFilterOperator.GT: include = price > amount break case PriceFilterOperator.GTE: include = price >= amount break case PriceFilterOperator.LT: include = price < amount break case PriceFilterOperator.LTE: include = price <= amount break } } //logic wants to know what we DONT want to show return !include }, }, }
import DegreeModule from './DegreeModule'; export default DegreeModule; export { DegreeModule };
//Gestion d'utilisateurs connectés ( function( $ ) { //-Déclaration de variables globales- var imageActuelle = 0, btn, link, domain = 'http://localhost/curl/index.php', //http://curl.vinders.be/index.php rondChargement = "data:image/gif;base64,R0lGODlhFAAUAPd1AC9UujZav1ZxsENjtTdauICp/4Cq/3+o/3WY4maAtmqGwWmFwH6n/DNXumJ6rGN7rn+p/4Co/Xyj9X+n/n+m91x2rmyKyH6k83uax4Cp/oKr/4Cp/YSu/4St/116unyj9n6m/IGn8nKT2GF5qmN6qmR9r0hmsy9TuEdpxGuHwnCOw3CV5XKS2H6l9Hyl+XCY8nGa8ktx0XqYyXqj92iGxmV+tGJ7rEty0jBUu22LyXKU2nuZx36m93+o/n6l836k8myKyX+h2ztevIOq92uJx2Z/tHWRwWJ5q2WEy4Kk4GB3qGZ/tYCgz32j7HeUwXubyl53rXWUyX+o/ICi4nWSxH6k9GF5q3uayXGR1WZ+s3OOuYKl4H6k7n6cy3uaymuJxWN6rX2k9X+p/TRXui9TuYGo8nea5WV/s2B3p3eUw2J5rICg0IKk4X+i3X2g3jNYvVdysWaHy1h6y01vx3qc2ICq/jNWui5TuH+h322LymmFwX2k83SQv2N7rEpotGR8rWGE02WN6HOU1nyl/CpOtWF+vi5RtnmYy3iXx3WTxmaExj1ixn2bymyGt0drxlRvrnOV2ThbuYOp82WN5FZytV93rj9lx26S5Xmb1nCLunym/mB4qzVav05yyjRZvn2cymF4q2V/tDxfvYKq+3ia21x0rGSCxDRYvX2g3Xib52B4qHqYx4Kl3VRzvmaK2HaSwlF0yXSRxGN9si1Rty5TuVx1rnCOyYGr/0hrxDFWuoOq82qJ0FR62XeVx1JtsDlewmeBtnmYyGaFy3iXznmWxF6D2GB4rGmGwW2JwGB5r4Cl7jtduW6KvU912IOt/16F4naX13aTxHOd8n+m9XWe9nyj9Exvw3WQu1JvuYGo9C5SuIGq/3ih+HCLvHSV01p/1nmYzF51rVB31nie6DxeuztgxUhntn+l9GR7qmKH2myKxnOb9HWe+F5/xnaSwIGo+GuHvXSSy1VwrkBmyD9kyGJ5qWV/tkxvyGN8rXia2XGU4ICi3V94rmKL5GB3qwAAACH/C05FVFNDQVBFMi4wAwEAAAAh/wtYTVAgRGF0YVhNUEI/eHBhY2tldCAyQjhGMyIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpCNTBGREFBQjU3NGtldCBlbmQ9InIiPz4AIfkEBQoAdQAsAAAAABQAFAAAB/+AdYKCaGoJKTQecBUlg46DVgoIEh0vMQ0EAwI2j4JnIgwGBRwwMQAAOGMmUI81ZqIHEUMrc0IBZCdvcmeDDiwGoiFsGEZ1UUgobzczLFaCCiAQEG5rnSpxLgcgCyRgCAYHIWmdgjJlBwYIVgkfBRtt5IN0GwUfCQs9BTxX8YI7PAV6LPgipkCLfoN+aDAA5IuoMFoQ1vFRIEMOfPr49fsXcAE7d1sQBqFn78i3cF3iOQmBDsGDOtCkcfHSiUkTaSAUCBohAkKBAiGm7KBi5EmSEAUMQBDhYFAWLD5jUbhQhUKEAwUg6FjyqAgoUT6zJmUgogg5B5IkTJBiYIIEBAoNRiB8cI+IBY9HlDwKBAAh+QQJCgAbACwIAAAADAAOAAAIcQAX5LGgJ8GDDQgTTshQZ4IEBAocJNwAoUCBigYYQEqQkMKeCxQiHNCgCVClhHw2YMAjaVCgAH76TETISBAnOw0EzER4yNEdAAP+7NygKAAAAhWGJopEyNCjoZk6LbJEaWijS5MmFRqKaOhETF6HbgoIACH5BAUKABoALAgAAAAMABQAAAiiABfksaAnwQMNCBNOyFBnggQEChwk1AChQIGKBhiICJWQwp4LFCIcKGAgVQ2EGPhowIAnxEUDLEZMRLgKFQQIIBSomqnhU4gDBhBI5MlqQ4EPCXiuHMWhQwqlGla8gEEDKqwYNzwojSUKgB0BSk0FAECgAk8VKO4AGFBipgxXnk40AIvw1SdSIWbEOGXCRsIWCQ+4aFUKKkJZMwsYngmKxMyAACH5BAUKABAALAQACAAQAAwAAAh+ACEIHEhQII8CPRYUXAjhRwEDQBgW9FGgTg6JA3ccTIhRYJANBT4kgPBJIjFdBwwgeABBWbCFwwANugVCAQQNAgX1QsbMljBcvwIx0OEAQoGBQ4otExKAVi5Pu4At5NBsFgAAOBr4ScawA69ZDQgMENBnobEExzz4ElDrz8KAACH5BAUKAA4ALAAACQASAAsAAAiCAB1sKDDNgcGDCBESueWs2rWEECEiikjRILSKFHUdougkhEESCxzcombNFkQmTSBAOKhDWgBtuJBEiWbkSZIQBQxAEGEwAbZZuWgFIOAgG4UIBwpA0LHkIBQ/DXAAIPTMGYScDEQUSdhHwAAChqpOkIBAwQiKJWoJKJRjQYIjSg4GBAAh+QQJCgAYACwAAAMACwARAAAIegAxYCgisKBBKxi2OTPIUCAehqAaSsTgrWGKDhxG9WrogZe4b40a+ppFiFy3hgLsABCVqGEFAgACKGrYZwCAOyjAoWxwotw4Rgz7mFjEzVmIKTuoFAy3y9mBAxEoXKhSMJQIBgYKQChQwKADBQgkTJBioOGDBAuIWAgIACH5BAUKABgALAAAAAALABQAAAigADEIFIgO1MCDCDHUOVgE0sFtA0uZY6fhQAQK53xg6ONnlqd1kkhdcSdQQAM7tNodOvhnAIA7jlQgrEAAQABFCR8ZIhQpUcJCz56lS4hBHQdn77QkXNCjAI8rCRN8KLBhS8IjCAwcCNEloQIQECBw8YJwhAgIBQqEmLKDihGBWbCgtUjhQpWBRUQwMFAAbYGDDhQgkDBBioGEDxIsIGIhIAAh+QQFCgAMACwAAAAAEAALAAAIcwAZCBRYD18teZQKLbDnb+DAPgIGEDA0b5JDh/xMjMEBgBC9fhcFAtP36wSZAATurQjpgEUHbotQCIvXDV6wfAy2HWCgAMQBZ/mGhRwIBoGBA2WIDR2Y4EOBDfuWDlzQowCPK1IFfhFToEVWrQYKhPnKICAAOw=="; //-Méthodes- //--afficher le chargement lors d'une publication var cliquerPublier = function(e){ $(".toolbar button").css({color:'rgba(40,60,80,.2)',position:'relative'}).append('<b id="loading_curl"></b>'); $(".toolbar b").css({display:'inline-block',background:"url('"+rondChargement+"') center no-repeat",width:20,height:20,position:'absolute',left:'50%',top:'50%',marginLeft:'-10px',marginTop:'-10px'}); };//fin cliquerPublier //--afficher les boutons de changement d'image lors d'une publication var creerGalerie = function(){ $("#prev").show(); $("#next").show(); $("#prev")[0].addEventListener('click',changerPrecedent,false); $("#next")[0].addEventListener('click',changerSuivant,false); };//fin creerGalerie var changerPrecedent = function(e){ e.preventDefault(); if(imageActuelle > 0){ --imageActuelle; changerImage(imageActuelle); }else{ var nombreImages = $(".img_gallery").length; imageActuelle = nombreImages - 1; changerImage(imageActuelle); } return false; };//fin changerPrecedent var changerSuivant = function(e){ e.preventDefault(); var nombreImages = $(".img_gallery").length; if(imageActuelle < (nombreImages - 1)){ ++imageActuelle; changerImage(imageActuelle); }else{ imageActuelle = 0; changerImage(imageActuelle); } return false; };//fin changerSuivant var changerImage = function(image){ var $img = $(".curl_content img"), url = $(".img_gallery")[image].getAttribute('value'); $img.fadeOut('fast',function(){$img[0].setAttribute('src',url);}); $("#img_input")[0].setAttribute('value',url); $img.fadeIn('slow'); };//fin changerImage //--bloquer l'actualisation en cas de clic de modification var modifierPublication = function(e){ $('footer').append('<b id="loading_curl"></b>'); };//fin modifierPublication //--confirmer la suppression d'un article sans changer de page var effacerPublication = function(e){ e.preventDefault(); var $url = $(this).attr('href'); var arrayurl = $url.split('/'); var id = arrayurl[arrayurl.length-1]; $("body").append('<div id="dialog_box" class="spr"><p>Êtes-vous sûr de supprimer cet article&nbsp;?</p><button class="s'+id+'">Supprimer</button><a class="btn_gray" href="#">Annuler</a></div><div id="dialog_back"></div>'); link = $("#dialog_box a"); btn = $("#dialog_box button"); link.css({marginLeft:8,position:'relative',top:'1px'}); btn.css({borderRadius:'3px',lineHeight:1.8}); link[0].addEventListener('click',fermerBoite,false); btn[0].addEventListener('click',confirmerSuppression,false); };//fin effacerPublication var confirmerSuppression = function(e){ e.preventDefault(); var $id = parseInt(e.target.getAttribute('class').substr(1),10), url = domain+'/ajax/supprimer/'+$id; $.ajax({ url: url, success: function(){ location.reload(false); }, error: function (){ window.location = domain+"/article/supprimer/"+$id; } }); return false; };//fin confirmerSuppression //--effacer un ami sans quitter la liste d'amis var effacerAmi = function(e){ e.preventDefault(); var $url = $(this).attr('href'); var arrayurl = $url.split('/'); var id = arrayurl[arrayurl.length-1]; $("body").append('<div id="dialog_box" class="rupt"><p>Êtes-vous sûr de retirer cet ami&nbsp;?</p><button class="s'+id+'">Supprimer</button><a class="btn_gray" href="#">Annuler</a></div><div id="dialog_back"></div>'); link = $("#dialog_box a"); btn = $("#dialog_box button"); link.css({marginLeft:8,position:'relative',top:'1px'}); btn.css({borderRadius:'3px',lineHeight:1.8}); link[0].addEventListener('click',fermerBoite,false); btn[0].addEventListener('click',confirmerRupture,false); return false; };//fin effacerAmi var confirmerRupture = function(e){ e.preventDefault(); var $cible = parseInt(e.target.getAttribute('class').substr(1),10), url = domain+'/ajax/rompre/'+$cible; $.ajax({ url: url, success: function(){ location.reload(false); }, error: function (){ window.location = domain+"/user/rompre/"+$cible; } }); //type:"POST",data:({cible:$cible}) return false; };//fin confirmerRupture //--fermer la boîte de confirmation en cas d'annulation var fermerBoite = function(e){ e.preventDefault(); link[0].removeEventListener('click',fermerBoite,false); if($("#dialog_box")[0].getAttribute('class') === 'rupt'){ btn[0].removeEventListener('click',confirmerRupture,false); }else{ btn[0].removeEventListener('click',confirmerSuppression,false); } document.body.removeChild(document.getElementById('dialog_box')); document.body.removeChild(document.getElementById('dialog_back')); return false; }; //--répondre aux notifications de requêtes sans changer de page var gererRequete = function(e){ e.preventDefault(); var urlarray = e.target.getAttribute('href').split('/'); var cible = urlarray[urlarray.length-1], url; switch(e.target.getAttribute('class')){ case 'btn2_blue': url = domain+'/ajax/lier/'+cible;break; case 'btn2_gray': url = domain+'/ajax/ignorer/'+cible;break; case 'btn2_red': url = domain+'/ajax/bloquer/'+cible;break; } $.ajax({ url: url, success: function(){ location.reload(false); }, error: function (){ window.location = domain+"/article/lister/wall/"+cible; } }); return false; };//fin gererRequete //actualiser pour mettre à jour amis/requêtes et publications listées var actualiser = function(){ if($("#dialog_box").length === 0 && $("textarea:focus").length === 0 && $("#loading_curl").length === 0){ location.reload(false); } }; //-Lancement- $( function () { if($(".toolbar").length > 0){ $(".toolbar button")[0].addEventListener('click',cliquerPublier,false); } if($(".img_gallery").length > 1){ creerGalerie(); } if($(".publication").length > 0){ $(".btn_suppr").each(function(){$(this).on("click",effacerPublication);}); $(".btn_modif").each(function(){$(this).on("click",modifierPublication);}); } if($(".inviter").length > 0){ $("#requests .btn2_blue,#requests .btn2_gray,#requests .btn2_red").each(function(){$(this)[0].addEventListener("click",gererRequete,false);}); } if($(".side_circle0").length > 0){ $(".btn2_gray").each(function(){$(this).on("click",effacerAmi);}); } if($(".publication").length>0 || $("#no_content").length>0 || $(".side_circle0").length>0){ setInterval(actualiser,16000); } } ); } )( jQuery );