hexsha
string
size
int64
ext
string
lang
string
max_stars_repo_path
string
max_stars_repo_name
string
max_stars_repo_head_hexsha
string
max_stars_repo_licenses
list
max_stars_count
int64
max_stars_repo_stars_event_min_datetime
string
max_stars_repo_stars_event_max_datetime
string
max_issues_repo_path
string
max_issues_repo_name
string
max_issues_repo_head_hexsha
string
max_issues_repo_licenses
list
max_issues_count
int64
max_issues_repo_issues_event_min_datetime
string
max_issues_repo_issues_event_max_datetime
string
max_forks_repo_path
string
max_forks_repo_name
string
max_forks_repo_head_hexsha
string
max_forks_repo_licenses
list
max_forks_count
int64
max_forks_repo_forks_event_min_datetime
string
max_forks_repo_forks_event_max_datetime
string
content
string
avg_line_length
float64
max_line_length
int64
alphanum_fraction
float64
46b977fba1ae9dc7855c7942fec24322fea2a83b
3,165
js
JavaScript
src/constants/types.data.js
DavidFFDAW/Poke-App
bed71ca8d68dcc5303f449f19ce7b4479bf44d49
[ "MIT" ]
1
2021-07-14T09:26:05.000Z
2021-07-14T09:26:05.000Z
src/constants/types.data.js
DavidFFDAW/Poke-App
bed71ca8d68dcc5303f449f19ce7b4479bf44d49
[ "MIT" ]
43
2021-07-12T11:12:56.000Z
2022-02-16T12:31:34.000Z
src/constants/types.data.js
DavidFFDAW/Poke-App
bed71ca8d68dcc5303f449f19ce7b4479bf44d49
[ "MIT" ]
null
null
null
export const types = { fire: { bg: 'linear-gradient(#f7c757,#d44646 80%)', font: '#fff', trad: 'Fuego' }, water: { bg: 'linear-gradient(#a5cff0,#4996d1)', font: '#fff', trad: 'Agua' }, grass: { bg: 'linear-gradient( #add19b,#5d9c3e )', font: '#fff', trad: 'Planta' }, ground: { bg: 'linear-gradient(#EBD69D,#927D44)', font: '#fff', trad: 'Tierra' }, rock: { bg: 'linear-gradient(#B8A038,#786824)', font: '#fff', trad: 'Roca' }, normal: { bg: 'linear-gradient( #C6C6A7,#A8A878 )', font: '#fff', trad: 'Normal' }, psychic: { bg: 'linear-gradient( #FA92B2,#F85888 )', font: '#fff', trad: 'Psìquico' }, poison: { bg: 'linear-gradient( #C183C1,#A040A0 )', font: '#fff', trad: 'Veneno' }, ghost: { bg: 'linear-gradient( #A292BC,#705898 )', font: '#fff', trad: 'Fantasma' }, dragon: { bg: 'linear-gradient( #A27DFA,#7038F8 )', font: '#fff', trad: 'Dragon' }, electric: { bg: 'linear-gradient( #FAE078,#F8D030 )', font: '#000', trad: 'Eléctrico' }, steel: { bg: 'linear-gradient( #D1D1E0,#B8B8D0 )', font: '#000', trad: 'Acero' }, fairy: { bg: 'linear-gradient( #F4BDC9,#EE99AC )', font: '#fff', trad: 'Hada' }, fighting: { bg: 'linear-gradient(#D67873,#C03028)', font: '#fff', trad: 'Lucha' }, bug: { bg: 'linear-gradient( #ebf0c5, #A8B820 )', font: '#000', trad: 'Bicho' }, ice: { bg: 'linear-gradient(#fff,#9feef5 80%)', font: '#000', trad: 'Hielo' }, dark: { bg: 'linear-gradient(#141414,#787878)', font: '#fff', trad: 'Siniestro' }, flying: { bg: 'linear-gradient( #C6B7F5,#A890F0 )', font: '#fff', trad: 'Volador' }, }; export const typesStrenght = { normal: [ 'none' ], fighting: [ 'normal', 'rock', 'steel', 'ice', 'dark' ], flying: [ 'fighting', 'bug', 'grass' ], poison: [ 'grass', 'fairy' ], ground: [ 'poison', 'rock', 'steel', 'fire', 'electric' ], rock: [ 'flying', 'bug', 'fire', 'ice' ], bug: [ 'grass', 'psychic', 'dark' ], ghost: [ 'ghost', 'psychic' ], steel: [ 'rock', 'ice', 'fairy' ], fire: [ 'bug', 'steel', 'grass', 'ice' ], water: [ 'ground', 'rock', 'fire' ], grass: [ 'water', 'rock', 'ground' ], electric: [ 'flying', 'water' ], psychic: [ 'fighting', 'poison' ], ice: [ 'flying', 'ground', 'grass', 'dragon' ], dragon: [ 'dragon' ], fairy: [ 'fighting', 'dragon', 'dark' ], dark: [ 'ghost', 'psychic' ], }; export const typesWeakness = { normal: [ 'fighting' ], fighting: [ 'flying', 'psychic', 'fairy' ], flying: [ 'rock', 'electric', 'ice' ], poison: [ 'ground', 'psychic' ], ground: [ 'water', 'grass', 'ice' ], rock: [ 'fighting', 'ground', 'steel', 'water', 'grass' ], bug: [ 'flying', 'rock', 'fire' ], ghost: [ 'dark', 'ghost' ], steel: [ 'fighting', 'ground', 'fire' ], fire: [ 'ground', 'rock', 'water' ], water: [ 'grass', 'electric' ], grass: [ 'poison', 'bug', 'flying', 'fire', 'ice' ], electric: [ 'ground' ], psychic: [ 'bug', 'ghost', 'dark' ], ice: [ 'fighting', 'rock', 'steel', 'fire' ], dragon: [ 'ice', 'dragon', 'fairy' ], fairy: [ 'poison', 'steel' ], dark: [ 'fighting', 'bug', 'fairy' ], // ... };
50.238095
92
0.535229
46ba3bdeff15c92db9f3f38f8ad2f8f9fd629996
1,749
js
JavaScript
js-exp/mouseclickcls.js
yosshii50/JS-Test
c5ce453bd2ce5a8e6d75a9ddaee8b73a3929baae
[ "MIT" ]
null
null
null
js-exp/mouseclickcls.js
yosshii50/JS-Test
c5ce453bd2ce5a8e6d75a9ddaee8b73a3929baae
[ "MIT" ]
null
null
null
js-exp/mouseclickcls.js
yosshii50/JS-Test
c5ce453bd2ce5a8e6d75a9ddaee8b73a3929baae
[ "MIT" ]
null
null
null
// デバッグ用メッセージ表示 class MouseClickCls { constructor( EmtDrw ) { this.EmtDrw = EmtDrw; this.CtxDrw = EmtDrw.getContext("2d"); this.lineWidth = 1; this.Color = "rgb(0, 0, 0)"; this.LastPosX = -1; this.LastPosY = -1; EmtDrw.addEventListener( 'mousedown' , event => { // マウスが押された this.MouseDownEve(event,"mousemove"); }); EmtDrw.addEventListener( 'pointerdown' , event => { // スマホが押された this.MouseDownEve(event,"pointermove"); }); EmtDrw.addEventListener( 'mouseup' , event => { // マウスが離された this.MouseUpEve(event,"mousemove"); }); EmtDrw.addEventListener( 'pointerup' , event => { // スマホが離された this.MouseUpEve(event,"pointermove"); }); //document.write("aa"); } MouseDownEve( event , EventName ){ // イベント処理開始 this.EmtDrw.addEventListener( EventName , this.OnMouseMove ); this.Painting( event ); } MouseUpEve(EventName){ // イベント処理終了 this.EmtDrw.removeEventListener( EventName , this.OnMouseMove ); } OnMouseMove = (event) => { if(event.buttons !== undefined){ if( (event.buttons & 1) != 1 ){ MouseUpEve("mousemove"); MouseUpEve("pointermove"); return; } } this.Painting( event ); } Painting( event ){ this.NowPosX = event.clientX - this.EmtDrw.getBoundingClientRect().left; this.NowPosY = event.clientY - this.EmtDrw.getBoundingClientRect().top; this.NowPosX = Math.floor( this.NowPosX ); this.NowPosY = Math.floor( this.NowPosY ); this.EmtDrw.dispatchEvent( new CustomEvent('MouseClickAj', { detail: event }) ); this.LastPosX = this.NowPosX; this.LastPosY = this.NowPosY; //document.write( event.clientX + " " + event.clientY + " aa"); } }
23.32
83
0.623785
46baecd743a942b9e8876064f9068b8f20db698b
5,636
js
JavaScript
packages/vue-jdlstudio/src/lib/nomnoml/shannar.custom.js
DanielFran/vue-jdlstudio
115046464c7bcbd0719d3aa245dcb7a7749b610d
[ "Apache-2.0" ]
null
null
null
packages/vue-jdlstudio/src/lib/nomnoml/shannar.custom.js
DanielFran/vue-jdlstudio
115046464c7bcbd0719d3aa245dcb7a7749b610d
[ "Apache-2.0" ]
9
2020-05-13T18:49:58.000Z
2020-05-13T19:12:15.000Z
packages/vue-jdlstudio/src/lib/nomnoml/shannar.custom.js
DanielFran/vue-jdlstudio
115046464c7bcbd0719d3aa245dcb7a7749b610d
[ "Apache-2.0" ]
1
2021-01-04T18:01:25.000Z
2021-01-04T18:01:25.000Z
var skanaar = skanaar || {}; skanaar.Canvas = function(canvas, callbacks) { var ctx = canvas.getContext("2d"); var mousePos = { x: 0, y: 0 }; var twopi = 2 * 3.1416; function mouseEventToPos(event) { var e = canvas; return { x: event.clientX - e.getBoundingClientRect().left - e.clientLeft + e.scrollLeft, y: event.clientY - e.getBoundingClientRect().top - e.clientTop + e.scrollTop }; } if (callbacks) { canvas.addEventListener("mousedown", function(event) { if (callbacks.mousedown) callbacks.mousedown(mouseEventToPos(event)); }); canvas.addEventListener("mouseup", function(event) { if (callbacks.mouseup) callbacks.mouseup(mouseEventToPos(event)); }); canvas.addEventListener("mousemove", function(event) { mousePos = mouseEventToPos(event); if (callbacks.mousemove) callbacks.mousemove(mouseEventToPos(event)); }); } var chainable = { stroke: function() { ctx.stroke(); return chainable; }, fill: function() { ctx.fill(); return chainable; } }; function color255(r, g, b, a) { var optionalAlpha = a === undefined ? 1 : a; var comps = [Math.floor(r), Math.floor(g), Math.floor(b), optionalAlpha]; return "rgba(" + comps.join() + ")"; } function tracePath(path, offset, s) { s = s === undefined ? 1 : s; offset = offset || { x: 0, y: 0 }; ctx.beginPath(); ctx.moveTo(offset.x + s * path[0].x, offset.y + s * path[0].y); for (var i = 1, len = path.length; i < len; i++) ctx.lineTo(offset.x + s * path[i].x, offset.y + s * path[i].y); return chainable; } return { mousePos: function() { return mousePos; }, width: function() { return canvas.width; }, height: function() { return canvas.height; }, ctx: ctx, background: function(r, g, b) { ctx.fillStyle = color255(r, g, b); ctx.fillRect(0, 0, canvas.width, canvas.height); }, clear: function() { ctx.clearRect(0, 0, canvas.width, canvas.height); }, circle: function(x, y, r) { ctx.beginPath(); if (arguments.length === 2) ctx.arc(x.x, x.y, y, 0, twopi); else ctx.arc(x, y, r, 0, twopi); return chainable; }, ellipse: function(center, rx, ry, start, stop) { if (start === undefined) start = 0; if (stop === undefined) stop = twopi; ctx.beginPath(); ctx.save(); ctx.translate(center.x, center.y); ctx.scale(1, ry / rx); ctx.arc(0, 0, rx / 2, start, stop); ctx.restore(); return chainable; }, arc: function(x, y, r, start, stop) { ctx.beginPath(); ctx.moveTo(x, y); ctx.arc(x, y, r, start, stop); return chainable; }, roundRect: function(x, y, w, h, r) { ctx.beginPath(); ctx.moveTo(x + r, y); ctx.arcTo(x + w, y, x + w, y + r, r); ctx.lineTo(x + w, y + h - r); ctx.arcTo(x + w, y + h, x + w - r, y + h, r); ctx.lineTo(x + r, y + h); ctx.arcTo(x, y + h, x, y + h - r, r); ctx.lineTo(x, y + r); ctx.arcTo(x, y, x + r, y, r); ctx.closePath(); return chainable; }, rect: function(x, y, w, h) { ctx.beginPath(); ctx.moveTo(x, y); ctx.lineTo(x + w, y); ctx.lineTo(x + w, y + h); ctx.lineTo(x, y + h); ctx.closePath(); return chainable; }, path: tracePath, circuit: function(path, offset, s) { tracePath(path, offset, s); ctx.closePath(); return chainable; }, colorNorm: function(r, g, b, a) { return color255(255 * r, 255 * g, 255 * b, a); }, color255: color255, colorObjHSL: function(hue, sat, lit) { function component(v) { var x = Math.cos(6.283 * v) / 2 + 0.5; return lit * (1 - sat + sat * x * x); } return { r: component(hue), g: component(hue - 1 / 3), b: component(hue + 1 / 3) }; }, radialGradient: function(x, y, r1, r2, colors) { var grad = ctx.createRadialGradient(x, y, r1, x, y, r2); for (var key in colors) if (colors.hasOwnProperty(key)) grad.addColorStop(key, colors[key]); return grad; } }; }; skanaar.sum = function sum(list, plucker) { var transform = { undefined: _.identity, string: function(obj) { return obj[plucker]; }, number: function(obj) { return obj[plucker]; }, function: plucker }[typeof plucker]; for (var i = 0, summation = 0, len = list.length; i < len; i++) summation += transform(list[i]); return summation; }; skanaar.hasSubstring = function hasSubstring(haystack, needle) { if (needle === "") return true; if (!haystack) return false; return haystack.indexOf(needle) !== -1; }; skanaar.format = function format(template /* variadic params */) { var parts = Array.prototype.slice.call(arguments, 1); return _.flatten(_.zip(template.split("#"), parts)).join(""); }; skanaar.vector = { dist: function(a, b) { return skanaar.vector.mag(skanaar.vector.diff(a, b)); }, add: function(a, b) { return { x: a.x + b.x, y: a.y + b.y }; }, diff: function(a, b) { return { x: a.x - b.x, y: a.y - b.y }; }, mult: function(v, factor) { return { x: factor * v.x, y: factor * v.y }; }, mag: function(v) { return Math.sqrt(v.x * v.x + v.y * v.y); }, normalize: function(v) { return skanaar.vector.mult(v, 1 / skanaar.vector.mag(v)); }, rot: function(a) { return { x: a.y, y: -a.x }; } }; export default skanaar;
26.7109
77
0.548084
46bc4f685cd0cbf0ea2999b9e31b8eb8e24b6e3a
1,223
js
JavaScript
src/api/setting.js
codeEgret/vue-hr
d17647852c93ca087c9e695a734d263e16ce7ce3
[ "MIT" ]
null
null
null
src/api/setting.js
codeEgret/vue-hr
d17647852c93ca087c9e695a734d263e16ce7ce3
[ "MIT" ]
null
null
null
src/api/setting.js
codeEgret/vue-hr
d17647852c93ca087c9e695a734d263e16ce7ce3
[ "MIT" ]
null
null
null
/* * @Author: fan * @Date: 2021-07-04 13:38:48 * @LastEditors: fan * @LastEditTime: 2021-07-18 16:15:54 * @Description: 公司和角色设置 */ import request from '@/utils/request' /** * @description 获取所有角色列表 */ export function getRoleList(params) { return request({ url: '/sys/role', params }) } /** * @description 根据 id 删除角色信息 */ export function delRole(id) { return request({ url: `/sys/role/${id}`, method: 'delete' }) } /** * @description 修改角色信息 */ export function updateRole(data) { return request({ url: `/sys/role/${data.id}`, method: 'put', data }) } /** * @description 根据 id 获取角色详细信息 */ export function getRoleDetail(id) { return request({ url: `/sys/role/${id}` }) } /** * @description 添加角色信息 */ export function addRole(data) { return request({ url: '/sys/role', method: 'post', data }) } /** * @description 根据 id 查询公司信息 */ export function getCompanyDetail(id) { return request({ url: `/company/${id}` }) } /** * 给角色分配权限 */ export function assignPerm(data) { return request({ url: '/sys/role/assignPrem', method: 'put', data }) }
15.2875
39
0.552739
46bc5880dcd995c0f131905deb26d5d43edeb578
1,356
js
JavaScript
packages/saasify-cli/lib/commands/dev.js
chrisvxd/saasify
f7fe29876e0d98c5674454cf149e4eef23e3641b
[ "MIT" ]
null
null
null
packages/saasify-cli/lib/commands/dev.js
chrisvxd/saasify
f7fe29876e0d98c5674454cf149e4eef23e3641b
[ "MIT" ]
null
null
null
packages/saasify-cli/lib/commands/dev.js
chrisvxd/saasify
f7fe29876e0d98c5674454cf149e4eef23e3641b
[ "MIT" ]
null
null
null
'use strict' const { prepareDeployment } = require('saasify-utils') const handleError = require('../handle-error') const parseProject = require('../parse-project') const spinner = require('../spinner') const zipProject = require('../zip-project') const now = require('../services/now') module.exports = (program, client) => { program .command('dev [path]') .description('Starts a local dev server for debugging your deployments') .option('-l, --listen <uri>', 'Specify a URI endpoint on which to listen') .action(async (arg, opts) => { if (arg) program.config = arg try { const project = await parseProject(program) if (program.debug) { console.log(JSON.stringify(project, null, 2)) } const zipBuffer = await zipProject(program, project) const tempDir = await spinner( prepareDeployment({ ...project, project: `localhost/${project.name}` }, zipBuffer), 'Preparing deployment' ) const hasListen = (opts.listen !== undefined) const args = [ program.debug && '--debug', hasListen && '--listen', hasListen && opts.listen, tempDir ] await now('dev', args, { cwd: tempDir }) } catch (err) { handleError(err) } }) }
27.12
78
0.575221
46bd1a64749906a0ce96e73fbbc443e599746436
1,320
js
JavaScript
src/gel-react/sport/gel-icon-volleyball.js
pkeroulas/nmos-web-router
ebf447820d202a0e0b41a42682cbf6be6e96811a
[ "Apache-2.0" ]
8
2019-11-12T17:37:16.000Z
2020-09-22T16:31:57.000Z
src/gel-react/sport/gel-icon-volleyball.js
pkeroulas/nmos-web-router
ebf447820d202a0e0b41a42682cbf6be6e96811a
[ "Apache-2.0" ]
16
2019-03-20T16:42:41.000Z
2022-02-26T09:53:48.000Z
src/gel-react/sport/gel-icon-volleyball.js
pkeroulas/nmos-web-router
ebf447820d202a0e0b41a42682cbf6be6e96811a
[ "Apache-2.0" ]
4
2019-11-30T18:04:10.000Z
2022-03-07T18:42:05.000Z
/** * Copyright 2019 British Broadcasting Corporation * * 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. */ var react = require('react') exports.default = function () { return react.createElement( 'svg', { className: 'gel-icon gel-icon-volleyball', xmlns: 'http://www.w3.org/2000/svg', width: '32', height: '32', viewBox: '0 0 32 32' }, react.createElement('path', { d: 'M6.5 13L6 7H4.5v10l5.4-2.4-2.2-2.2zM12.6 8.9c.7-.2 1.2-.6 1.6-1.2L11.5 4c-1.3.3-2.2 1.7-1.8 3s1.6 2.3 2.9 1.9zM20.5 6c1.7 0 3-1.3 3-3s-1.3-3-3-3-3 1.3-3 3 1.4 3 3 3zm0-5c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2z' }), react.createElement('path', { d: 'M13.5 26l-10 4.7V32l13-3.4 2-10.6-1-6h5l6-3-1-1.5-5 2.1-6-.6-6 2-1.4.7 2.3 2.2 3.1 3.1-1 3z' }), react.createElement('path', { d: 'M6.5 24.5V26l6-1.5v-3z' }) ) }
48.888889
256
0.662121
46bd3f75404ee5f2150acba6f7258a2bf86d0f50
389
js
JavaScript
src/utils.js
jarvisniu/JetUI
b9b6171fde1b9188f32758d97cdba9c5d75cf538
[ "MIT" ]
null
null
null
src/utils.js
jarvisniu/JetUI
b9b6171fde1b9188f32758d97cdba9c5d75cf538
[ "MIT" ]
null
null
null
src/utils.js
jarvisniu/JetUI
b9b6171fde1b9188f32758d97cdba9c5d75cf538
[ "MIT" ]
null
null
null
function convertSizeToCSS(str='') { if (str == null) { return null } else if (typeof str == 'number') { if (str == 0) return '0' else return str + 'px' } else if (/^[\d\.]+%$/.test(str)) { return str } else if (str.includes('px')) { return str } return str.trim().split(/ +/g).map(x => x + 'px').join(' ') } export { convertSizeToCSS, }
21.611111
62
0.508997
46bd71c41fc44297692bd034c11d4f84ddb52c7f
25,993
js
JavaScript
public/theme/app-assets/js/scripts/extensions/fullcalendar.min.js
rootmap/nucleusv4
5f3c206ee4214e951c122a5e110603c24252625f
[ "MIT" ]
null
null
null
public/theme/app-assets/js/scripts/extensions/fullcalendar.min.js
rootmap/nucleusv4
5f3c206ee4214e951c122a5e110603c24252625f
[ "MIT" ]
8
2020-04-30T19:54:32.000Z
2021-06-22T15:40:52.000Z
public/theme/app-assets/js/scripts/extensions/fullcalendar.min.js
rootmap/nucleusv4
5f3c206ee4214e951c122a5e110603c24252625f
[ "MIT" ]
1
2021-03-21T11:28:01.000Z
2021-03-21T11:28:01.000Z
/*! * robust-admin-theme (http://demo.pixinvent.com/robust-admin) * Copyright 2017 PIXINVENT * Licensed under the Themeforest Standard Licenses */ //$(document).ready(function(){$("#fc-default").fullCalendar({defaultDate:"2016-06-12",editable:!0,eventLimit:!0,events:[{title:"All Day Event",start:"2016-06-01"},{title:"Long Event",start:"2016-06-07",end:"2016-06-10"},{id:999,title:"Repeating Event",start:"2016-06-09T16:00:00"},{id:999,title:"Repeating Event",start:"2016-06-16T16:00:00"},{title:"Conference",start:"2016-06-11",end:"2016-06-13"},{title:"Meeting",start:"2016-06-12T10:30:00",end:"2016-06-12T12:30:00"},{title:"Lunch",start:"2016-06-12T12:00:00"},{title:"Meeting",start:"2016-06-12T14:30:00"},{title:"Happy Hour",start:"2016-06-12T17:30:00"},{title:"Dinner",start:"2016-06-12T20:00:00"},{title:"Birthday Party",start:"2016-06-13T07:00:00"},{title:"Click for Google",url:"http://google.com/",start:"2016-06-28"}]}),$("#fc-basic-views").fullCalendar({header:{left:"prev,next today",center:"title",right:"month,basicWeek,basicDay"},defaultDate:"2016-06-12",editable:!0,eventLimit:!0,events:[{title:"All Day Event",start:"2016-06-01"},{title:"Long Event",start:"2016-06-07",end:"2016-06-10"},{id:999,title:"Repeating Event",start:"2016-06-09T16:00:00"},{id:999,title:"Repeating Event",start:"2016-06-16T16:00:00"},{title:"Conference",start:"2016-06-11",end:"2016-06-13"},{title:"Meeting",start:"2016-06-12T10:30:00",end:"2016-06-12T12:30:00"},{title:"Lunch",start:"2016-06-12T12:00:00"},{title:"Meeting",start:"2016-06-12T14:30:00"},{title:"Happy Hour",start:"2016-06-12T17:30:00"},{title:"Dinner",start:"2016-06-12T20:00:00"},{title:"Birthday Party",start:"2016-06-13T07:00:00"},{title:"Click for Google",url:"http://google.com/",start:"2016-06-28"}]}),$("#fc-agenda-views").fullCalendar({header:{left:"prev,next today",center:"title",right:"month,agendaWeek,agendaDay"},defaultDate:"2016-06-12",defaultView:"agendaWeek",editable:!0,eventLimit:!0,events:[{title:"All Day Event",start:"2016-06-01"},{title:"Long Event",start:"2016-06-07",end:"2016-06-10"},{id:999,title:"Repeating Event",start:"2016-06-09T16:00:00"},{id:999,title:"Repeating Event",start:"2016-06-16T16:00:00"},{title:"Conference",start:"2016-06-11",end:"2016-06-13"},{title:"Meeting",start:"2016-06-12T10:30:00",end:"2016-06-12T12:30:00"},{title:"Lunch",start:"2016-06-12T12:00:00"},{title:"Meeting",start:"2016-06-12T14:30:00"},{title:"Happy Hour",start:"2016-06-12T17:30:00"},{title:"Dinner",start:"2016-06-12T20:00:00"},{title:"Birthday Party",start:"2016-06-13T07:00:00"},{title:"Click for Google",url:"http://google.com/",start:"2016-06-28"}]}),$("#fc-bg-events").fullCalendar({header:{left:"prev,next today",center:"title",right:"month,agendaWeek,agendaDay"},defaultDate:"2016-06-12",businessHours:!0,editable:!0,events:[{title:"Business Lunch",start:"2016-06-03T13:00:00",constraint:"businessHours"},{title:"Meeting",start:"2016-06-13T11:00:00",constraint:"availableForMeeting",color:"#257e4a"},{title:"Conference",start:"2016-06-18",end:"2016-06-20"},{title:"Party",start:"2016-06-29T20:00:00"},{id:"availableForMeeting",start:"2016-06-11T10:00:00",end:"2016-06-11T16:00:00",rendering:"background"},{id:"availableForMeeting",start:"2016-06-13T10:00:00",end:"2016-06-13T16:00:00",rendering:"background"},{start:"2016-06-24",end:"2016-06-28",overlap:!1,rendering:"background",color:"#DA4453"},{start:"2016-06-06",end:"2016-06-08",overlap:!1,rendering:"background",color:"#DA4453"}]}),$("#fc-event-colors").fullCalendar({header:{left:"prev,next today",center:"title",right:"month,agendaWeek,agendaDay"},defaultDate:"2016-06-12",businessHours:!0,editable:!0,events:[{title:"All Day Event",start:"2016-06-01",color:"#2c2b7c"},{title:"Long Event",start:"2016-06-07",end:"2016-06-10",color:"#37BC9B"},{id:999,title:"Repeating Event",start:"2016-06-09T16:00:00",color:"#37BC9B"},{id:999,title:"Repeating Event",start:"2016-06-16T16:00:00",color:"#F6BB42"},{title:"Conference",start:"2016-06-11",end:"2016-06-13",color:"#DA4453"},{title:"Meeting",start:"2016-06-12T10:30:00",end:"2016-06-12T12:30:00",color:"#DA4453"},{title:"Lunch",start:"2016-06-12T12:00:00",color:"#DA4453"},{title:"Meeting",start:"2016-06-12T14:30:00",color:"#DA4453"},{title:"Happy Hour",start:"2016-06-12T17:30:00",color:"#DA4453"},{title:"Dinner",start:"2016-06-12T20:00:00",color:"#DA4453"},{title:"Birthday Party",start:"2016-06-13T07:00:00",color:"#DA4453"},{title:"Click for Google",url:"http://google.com/",start:"2016-06-28",color:"#3BAFDA"}]}),$("#fc-external-drag").fullCalendar({header:{left:"prev,next today",center:"title",right:"month,agendaWeek,agendaDay"},editable:!0,droppable:!0,defaultDate:"2016-06-12",events:[{title:"All Day Event",start:"2016-06-01",color:"#2c2b7c"},{title:"Long Event",start:"2016-06-07",end:"2016-06-10",color:"#37BC9B"},{id:999,title:"Repeating Event",start:"2016-06-09T16:00:00",color:"#37BC9B"},{id:999,title:"Repeating Event",start:"2016-06-16T16:00:00",color:"#F6BB42"},{title:"Conference",start:"2016-06-11",end:"2016-06-13",color:"#DA4453"},{title:"Meeting",start:"2016-06-12T10:30:00",end:"2016-06-12T12:30:00",color:"#DA4453"},{title:"Lunch",start:"2016-06-12T12:00:00",color:"#DA4453"},{title:"Meeting",start:"2016-06-12T14:30:00",color:"#DA4453"},{title:"Happy Hour",start:"2016-06-12T17:30:00",color:"#DA4453"},{title:"Dinner",start:"2016-06-12T20:00:00",color:"#DA4453"},{title:"Birthday Party",start:"2016-06-13T07:00:00",color:"#DA4453"},{title:"Click for Google",url:"http://google.com/",start:"2016-06-28",color:"#3BAFDA"}],drop:function(){$("#drop-remove").is(":checked")&&$(this).remove()}}),$("#external-events .fc-event").each(function(){$(this).css({backgroundColor:$(this).data("color"),borderColor:$(this).data("color")}),$(this).data("event",{title:$.trim($(this).text()),color:$(this).data("color"),stick:!0}),$(this).draggable({zIndex:999,revert:!0,revertDuration:0})}),$("#fc-selectable").fullCalendar({header:{left:"prev,next today",center:"title",right:"month,agendaWeek,agendaDay"},defaultDate:"2016-06-12",selectable:!0,selectHelper:!0,select:function(start,end){var eventData,title=prompt("Event Title:");title&&(eventData={title:title,start:start,end:end},$("#fc-selectable").fullCalendar("renderEvent",eventData,!0)),$("#fc-selectable").fullCalendar("unselect")},editable:!0,eventLimit:!0,events:[{title:"All Day Event",start:"2016-06-01"},{title:"Long Event",start:"2016-06-07",end:"2016-06-10"},{id:999,title:"Repeating Event",start:"2016-06-09T16:00:00"},{id:999,title:"Repeating Event",start:"2016-06-16T16:00:00"},{title:"Conference",start:"2016-06-11",end:"2016-06-13"},{title:"Meeting",start:"2016-06-12T10:30:00",end:"2016-06-12T12:30:00"},{title:"Lunch",start:"2016-06-12T12:00:00"},{title:"Meeting",start:"2016-06-12T14:30:00"},{title:"Happy Hour",start:"2016-06-12T17:30:00"},{title:"Dinner",start:"2016-06-12T20:00:00"},{title:"Birthday Party",start:"2016-06-13T07:00:00"},{title:"Click for Google",url:"http://google.com/",start:"2016-06-28"}]}),$("#fc-gcal").fullCalendar({googleCalendarApiKey:"AIzaSyAAZnaZBXLqNBRXjd-82km_NO7GUItyKek",events:"en.indian#holiday@group.v.calendar.google.com",eventClick:function(event){return window.open(event.url,"gcalevent","width=700,height=600"),!1},loading:function(bool){$("#loading").toggle(bool)}}),$("#fc-json").fullCalendar({header:{left:"prev,next today",center:"title",right:"month,agendaWeek,agendaDay"},defaultDate:"2016-06-12",editable:!0,eventLimit:!0,events:{url:"../../../app-assets/data/fullcalendar/php/get-events.php",error:function(){$("#script-warning").show()}},loading:function(bool){$("#loading").toggle(bool)}});var initialLangCode="en";$("#fc-languages").fullCalendar({header:{left:"prev,next today",center:"title",right:"month,agendaWeek,agendaDay"},defaultDate:"2016-06-12",lang:initialLangCode,buttonIcons:!1,weekNumbers:!0,editable:!0,defaultView:"agendaWeek",eventLimit:!0,events:[{title:"All Day Event",start:"2016-06-01"},{title:"Long Event",start:"2016-06-07",end:"2016-06-10"},{id:999,title:"Repeating Event",start:"2016-06-09T16:00:00"},{id:999,title:"Repeating Event",start:"2016-06-16T16:00:00"},{title:"Conference",start:"2016-06-11",end:"2016-06-13"},{title:"Meeting",start:"2016-06-12T10:30:00",end:"2016-06-12T12:30:00"},{title:"Lunch",start:"2016-06-12T12:00:00"},{title:"Meeting",start:"2016-06-12T14:30:00"},{title:"Happy Hour",start:"2016-06-12T17:30:00"},{title:"Dinner",start:"2016-06-12T20:00:00"},{title:"Birthday Party",start:"2016-06-13T07:00:00"},{title:"Click for Google",url:"http://google.com/",start:"2016-06-28"}]}),$.each($.fullCalendar.langs,function(langCode){$("#lang-selector").append($("<option/>").attr("value",langCode).prop("selected",langCode==initialLangCode).text(langCode))}),$("#lang-selector").on("change",function(){this.value&&$("#fc-languages").fullCalendar("option","lang",this.value)}),$("#fc-timezones").fullCalendar({header:{left:"prev,next today",center:"title",right:"month,agendaWeek,agendaDay"},defaultDate:"2016-06-12",editable:!0,selectable:!0,eventLimit:!0,events:{url:"../../../app-assets/data/fullcalendar/php/get-events.php",error:function(){$("#script-warning").show()}},loading:function(bool){$("#loading").toggle(bool)},eventRender:function(event,el){event.start.hasZone()&&el.find(".fc-title").after($('<div class="tzo"/>').text(event.start.format("Z")))},dayClick:function(date){},select:function(startDate,endDate){}}),$.getJSON("../../../app-assets/data/fullcalendar/php/get-timezones.php",function(timezones){$.each(timezones,function(i,timezone){"UTC"!=timezone&&$("#timezone-selector").append($("<option/>").text(timezone).attr("value",timezone))})}),$("#timezone-selector").on("change",function(){$("#fc-timezones").fullCalendar("option","timezone",this.value||!1)})}); /*! * robust-admin-theme (http://demo.pixinvent.com/robust-admin) * Copyright 2017 PIXINVENT * Licensed under the Themeforest Standard Licenses */ $(document).ready(function() { $("#fc-default").fullCalendar({ defaultDate: "2016-06-12", editable: !0, eventLimit: !0, events: [{ title: "All Day Event", start: "2016-06-01" }, { title: "Long Event", start: "2016-06-07", end: "2016-06-10" }, { id: 999, title: "Repeating Event", start: "2016-06-09T16:00:00" }, { id: 999, title: "Repeating Event", start: "2016-06-16T16:00:00" }, { title: "Conference", start: "2016-06-11", end: "2016-06-13" }, { title: "Meeting", start: "2016-06-12T10:30:00", end: "2016-06-12T12:30:00" }, { title: "Lunch", start: "2016-06-12T12:00:00" }, { title: "Meeting", start: "2016-06-12T14:30:00" }, { title: "Happy Hour", start: "2016-06-12T17:30:00" }, { title: "Dinner", start: "2016-06-12T20:00:00" }, { title: "Birthday Party", start: "2016-06-13T07:00:00" }, { title: "Click for Google", url: "http://google.com/", start: "2016-06-28" }] }), $("#fc-basic-views").fullCalendar({ header: { left: "prev,next today", center: "title", right: "month,basicWeek,basicDay" }, defaultDate: "2016-06-12", editable: !0, eventLimit: !0, events: [{ title: "All Day Event", start: "2016-06-01" }, { title: "Long Event", start: "2016-06-07", end: "2016-06-10" }, { id: 999, title: "Repeating Event", start: "2016-06-09T16:00:00" }, { id: 999, title: "Repeating Event", start: "2016-06-16T16:00:00" }, { title: "Conference", start: "2016-06-11", end: "2016-06-13" }, { title: "Meeting", start: "2016-06-12T10:30:00", end: "2016-06-12T12:30:00" }, { title: "Lunch", start: "2016-06-12T12:00:00" }, { title: "Meeting", start: "2016-06-12T14:30:00" }, { title: "Happy Hour", start: "2016-06-12T17:30:00" }, { title: "Dinner", start: "2016-06-12T20:00:00" }, { title: "Birthday Party", start: "2016-06-13T07:00:00" }, { title: "Click for Google", url: "http://google.com/", start: "2016-06-28" }] }), $("#fc-agenda-views").fullCalendar({ header: { left: "prev,next today", center: "title", right: "month,agendaWeek,agendaDay" }, defaultDate: "2016-06-12", defaultView: "agendaWeek", editable: !0, eventLimit: !0, events: [{ title: "All Day Event", start: "2016-06-01" }, { title: "Long Event", start: "2016-06-07", end: "2016-06-10" }, { id: 999, title: "Repeating Event", start: "2016-06-09T16:00:00" }, { id: 999, title: "Repeating Event", start: "2016-06-16T16:00:00" }, { title: "Conference", start: "2016-06-11", end: "2016-06-13" }, { title: "Meeting", start: "2016-06-12T10:30:00", end: "2016-06-12T12:30:00" }, { title: "Lunch", start: "2016-06-12T12:00:00" }, { title: "Meeting", start: "2016-06-12T14:30:00" }, { title: "Happy Hour", start: "2016-06-12T17:30:00" }, { title: "Dinner", start: "2016-06-12T20:00:00" }, { title: "Birthday Party", start: "2016-06-13T07:00:00" }, { title: "Click for Google", url: "http://google.com/", start: "2016-06-28" }] }), $("#fc-bg-events").fullCalendar({ header: { left: "prev,next today", center: "title", right: "month,agendaWeek,agendaDay" }, defaultDate: "2016-06-12", businessHours: !0, editable: !0, events: [{ title: "Business Lunch", start: "2016-06-03T13:00:00", constraint: "businessHours" }, { title: "Meeting", start: "2016-06-13T11:00:00", constraint: "availableForMeeting", color: "#257e4a" }, { title: "Conference", start: "2016-06-18", end: "2016-06-20" }, { title: "Party", start: "2016-06-29T20:00:00" }, { id: "availableForMeeting", start: "2016-06-11T10:00:00", end: "2016-06-11T16:00:00", rendering: "background" }, { id: "availableForMeeting", start: "2016-06-13T10:00:00", end: "2016-06-13T16:00:00", rendering: "background" }, { start: "2016-06-24", end: "2016-06-28", overlap: !1, rendering: "background", color: "#DA4453" }, { start: "2016-06-06", end: "2016-06-08", overlap: !1, rendering: "background", color: "#DA4453" }] }), $("#fc-event-colors").fullCalendar({ header: { left: "prev,next today", center: "title", right: "month,agendaWeek,agendaDay" }, defaultDate: "2016-06-12", businessHours: !0, editable: !0, events: [{ title: "All Day Event", start: "2016-06-01", color: "#2c2b7c" }, { title: "Long Event", start: "2016-06-07", end: "2016-06-10", color: "#37BC9B" }, { id: 999, title: "Repeating Event", start: "2016-06-09T16:00:00", color: "#37BC9B" }, { id: 999, title: "Repeating Event", start: "2016-06-16T16:00:00", color: "#F6BB42" }, { title: "Conference", start: "2016-06-11", end: "2016-06-13", color: "#DA4453" }, { title: "Meeting", start: "2016-06-12T10:30:00", end: "2016-06-12T12:30:00", color: "#DA4453" }, { title: "Lunch", start: "2016-06-12T12:00:00", color: "#DA4453" }, { title: "Meeting", start: "2016-06-12T14:30:00", color: "#DA4453" }, { title: "Happy Hour", start: "2016-06-12T17:30:00", color: "#DA4453" }, { title: "Dinner", start: "2016-06-12T20:00:00", color: "#DA4453" }, { title: "Birthday Party", start: "2016-06-13T07:00:00", color: "#DA4453" }, { title: "Click for Google", url: "http://google.com/", start: "2016-06-28", color: "#3BAFDA" }] }), $("#fc-external-drag").fullCalendar({ header: { left: "prev,next today", center: "title", right: "month,agendaWeek,agendaDay" }, editable: !0, droppable: !0, defaultDate: "2016-06-12", events: [{ title: "All Day Event", start: "2016-06-01", color: "#2c2b7c" }, { title: "Long Event", start: "2016-06-07", end: "2016-06-10", color: "#37BC9B" }, { id: 999, title: "Repeating Event", start: "2016-06-09T16:00:00", color: "#37BC9B" }, { id: 999, title: "Repeating Event", start: "2016-06-16T16:00:00", color: "#F6BB42" }, { title: "Conference", start: "2016-06-11", end: "2016-06-13", color: "#DA4453" }, { title: "Meeting", start: "2016-06-12T10:30:00", end: "2016-06-12T12:30:00", color: "#DA4453" }, { title: "Lunch", start: "2016-06-12T12:00:00", color: "#DA4453" }, { title: "Meeting", start: "2016-06-12T14:30:00", color: "#DA4453" }, { title: "Happy Hour", start: "2016-06-12T17:30:00", color: "#DA4453" }, { title: "Dinner", start: "2016-06-12T20:00:00", color: "#DA4453" }, { title: "Birthday Party", start: "2016-06-13T07:00:00", color: "#DA4453" }, { title: "Click for Google", url: "http://google.com/", start: "2016-06-28", color: "#3BAFDA" }], drop: function() { $("#drop-remove").is(":checked") && $(this).remove() } }), $("#external-events .fc-event").each(function() { $(this).css({ backgroundColor: $(this).data("color"), borderColor: $(this).data("color") }), $(this).data("event", { title: $.trim($(this).text()), color: $(this).data("color"), stick: !0 }), $(this).draggable({ zIndex: 999, revert: !0, revertDuration: 0 }) }), $("#fc-selectable").fullCalendar({ header: { left: "prev,next today", center: "title", right: "month,agendaWeek,agendaDay" }, defaultDate: "2016-06-12", selectable: !0, selectHelper: !0, select: function(start, end) { var eventData, title = prompt("Event Title:"); title && (eventData = { title: title, start: start, end: end }, $("#fc-selectable").fullCalendar("renderEvent", eventData, !0)), $("#fc-selectable").fullCalendar("unselect") }, editable: !0, eventLimit: !0, events: [{ title: "All Day Event", start: "2016-06-01" }, { title: "Long Event", start: "2016-06-07", end: "2016-06-10" }, { id: 999, title: "Repeating Event", start: "2016-06-09T16:00:00" }, { id: 999, title: "Repeating Event", start: "2016-06-16T16:00:00" }, { title: "Conference", start: "2016-06-11", end: "2016-06-13" }, { title: "Meeting", start: "2016-06-12T10:30:00", end: "2016-06-12T12:30:00" }, { title: "Lunch", start: "2016-06-12T12:00:00" }, { title: "Meeting", start: "2016-06-12T14:30:00" }, { title: "Happy Hour", start: "2016-06-12T17:30:00" }, { title: "Dinner", start: "2016-06-12T20:00:00" }, { title: "Birthday Party", start: "2016-06-13T07:00:00" }, { title: "Click for Google", url: "http://google.com/", start: "2016-06-28" }] }), $("#fc-gcal").fullCalendar({ googleCalendarApiKey: "AIzaSyAAZnaZBXLqNBRXjd-82km_NO7GUItyKek", events: "en.indian#holiday@group.v.calendar.google.com", eventClick: function(event) { return window.open(event.url, "gcalevent", "width=700,height=600"), !1 }, loading: function(bool) { $("#loading").toggle(bool) } }), $("#fc-json").fullCalendar({ header: { left: "prev,next today", center: "title", right: "month,agendaWeek,agendaDay" }, defaultDate: "2016-06-12", editable: !0, eventLimit: !0, events: { url: "../../../app-assets/data/fullcalendar/php/get-events.php", error: function() { $("#script-warning").show() } }, loading: function(bool) { $("#loading").toggle(bool) } }); var initialLangCode = "en"; $("#fc-languages").fullCalendar({ header: { left: "prev,next today", center: "title", right: "month,agendaWeek,agendaDay" }, defaultDate: "2016-06-12", lang: initialLangCode, buttonIcons: !1, weekNumbers: !0, editable: !0, defaultView: "agendaWeek", eventLimit: !0, events: [{ title: "All Day Event", start: "2016-06-01" }, { title: "Long Event", start: "2016-06-07", end: "2016-06-10" }, { id: 999, title: "Repeating Event", start: "2016-06-09T16:00:00" }, { id: 999, title: "Repeating Event", start: "2016-06-16T16:00:00" }, { title: "Conference", start: "2016-06-11", end: "2016-06-13" }, { title: "Meeting", start: "2016-06-12T10:30:00", end: "2016-06-12T12:30:00" }, { title: "Lunch", start: "2016-06-12T12:00:00" }, { title: "Meeting", start: "2016-06-12T14:30:00" }, { title: "Happy Hour", start: "2016-06-12T17:30:00" }, { title: "Dinner", start: "2016-06-12T20:00:00" }, { title: "Birthday Party", start: "2016-06-13T07:00:00" }, { title: "Click for Google", url: "http://google.com/", start: "2016-06-28" }] }), $.each($.fullCalendar.langs, function(langCode) { $("#lang-selector").append($("<option/>").attr("value", langCode).prop("selected", langCode == initialLangCode).text(langCode)) }), $("#lang-selector").on("change", function() { this.value && $("#fc-languages").fullCalendar("option", "lang", this.value) }), $("#fc-timezones").fullCalendar({ header: { left: "prev,next today", center: "title", right: "month,agendaWeek,agendaDay" }, defaultDate: "2016-06-12", editable: !0, selectable: !0, eventLimit: !0, events: { url: "../../../app-assets/data/fullcalendar/php/get-events.php", error: function() { $("#script-warning").show() } }, loading: function(bool) { $("#loading").toggle(bool) }, eventRender: function(event, el) { event.start.hasZone() && el.find(".fc-title").after($('<div class="tzo"/>').text(event.start.format("Z"))) }, dayClick: function(date) {}, select: function(startDate, endDate) {} }), $.getJSON("../../../app-assets/data/fullcalendar/php/get-timezones.php", function(timezones) { $.each(timezones, function(i, timezone) { "UTC" != timezone && $("#timezone-selector").append($("<option/>").text(timezone).attr("value", timezone)) }) }), $("#timezone-selector").on("change", function() { $("#fc-timezones").fullCalendar("option", "timezone", this.value || !1) }) });
48.22449
9,599
0.531759
46be547b52974c542436d8bbbab4db05936d46ba
720
js
JavaScript
client/components/PlaySong.js
MaggieWalker/RapBoardReact
3704c808ec7d0c62f814418138fb386d1e54b261
[ "MIT" ]
null
null
null
client/components/PlaySong.js
MaggieWalker/RapBoardReact
3704c808ec7d0c62f814418138fb386d1e54b261
[ "MIT" ]
8
2021-03-08T23:01:00.000Z
2022-02-12T04:11:18.000Z
client/components/PlaySong.js
MaggieWalker/RapBoardReact
3704c808ec7d0c62f814418138fb386d1e54b261
[ "MIT" ]
null
null
null
import React from 'react' import history from '../history' import {connect} from 'react-redux' class PlaySong extends React.Component{ constructor(props) { super(props) this.state ={} } render() { return ( <div> <figure > <img src="https://cdn.shopify.com/s/files/1/0185/5092/products/objects-0039_800x.png?v=1369543954" /> </figure> </div> ) } } const mapStateToProps = state => { return { room: state.room, gameState: state.gameState, allPlayers: state.allPlayers, playerOne: state.playerOne, playerTwo: state.playerTwo } } export default connect(mapStateToProps)(PlaySong)
22.5
117
0.594444
46bf054971b7a3cb87b32f9e5abc21254ff95213
2,046
js
JavaScript
src/client/components/profile/profile-form.js
sitnpaws/sit-n-paws
b534638725a67f2b0477f757287410677c42aae6
[ "Unlicense" ]
1
2017-10-11T18:47:09.000Z
2017-10-11T18:47:09.000Z
src/client/components/profile/profile-form.js
sitnpaws/sit-n-paws
b534638725a67f2b0477f757287410677c42aae6
[ "Unlicense" ]
64
2017-10-11T18:30:47.000Z
2017-10-16T06:56:05.000Z
src/client/components/profile/profile-form.js
sitnpaws/sit-n-paws
b534638725a67f2b0477f757287410677c42aae6
[ "Unlicense" ]
4
2017-10-11T17:19:02.000Z
2017-10-11T18:20:55.000Z
// libraries import React from 'react'; import axios from 'axios'; // material-ui components import RaisedButton from 'material-ui/RaisedButton'; export default class ProfileForm extends React.Component { constructor(props) { super(props); this.state = { name: '', phone: '', address: '' }; this.setField = this.setField.bind(this); this.getProfile = this.getProfile.bind(this); this.updateProfile = this.updateProfile.bind(this); } componentDidMount() { this.getProfile(); } // Handles form fields setField(e) { this.setState({[e.target.name]: e.target.value}); } getProfile() { axios.get('/api/profile', { headers: {'authorization': this.props.getToken()} }) .then((res) => { this.setState({ name: res.data.name, phone: res.data.phone, address: res.data.address }); }).catch((err) => console.log(err)); } // Updates profile on clicking submit button updateProfile() { let name = (this.state.name) ? this.state.name : ''; let phone = (this.state.phone) ? this.state.phone : ''; let address = (this.state.address) ? this.state.address : ''; let data = { name: name, phone: phone, address: address }; this.props.handleUpdateProfile(data); } // Form for updateProfile render() { return ( <div className='profileBox'> <h1>Edit Your Profile</h1> <form onChange={this.setField}> <fieldset> <label>Name:</label> <input type="text" value={this.state.name} name="name" /> <br /> <label>Phone:</label> <input type="text" value={this.state.phone} name="phone" /> <br /> <label>Address:</label> <input type="text" value={this.state.address} name="address" /> </fieldset> </form> <br /> <RaisedButton onClick={this.updateProfile} type="submit" label="Submit Changes" primary={true} style={this.styles} /> </div> ) } }
28.416667
125
0.5826
46c113966192f2f1d6b85de98d9f06526b7ef688
324
js
JavaScript
webpack.config.js
yanpearson/jagol
88631719f6e1c1dc20f493096db2ef39ac70dd86
[ "MIT" ]
null
null
null
webpack.config.js
yanpearson/jagol
88631719f6e1c1dc20f493096db2ef39ac70dd86
[ "MIT" ]
null
null
null
webpack.config.js
yanpearson/jagol
88631719f6e1c1dc20f493096db2ef39ac70dd86
[ "MIT" ]
null
null
null
const path = require('path'); const webpack = require('webpack'); module.exports = { entry: { jagol: './lib/jagol/index.js', patterns: './lib/patterns/index.js', immutable: 'immutable' }, output: { filename: '[name].js', path: path.resolve(__dirname, 'dist'), library: '[name]', libraryTarget: 'var' } };
19.058824
40
0.626543
46c1e23bc3a432cb8f8c0f6df991a6f69d706324
306
js
JavaScript
registerYields.js
civ-clone/civ1-treasury
a468b0ea1982dfd8722f9cf6f891f9493c6dc615
[ "MIT" ]
null
null
null
registerYields.js
civ-clone/civ1-treasury
a468b0ea1982dfd8722f9cf6f891f9493c6dc615
[ "MIT" ]
null
null
null
registerYields.js
civ-clone/civ1-treasury
a468b0ea1982dfd8722f9cf6f891f9493c6dc615
[ "MIT" ]
null
null
null
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const Gold_1 = require("@civ-clone/base-city-yield-gold/Gold"); const YieldRegistry_1 = require("@civ-clone/core-yield/YieldRegistry"); YieldRegistry_1.instance.register(Gold_1.default); //# sourceMappingURL=registerYields.js.map
51
71
0.777778
46c2550c80fd196e797be2b088fd5dcb82b75fe4
29,202
js
JavaScript
src/ReactTelephoneInput.js
vaishsh/mui-react-phone-input
a3e4b4a156cfd601ce565f871510384de8122e4f
[ "MIT" ]
null
null
null
src/ReactTelephoneInput.js
vaishsh/mui-react-phone-input
a3e4b4a156cfd601ce565f871510384de8122e4f
[ "MIT" ]
null
null
null
src/ReactTelephoneInput.js
vaishsh/mui-react-phone-input
a3e4b4a156cfd601ce565f871510384de8122e4f
[ "MIT" ]
null
null
null
// TODO - fix the onlyContries props. // Currently expects that as an array of country object, // but users should be able to send in array of country isos import find from 'lodash/find'; import reduce from 'lodash/reduce'; import map from 'lodash/map'; import filter from 'lodash/filter'; import findIndex from 'lodash/findIndex'; import first from 'lodash/first'; import tail from 'lodash/tail'; import debounce from 'lodash/debounce'; import memoize from 'lodash/memoize'; import assign from 'lodash/assign'; import isEqual from 'lodash/isEqual'; // import lodash string methods import trim from 'lodash/trim'; import startsWith from 'lodash/startsWith'; import PropTypes from 'prop-types'; import React from 'react'; import ReactDOM from 'react-dom'; import onClickOutside from 'react-onclickoutside'; import classNames from 'classnames'; import countryData from 'country-telephone-data'; import TextField from 'material-ui/TextField'; import Divider from 'material-ui/Divider'; import { List, ListItem } from 'material-ui/List'; import { isNumberValid, getUnformattedValue, isModernBrowser } from './utils'; import styles from '../css/default.css'; import flagImage from '../images/flags.png'; import AutoselectOptions from './AutoselectOptions'; const allCountries = countryData.allCountries; const iso2Lookup = countryData.iso2Lookup; const allCountryCodes = countryData.allCountryCodes; const keys = { UP: 38, DOWN: 40, RIGHT: 39, LEFT: 37, ENTER: 13, ESC: 27, PLUS: 43, A: 65, Z: 90, SPACE: 32 }; const getFlagStyle = (flagsImagePath = flagImage) => ({ backgroundImage: `url(${flagsImagePath})` }) const FlagIcon = ({ inputFlagClasses }) => (<div className={inputFlagClasses} style={getFlagStyle()} />) FlagIcon.propTypes = { inputFlagClasses: PropTypes.string, } FlagIcon.defaultProps = { inputFlagClasses: '', } const CountryText = ({ name, dialCode }) => ( <span> <span className="country-name"> {name} </span> <span className="dial-code"> {dialCode} </span> </span>) CountryText.propTypes = { name: PropTypes.string, dialCode: PropTypes.string, } CountryText.defaultProps = { name: '', dialCode: '', } const propTypes = { value: PropTypes.string, initialValue: PropTypes.string, style: PropTypes.shape(), errorText: PropTypes.string, autoFormat: PropTypes.bool, defaultCountry: PropTypes.string, onlyCountries: PropTypes.arrayOf(PropTypes.object), preferredCountries: PropTypes.arrayOf(PropTypes.string), classNames: PropTypes.string, className: PropTypes.string, inputId: PropTypes.string, onChange: PropTypes.func, onEnterKeyPress: PropTypes.func, onBlur: PropTypes.func, onKeyDown: PropTypes.func, onFocus: PropTypes.func, onClick: PropTypes.func, disabled: PropTypes.bool, pattern: PropTypes.string, required: PropTypes.bool, autoComplete: PropTypes.bool, isValid: PropTypes.func, placeholder: PropTypes.string, flagDropDownEnabled: PropTypes.bool, floatingLabelText: PropTypes.string, floatingLabelStyle: PropTypes.shape(), name: PropTypes.string, inputStyle: PropTypes.shape(), underlineFocusStyle: PropTypes.shape(), floatingLabelFixed: PropTypes.bool, multiLine: PropTypes.bool, hintStyle: PropTypes.shape(), autoSelect: PropTypes.bool, autoSelectOptions: PropTypes.arrayOf(PropTypes.shape()) } const defaultProps = { autoFormat: true, errorText: '', onlyCountries: allCountries, defaultCountry: '', isValid: isNumberValid, flagsImagePath: 'flags.png', onEnterKeyPress: null, preferredCountries: [], disabled: false, placeholder: ' 1 (702) 123-4567', autoComplete: false, required: false, inputId: 'telephone-input', flagDropDownEnabled: true, onChange: null, floatingLabelText: '', floatingLabelStyle: {}, name: 'phone', inputStyle: {}, underlineFocusStyle: {}, floatingLabelFixed: true, multiLine: false, hintStyle: {}, autoSelect: false, autoSelectOptions: [], } class ReactTelephoneInput extends React.Component { constructor(props) { super(props) const preferredCountries = this.props.preferredCountries .map(iso2 => (iso2Lookup.hasOwnProperty(iso2) ? allCountries[iso2Lookup[iso2]] : null)) .filter(val => val !== null); this.state = assign( {}, { preferredCountries, showDropDown: false, suggestionsOpen: false, queryString: '', freezeSelection: false, debouncedQueryStingSearcher: debounce(this.searchCountry, 300) }, this._mapPropsToState(this.props, true) ) } componentDidMount() { document.addEventListener('keydown', this.handleKeydown) this._cursorToEnd(true) if (typeof this.props.onChange === 'function') { this.props.onChange( this.numberInput.input, this.state.formattedNumber, this.state.selectedCountry, getUnformattedValue(this.state.formattedNumber) ) } } componentWillReceiveProps(nextProps) { this.setState(this._mapPropsToState(nextProps)) } shouldComponentUpdate(nextProps, nextState) { return ( !isEqual(nextProps, this.props) || !isEqual(nextState, this.state) ) } componentWillUnmount() { document.removeEventListener('keydown', this.handleKeydown) } getNumber() { return this.state.formattedNumber !== '+' ? this.state.formattedNumber : '' } getValue() { return this.getNumber() } getElement(index) { return ReactDOM.findDOMNode(this.refs[`flag_no_${index}`]) } getCountryDropDownList() { const { country: countryStyle, preferred, highlight, flag: flagIconStyle, 'country-list': countryListStyle, hide: hideStyle } = styles const self = this; const countryDropDownList = map( this.state.preferredCountries.concat(this.props.onlyCountries), (country, index) => { const itemClasses = classNames({ [`${countryStyle}`]: true, [`${preferred}`]: findIndex(self.state.preferredCountries, { iso2: country.iso2 }) >= 0, [`${highlight}`]: self.state.highlightCountryIndex === index }) const inputFlagClasses = classNames({ [`${flagIconStyle}`]: true, [`${styles[country.iso2]}`]: true, }) // const inputFlagClasses = `flag ${country.iso2}`; return ( <ListItem ref={`flag_no_${index}`} key={`flag_no_${index}`} data-flag-key={`flag_no_${index}`} className={itemClasses} data-dial-code="1" data-country-code={country.iso2} onTouchTap={self.handleFlagItemClick.bind(self, country)} leftIcon={<FlagIcon inputFlagClasses={inputFlagClasses} />} primaryText={<CountryText name={country.name} dialCode={country.dialCode} />} /> ) } ); const dashedLi = <Divider key="divider" /> // let's insert a dashed line in between preffered countries and the rest countryDropDownList.splice( this.state.preferredCountries.length, 0, dashedLi ) const dropDownClasses = classNames({ [`${countryListStyle}`]: true, [`${hideStyle}`]: !this.state.showDropDown }) return ( <List ref={elem => this.flagDropdownList = elem} className={dropDownClasses}> {countryDropDownList} </List> ) } searchCountry() { const probableCandidate = this._searchCountry(this.state.queryString) || this.props.onlyCountries[0] const probableCandidateIndex = findIndex(this.props.onlyCountries, probableCandidate) + this.state.preferredCountries.length this.scrollTo(this.getElement(probableCandidateIndex), true) this.setState({ queryString: '', highlightCountryIndex: probableCandidateIndex }) } // memoize results based on the first 5/6 characters. That is all that matters guessSelectedCountry(inputNumber) { const secondBestGuess = find(allCountries, { iso2: this.props.defaultCountry }) || this.props.onlyCountries[0]; const inputNumberForCountries = inputNumber.substr(0, 4); let bestGuess if (trim(inputNumber) !== '') { bestGuess = reduce( this.props.onlyCountries, (selectedCountry, country) => { // if the country dialCode exists WITH area code if ( allCountryCodes[inputNumberForCountries] && allCountryCodes[inputNumberForCountries][0] === country.iso2 ) { return country // if the selected country dialCode is there with the area code } else if ( allCountryCodes[inputNumberForCountries] && allCountryCodes[inputNumberForCountries][0] === selectedCountry.iso2 ) { return selectedCountry // else do the original if statement } else if (startsWith(inputNumber, country.dialCode)) { if ( country.dialCode.length > selectedCountry.dialCode.length ) { return country } if ( country.dialCode.length === selectedCountry.dialCode.length && country.priority < selectedCountry.priority ) { return country } } return selectedCountry }, { dialCode: '', priority: 10001 }, this ) } else { return this.props.defaultCountry ? secondBestGuess : { dialCode: '', priority: 10001 } } if (!bestGuess.name) { return secondBestGuess } return bestGuess } // put the cursor to the end of the input (usually after a focus event) _cursorToEnd(skipFocus) { const { input } = this.numberInput; if (skipFocus) { this._fillDialCode() } else { input.focus() if (isModernBrowser) { const len = input.value.length; input.setSelectionRange(len, len) } } } formatNumber(text, pattern) { if (!text || text.length === 0) { return '+' } // for all strings with length less than 3, just return it (1, 2 etc.) // also return the same text if the selected country has no fixed format if ((text && text.length < 2) || !pattern || !this.props.autoFormat) { return `+${text}` } const formattedObject = reduce( pattern, (acc, character) => { if (acc.remainingText.length === 0) { return acc } if (character !== '.') { return { formattedText: acc.formattedText + character, remainingText: acc.remainingText } } return { formattedText: acc.formattedText + first(acc.remainingText), remainingText: tail(acc.remainingText) } }, { formattedText: '', remainingText: text.split('') } ); return ( formattedObject.formattedText + formattedObject.remainingText.join('') ) } scrollTo(country, middle) { if (!country) { return } const container = ReactDOM.findDOMNode(this.refs.flagDropdownList); if (!container) { return } const containerHeight = container.offsetHeight; const containerOffset = container.getBoundingClientRect(); const containerTop = containerOffset.top + document.body.scrollTop; const containerBottom = containerTop + containerHeight; const element = country; const elementOffset = element.getBoundingClientRect(); const elementHeight = element.offsetHeight; const elementTop = elementOffset.top + document.body.scrollTop; const elementBottom = elementTop + elementHeight; let newScrollTop = elementTop - containerTop + container.scrollTop; const middleOffset = (containerHeight / 2) - (elementHeight / 2); if (elementTop < containerTop) { // scroll up if (middle) { newScrollTop -= middleOffset } container.scrollTop = newScrollTop } else if (elementBottom > containerBottom) { // scroll down if (middle) { newScrollTop += middleOffset } const heightDifference = containerHeight - elementHeight; container.scrollTop = newScrollTop - heightDifference } } handleKeydown =(event) => { if (!this.state.showDropDown) { return } // ie hack if (event.preventDefault) { event.preventDefault() } else { event.returnValue = false // eslint-disable-line no-param-reassign } const self = this; function _moveHighlight(direction) { self.setState( { highlightCountryIndex: self._getHighlightCountryIndex( direction ) }, () => { self.scrollTo( self.getElement(self.state.highlightCountryIndex), true ) } ) } switch (event.which) { case keys.DOWN: _moveHighlight(1) break case keys.UP: _moveHighlight(-1) break case keys.ENTER: this.handleFlagItemClick( this.state.preferredCountries.concat( this.props.onlyCountries )[this.state.highlightCountryIndex], event ) break case keys.ESC: this.setState({ showDropDown: false }, this._cursorToEnd) break default: if ( (event.which >= keys.A && event.which <= keys.Z) || event.which === keys.SPACE ) { this.setState( { queryString: this.state.queryString + String.fromCharCode(event.which) }, this.state.debouncedQueryStingSearcher ) } } } handleInputKeyDown =(event) => { const { onEnterKeyPress, onKeyDown } = this.props if (event.which === keys.ENTER) { if (typeof onEnterKeyPress === 'function') { onEnterKeyPress(event) } } if (typeof onKeyDown === 'function') { onKeyDown(event) } } handleClickOutside() { if (this.state.showDropDown) { this.setState({ showDropDown: false }) } } handleInputClick = () => { this.setState({ showDropDown: false }) } handleFlagItemClick(country) { const { selectedCountry: currentSelectedCountry } = this.state; const nextSelectedCountry = find(this.props.onlyCountries, country); // tiny optimization if (currentSelectedCountry.iso2 !== nextSelectedCountry.iso2) { const dialCodeRegex = RegExp( `^(\\+${currentSelectedCountry.dialCode})|\\+` ); const newNumber = this.state.formattedNumber.replace( dialCodeRegex, `+${nextSelectedCountry.dialCode}` ); const formattedNumber = this.formatNumber( newNumber.replace(/\D/g, ''), nextSelectedCountry.format ); this.setState( { showDropDown: false, selectedCountry: nextSelectedCountry, freezeSelection: true, formattedNumber }, () => { this._cursorToEnd() if (this.props.onChange) { this.props.onChange( this.numberInput.input, formattedNumber, nextSelectedCountry, getUnformattedValue(this.state.formattedNumber) ) } } ) } else { this.setState({ showDropDown: false }) } } handleInputFocus =() => { const { onFocus, onClick } = this.props const { formattedNumber, selectedCountry } = this.state // trigger parent component's onFocus handler if (typeof onFocus === 'function') { onFocus( formattedNumber, selectedCountry ) } this._fillDialCode() if (typeof onClick === 'function') { onClick( formattedNumber, selectedCountry ) } } handleInput = (event) => { let formattedNumber = '+'; let newSelectedCountry = this.state.selectedCountry; let freezeSelection = this.state.freezeSelection; // if the input is the same as before, must be some special key like enter etc. if (event.target.value === this.state.formattedNumber) { return } // ie hack if (event.preventDefault) { event.preventDefault() } else { event.returnValue = false // eslint-disable-line no-param-reassign } if (event.target.value.length > 0) { /* before entering the number in new format, lets check if the dial code now matches some other country */ const inputNumber = event.target.value.replace(/\D/g, ''); /* we don't need to send the whole number to guess the country... only the first 6 characters are enough the guess country function can then use memoization much more effectively since the set of input it gets has drastically reduced */ if ( !this.state.freezeSelection || this.state.selectedCountry.dialCode.length > inputNumber.length ) { newSelectedCountry = this.guessSelectedCountry( inputNumber.substring(0, 6) ) freezeSelection = false } // let us remove all non numerals from the input formattedNumber = this.formatNumber( inputNumber, newSelectedCountry.format ) } let caretPosition = event.target.selectionStart; const oldFormattedText = this.state.formattedNumber; const diff = formattedNumber.length - oldFormattedText.length; const onSetStateComplete = () => { if (isModernBrowser) { if (caretPosition === 1 && formattedNumber.length === 2) { caretPosition += 1 } if (diff > 0) { caretPosition -= diff } if ( caretPosition > 0 && oldFormattedText.length >= formattedNumber.length ) { this.numberInput.input.setSelectionRange( caretPosition, caretPosition ) } } if (this.props.onChange) { this.props.onChange( this.numberInput.input, this.state.formattedNumber, this.state.selectedCountry, getUnformattedValue(this.state.formattedNumber) ) } } this.setState( { formattedNumber, freezeSelection, selectedCountry: newSelectedCountry.dialCode.length > 0 ? newSelectedCountry : this.state.selectedCountry }, onSetStateComplete ) } handleFlagDropdownClick =(e) => { if (this.props.disabled) { return } e.preventDefault() /* need to put the highlight on the current selected country if the dropdown is going to open up */ this.setState( { showDropDown: !this.state.showDropDown, highlightCountry: find( this.props.onlyCountries, this.state.selectedCountry ), highlightCountryIndex: findIndex( this.state.preferredCountries.concat( this.props.onlyCountries ), this.state.selectedCountry ) }, () => { // only need to scrool if the dropdown list is alive if (this.state.showDropDown) { this.scrollTo( this.getElement( this.state.highlightCountryIndex + this.state.preferredCountries.length ) ) } } ) } handleInputBlur = () => { if (typeof this.props.onBlur === 'function') { this.props.onBlur( this.state.formattedNumber, this.state.selectedCountry ) } } handleAutoselectListSelect = (selectedValue) => { let formattedNumber = '+'; // if the input is the same as before, must be some special key like enter etc. if (selectedValue === this.state.formattedNumber) { return } const newSelectedCountry = this.guessSelectedCountry( selectedValue.substring(0, 6) ) formattedNumber = this.formatNumber( selectedValue, newSelectedCountry.format ) let caretPosition = this.numberInput.input.selectionStart; const oldFormattedText = this.state.formattedNumber; const diff = formattedNumber.length - oldFormattedText.length; this.numberInput.input.focus() const onSetStateComplete = () => { if (isModernBrowser) { if (caretPosition === 1 && formattedNumber.length === 2) { caretPosition += 1 } if (diff > 0) { caretPosition -= diff } if ( caretPosition > 0 && oldFormattedText.length >= formattedNumber.length ) { this.numberInput.input.setSelectionRange( caretPosition, caretPosition ) } } if (this.props.onChange) { this.props.onChange( this.numberInput.input, this.state.formattedNumber, this.state.selectedCountry, getUnformattedValue(this.state.formattedNumber) ) } } this.setState( { formattedNumber, selectedCountry: newSelectedCountry.dialCode.length > 0 ? newSelectedCountry : this.state.selectedCountry }, onSetStateComplete ) } _mapPropsToState(props, firstCall = false) { let inputNumber if (props.value) { inputNumber = props.value } else if (props.initialValue && firstCall) { inputNumber = props.initialValue } else if (this.props.value) { // just cleared the value inputNumber = '' } else if ( this.state && this.state.formattedNumber && this.state.formattedNumber.length > 0 ) { inputNumber = this.state.formattedNumber } else { inputNumber = '' } const selectedCountryGuess = this.guessSelectedCountry( inputNumber.replace(/\D/g, '') ) const selectedCountryGuessIndex = findIndex( allCountries, selectedCountryGuess ) const formattedNumber = this.formatNumber( inputNumber.replace(/\D/g, ''), selectedCountryGuess ? selectedCountryGuess.format : null ) return { selectedCountry: selectedCountryGuess, highlightCountryIndex: selectedCountryGuessIndex, formattedNumber } } _fillDialCode() { // if the input is blank, insert dial code of the selected country if (this.numberInput.input.value === '+') { if (this.props.disabled) { this.setState({ formattedNumber: '' }) } else { this.setState({ formattedNumber: `+${this.state.selectedCountry.dialCode}` }) } } } _getHighlightCountryIndex(direction) { // had to write own function because underscore does not have findIndex. lodash has it const highlightCountryIndex = this.state.highlightCountryIndex + direction; if ( highlightCountryIndex < 0 || highlightCountryIndex >= this.props.onlyCountries.length + this.state.preferredCountries.length ) { return highlightCountryIndex - direction } return highlightCountryIndex } _searchCountry= memoize((queryString) => { if (!queryString || queryString.length === 0) { return null } // don't include the preferred countries in search const probableCountries = filter( this.props.onlyCountries, country => startsWith( country.name.toLowerCase(), queryString.toLowerCase() ), this ); return probableCountries[0] }) render() { const { inputId: id, name, autoSelect, autoSelectOptions, isValid, placeholder, pattern, disabled, flagDropDownEnabled, style, errorText, floatingLabelText, floatingLabelStyle, inputStyle, underlineFocusStyle, floatingLabelFixed, multiLine, hintStyle, required } = this.props const { formattedNumber, showDropDown, selectedCountry } = this.state const rawValue = getUnformattedValue(formattedNumber) const { arrow: arrowStyle, up: upStyle, hide: hideStyle, 'react-tel-input': rootStyle, 'form-control': formControlStyle, 'flag-dropdown': flagDropdownStyle, 'open-dropdown': openDropdownStyle, flag: flagStyle, 'invalid-number': invalidNumberStyle, 'selected-flag': selectedFlagStyle, 'phone-text-field-container': textFieldContainerStyle, 'autoselect-menu-container': autoSelectMenuContainerStyle, } = styles const selectedCountryFlagStyle = styles[selectedCountry.iso2] const rootClasses = classNames({ [`${rootStyle}`]: true } ) const arrowClasses = classNames({ [`${arrowStyle}`]: true, [`${upStyle}`]: showDropDown }); const inputClasses = classNames({ [`${formControlStyle}`]: true, [`${invalidNumberStyle}`]: !isValid(formattedNumber.replace(/\D/g, '')) }); const flagViewClasses = classNames({ [`${flagDropdownStyle}`]: true, [`${openDropdownStyle}`]: showDropDown, [`${hideStyle}`]: !flagDropDownEnabled, }); const inputFlagClasses = classNames({ [`${flagStyle}`]: true, [`${selectedCountryFlagStyle}`]: true }) const flagDropdownContainerClasses = classNames({ [`${selectedFlagStyle}`]: true, [`${hideStyle}`]: !flagDropDownEnabled, }) return ( <div className={rootClasses} > <div ref={(input) => { this.flagDropDownButton = input; }} className={flagViewClasses} onKeyDown={this.handleKeydown} > <div ref="selectedFlag" onTouchTap={this.handleFlagDropdownClick} className={flagDropdownContainerClasses} title={`${selectedCountry.name}: + ${selectedCountry.dialCode}`} role="menuitem" > { flagDropDownEnabled && <FlagIcon inputFlagClasses={inputFlagClasses} /> } { flagDropDownEnabled && selectedCountryFlagStyle && <div className={arrowClasses} />} </div> {flagDropDownEnabled && showDropDown ? this.getCountryDropDownList() : ''} </div> <div className={textFieldContainerStyle}> <TextField onChange={this.handleInput} onTouchTap={this.handleInputClick} onFocus={this.handleInputFocus} onBlur={this.handleInputBlur} onKeyDown={this.handleInputKeyDown} value={formattedNumber} ref={(input) => { this.numberInput = input; }} type="tel" autoComplete="off" className={inputClasses} pattern={pattern} required={required} hintText={!disabled && placeholder} disabled={disabled} id={id} name={name} style={style} errorText={errorText} title={formattedNumber} maxLength={(selectedCountry.format && selectedCountry.format.length) || 50} floatingLabelText={floatingLabelText} floatingLabelStyle={floatingLabelStyle} inputStyle={inputStyle} underlineFocusStyle={underlineFocusStyle} floatingLabelFixed={floatingLabelFixed} multiLine={multiLine} hintStyle={hintStyle} fullWidth /> </div> <div className={autoSelectMenuContainerStyle}> { autoSelect && (<AutoselectOptions searchTerm={rawValue} options={autoSelectOptions} isOpen={this.state.suggestionsOpen} onListItemSelect={this.handleAutoselectListSelect} />) } </div> </div> ) } } ReactTelephoneInput.propTypes = propTypes ReactTelephoneInput.defaultProps = defaultProps export default onClickOutside(ReactTelephoneInput)
30.167355
100
0.593624
46c2cf0ea81d4edf7570d54799344befcb6246a4
510
js
JavaScript
tasks/03-autobots-rollout-index.js
sky-uk/grunt-autobots
20baddd986a8f08cdbe2b3ac9c24991a5da7fab7
[ "MIT" ]
null
null
null
tasks/03-autobots-rollout-index.js
sky-uk/grunt-autobots
20baddd986a8f08cdbe2b3ac9c24991a5da7fab7
[ "MIT" ]
null
null
null
tasks/03-autobots-rollout-index.js
sky-uk/grunt-autobots
20baddd986a8f08cdbe2b3ac9c24991a5da7fab7
[ "MIT" ]
null
null
null
/* * grunt-autobots * https://github.com/achambers/autobots * * Copyright (c) 2014 Aaron Chambers * Licensed under the MIT license. */ 'use strict'; module.exports = function(grunt) { var RolloutIndexTask = require('./lib/rollout-index-task'); grunt.registerTask('autobots:rollout:index', 'Publish index.html to Redis', function() { var done = this.async(); var config = grunt.config('autobots') || {}; var task = new RolloutIndexTask(config); task.run().finally(done); }); };
22.173913
90
0.664706
46c30bec6cbfd670e5e225d79f0a3e992416a73a
527
js
JavaScript
src/pages/404.js
mlaroy/mikelaroy.ca
0d9990fe16a781be948f3a961656c69c01232a0a
[ "MIT" ]
null
null
null
src/pages/404.js
mlaroy/mikelaroy.ca
0d9990fe16a781be948f3a961656c69c01232a0a
[ "MIT" ]
28
2021-02-12T07:21:08.000Z
2022-02-26T21:40:08.000Z
src/pages/404.js
mlaroy/mikelaroy.ca
0d9990fe16a781be948f3a961656c69c01232a0a
[ "MIT" ]
null
null
null
import React from 'react' import Layout from '../components/layout' import Section from '../components/Section' import CustomLink from '../components/CustomLink' const NotFound = () => ( <Layout> <Section classes="container p-24 text-center flex items-center justify-center"> <div> <h1 className="text-4xl mb-4">NOT FOUND</h1> <p className="text-xl mb-4">That page doesn't exist 😕</p> <CustomLink to="/">Home</CustomLink> </div> </Section> </Layout> ) export default NotFound
26.35
83
0.654649
46c3b4a163fbe8407f68db58e7306c9ebc0037d8
52,007
js
JavaScript
Laravel API/public/users.js
vankatwijk/YikYak-Laravel-Vue-NS
cb0c697b3b7f4cd4934cdd09d9bf984fd5af8898
[ "MIT" ]
2
2020-07-08T18:11:34.000Z
2020-07-23T10:16:37.000Z
Laravel API/public/users.js
vankatwijk/YikYak-Laravel-Vue-NS
cb0c697b3b7f4cd4934cdd09d9bf984fd5af8898
[ "MIT" ]
1
2021-05-22T11:09:06.000Z
2021-05-22T12:00:59.000Z
Laravel API/public/users.js
vankatwijk/YikYak-Laravel-Vue-NS
cb0c697b3b7f4cd4934cdd09d9bf984fd5af8898
[ "MIT" ]
null
null
null
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["users"],{ /***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/views/UserAccount.vue?vue&type=script&lang=js&": /*!*****************************************************************************************************************************************************************!*\ !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/views/UserAccount.vue?vue&type=script&lang=js& ***! \*****************************************************************************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["default"] = ({ data: function data() { return { account_name: this.$store.state.user, account_email: "", entity_name: this.$store.state.entity_name, valid: true, name: '', nameRules: [function (v) { return !!v || 'Name is required'; } //v => (v && v.length <= 10) || 'Name must be less than 10 characters', ], email: '', emailRules: [function (v) { return !!v || 'E-mail is required'; }, function (v) { return /.+@.+\..+/.test(v) || 'E-mail must be valid'; }], select: null }; }, methods: { saveAccountData: function saveAccountData() { // Base Url of App var baseUrl = localStorage.getItem('appUrl'); // Custom Url for Api Call var accountUrl = baseUrl + '/api/details/'; // Session Token var token = localStorage.getItem('session_token'); // Headers var headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer ' + token }; this.$http.get(accountUrl, { headers: headers }).then(function (result) { console.log(result); }); }, validate: function validate() { this.$refs.form.validate(); this.saveAccountData(); }, reset: function reset() { this.$refs.form.reset(); }, resetValidation: function resetValidation() { this.$refs.form.resetValidation(); } } }); /***/ }), /***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/views/Users.vue?vue&type=script&lang=js&": /*!***********************************************************************************************************************************************************!*\ !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/views/Users.vue?vue&type=script&lang=js& ***! \***********************************************************************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["default"] = ({ data: function data() { return { username_id: this.$store.state.user_id, entity_name: this.$store.state.entity_name, dialog: false, messagechatinfo: "", new_user: { username: "", email: "", password: "", password_confirm: "" }, textbox_message: "", users_list: this.$store.state.entity_users, users_chat: [] }; }, methods: { isSender: function isSender(user_id, rec_id) { console.log(user_id); console.log(rec_id); if (user_id === user_id) { return "sender"; } if (rec_id === rec_id) { return "other"; } }, createUser: function createUser() { var _this = this; // Base Url of App var baseUrl = localStorage.getItem('appUrl'); // Custom Url for Api Call var registerUrl = baseUrl + '/api/adduser'; // Session Token //const token = this.$store.data.token; var token = localStorage.getItem('session_token'); // Header to post Request var headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer ' + token }; // Data to send for Registration var data = { 'name': this.new_user.username, 'email': this.new_user.email, 'password': this.new_user.password, 'password-confirm': this.new_user.password_confirm }; console.log(data); this.$http.post(registerUrl, data, { headers: headers }).then(function (result) { console.log(result); _this.users_list.unshift(result.data.success); }); }, // getUserChat : function(item) { // console.log(item.id); // } getUserChat: function getUserChat(item) { var _this2 = this; //console.log('this is the element i clicked: ', item.id); // Base Url of App var baseUrl = localStorage.getItem('appUrl'); // Custom Url for Api Call var singleChatUrl = baseUrl + '/api/usermessanger/' + item.id; // Save item Id to Storage for use in send message function localStorage.setItem('chat-id', item.id); // Session Token //const token = this.$store.data.token; var token = localStorage.getItem('session_token'); // Header to post Request var headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer ' + token }; this.$http.get(singleChatUrl, { headers: headers }).then(function (result) { console.log(result); if (result.data.success == '') { console.log('no messages'); // this.messagechatinfo = 'no message' } else { _this2.users_chat = result.data.success; } }); }, postUserMessage: function postUserMessage() { var _this3 = this; var chatId = localStorage.getItem('chat-id'); console.log(chatId); // Base Url of App var baseUrl = localStorage.getItem('appUrl'); // Custom Url for Api Call var singleChatUrl = baseUrl + '/api/usermessanger/' + chatId; // Session Token //const token = this.$store.data.token; var token = localStorage.getItem('session_token'); // Header to post Request var headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer ' + token }; var data = { message: this.textbox_message }; this.$http.post(singleChatUrl, data, { headers: headers }).then(function (result) { console.log(result); //this.users_chat = result.data _this3.users_chat.push(result.data.success); // if(result.data.success == '') { // console.log('no messages'); // this.messagechatinfo = 'no message' // } else { // this.users_chat = result.data // } }); } }, mounted: function mounted() {//this.getUsersList() get users list on load } }); /***/ }), /***/ "./node_modules/css-loader/dist/cjs.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/views/Users.vue?vue&type=style&index=0&id=e2911f0e&scoped=true&lang=css&": /*!******************************************************************************************************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/css-loader/dist/cjs.js??ref--6-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--6-2!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/views/Users.vue?vue&type=style&index=0&id=e2911f0e&scoped=true&lang=css& ***! \******************************************************************************************************************************************************************************************************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { // Imports var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js"); exports = ___CSS_LOADER_API_IMPORT___(false); // Module exports.push([module.i, "\n.message-chat-container[data-v-e2911f0e] {\n padding: 1.5rem;\n}\n.message-chat-container .message-input-container[data-v-e2911f0e] {\n position: absolute;\n left: 15px;\n right: 15px;\n bottom: 15px;\n}\n.message-chat-container .message-input-container .col[data-v-e2911f0e] {\n padding-top: 0;\n padding-bottom: 0;\n}\n.message-chat-container .message-chat-list[data-v-e2911f0e] {\n padding: 0 2rem;\n height: 63vh;\n overflow-y: scroll;\n overflow-x: hidden;\n}\n.message-chat-container .message-chat-list .single-message[data-v-e2911f0e] {\n margin: .75rem;\n max-width: 90%;\n background-color : rgba(25, 118, 210, 0.16)\n}\n\n/* .message-chat-container .message-chat-list .sender {\n margin: .75rem;\n max-width: 90%;\n background-color : rgba(25, 118, 210, 1)\n} */\n\n", ""]); // Exports module.exports = exports; /***/ }), /***/ "./node_modules/style-loader/index.js!./node_modules/css-loader/dist/cjs.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/views/Users.vue?vue&type=style&index=0&id=e2911f0e&scoped=true&lang=css&": /*!**********************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/style-loader!./node_modules/css-loader/dist/cjs.js??ref--6-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--6-2!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/views/Users.vue?vue&type=style&index=0&id=e2911f0e&scoped=true&lang=css& ***! \**********************************************************************************************************************************************************************************************************************************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader/dist/cjs.js??ref--6-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src??ref--6-2!../../../node_modules/vue-loader/lib??vue-loader-options!./Users.vue?vue&type=style&index=0&id=e2911f0e&scoped=true&lang=css& */ "./node_modules/css-loader/dist/cjs.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/views/Users.vue?vue&type=style&index=0&id=e2911f0e&scoped=true&lang=css&"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/views/UserAccount.vue?vue&type=template&id=42f5ca93&": /*!*********************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/views/UserAccount.vue?vue&type=template&id=42f5ca93& ***! \*********************************************************************************************************************************************************************************************************/ /*! exports provided: render, staticRenderFns */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; }); var render = function() { var _vm = this var _h = _vm.$createElement var _c = _vm._self._c || _h return _c( "section", { staticClass: "page-container page-account" }, [ _c("header-global"), _vm._v(" "), _c( "v-content", [ _c( "v-container", [ _c( "v-row", { attrs: { align: "center", justify: "center" } }, [ _c( "v-col", { attrs: { cols: "12", sm: "8", md: "5" } }, [ _c( "v-form", { ref: "form", attrs: { "lazy-validation": "" }, model: { value: _vm.valid, callback: function($$v) { _vm.valid = $$v }, expression: "valid" } }, [ _c("v-text-field", { attrs: { rules: _vm.nameRules, label: "Name", required: "" }, model: { value: _vm.account_name, callback: function($$v) { _vm.account_name = $$v }, expression: "account_name" } }), _vm._v(" "), _c("v-text-field", { attrs: { rules: _vm.emailRules, label: "E-mail", required: "" }, model: { value: _vm.account_email, callback: function($$v) { _vm.account_email = $$v }, expression: "account_email" } }), _vm._v(" "), _c("v-text-field", { attrs: { rules: _vm.nameRules, label: "Company Name", required: "" }, model: { value: _vm.entity_name, callback: function($$v) { _vm.entity_name = $$v }, expression: "entity_name" } }), _vm._v(" "), _c( "v-btn", { staticClass: "mr-4", attrs: { block: "", disabled: !_vm.valid, color: "success" }, on: { click: _vm.validate } }, [ _vm._v( "\n Save\n " ) ] ) ], 1 ) ], 1 ) ], 1 ) ], 1 ) ], 1 ) ], 1 ) } var staticRenderFns = [] render._withStripped = true /***/ }), /***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/views/Users.vue?vue&type=template&id=e2911f0e&scoped=true&": /*!***************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/views/Users.vue?vue&type=template&id=e2911f0e&scoped=true& ***! \***************************************************************************************************************************************************************************************************************/ /*! exports provided: render, staticRenderFns */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; }); var render = function() { var _vm = this var _h = _vm.$createElement var _c = _vm._self._c || _h return _c( "section", { staticClass: "page-container" }, [ _c("header-global"), _vm._v(" "), _c( "v-content", [ _c( "v-container", [ _c( "v-row", [ _c( "v-col", { attrs: { xs: "12", sm: "12", md: "6", lg: "5", xl: "4" } }, [ _c( "v-card", [ _c( "v-container", [ _c( "v-row", { attrs: { justify: "space-between" } }, [ _c( "v-col", { attrs: { xl: "12" } }, [ _c( "v-form", [ _c("v-text-field", { attrs: { label: "Username", name: "username", "prepend-icon": "mdi-account-outline", type: "text", autocomplete: "off" }, model: { value: _vm.new_user.username, callback: function($$v) { _vm.$set( _vm.new_user, "username", $$v ) }, expression: "new_user.username" } }), _vm._v(" "), _c("v-text-field", { attrs: { id: "email", label: "Email", name: "email", "prepend-icon": "mdi-email-outline", type: "email", autocomplete: "off" }, model: { value: _vm.new_user.email, callback: function($$v) { _vm.$set( _vm.new_user, "email", $$v ) }, expression: "new_user.email" } }), _vm._v(" "), _c("v-text-field", { attrs: { id: "password", label: "Password", name: "password", "prepend-icon": "mdi-lock", type: "password", autocomplete: "off" }, model: { value: _vm.new_user.password, callback: function($$v) { _vm.$set( _vm.new_user, "password", $$v ) }, expression: "new_user.password" } }), _vm._v(" "), _c("v-text-field", { attrs: { id: "password-confirmation", label: "Confirm Password", name: "confirm-password", "prepend-icon": "mdi-lock", type: "password", autocomplete: "off" }, model: { value: _vm.new_user.password_confirm, callback: function($$v) { _vm.$set( _vm.new_user, "password_confirm", $$v ) }, expression: "new_user.password_confirm" } }), _vm._v(" "), _c( "v-btn", { attrs: { color: "primary", "x-large": "", block: "" }, on: { click: _vm.createUser } }, [_vm._v("Add User ")] ) ], 1 ) ], 1 ) ], 1 ) ], 1 ) ], 1 ) ], 1 ), _vm._v(" "), _c( "v-col", { attrs: { xs: "12", sm: "12", md: "6", lg: "7", xl: "8" } }, [ _c( "v-card", [ _c( "v-list", { staticClass: "list-scrollable", attrs: { subheader: "", dense: "" } }, [ _c("v-subheader", [ _vm._v(_vm._s(_vm.entity_name) + " Users List") ]), _vm._v(" "), _vm._l(_vm.users_list, function(item, i) { return _c( "v-list-item", { key: i }, [ _c( "v-list-item-avatar", [ item.avatar_path ? [ _c("v-img", { attrs: { src: item.avatar_path } }) ] : [ _c("v-icon", [ _vm._v( "mdi-account-supervisor-circle" ) ]) ] ], 2 ), _vm._v(" "), _c( "v-list-item-content", [ _c("v-list-item-title", { domProps: { textContent: _vm._s(item.name) } }) ], 1 ), _vm._v(" "), _c( "v-list-item-action", [ _c( "v-btn", { attrs: { id: item.id, color: "primary" }, on: { click: function($event) { ;(_vm.dialog = true), _vm.getUserChat(item) } } }, [_vm._v("Chat")] ) ], 1 ) ], 1 ) }) ], 2 ) ], 1 ) ], 1 ) ], 1 ), _vm._v(" "), _c( "v-dialog", { attrs: { fullscreen: "", "hide-overlay": "", transition: "dialog-bottom-transition" }, model: { value: _vm.dialog, callback: function($$v) { _vm.dialog = $$v }, expression: "dialog" } }, [ _c( "v-card", { staticClass: "message-chat-container" }, [ _c( "v-toolbar", { attrs: { dark: "", color: "primary" } }, [ _c( "v-btn", { attrs: { icon: "", dark: "" }, on: { click: function($event) { _vm.dialog = false } } }, [_c("v-icon", [_vm._v("mdi-close")])], 1 ), _vm._v(" "), _c("v-toolbar-title", [_vm._v("Chat")]), _vm._v(" "), _c("v-spacer"), _vm._v(" "), _c("v-toolbar-items") ], 1 ), _vm._v(" "), _c( "div", { staticClass: "message-chat-list" }, _vm._l(_vm.users_chat, function(item, i) { return _c( "v-list", { key: i, staticClass: "single-message" }, [ _c( "v-list-item", { class: _vm.isSender( item.from_user_id, item.to_user_id ), domProps: { textContent: _vm._s(item.message) } }, [ _c( "v-list-item-avatar", [ _c("v-img", { attrs: { src: item.avatar } }) ], 1 ), _vm._v(" "), _c( "v-list-item-content", [ _c("v-list-item-title", { domProps: { innerHTML: _vm._s(item.message) } }) ], 1 ) ], 1 ) ], 1 ) }), 1 ), _vm._v(" "), _c( "div", { staticClass: "message-input-container" }, [ _c( "v-container", { attrs: { fluid: "" } }, [ _c( "v-col", { attrs: { xl: "12" } }, [ _c("v-textarea", { attrs: { outlined: "", name: "message-textarea", label: "Message", value: "Type here your message" }, model: { value: _vm.textbox_message, callback: function($$v) { _vm.textbox_message = $$v }, expression: "textbox_message" } }) ], 1 ), _vm._v(" "), _c( "v-col", { attrs: { xl: "12" } }, [ _c( "v-btn", { attrs: { "x-large": "", block: "", color: "primary" }, on: { click: _vm.postUserMessage } }, [_vm._v("Send Message")] ) ], 1 ) ], 1 ) ], 1 ) ], 1 ) ], 1 ) ], 1 ) ], 1 ) ], 1 ) } var staticRenderFns = [] render._withStripped = true /***/ }), /***/ "./resources/js/views/UserAccount.vue": /*!********************************************!*\ !*** ./resources/js/views/UserAccount.vue ***! \********************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _UserAccount_vue_vue_type_template_id_42f5ca93___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./UserAccount.vue?vue&type=template&id=42f5ca93& */ "./resources/js/views/UserAccount.vue?vue&type=template&id=42f5ca93&"); /* harmony import */ var _UserAccount_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./UserAccount.vue?vue&type=script&lang=js& */ "./resources/js/views/UserAccount.vue?vue&type=script&lang=js&"); /* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); /* normalize component */ var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])( _UserAccount_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], _UserAccount_vue_vue_type_template_id_42f5ca93___WEBPACK_IMPORTED_MODULE_0__["render"], _UserAccount_vue_vue_type_template_id_42f5ca93___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], false, null, null, null ) /* hot reload */ if (false) { var api; } component.options.__file = "resources/js/views/UserAccount.vue" /* harmony default export */ __webpack_exports__["default"] = (component.exports); /***/ }), /***/ "./resources/js/views/UserAccount.vue?vue&type=script&lang=js&": /*!*********************************************************************!*\ !*** ./resources/js/views/UserAccount.vue?vue&type=script&lang=js& ***! \*********************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_UserAccount_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib??ref--4-0!../../../node_modules/vue-loader/lib??vue-loader-options!./UserAccount.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/views/UserAccount.vue?vue&type=script&lang=js&"); /* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_UserAccount_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); /***/ }), /***/ "./resources/js/views/UserAccount.vue?vue&type=template&id=42f5ca93&": /*!***************************************************************************!*\ !*** ./resources/js/views/UserAccount.vue?vue&type=template&id=42f5ca93& ***! \***************************************************************************/ /*! exports provided: render, staticRenderFns */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_UserAccount_vue_vue_type_template_id_42f5ca93___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../node_modules/vue-loader/lib??vue-loader-options!./UserAccount.vue?vue&type=template&id=42f5ca93& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/views/UserAccount.vue?vue&type=template&id=42f5ca93&"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_UserAccount_vue_vue_type_template_id_42f5ca93___WEBPACK_IMPORTED_MODULE_0__["render"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_UserAccount_vue_vue_type_template_id_42f5ca93___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); /***/ }), /***/ "./resources/js/views/Users.vue": /*!**************************************!*\ !*** ./resources/js/views/Users.vue ***! \**************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _Users_vue_vue_type_template_id_e2911f0e_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Users.vue?vue&type=template&id=e2911f0e&scoped=true& */ "./resources/js/views/Users.vue?vue&type=template&id=e2911f0e&scoped=true&"); /* harmony import */ var _Users_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Users.vue?vue&type=script&lang=js& */ "./resources/js/views/Users.vue?vue&type=script&lang=js&"); /* empty/unused harmony star reexport *//* harmony import */ var _Users_vue_vue_type_style_index_0_id_e2911f0e_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Users.vue?vue&type=style&index=0&id=e2911f0e&scoped=true&lang=css& */ "./resources/js/views/Users.vue?vue&type=style&index=0&id=e2911f0e&scoped=true&lang=css&"); /* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); /* normalize component */ var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__["default"])( _Users_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], _Users_vue_vue_type_template_id_e2911f0e_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"], _Users_vue_vue_type_template_id_e2911f0e_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], false, null, "e2911f0e", null ) /* hot reload */ if (false) { var api; } component.options.__file = "resources/js/views/Users.vue" /* harmony default export */ __webpack_exports__["default"] = (component.exports); /***/ }), /***/ "./resources/js/views/Users.vue?vue&type=script&lang=js&": /*!***************************************************************!*\ !*** ./resources/js/views/Users.vue?vue&type=script&lang=js& ***! \***************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Users_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib??ref--4-0!../../../node_modules/vue-loader/lib??vue-loader-options!./Users.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/views/Users.vue?vue&type=script&lang=js&"); /* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Users_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); /***/ }), /***/ "./resources/js/views/Users.vue?vue&type=style&index=0&id=e2911f0e&scoped=true&lang=css&": /*!***********************************************************************************************!*\ !*** ./resources/js/views/Users.vue?vue&type=style&index=0&id=e2911f0e&scoped=true&lang=css& ***! \***********************************************************************************************/ /*! no static exports found */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _node_modules_style_loader_index_js_node_modules_css_loader_dist_cjs_js_ref_6_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_2_node_modules_vue_loader_lib_index_js_vue_loader_options_Users_vue_vue_type_style_index_0_id_e2911f0e_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader!../../../node_modules/css-loader/dist/cjs.js??ref--6-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src??ref--6-2!../../../node_modules/vue-loader/lib??vue-loader-options!./Users.vue?vue&type=style&index=0&id=e2911f0e&scoped=true&lang=css& */ "./node_modules/style-loader/index.js!./node_modules/css-loader/dist/cjs.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/views/Users.vue?vue&type=style&index=0&id=e2911f0e&scoped=true&lang=css&"); /* harmony import */ var _node_modules_style_loader_index_js_node_modules_css_loader_dist_cjs_js_ref_6_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_2_node_modules_vue_loader_lib_index_js_vue_loader_options_Users_vue_vue_type_style_index_0_id_e2911f0e_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_index_js_node_modules_css_loader_dist_cjs_js_ref_6_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_2_node_modules_vue_loader_lib_index_js_vue_loader_options_Users_vue_vue_type_style_index_0_id_e2911f0e_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__); /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_style_loader_index_js_node_modules_css_loader_dist_cjs_js_ref_6_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_2_node_modules_vue_loader_lib_index_js_vue_loader_options_Users_vue_vue_type_style_index_0_id_e2911f0e_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_style_loader_index_js_node_modules_css_loader_dist_cjs_js_ref_6_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_2_node_modules_vue_loader_lib_index_js_vue_loader_options_Users_vue_vue_type_style_index_0_id_e2911f0e_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__)); /* harmony default export */ __webpack_exports__["default"] = (_node_modules_style_loader_index_js_node_modules_css_loader_dist_cjs_js_ref_6_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_2_node_modules_vue_loader_lib_index_js_vue_loader_options_Users_vue_vue_type_style_index_0_id_e2911f0e_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a); /***/ }), /***/ "./resources/js/views/Users.vue?vue&type=template&id=e2911f0e&scoped=true&": /*!*********************************************************************************!*\ !*** ./resources/js/views/Users.vue?vue&type=template&id=e2911f0e&scoped=true& ***! \*********************************************************************************/ /*! exports provided: render, staticRenderFns */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Users_vue_vue_type_template_id_e2911f0e_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../node_modules/vue-loader/lib??vue-loader-options!./Users.vue?vue&type=template&id=e2911f0e&scoped=true& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/views/Users.vue?vue&type=template&id=e2911f0e&scoped=true&"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Users_vue_vue_type_template_id_e2911f0e_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Users_vue_vue_type_template_id_e2911f0e_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); /***/ }) }]);
41.341017
1,031
0.418924
46c456355b23db459f4c8267d28cb1c2ee95ad75
3,301
js
JavaScript
src/pages/Contestant/Challenges/graphql/queries.js
sikula/saigar-ctf
ac50506e520ddc722d9c8ecd0f2810f170c5eff0
[ "Apache-2.0" ]
6
2020-06-30T14:34:48.000Z
2022-02-17T02:29:44.000Z
src/pages/Contestant/Challenges/graphql/queries.js
sikula/saigar-ctf
ac50506e520ddc722d9c8ecd0f2810f170c5eff0
[ "Apache-2.0" ]
1
2021-09-20T05:48:58.000Z
2021-09-20T05:48:58.000Z
src/pages/Contestant/Challenges/graphql/queries.js
sikula/saigar-ctf
ac50506e520ddc722d9c8ecd0f2810f170c5eff0
[ "Apache-2.0" ]
8
2020-05-30T21:47:55.000Z
2021-11-19T15:52:57.000Z
import gql from 'graphql-tag' const CASE_LIST = gql` query caseList($auth0id: String!) { user(where: { auth0id: { _eq: $auth0id } }) { acceptedTos } event(order_by: { start_time: desc }, limit: 1) { start_time end_time eventCasesByeventId { case { uuid name missing_since missing_from pendingSubmissions: submissions_aggregate( where: { processed: { _eq: "PENDING" } teamByteamId: { user_team: { user: { auth0id: { _eq: $auth0id } } } } } ) { aggregate { count } } acceptedSubmissions: submissions_aggregate( where: { processed: { _in: ["ACCEPTED", "STARRED"] } teamByteamId: { user_team: { user: { auth0id: { _eq: $auth0id } } } } } ) { aggregate { count } } rejectedSubmissions: submissions_aggregate( where: { processed: { _eq: "REJECTED" } teamByteamId: { user_team: { user: { auth0id: { _eq: $auth0id } } } } } ) { aggregate { count } } } } } team(where: { user_team: { user: { auth0id: { _eq: $auth0id } } } }) { name } } ` const ACCEPT_TERMS = gql` mutation acceptTerms($auth0id: String!) { update_user(_set: { acceptedTos: true }, where: { auth0id: { _eq: $auth0id } }) { affected_rows } } ` const NEW_SUBMISSION_MUTATION = gql` mutation insertSubmission( $content: String! $explanation: String! $supporting_evidence: String! $teamId: uuid! $eventId: uuid! $caseId: uuid! $configId: uuid! ) { insert_submission( objects: { content: $content explanation: $explanation supporting_evidence: $supporting_evidence team_id: $teamId # can get it from user event_id: $eventId # can get it from query case_id: $caseId # can get it from modal config_id: $configId # can get it from query } ) { affected_rows returning { uuid } } } ` const NEW_SUBMISSIONFILE_MUTATION = gql` mutation insertSubmissionFile($submission_id: uuid!) { insert_submission_file(objects: { submission_id: $submission_id }) { returning { uuid } } } ` const UPDATE_SUBMISSIONFILE_MUTATION = gql` mutation updateSubmissionFile($file_id: uuid!, $url: String!, $expiry: timestamptz!) { update_submission_file( where: { uuid: { _eq: $file_id } } _set: { url: $url, url_expiry: $expiry } ) { affected_rows } } ` const SUBMISION_INFO = gql` query submissionConfig($auth0id: String!) { event(order_by: { start_time: desc }, limit: 1) { uuid start_time end_time } user_team(where: { user: { auth0id: { _eq: $auth0id } } }) { team { uuid } } submission_configuration { uuid category points } } ` export { CASE_LIST, ACCEPT_TERMS, NEW_SUBMISSION_MUTATION, NEW_SUBMISSIONFILE_MUTATION, UPDATE_SUBMISSIONFILE_MUTATION, SUBMISION_INFO, }
23.246479
88
0.541654
46c5d0bcbd36fa83b124bebb4d7e757bf8f09f32
722
js
JavaScript
app/models/Page.js
ekansa/gapvis
07e9d40d7e99eff6a0c1afad8aa89129339fac92
[ "BSD-3-Clause" ]
2
2016-09-16T09:29:50.000Z
2016-09-16T16:30:05.000Z
app/models/Page.js
ekansa/gapvis
07e9d40d7e99eff6a0c1afad8aa89129339fac92
[ "BSD-3-Clause" ]
null
null
null
app/models/Page.js
ekansa/gapvis
07e9d40d7e99eff6a0c1afad8aa89129339fac92
[ "BSD-3-Clause" ]
null
null
null
/* * Page models */ (function(gv) { var Model = gv.Model, Collection = gv.Collection, API_ROOT = gv.settings.API_ROOT, Page; // Model: Page Page = gv.Page = Model.extend({ defaults: { places: [] }, initialize: function() { this.set({ title:'Page ' + this.id }); }, isFullyLoaded: function() { return !!this.get('text'); } }); // Collection: PageList gv.PageList = Collection.extend({ model: Page, url: function() { return API_ROOT + '/books/' + this.book.id + '/page'; } }); }(gv));
20.628571
66
0.426593
46c6c6b5e62d7c731a4098002afd7840a7426a0e
1,950
js
JavaScript
routes/auth.js
MEMARSAHAB/EasyLive-Rooms-Api
495a12adfccda123768d73b9003e7e07794fef19
[ "MIT" ]
null
null
null
routes/auth.js
MEMARSAHAB/EasyLive-Rooms-Api
495a12adfccda123768d73b9003e7e07794fef19
[ "MIT" ]
null
null
null
routes/auth.js
MEMARSAHAB/EasyLive-Rooms-Api
495a12adfccda123768d73b9003e7e07794fef19
[ "MIT" ]
null
null
null
const express = require('express'); const { OAuth2Client } = require('google-auth-library'); const jwt = require('jsonwebtoken'); const User = require('../models/user') const router=express.Router() const client = new OAuth2Client(process.env.GOOGLE_CLIENT_ID); router.post('/googlelogin', async (req, res) => { const { idToken } = req.body; try { const response= await client.verifyIdToken({idToken, audience: process.env.GOOGLE_CLIENT_ID}); // console.log('GOOGLE LOGIN RESPONSE',response) const { email_verified, name, email, picture } = response.payload; if (email_verified) { const user= await User.findOne({ email }); if (user) { console.log('find user', user); const token = jwt.sign({ _id: user._id }, process.env.JWT_SECRET, {expiresIn: '7d'}); const { _id, email, name } = user; return res.json({ token, user: { _id, email, name} }); } else { let password = email + process.env.JWT_SECRET; const user = new User({ name, email, password, image: picture }); user.save((err, data) => { if (err) { console.log('ERROR GOOGLE LOGIN ON USER SAVE', err); return res.status(400).json({ error: 'User signup failed with google' }); } console.log('created user', data); const token = jwt.sign( { _id: data._id }, process.env.JWT_SECRET, { expiresIn: '7d' } ); const { _id, email, name } = data; return res.json({ token, user: { _id, email, name} }); }); }; } else { return res.status(400).json({ error: 'Google login failed. Try again' }); } } catch (error) { console.log(error); } }); module.exports = router;
30.952381
98
0.531795
46c6d422d66e9b3d22326f13eddafea1de251ac9
1,372
js
JavaScript
seedDatabase.js
arol/streetfleet-backend
2371c13435222e7c429630e8e489da2315b7c616
[ "MIT" ]
null
null
null
seedDatabase.js
arol/streetfleet-backend
2371c13435222e7c429630e8e489da2315b7c616
[ "MIT" ]
null
null
null
seedDatabase.js
arol/streetfleet-backend
2371c13435222e7c429630e8e489da2315b7c616
[ "MIT" ]
null
null
null
'use strict'; const Company = require('../models/company'); const Location = require('../models/location'); const companyData = [ { company_name: 'BP', email: 'bingbong@pp.com', username: 'gonkit', password: 'g4hj32gj', fleet: [ { car_id: '12344234', car_model: 'Abrams Tank', license_number: '3g329423', MAC_address: 'a5:b7:cc:98:45', total_driving_time: 200, total_km_driven: 400 } ] }, { company_name: 'Shell oil', email: 'boombamg@pp.com', username: 'bigby', password: '2g999999j', fleet: [ { car_id: '12344234', car_model: 'hoop-D', license_number: '39423', MAC_address: 'a5:b7:bb:98:45', total_driving_time: 300, total_km_driven: 78 } ] }, { company_name: 'Exxon', email: 'boombamg@pp.com', username: 'bigby', password: '2g999999j', fleet: [ { car_id: '12344234', car_model: 'hoop-D', license_number: '39423', MAC_address: 'a5:b7:bb:98:45', total_driving_time: 300, total_km_driven: 78 } ] } ] companyData.forEach( (comp) => { const newCompany = new Company ((comp)); // creates new document newCompany.save(); // inserts the document into collection. save is mongoose method for documents });
22.129032
99
0.564869
46c7574d5d9e0a286fbde73ff33dc2cd1a5d77b3
2,423
js
JavaScript
src/webui/src/js/views/modals/finishConfirmation.directive.js
Dabble-of-DevOps-Bio/ella
e38631d302611a143c9baaa684bcbd014d9734e4
[ "MIT" ]
null
null
null
src/webui/src/js/views/modals/finishConfirmation.directive.js
Dabble-of-DevOps-Bio/ella
e38631d302611a143c9baaa684bcbd014d9734e4
[ "MIT" ]
null
null
null
src/webui/src/js/views/modals/finishConfirmation.directive.js
Dabble-of-DevOps-Bio/ella
e38631d302611a143c9baaa684bcbd014d9734e4
[ "MIT" ]
null
null
null
import app from '../../ng-decorators' import { connect } from '@cerebral/angularjs' import { state, signal } from 'cerebral/tags' import canFinalize from '../../store/modules/views/workflows/computed/canFinalize' import template from './finishConfirmation.ngtmpl.html' // eslint-disable-line no-unused-vars import getSelectedInterpretation from '../../store/modules/views/workflows/computed/getSelectedInterpretation' app.component('finishConfirmation', { templateUrl: 'finishConfirmation.ngtmpl.html', controller: connect( { selectedInterpretation: getSelectedInterpretation, type: state`views.workflows.type`, canFinalize, isSubmitting: state`views.workflows.modals.finishConfirmation.submitting`, finishClicked: signal`views.workflows.modals.finishConfirmation.finishConfirmationClicked`, dismissClicked: signal`views.workflows.modals.finishConfirmation.dismissClicked` }, 'FinishConfirmation', [ '$scope', ($scope) => { const $ctrl = $scope.$ctrl Object.assign($ctrl, { close() { $ctrl.dismissClicked() }, getSelectedStatus() { if (!$ctrl.selectedStatus) { $ctrl.selectedStatus = $ctrl.getWorkflowStatus() } return $ctrl.selectedStatus }, getWorkflowStatus() { return $ctrl.selectedInterpretation.workflow_status }, selectStatus(status) { $ctrl.selectedStatus = status }, getClass(status) { return status === $ctrl.selectedStatus ? 'blue' : 'normal' }, finishDisabled() { return ( ($ctrl.getSelectedStatus() == 'Finalized' && !$ctrl.canFinalize.canFinalize) || $ctrl.isSubmitting ) }, finishButtonText() { return $ctrl.isSubmitting ? 'Please wait' : 'Finish' } }) } ] ) })
41.067797
110
0.498556
46c9ea50744aedf66ed11849afbf6b3b1b26a6c7
167
js
JavaScript
src/index.js
elmao79/react-pretty-input
97b4b37ddeac1de8b066673a3083f0057988dbac
[ "MIT" ]
1
2018-07-12T08:55:31.000Z
2018-07-12T08:55:31.000Z
src/index.js
elmao79/react-pretty-input
97b4b37ddeac1de8b066673a3083f0057988dbac
[ "MIT" ]
null
null
null
src/index.js
elmao79/react-pretty-input
97b4b37ddeac1de8b066673a3083f0057988dbac
[ "MIT" ]
null
null
null
export { default as PrettyInputText } from './components/PrettyInputText.jsx'; export { default as PrettyInputTextArea } from './components/PrettyInputTextArea.jsx';
41.75
86
0.790419
46c9ffcd4a23200fe3f3a9a56e3d541317d7e47c
7,122
js
JavaScript
visualization/bar_gas_month.js
stanhelsloot/project
8da0927777a95fa3ed6f1fcc3704c26f1c8433d0
[ "MIT" ]
null
null
null
visualization/bar_gas_month.js
stanhelsloot/project
8da0927777a95fa3ed6f1fcc3704c26f1c8433d0
[ "MIT" ]
null
null
null
visualization/bar_gas_month.js
stanhelsloot/project
8da0927777a95fa3ed6f1fcc3704c26f1c8433d0
[ "MIT" ]
null
null
null
// Stan Helsloot, 10762388 // Renders a histogram of the yearly gas extraction by NAM var requestsBarMonth = [d3.json("../../data/data_refined/data_months.json")]; // for storage of global variables in update functions var barDims = {}; var gasYearInitial = 1971; var gasYearFinal = 2019; var month = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; // main function for making monthly gas extraction histogram. var barMonth = function() { Promise.all(requestsBarMonth) .then(function(response) { var draw = barMakerMonth(response); }); }; // creates the first histogram function barMakerMonth(data) { // tooltip of bar_month var tip = d3.tip() .attr('class', 'd3-tip') .offset([-10, 0]); barDims.tip = tip; // sizes and margins var w = 400; var h = 300; var margin = { top: 80, right: 50, bottom: 20, left: 50 }; // adding the measurements to the global variable barDims barDims.w = w; barDims.h = h; barDims.margin = margin; // creating a svg object and adding it to an specified element on the page var svg = d3.select("div#extrMonth") .append("svg") .attr("id", "month") .attr("width", w + margin.left + margin.right) .attr("height", h + margin.top + margin.bottom); // selecting the correct data and obtaining the keys data = data[0]; var keys = Object.keys(data); // collect, process and save data of all years var dataRefined = []; for (var j = gasYearInitial; j < gasYearFinal; j++) { // empty the dataRefined list dataRefined = []; for (i = 0; i < keys.length; i++) { if (parseInt(keys[i]) == j) { // convert the numeric data to [data] billion m^3 dataRefined.push([month[i % 12], data[keys[i]] / 1e9]); } barDims[j] = dataRefined; } } // collect extraction data per year to obtain maximum value per year var dataArray = []; for (i = 0; i < barDims[2018].length; i++) { dataArray.push(barDims[2018][i][1]); } // setting data data = dataRefined; // setting the yScale and making it global for use in update function var yScale = d3.scaleLinear() .domain([0, Math.max(...dataArray)]) .range([h, margin.top]); barDims.yScale = yScale; // creating the bars for the histogram svg.append("g") .attr("id", "rectGroupMonth") .selectAll("rect") .data(data) .enter() .append("rect") .attr("id", "rect") .attr("width", w / data.length) .attr("transform", "translate(" + margin.left + ",0)") .attr("x", function(d, i) { return i * (w / data.length); }) .attr("y", function(d) { return yScale(d[1]); }) .attr("height", function(d) { return h - yScale(d[1]); }) .style("fill", "rgba(150,150,150, 1)") .on('mouseover', function(d) { // make a banner with the month and amount of gas extracted tip.html(function() { return "<strong>Month: </strong><span class='details'>" + d[0] + "<br></span>" + "<strong>Gas in billion Nm^3: </strong><span class='details'>" + Math.round(d[1] * 100) / 100 + "</span>"; }); tip.show(); d3.select(this) .style("fill", "rgba(123,50,148, 1)"); }) .on('mouseout', function(d) { tip.hide(); d3.select(this) .style("fill", "rgba(150,150,150, 1)"); }); // activating the tooltip svg.call(tip); // appending title svg.append("text") .attr("id", "bar_month_title") .attr("class", "title") .attr("y", margin.top / 2) .attr("x", margin.left) .text("Monthly total of gas extracted in 2018"); // set xScale using the name abbreviation per month var xScale = d3.scaleBand() .rangeRound([0, w]) .padding(0.1) .domain(month); // setting yAxis var yAxis = d3.axisLeft() .scale(yScale) .ticks(5); // globalize yAxis barDims.yAxis = yAxis; // setting xAxis var xAxis = d3.axisBottom() .scale(xScale); // appending yAxis svg.append("g") .attr("class", "yaxis") .attr("id", "month_y") .attr("transform", "translate(" + margin.left + ",0)") .call(yAxis); // appending xAxis svg.append("g") .attr("class", "xaxis") .attr("id", "month_x") .attr("transform", "translate(" + margin.left + "," + h + ")") .call(xAxis); // append xAxis text svg.append("text") .attr("transform", "translate(" + (w / 2) + " ," + (h + margin.top / 1.5) + ")") .style("text-anchor", "start") .text("Month"); // Append yAxis text svg.append("text") .attr("transform", "rotate(-90)") .attr("x", -h) .attr("y", margin.left / 3) .text("Gas extraction in billion Nm^3"); // making the slider as global as possible for further use in stacked_year.js // taken from https://github.com/johnwalley/d3-simple-slider sliderBar = d3.sliderBottom() .min(gasYearInitial) .max(gasYearFinal - 1) .width(w) .tickFormat(d3.format('.4')) .ticks(10) .step(1) .default(gasYearFinal) .fill("black") .on('onchange', val => { d3.select('p#value-step').text(val); setYear(val); }); // setting location for the slider var g = svg.append('g') .attr("transform", "translate("+margin.left+", "+ h * 1.21 +")"); // activate the slider g.call(sliderBar); } // update function for the monthly extraction chart function setYear(year) { // select and update title with selected year d3.selectAll("#bar_month_title") .text("Monthly total of gas extracted in " + year + ""); // select the choosen year data = barDims[year]; // collecting extraction data of choosen year for use in setting yScale var dataArray = []; for (i = 0; i < data.length; i++) { dataArray.push(data[i][1]); } // setting the yScale (updating it because it is to be used in yAxis) var yScale = barDims.yScale.domain([0, Math.max(...dataArray)]); // select the correct svg var rectGroup = d3.selectAll("#rectGroupMonth"); // changing the rectangles to fit the new data var rect = rectGroup.selectAll("#rect") .data(data) .transition() .duration(750) .attr("height", function(d) { return barDims.h - yScale(d[1]); }) .attr("y", function(d) { return yScale(d[1]); }); // updating the axis to addapt to the new yScale // barDims.yAxis.scale(yScale) var yAxis = d3.axisLeft() .scale(yScale) .ticks(5); d3.selectAll("#month_y") .transition() .duration(750) .call(yAxis); }
28.374502
80
0.546054
46ca999688d8c2aca8c11ad2986f768af636ba41
168,609
js
JavaScript
public_html/media/editors/codemirror/lib/codemirror.min.js
Danial41/-
1533bfef5528b95ade256495065de27c0760fb01
[ "MIT", "Unlicense" ]
null
null
null
public_html/media/editors/codemirror/lib/codemirror.min.js
Danial41/-
1533bfef5528b95ade256495065de27c0760fb01
[ "MIT", "Unlicense" ]
1
2022-02-10T21:24:17.000Z
2022-02-10T21:24:17.000Z
public_html/media/editors/codemirror/lib/codemirror.min.js
Danial41/-
1533bfef5528b95ade256495065de27c0760fb01
[ "MIT", "Unlicense" ]
2
2020-03-05T09:24:37.000Z
2021-02-19T04:19:37.000Z
!(function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.CodeMirror=b()})(this,(function(){"use strict";function a(a){return new RegExp("(^|\\s)"+a+"(?:$|\\s)\\s*")}function b(a){for(var b=a.childNodes.length;b>0;--b)a.removeChild(a.firstChild);return a}function c(a,c){return b(a).appendChild(c)}function d(a,b,c,d){var e=document.createElement(a);if(c&&(e.className=c),d&&(e.style.cssText=d),"string"==typeof b)e.appendChild(document.createTextNode(b));else if(b)for(var f=0;f<b.length;++f)e.appendChild(b[f]);return e}function e(a,b,c,e){var f=d(a,b,c,e);return f.setAttribute("role","presentation"),f}function f(a,b){if(3==b.nodeType&&(b=b.parentNode),a.contains)return a.contains(b);do if(11==b.nodeType&&(b=b.host),b==a)return!0;while(b=b.parentNode)}function g(){var a;try{a=document.activeElement}catch(b){a=document.body||null}for(;a&&a.shadowRoot&&a.shadowRoot.activeElement;)a=a.shadowRoot.activeElement;return a}function h(b,c){var d=b.className;a(c).test(d)||(b.className+=(d?" ":"")+c)}function i(b,c){for(var d=b.split(" "),e=0;e<d.length;e++)d[e]&&!a(d[e]).test(c)&&(c+=" "+d[e]);return c}function j(a){var b=Array.prototype.slice.call(arguments,1);return function(){return a.apply(null,b)}}function k(a,b,c){b||(b={});for(var d in a)!a.hasOwnProperty(d)||c===!1&&b.hasOwnProperty(d)||(b[d]=a[d]);return b}function l(a,b,c,d,e){null==b&&(b=a.search(/[^\s\u00a0]/),b==-1&&(b=a.length));for(var f=d||0,g=e||0;;){var h=a.indexOf("\t",f);if(h<0||h>=b)return g+(b-f);g+=h-f,g+=c-g%c,f=h+1}}function m(a,b){for(var c=0;c<a.length;++c)if(a[c]==b)return c;return-1}function n(a,b,c){for(var d=0,e=0;;){var f=a.indexOf("\t",d);f==-1&&(f=a.length);var g=f-d;if(f==a.length||e+g>=b)return d+Math.min(g,b-e);if(e+=f-d,e+=c-e%c,d=f+1,e>=b)return d}}function o(a){for(;Xg.length<=a;)Xg.push(p(Xg)+" ");return Xg[a]}function p(a){return a[a.length-1]}function q(a,b){for(var c=[],d=0;d<a.length;d++)c[d]=b(a[d],d);return c}function r(a,b,c){for(var d=0,e=c(b);d<a.length&&c(a[d])<=e;)d++;a.splice(d,0,b)}function s(){}function t(a,b){var c;return Object.create?c=Object.create(a):(s.prototype=a,c=new s),b&&k(b,c),c}function u(a){return/\w/.test(a)||a>"€"&&(a.toUpperCase()!=a.toLowerCase()||Yg.test(a))}function v(a,b){return b?!!(b.source.indexOf("\\w")>-1&&u(a))||b.test(a):u(a)}function w(a){for(var b in a)if(a.hasOwnProperty(b)&&a[b])return!1;return!0}function x(a){return a.charCodeAt(0)>=768&&Zg.test(a)}function y(a,b,c){for(;(c<0?b>0:b<a.length)&&x(a.charAt(b));)b+=c;return b}function z(a,b,c){for(var d=b>c?-1:1;;){if(b==c)return b;var e=(b+c)/2,f=d<0?Math.ceil(e):Math.floor(e);if(f==b)return a(f)?b:c;a(f)?c=f:b=f+d}}function A(a,b,c){var f=this;this.input=c,f.scrollbarFiller=d("div",null,"CodeMirror-scrollbar-filler"),f.scrollbarFiller.setAttribute("cm-not-content","true"),f.gutterFiller=d("div",null,"CodeMirror-gutter-filler"),f.gutterFiller.setAttribute("cm-not-content","true"),f.lineDiv=e("div",null,"CodeMirror-code"),f.selectionDiv=d("div",null,null,"position: relative; z-index: 1"),f.cursorDiv=d("div",null,"CodeMirror-cursors"),f.measure=d("div",null,"CodeMirror-measure"),f.lineMeasure=d("div",null,"CodeMirror-measure"),f.lineSpace=e("div",[f.measure,f.lineMeasure,f.selectionDiv,f.cursorDiv,f.lineDiv],null,"position: relative; outline: none");var g=e("div",[f.lineSpace],"CodeMirror-lines");f.mover=d("div",[g],null,"position: relative"),f.sizer=d("div",[f.mover],"CodeMirror-sizer"),f.sizerWidth=null,f.heightForcer=d("div",null,null,"position: absolute; height: "+Sg+"px; width: 1px;"),f.gutters=d("div",null,"CodeMirror-gutters"),f.lineGutter=null,f.scroller=d("div",[f.sizer,f.heightForcer,f.gutters],"CodeMirror-scroll"),f.scroller.setAttribute("tabIndex","-1"),f.wrapper=d("div",[f.scrollbarFiller,f.gutterFiller,f.scroller],"CodeMirror"),ug&&vg<8&&(f.gutters.style.zIndex=-1,f.scroller.style.paddingRight=0),wg||qg&&Fg||(f.scroller.draggable=!0),a&&(a.appendChild?a.appendChild(f.wrapper):a(f.wrapper)),f.viewFrom=f.viewTo=b.first,f.reportedViewFrom=f.reportedViewTo=b.first,f.view=[],f.renderedView=null,f.externalMeasured=null,f.viewOffset=0,f.lastWrapHeight=f.lastWrapWidth=0,f.updateLineNumbers=null,f.nativeBarWidth=f.barHeight=f.barWidth=0,f.scrollbarsClipped=!1,f.lineNumWidth=f.lineNumInnerWidth=f.lineNumChars=null,f.alignWidgets=!1,f.cachedCharWidth=f.cachedTextHeight=f.cachedPaddingH=null,f.maxLine=null,f.maxLineLength=0,f.maxLineChanged=!1,f.wheelDX=f.wheelDY=f.wheelStartX=f.wheelStartY=null,f.shift=!1,f.selForContextMenu=null,f.activeTouch=null,c.init(f)}function B(a,b){if(b-=a.first,b<0||b>=a.size)throw new Error("There is no line "+(b+a.first)+" in the document.");for(var c=a;!c.lines;)for(var d=0;;++d){var e=c.children[d],f=e.chunkSize();if(b<f){c=e;break}b-=f}return c.lines[b]}function C(a,b,c){var d=[],e=b.line;return a.iter(b.line,c.line+1,(function(a){var f=a.text;e==c.line&&(f=f.slice(0,c.ch)),e==b.line&&(f=f.slice(b.ch)),d.push(f),++e})),d}function D(a,b,c){var d=[];return a.iter(b,c,(function(a){d.push(a.text)})),d}function E(a,b){var c=b-a.height;if(c)for(var d=a;d;d=d.parent)d.height+=c}function F(a){if(null==a.parent)return null;for(var b=a.parent,c=m(b.lines,a),d=b.parent;d;b=d,d=d.parent)for(var e=0;d.children[e]!=b;++e)c+=d.children[e].chunkSize();return c+b.first}function G(a,b){var c=a.first;a:do{for(var d=0;d<a.children.length;++d){var e=a.children[d],f=e.height;if(b<f){a=e;continue a}b-=f,c+=e.chunkSize()}return c}while(!a.lines);for(var g=0;g<a.lines.length;++g){var h=a.lines[g],i=h.height;if(b<i)break;b-=i}return c+g}function H(a,b){return b>=a.first&&b<a.first+a.size}function I(a,b){return String(a.lineNumberFormatter(b+a.firstLineNumber))}function J(a,b,c){return void 0===c&&(c=null),this instanceof J?(this.line=a,this.ch=b,void(this.sticky=c)):new J(a,b,c)}function K(a,b){return a.line-b.line||a.ch-b.ch}function L(a,b){return a.sticky==b.sticky&&0==K(a,b)}function M(a){return J(a.line,a.ch)}function N(a,b){return K(a,b)<0?b:a}function O(a,b){return K(a,b)<0?a:b}function P(a,b){return Math.max(a.first,Math.min(b,a.first+a.size-1))}function Q(a,b){if(b.line<a.first)return J(a.first,0);var c=a.first+a.size-1;return b.line>c?J(c,B(a,c).text.length):R(b,B(a,b.line).text.length)}function R(a,b){var c=a.ch;return null==c||c>b?J(a.line,b):c<0?J(a.line,0):a}function S(a,b){for(var c=[],d=0;d<b.length;d++)c[d]=Q(a,b[d]);return c}function T(){$g=!0}function U(){_g=!0}function V(a,b,c){this.marker=a,this.from=b,this.to=c}function W(a,b){if(a)for(var c=0;c<a.length;++c){var d=a[c];if(d.marker==b)return d}}function X(a,b){for(var c,d=0;d<a.length;++d)a[d]!=b&&(c||(c=[])).push(a[d]);return c}function Y(a,b){a.markedSpans=a.markedSpans?a.markedSpans.concat([b]):[b],b.marker.attachLine(a)}function Z(a,b,c){var d;if(a)for(var e=0;e<a.length;++e){var f=a[e],g=f.marker,h=null==f.from||(g.inclusiveLeft?f.from<=b:f.from<b);if(h||f.from==b&&"bookmark"==g.type&&(!c||!f.marker.insertLeft)){var i=null==f.to||(g.inclusiveRight?f.to>=b:f.to>b);(d||(d=[])).push(new V(g,f.from,i?null:f.to))}}return d}function $(a,b,c){var d;if(a)for(var e=0;e<a.length;++e){var f=a[e],g=f.marker,h=null==f.to||(g.inclusiveRight?f.to>=b:f.to>b);if(h||f.from==b&&"bookmark"==g.type&&(!c||f.marker.insertLeft)){var i=null==f.from||(g.inclusiveLeft?f.from<=b:f.from<b);(d||(d=[])).push(new V(g,i?null:f.from-b,null==f.to?null:f.to-b))}}return d}function _(a,b){if(b.full)return null;var c=H(a,b.from.line)&&B(a,b.from.line).markedSpans,d=H(a,b.to.line)&&B(a,b.to.line).markedSpans;if(!c&&!d)return null;var e=b.from.ch,f=b.to.ch,g=0==K(b.from,b.to),h=Z(c,e,g),i=$(d,f,g),j=1==b.text.length,k=p(b.text).length+(j?e:0);if(h)for(var l=0;l<h.length;++l){var m=h[l];if(null==m.to){var n=W(i,m.marker);n?j&&(m.to=null==n.to?null:n.to+k):m.to=e}}if(i)for(var o=0;o<i.length;++o){var q=i[o];if(null!=q.to&&(q.to+=k),null==q.from){var r=W(h,q.marker);r||(q.from=k,j&&(h||(h=[])).push(q))}else q.from+=k,j&&(h||(h=[])).push(q)}h&&(h=aa(h)),i&&i!=h&&(i=aa(i));var s=[h];if(!j){var t,u=b.text.length-2;if(u>0&&h)for(var v=0;v<h.length;++v)null==h[v].to&&(t||(t=[])).push(new V(h[v].marker,null,null));for(var w=0;w<u;++w)s.push(t);s.push(i)}return s}function aa(a){for(var b=0;b<a.length;++b){var c=a[b];null!=c.from&&c.from==c.to&&c.marker.clearWhenEmpty!==!1&&a.splice(b--,1)}return a.length?a:null}function ba(a,b,c){var d=null;if(a.iter(b.line,c.line+1,(function(a){if(a.markedSpans)for(var b=0;b<a.markedSpans.length;++b){var c=a.markedSpans[b].marker;!c.readOnly||d&&m(d,c)!=-1||(d||(d=[])).push(c)}})),!d)return null;for(var e=[{from:b,to:c}],f=0;f<d.length;++f)for(var g=d[f],h=g.find(0),i=0;i<e.length;++i){var j=e[i];if(!(K(j.to,h.from)<0||K(j.from,h.to)>0)){var k=[i,1],l=K(j.from,h.from),n=K(j.to,h.to);(l<0||!g.inclusiveLeft&&!l)&&k.push({from:j.from,to:h.from}),(n>0||!g.inclusiveRight&&!n)&&k.push({from:h.to,to:j.to}),e.splice.apply(e,k),i+=k.length-3}}return e}function ca(a){var b=a.markedSpans;if(b){for(var c=0;c<b.length;++c)b[c].marker.detachLine(a);a.markedSpans=null}}function da(a,b){if(b){for(var c=0;c<b.length;++c)b[c].marker.attachLine(a);a.markedSpans=b}}function ea(a){return a.inclusiveLeft?-1:0}function fa(a){return a.inclusiveRight?1:0}function ga(a,b){var c=a.lines.length-b.lines.length;if(0!=c)return c;var d=a.find(),e=b.find(),f=K(d.from,e.from)||ea(a)-ea(b);if(f)return-f;var g=K(d.to,e.to)||fa(a)-fa(b);return g?g:b.id-a.id}function ha(a,b){var c,d=_g&&a.markedSpans;if(d)for(var e=void 0,f=0;f<d.length;++f)e=d[f],e.marker.collapsed&&null==(b?e.from:e.to)&&(!c||ga(c,e.marker)<0)&&(c=e.marker);return c}function ia(a){return ha(a,!0)}function ja(a){return ha(a,!1)}function ka(a,b){var c,d=_g&&a.markedSpans;if(d)for(var e=0;e<d.length;++e){var f=d[e];f.marker.collapsed&&(null==f.from||f.from<b)&&(null==f.to||f.to>b)&&(!c||ga(c,f.marker)<0)&&(c=f.marker)}return c}function la(a,b,c,d,e){var f=B(a,b),g=_g&&f.markedSpans;if(g)for(var h=0;h<g.length;++h){var i=g[h];if(i.marker.collapsed){var j=i.marker.find(0),k=K(j.from,c)||ea(i.marker)-ea(e),l=K(j.to,d)||fa(i.marker)-fa(e);if(!(k>=0&&l<=0||k<=0&&l>=0)&&(k<=0&&(i.marker.inclusiveRight&&e.inclusiveLeft?K(j.to,c)>=0:K(j.to,c)>0)||k>=0&&(i.marker.inclusiveRight&&e.inclusiveLeft?K(j.from,d)<=0:K(j.from,d)<0)))return!0}}}function ma(a){for(var b;b=ia(a);)a=b.find(-1,!0).line;return a}function na(a){for(var b;b=ja(a);)a=b.find(1,!0).line;return a}function oa(a){for(var b,c;b=ja(a);)a=b.find(1,!0).line,(c||(c=[])).push(a);return c}function pa(a,b){var c=B(a,b),d=ma(c);return c==d?b:F(d)}function qa(a,b){if(b>a.lastLine())return b;var c,d=B(a,b);if(!ra(a,d))return b;for(;c=ja(d);)d=c.find(1,!0).line;return F(d)+1}function ra(a,b){var c=_g&&b.markedSpans;if(c)for(var d=void 0,e=0;e<c.length;++e)if(d=c[e],d.marker.collapsed){if(null==d.from)return!0;if(!d.marker.widgetNode&&0==d.from&&d.marker.inclusiveLeft&&sa(a,b,d))return!0}}function sa(a,b,c){if(null==c.to){var d=c.marker.find(1,!0);return sa(a,d.line,W(d.line.markedSpans,c.marker))}if(c.marker.inclusiveRight&&c.to==b.text.length)return!0;for(var e=void 0,f=0;f<b.markedSpans.length;++f)if(e=b.markedSpans[f],e.marker.collapsed&&!e.marker.widgetNode&&e.from==c.to&&(null==e.to||e.to!=c.from)&&(e.marker.inclusiveLeft||c.marker.inclusiveRight)&&sa(a,b,e))return!0}function ta(a){a=ma(a);for(var b=0,c=a.parent,d=0;d<c.lines.length;++d){var e=c.lines[d];if(e==a)break;b+=e.height}for(var f=c.parent;f;c=f,f=c.parent)for(var g=0;g<f.children.length;++g){var h=f.children[g];if(h==c)break;b+=h.height}return b}function ua(a){if(0==a.height)return 0;for(var b,c=a.text.length,d=a;b=ia(d);){var e=b.find(0,!0);d=e.from.line,c+=e.from.ch-e.to.ch}for(d=a;b=ja(d);){var f=b.find(0,!0);c-=d.text.length-f.from.ch,d=f.to.line,c+=d.text.length-f.to.ch}return c}function va(a){var b=a.display,c=a.doc;b.maxLine=B(c,c.first),b.maxLineLength=ua(b.maxLine),b.maxLineChanged=!0,c.iter((function(a){var c=ua(a);c>b.maxLineLength&&(b.maxLineLength=c,b.maxLine=a)}))}function wa(a,b,c,d){if(!a)return d(b,c,"ltr",0);for(var e=!1,f=0;f<a.length;++f){var g=a[f];(g.from<c&&g.to>b||b==c&&g.to==b)&&(d(Math.max(g.from,b),Math.min(g.to,c),1==g.level?"rtl":"ltr",f),e=!0)}e||d(b,c,"ltr")}function xa(a,b,c){var d;ah=null;for(var e=0;e<a.length;++e){var f=a[e];if(f.from<b&&f.to>b)return e;f.to==b&&(f.from!=f.to&&"before"==c?d=e:ah=e),f.from==b&&(f.from!=f.to&&"before"!=c?d=e:ah=e)}return null!=d?d:ah}function ya(a,b){var c=a.order;return null==c&&(c=a.order=bh(a.text,b)),c}function za(a,b){return a._handlers&&a._handlers[b]||ch}function Aa(a,b,c){if(a.removeEventListener)a.removeEventListener(b,c,!1);else if(a.detachEvent)a.detachEvent("on"+b,c);else{var d=a._handlers,e=d&&d[b];if(e){var f=m(e,c);f>-1&&(d[b]=e.slice(0,f).concat(e.slice(f+1)))}}}function Ba(a,b){var c=za(a,b);if(c.length)for(var d=Array.prototype.slice.call(arguments,2),e=0;e<c.length;++e)c[e].apply(null,d)}function Ca(a,b,c){return"string"==typeof b&&(b={type:b,preventDefault:function(){this.defaultPrevented=!0}}),Ba(a,c||b.type,a,b),Ia(b)||b.codemirrorIgnore}function Da(a){var b=a._handlers&&a._handlers.cursorActivity;if(b)for(var c=a.curOp.cursorActivityHandlers||(a.curOp.cursorActivityHandlers=[]),d=0;d<b.length;++d)m(c,b[d])==-1&&c.push(b[d])}function Ea(a,b){return za(a,b).length>0}function Fa(a){a.prototype.on=function(a,b){dh(this,a,b)},a.prototype.off=function(a,b){Aa(this,a,b)}}function Ga(a){a.preventDefault?a.preventDefault():a.returnValue=!1}function Ha(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0}function Ia(a){return null!=a.defaultPrevented?a.defaultPrevented:0==a.returnValue}function Ja(a){Ga(a),Ha(a)}function Ka(a){return a.target||a.srcElement}function La(a){var b=a.which;return null==b&&(1&a.button?b=1:2&a.button?b=3:4&a.button&&(b=2)),Gg&&a.ctrlKey&&1==b&&(b=3),b}function Ma(a){if(null==Qg){var b=d("span","​");c(a,d("span",[b,document.createTextNode("x")])),0!=a.firstChild.offsetHeight&&(Qg=b.offsetWidth<=1&&b.offsetHeight>2&&!(ug&&vg<8))}var e=Qg?d("span","​"):d("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return e.setAttribute("cm-text",""),e}function Na(a){if(null!=Rg)return Rg;var d=c(a,document.createTextNode("AخA")),e=Kg(d,0,1).getBoundingClientRect(),f=Kg(d,1,2).getBoundingClientRect();return b(a),!(!e||e.left==e.right)&&(Rg=f.right-e.right<3)}function Oa(a){if(null!=ih)return ih;var b=c(a,d("span","x")),e=b.getBoundingClientRect(),f=Kg(b,0,1).getBoundingClientRect();return ih=Math.abs(e.left-f.left)>1}function Pa(a,b){arguments.length>2&&(b.dependencies=Array.prototype.slice.call(arguments,2)),jh[a]=b}function Qa(a,b){kh[a]=b}function Ra(a){if("string"==typeof a&&kh.hasOwnProperty(a))a=kh[a];else if(a&&"string"==typeof a.name&&kh.hasOwnProperty(a.name)){var b=kh[a.name];"string"==typeof b&&(b={name:b}),a=t(b,a),a.name=b.name}else{if("string"==typeof a&&/^[\w\-]+\/[\w\-]+\+xml$/.test(a))return Ra("application/xml");if("string"==typeof a&&/^[\w\-]+\/[\w\-]+\+json$/.test(a))return Ra("application/json")}return"string"==typeof a?{name:a}:a||{name:"null"}}function Sa(a,b){b=Ra(b);var c=jh[b.name];if(!c)return Sa(a,"text/plain");var d=c(a,b);if(lh.hasOwnProperty(b.name)){var e=lh[b.name];for(var f in e)e.hasOwnProperty(f)&&(d.hasOwnProperty(f)&&(d["_"+f]=d[f]),d[f]=e[f])}if(d.name=b.name,b.helperType&&(d.helperType=b.helperType),b.modeProps)for(var g in b.modeProps)d[g]=b.modeProps[g];return d}function Ta(a,b){var c=lh.hasOwnProperty(a)?lh[a]:lh[a]={};k(b,c)}function Ua(a,b){if(b===!0)return b;if(a.copyState)return a.copyState(b);var c={};for(var d in b){var e=b[d];e instanceof Array&&(e=e.concat([])),c[d]=e}return c}function Va(a,b){for(var c;a.innerMode&&(c=a.innerMode(b),c&&c.mode!=a);)b=c.state,a=c.mode;return c||{mode:a,state:b}}function Wa(a,b,c){return!a.startState||a.startState(b,c)}function Xa(a,b,c,d){var e=[a.state.modeGen],f={};db(a,b.text,a.doc.mode,c,(function(a,b){return e.push(a,b)}),f,d);for(var g=c.state,h=function(d){c.baseTokens=e;var h=a.state.overlays[d],i=1,j=0;c.state=!0,db(a,b.text,h.mode,c,(function(a,b){for(var c=i;j<a;){var d=e[i];d>a&&e.splice(i,1,a,e[i+1],d),i+=2,j=Math.min(a,d)}if(b)if(h.opaque)e.splice(c,i-c,a,"overlay "+b),i=c+2;else for(;c<i;c+=2){var f=e[c+1];e[c+1]=(f?f+" ":"")+"overlay "+b}}),f),c.state=g,c.baseTokens=null,c.baseTokenPos=1},i=0;i<a.state.overlays.length;++i)h(i);return{styles:e,classes:f.bgClass||f.textClass?f:null}}function Ya(a,b,c){if(!b.styles||b.styles[0]!=a.state.modeGen){var d=Za(a,F(b)),e=b.text.length>a.options.maxHighlightLength&&Ua(a.doc.mode,d.state),f=Xa(a,b,d);e&&(d.state=e),b.stateAfter=d.save(!e),b.styles=f.styles,f.classes?b.styleClasses=f.classes:b.styleClasses&&(b.styleClasses=null),c===a.doc.highlightFrontier&&(a.doc.modeFrontier=Math.max(a.doc.modeFrontier,++a.doc.highlightFrontier))}return b.styles}function Za(a,b,c){var d=a.doc,e=a.display;if(!d.mode.startState)return new oh(d,!0,b);var f=eb(a,b,c),g=f>d.first&&B(d,f-1).stateAfter,h=g?oh.fromSaved(d,g,f):new oh(d,Wa(d.mode),f);return d.iter(f,b,(function(c){$a(a,c.text,h);var d=h.line;c.stateAfter=d==b-1||d%5==0||d>=e.viewFrom&&d<e.viewTo?h.save():null,h.nextLine()})),c&&(d.modeFrontier=h.line),h}function $a(a,b,c,d){var e=a.doc.mode,f=new mh(b,a.options.tabSize,c);for(f.start=f.pos=d||0,""==b&&_a(e,c.state);!f.eol();)ab(e,f,c.state),f.start=f.pos}function _a(a,b){if(a.blankLine)return a.blankLine(b);if(a.innerMode){var c=Va(a,b);return c.mode.blankLine?c.mode.blankLine(c.state):void 0}}function ab(a,b,c,d){for(var e=0;e<10;e++){d&&(d[0]=Va(a,c).mode);var f=a.token(b,c);if(b.pos>b.start)return f}throw new Error("Mode "+a.name+" failed to advance stream.")}function bb(a,b,c,d){var e,f=a.doc,g=f.mode;b=Q(f,b);var h,i=B(f,b.line),j=Za(a,b.line,c),k=new mh(i.text,a.options.tabSize,j);for(d&&(h=[]);(d||k.pos<b.ch)&&!k.eol();)k.start=k.pos,e=ab(g,k,j.state),d&&h.push(new ph(k,e,Ua(f.mode,j.state)));return d?h:new ph(k,e,j.state)}function cb(a,b){if(a)for(;;){var c=a.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!c)break;a=a.slice(0,c.index)+a.slice(c.index+c[0].length);var d=c[1]?"bgClass":"textClass";null==b[d]?b[d]=c[2]:new RegExp("(?:^|s)"+c[2]+"(?:$|s)").test(b[d])||(b[d]+=" "+c[2])}return a}function db(a,b,c,d,e,f,g){var h=c.flattenSpans;null==h&&(h=a.options.flattenSpans);var i,j=0,k=null,l=new mh(b,a.options.tabSize,d),m=a.options.addModeClass&&[null];for(""==b&&cb(_a(c,d.state),f);!l.eol();){if(l.pos>a.options.maxHighlightLength?(h=!1,g&&$a(a,b,d,l.pos),l.pos=b.length,i=null):i=cb(ab(c,l,d.state,m),f),m){var n=m[0].name;n&&(i="m-"+(i?n+" "+i:n))}if(!h||k!=i){for(;j<l.start;)j=Math.min(l.start,j+5e3),e(j,k);k=i}l.start=l.pos}for(;j<l.pos;){var o=Math.min(l.pos,j+5e3);e(o,k),j=o}}function eb(a,b,c){for(var d,e,f=a.doc,g=c?-1:b-(a.doc.mode.innerMode?1e3:100),h=b;h>g;--h){if(h<=f.first)return f.first;var i=B(f,h-1),j=i.stateAfter;if(j&&(!c||h+(j instanceof nh?j.lookAhead:0)<=f.modeFrontier))return h;var k=l(i.text,null,a.options.tabSize);(null==e||d>k)&&(e=h-1,d=k)}return e}function fb(a,b){if(a.modeFrontier=Math.min(a.modeFrontier,b),!(a.highlightFrontier<b-10)){for(var c=a.first,d=b-1;d>c;d--){var e=B(a,d).stateAfter;if(e&&(!(e instanceof nh)||d+e.lookAhead<b)){c=d+1;break}}a.highlightFrontier=Math.min(a.highlightFrontier,c)}}function gb(a,b,c,d){a.text=b,a.stateAfter&&(a.stateAfter=null),a.styles&&(a.styles=null),null!=a.order&&(a.order=null),ca(a),da(a,c);var e=d?d(a):1;e!=a.height&&E(a,e)}function hb(a){a.parent=null,ca(a)}function ib(a,b){if(!a||/^\s*$/.test(a))return null;var c=b.addModeClass?th:sh;return c[a]||(c[a]=a.replace(/\S+/g,"cm-$&"))}function jb(a,b){var c=e("span",null,null,wg?"padding-right: .1px":null),d={pre:e("pre",[c],"CodeMirror-line"),content:c,col:0,pos:0,cm:a,trailingSpace:!1,splitSpaces:(ug||wg)&&a.getOption("lineWrapping")};b.measure={};for(var f=0;f<=(b.rest?b.rest.length:0);f++){var g=f?b.rest[f-1]:b.line,h=void 0;d.pos=0,d.addToken=lb,Na(a.display.measure)&&(h=ya(g,a.doc.direction))&&(d.addToken=nb(d.addToken,h)),d.map=[];var j=b!=a.display.externalMeasured&&F(g);pb(g,d,Ya(a,g,j)),g.styleClasses&&(g.styleClasses.bgClass&&(d.bgClass=i(g.styleClasses.bgClass,d.bgClass||"")),g.styleClasses.textClass&&(d.textClass=i(g.styleClasses.textClass,d.textClass||""))),0==d.map.length&&d.map.push(0,0,d.content.appendChild(Ma(a.display.measure))),0==f?(b.measure.map=d.map,b.measure.cache={}):((b.measure.maps||(b.measure.maps=[])).push(d.map),(b.measure.caches||(b.measure.caches=[])).push({}))}if(wg){var k=d.content.lastChild;(/\bcm-tab\b/.test(k.className)||k.querySelector&&k.querySelector(".cm-tab"))&&(d.content.className="cm-tab-wrap-hack")}return Ba(a,"renderLine",a,b.line,d.pre),d.pre.className&&(d.textClass=i(d.pre.className,d.textClass||"")),d}function kb(a){var b=d("span","•","cm-invalidchar");return b.title="\\u"+a.charCodeAt(0).toString(16),b.setAttribute("aria-label",b.title),b}function lb(a,b,c,e,f,g,h){if(b){var i,j=a.splitSpaces?mb(b,a.trailingSpace):b,k=a.cm.state.specialChars,l=!1;if(k.test(b)){i=document.createDocumentFragment();for(var m=0;;){k.lastIndex=m;var n=k.exec(b),p=n?n.index-m:b.length-m;if(p){var q=document.createTextNode(j.slice(m,m+p));ug&&vg<9?i.appendChild(d("span",[q])):i.appendChild(q),a.map.push(a.pos,a.pos+p,q),a.col+=p,a.pos+=p}if(!n)break;m+=p+1;var r=void 0;if("\t"==n[0]){var s=a.cm.options.tabSize,t=s-a.col%s;r=i.appendChild(d("span",o(t),"cm-tab")),r.setAttribute("role","presentation"),r.setAttribute("cm-text","\t"),a.col+=t}else"\r"==n[0]||"\n"==n[0]?(r=i.appendChild(d("span","\r"==n[0]?"␍":"␤","cm-invalidchar")),r.setAttribute("cm-text",n[0]),a.col+=1):(r=a.cm.options.specialCharPlaceholder(n[0]),r.setAttribute("cm-text",n[0]),ug&&vg<9?i.appendChild(d("span",[r])):i.appendChild(r),a.col+=1);a.map.push(a.pos,a.pos+1,r),a.pos++}}else a.col+=b.length,i=document.createTextNode(j),a.map.push(a.pos,a.pos+b.length,i),ug&&vg<9&&(l=!0),a.pos+=b.length;if(a.trailingSpace=32==j.charCodeAt(b.length-1),c||e||f||l||h){var u=c||"";e&&(u+=e),f&&(u+=f);var v=d("span",[i],u,h);return g&&(v.title=g),a.content.appendChild(v)}a.content.appendChild(i)}}function mb(a,b){if(a.length>1&&!/ /.test(a))return a;for(var c=b,d="",e=0;e<a.length;e++){var f=a.charAt(e);" "!=f||!c||e!=a.length-1&&32!=a.charCodeAt(e+1)||(f=" "),d+=f,c=" "==f}return d}function nb(a,b){return function(c,d,e,f,g,h,i){e=e?e+" cm-force-border":"cm-force-border";for(var j=c.pos,k=j+d.length;;){for(var l=void 0,m=0;m<b.length&&(l=b[m],!(l.to>j&&l.from<=j));m++);if(l.to>=k)return a(c,d,e,f,g,h,i);a(c,d.slice(0,l.to-j),e,f,null,h,i),f=null,d=d.slice(l.to-j),j=l.to}}}function ob(a,b,c,d){var e=!d&&c.widgetNode;e&&a.map.push(a.pos,a.pos+b,e),!d&&a.cm.display.input.needsContentAttribute&&(e||(e=a.content.appendChild(document.createElement("span"))),e.setAttribute("cm-marker",c.id)),e&&(a.cm.display.input.setUneditable(e),a.content.appendChild(e)),a.pos+=b,a.trailingSpace=!1}function pb(a,b,c){var d=a.markedSpans,e=a.text,f=0;if(d)for(var g,h,i,j,k,l,m,n=e.length,o=0,p=1,q="",r=0;;){if(r==o){i=j=k=l=h="",m=null,r=1/0;for(var s=[],t=void 0,u=0;u<d.length;++u){var v=d[u],w=v.marker;"bookmark"==w.type&&v.from==o&&w.widgetNode?s.push(w):v.from<=o&&(null==v.to||v.to>o||w.collapsed&&v.to==o&&v.from==o)?(null!=v.to&&v.to!=o&&r>v.to&&(r=v.to,j=""),w.className&&(i+=" "+w.className),w.css&&(h=(h?h+";":"")+w.css),w.startStyle&&v.from==o&&(k+=" "+w.startStyle),w.endStyle&&v.to==r&&(t||(t=[])).push(w.endStyle,v.to),w.title&&!l&&(l=w.title),w.collapsed&&(!m||ga(m.marker,w)<0)&&(m=v)):v.from>o&&r>v.from&&(r=v.from)}if(t)for(var x=0;x<t.length;x+=2)t[x+1]==r&&(j+=" "+t[x]);if(!m||m.from==o)for(var y=0;y<s.length;++y)ob(b,0,s[y]);if(m&&(m.from||0)==o){if(ob(b,(null==m.to?n+1:m.to)-o,m.marker,null==m.from),null==m.to)return;m.to==o&&(m=!1)}}if(o>=n)break;for(var z=Math.min(n,r);;){if(q){var A=o+q.length;if(!m){var B=A>z?q.slice(0,z-o):q;b.addToken(b,B,g?g+i:i,k,o+B.length==r?j:"",l,h)}if(A>=z){q=q.slice(z-o),o=z;break}o=A,k=""}q=e.slice(f,f=c[p++]),g=ib(c[p++],b.cm.options)}}else for(var C=1;C<c.length;C+=2)b.addToken(b,e.slice(f,f=c[C]),ib(c[C+1],b.cm.options))}function qb(a,b,c){this.line=b,this.rest=oa(b),this.size=this.rest?F(p(this.rest))-c+1:1,this.node=this.text=null,this.hidden=ra(a,b)}function rb(a,b,c){for(var d,e=[],f=b;f<c;f=d){var g=new qb(a.doc,B(a.doc,f),f);d=f+g.size,e.push(g)}return e}function sb(a){uh?uh.ops.push(a):a.ownsGroup=uh={ops:[a],delayedCallbacks:[]}}function tb(a){var b=a.delayedCallbacks,c=0;do{for(;c<b.length;c++)b[c].call(null);for(var d=0;d<a.ops.length;d++){var e=a.ops[d];if(e.cursorActivityHandlers)for(;e.cursorActivityCalled<e.cursorActivityHandlers.length;)e.cursorActivityHandlers[e.cursorActivityCalled++].call(null,e.cm)}}while(c<b.length)}function ub(a,b){var c=a.ownsGroup;if(c)try{tb(c)}finally{uh=null,b(c)}}function vb(a,b){var c=za(a,b);if(c.length){var d,e=Array.prototype.slice.call(arguments,2);uh?d=uh.delayedCallbacks:vh?d=vh:(d=vh=[],setTimeout(wb,0));for(var f=function(a){d.push((function(){return c[a].apply(null,e)}))},g=0;g<c.length;++g)f(g)}}function wb(){var a=vh;vh=null;for(var b=0;b<a.length;++b)a[b]()}function xb(a,b,c,d){for(var e=0;e<b.changes.length;e++){var f=b.changes[e];"text"==f?Bb(a,b):"gutter"==f?Db(a,b,c,d):"class"==f?Cb(a,b):"widget"==f&&Eb(a,b,d)}b.changes=null}function yb(a){return a.node==a.text&&(a.node=d("div",null,null,"position: relative"),a.text.parentNode&&a.text.parentNode.replaceChild(a.node,a.text),a.node.appendChild(a.text),ug&&vg<8&&(a.node.style.zIndex=2)),a.node}function zb(a,b){var c=b.bgClass?b.bgClass+" "+(b.line.bgClass||""):b.line.bgClass;if(c&&(c+=" CodeMirror-linebackground"),b.background)c?b.background.className=c:(b.background.parentNode.removeChild(b.background),b.background=null);else if(c){var e=yb(b);b.background=e.insertBefore(d("div",null,c),e.firstChild),a.display.input.setUneditable(b.background)}}function Ab(a,b){var c=a.display.externalMeasured;return c&&c.line==b.line?(a.display.externalMeasured=null,b.measure=c.measure,c.built):jb(a,b)}function Bb(a,b){var c=b.text.className,d=Ab(a,b);b.text==b.node&&(b.node=d.pre),b.text.parentNode.replaceChild(d.pre,b.text),b.text=d.pre,d.bgClass!=b.bgClass||d.textClass!=b.textClass?(b.bgClass=d.bgClass,b.textClass=d.textClass,Cb(a,b)):c&&(b.text.className=c)}function Cb(a,b){zb(a,b),b.line.wrapClass?yb(b).className=b.line.wrapClass:b.node!=b.text&&(b.node.className="");var c=b.textClass?b.textClass+" "+(b.line.textClass||""):b.line.textClass;b.text.className=c||""}function Db(a,b,c,e){if(b.gutter&&(b.node.removeChild(b.gutter),b.gutter=null),b.gutterBackground&&(b.node.removeChild(b.gutterBackground),b.gutterBackground=null),b.line.gutterClass){var f=yb(b);b.gutterBackground=d("div",null,"CodeMirror-gutter-background "+b.line.gutterClass,"left: "+(a.options.fixedGutter?e.fixedPos:-e.gutterTotalWidth)+"px; width: "+e.gutterTotalWidth+"px"),a.display.input.setUneditable(b.gutterBackground),f.insertBefore(b.gutterBackground,b.text)}var g=b.line.gutterMarkers;if(a.options.lineNumbers||g){var h=yb(b),i=b.gutter=d("div",null,"CodeMirror-gutter-wrapper","left: "+(a.options.fixedGutter?e.fixedPos:-e.gutterTotalWidth)+"px");if(a.display.input.setUneditable(i),h.insertBefore(i,b.text),b.line.gutterClass&&(i.className+=" "+b.line.gutterClass),!a.options.lineNumbers||g&&g["CodeMirror-linenumbers"]||(b.lineNumber=i.appendChild(d("div",I(a.options,c),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+e.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+a.display.lineNumInnerWidth+"px"))),g)for(var j=0;j<a.options.gutters.length;++j){var k=a.options.gutters[j],l=g.hasOwnProperty(k)&&g[k];l&&i.appendChild(d("div",[l],"CodeMirror-gutter-elt","left: "+e.gutterLeft[k]+"px; width: "+e.gutterWidth[k]+"px"))}}}function Eb(a,b,c){b.alignable&&(b.alignable=null);for(var d=b.node.firstChild,e=void 0;d;d=e)e=d.nextSibling,"CodeMirror-linewidget"==d.className&&b.node.removeChild(d);Gb(a,b,c)}function Fb(a,b,c,d){var e=Ab(a,b);return b.text=b.node=e.pre,e.bgClass&&(b.bgClass=e.bgClass),e.textClass&&(b.textClass=e.textClass),Cb(a,b),Db(a,b,c,d),Gb(a,b,d),b.node}function Gb(a,b,c){if(Hb(a,b.line,b,c,!0),b.rest)for(var d=0;d<b.rest.length;d++)Hb(a,b.rest[d],b,c,!1)}function Hb(a,b,c,e,f){if(b.widgets)for(var g=yb(c),h=0,i=b.widgets;h<i.length;++h){var j=i[h],k=d("div",[j.node],"CodeMirror-linewidget");j.handleMouseEvents||k.setAttribute("cm-ignore-events","true"),Ib(j,k,c,e),a.display.input.setUneditable(k),f&&j.above?g.insertBefore(k,c.gutter||c.text):g.appendChild(k),vb(j,"redraw")}}function Ib(a,b,c,d){if(a.noHScroll){(c.alignable||(c.alignable=[])).push(b);var e=d.wrapperWidth;b.style.left=d.fixedPos+"px",a.coverGutter||(e-=d.gutterTotalWidth,b.style.paddingLeft=d.gutterTotalWidth+"px"),b.style.width=e+"px"}a.coverGutter&&(b.style.zIndex=5,b.style.position="relative",a.noHScroll||(b.style.marginLeft=-d.gutterTotalWidth+"px"))}function Jb(a){if(null!=a.height)return a.height;var b=a.doc.cm;if(!b)return 0;if(!f(document.body,a.node)){var e="position: relative;";a.coverGutter&&(e+="margin-left: -"+b.display.gutters.offsetWidth+"px;"),a.noHScroll&&(e+="width: "+b.display.wrapper.clientWidth+"px;"),c(b.display.measure,d("div",[a.node],null,e))}return a.height=a.node.parentNode.offsetHeight}function Kb(a,b){for(var c=Ka(b);c!=a.wrapper;c=c.parentNode)if(!c||1==c.nodeType&&"true"==c.getAttribute("cm-ignore-events")||c.parentNode==a.sizer&&c!=a.mover)return!0}function Lb(a){return a.lineSpace.offsetTop}function Mb(a){return a.mover.offsetHeight-a.lineSpace.offsetHeight}function Nb(a){if(a.cachedPaddingH)return a.cachedPaddingH;var b=c(a.measure,d("pre","x")),e=window.getComputedStyle?window.getComputedStyle(b):b.currentStyle,f={left:parseInt(e.paddingLeft),right:parseInt(e.paddingRight)};return isNaN(f.left)||isNaN(f.right)||(a.cachedPaddingH=f),f}function Ob(a){return Sg-a.display.nativeBarWidth}function Pb(a){return a.display.scroller.clientWidth-Ob(a)-a.display.barWidth}function Qb(a){return a.display.scroller.clientHeight-Ob(a)-a.display.barHeight}function Rb(a,b,c){var d=a.options.lineWrapping,e=d&&Pb(a);if(!b.measure.heights||d&&b.measure.width!=e){var f=b.measure.heights=[];if(d){b.measure.width=e;for(var g=b.text.firstChild.getClientRects(),h=0;h<g.length-1;h++){var i=g[h],j=g[h+1];Math.abs(i.bottom-j.bottom)>2&&f.push((i.bottom+j.top)/2-c.top)}}f.push(c.bottom-c.top)}}function Sb(a,b,c){if(a.line==b)return{map:a.measure.map,cache:a.measure.cache};for(var d=0;d<a.rest.length;d++)if(a.rest[d]==b)return{map:a.measure.maps[d],cache:a.measure.caches[d]};for(var e=0;e<a.rest.length;e++)if(F(a.rest[e])>c)return{map:a.measure.maps[e],cache:a.measure.caches[e],before:!0}}function Tb(a,b){b=ma(b);var d=F(b),e=a.display.externalMeasured=new qb(a.doc,b,d);e.lineN=d;var f=e.built=jb(a,e);return e.text=f.pre,c(a.display.lineMeasure,f.pre),e}function Ub(a,b,c,d){return Xb(a,Wb(a,b),c,d)}function Vb(a,b){if(b>=a.display.viewFrom&&b<a.display.viewTo)return a.display.view[Ac(a,b)];var c=a.display.externalMeasured;return c&&b>=c.lineN&&b<c.lineN+c.size?c:void 0}function Wb(a,b){var c=F(b),d=Vb(a,c);d&&!d.text?d=null:d&&d.changes&&(xb(a,d,c,vc(a)),a.curOp.forceUpdate=!0),d||(d=Tb(a,b));var e=Sb(d,b,c);return{line:b,view:d,rect:null,map:e.map,cache:e.cache,before:e.before,hasHeights:!1}}function Xb(a,b,c,d,e){b.before&&(c=-1);var f,g=c+(d||"");return b.cache.hasOwnProperty(g)?f=b.cache[g]:(b.rect||(b.rect=b.view.text.getBoundingClientRect()),b.hasHeights||(Rb(a,b.view,b.rect),b.hasHeights=!0),f=$b(a,b,c,d),f.bogus||(b.cache[g]=f)),{left:f.left,right:f.right,top:e?f.rtop:f.top,bottom:e?f.rbottom:f.bottom}}function Yb(a,b,c){for(var d,e,f,g,h,i,j=0;j<a.length;j+=3)if(h=a[j],i=a[j+1],b<h?(e=0,f=1,g="left"):b<i?(e=b-h,f=e+1):(j==a.length-3||b==i&&a[j+3]>b)&&(f=i-h,e=f-1,b>=i&&(g="right")),null!=e){if(d=a[j+2],h==i&&c==(d.insertLeft?"left":"right")&&(g=c),"left"==c&&0==e)for(;j&&a[j-2]==a[j-3]&&a[j-1].insertLeft;)d=a[(j-=3)+2],g="left";if("right"==c&&e==i-h)for(;j<a.length-3&&a[j+3]==a[j+4]&&!a[j+5].insertLeft;)d=a[(j+=3)+2],g="right";break}return{node:d,start:e,end:f,collapse:g,coverStart:h,coverEnd:i}}function Zb(a,b){var c=wh; if("left"==b)for(var d=0;d<a.length&&(c=a[d]).left==c.right;d++);else for(var e=a.length-1;e>=0&&(c=a[e]).left==c.right;e--);return c}function $b(a,b,c,d){var e,f=Yb(b.map,c,d),g=f.node,h=f.start,i=f.end,j=f.collapse;if(3==g.nodeType){for(var k=0;k<4;k++){for(;h&&x(b.line.text.charAt(f.coverStart+h));)--h;for(;f.coverStart+i<f.coverEnd&&x(b.line.text.charAt(f.coverStart+i));)++i;if(e=ug&&vg<9&&0==h&&i==f.coverEnd-f.coverStart?g.parentNode.getBoundingClientRect():Zb(Kg(g,h,i).getClientRects(),d),e.left||e.right||0==h)break;i=h,h-=1,j="right"}ug&&vg<11&&(e=_b(a.display.measure,e))}else{h>0&&(j=d="right");var l;e=a.options.lineWrapping&&(l=g.getClientRects()).length>1?l["right"==d?l.length-1:0]:g.getBoundingClientRect()}if(ug&&vg<9&&!h&&(!e||!e.left&&!e.right)){var m=g.parentNode.getClientRects()[0];e=m?{left:m.left,right:m.left+uc(a.display),top:m.top,bottom:m.bottom}:wh}for(var n=e.top-b.rect.top,o=e.bottom-b.rect.top,p=(n+o)/2,q=b.view.measure.heights,r=0;r<q.length-1&&!(p<q[r]);r++);var s=r?q[r-1]:0,t=q[r],u={left:("right"==j?e.right:e.left)-b.rect.left,right:("left"==j?e.left:e.right)-b.rect.left,top:s,bottom:t};return e.left||e.right||(u.bogus=!0),a.options.singleCursorHeightPerLine||(u.rtop=n,u.rbottom=o),u}function _b(a,b){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!Oa(a))return b;var c=screen.logicalXDPI/screen.deviceXDPI,d=screen.logicalYDPI/screen.deviceYDPI;return{left:b.left*c,right:b.right*c,top:b.top*d,bottom:b.bottom*d}}function ac(a){if(a.measure&&(a.measure.cache={},a.measure.heights=null,a.rest))for(var b=0;b<a.rest.length;b++)a.measure.caches[b]={}}function bc(a){a.display.externalMeasure=null,b(a.display.lineMeasure);for(var c=0;c<a.display.view.length;c++)ac(a.display.view[c])}function cc(a){bc(a),a.display.cachedCharWidth=a.display.cachedTextHeight=a.display.cachedPaddingH=null,a.options.lineWrapping||(a.display.maxLineChanged=!0),a.display.lineNumChars=null}function dc(){return yg&&Eg?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ec(){return yg&&Eg?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function fc(a){var b=0;if(a.widgets)for(var c=0;c<a.widgets.length;++c)a.widgets[c].above&&(b+=Jb(a.widgets[c]));return b}function gc(a,b,c,d,e){if(!e){var f=fc(b);c.top+=f,c.bottom+=f}if("line"==d)return c;d||(d="local");var g=ta(b);if("local"==d?g+=Lb(a.display):g-=a.display.viewOffset,"page"==d||"window"==d){var h=a.display.lineSpace.getBoundingClientRect();g+=h.top+("window"==d?0:ec());var i=h.left+("window"==d?0:dc());c.left+=i,c.right+=i}return c.top+=g,c.bottom+=g,c}function hc(a,b,c){if("div"==c)return b;var d=b.left,e=b.top;if("page"==c)d-=dc(),e-=ec();else if("local"==c||!c){var f=a.display.sizer.getBoundingClientRect();d+=f.left,e+=f.top}var g=a.display.lineSpace.getBoundingClientRect();return{left:d-g.left,top:e-g.top}}function ic(a,b,c,d,e){return d||(d=B(a.doc,b.line)),gc(a,d,Ub(a,d,b.ch,e),c)}function jc(a,b,c,d,e,f){function g(b,g){var h=Xb(a,e,b,g?"right":"left",f);return g?h.left=h.right:h.right=h.left,gc(a,d,h,c)}function h(a,b,c){var d=i[b],e=1==d.level;return g(c?a-1:a,e!=c)}d=d||B(a.doc,b.line),e||(e=Wb(a,d));var i=ya(d,a.doc.direction),j=b.ch,k=b.sticky;if(j>=d.text.length?(j=d.text.length,k="before"):j<=0&&(j=0,k="after"),!i)return g("before"==k?j-1:j,"before"==k);var l=xa(i,j,k),m=ah,n=h(j,l,"before"==k);return null!=m&&(n.other=h(j,m,"before"!=k)),n}function kc(a,b){var c=0;b=Q(a.doc,b),a.options.lineWrapping||(c=uc(a.display)*b.ch);var d=B(a.doc,b.line),e=ta(d)+Lb(a.display);return{left:c,right:c,top:e,bottom:e+d.height}}function lc(a,b,c,d,e){var f=J(a,b,c);return f.xRel=e,d&&(f.outside=!0),f}function mc(a,b,c){var d=a.doc;if(c+=a.display.viewOffset,c<0)return lc(d.first,0,null,!0,-1);var e=G(d,c),f=d.first+d.size-1;if(e>f)return lc(d.first+d.size-1,B(d,f).text.length,null,!0,1);b<0&&(b=0);for(var g=B(d,e);;){var h=qc(a,g,e,b,c),i=ka(g,h.ch+(h.xRel>0?1:0));if(!i)return h;var j=i.find(1);if(j.line==e)return j;g=B(d,e=j.line)}}function nc(a,b,c,d){d-=fc(b);var e=b.text.length,f=z((function(b){return Xb(a,c,b-1).bottom<=d}),e,0);return e=z((function(b){return Xb(a,c,b).top>d}),f,e),{begin:f,end:e}}function oc(a,b,c,d){c||(c=Wb(a,b));var e=gc(a,b,Xb(a,c,d),"line").top;return nc(a,b,c,e)}function pc(a,b,c,d){return!(a.bottom<=c)&&(a.top>c||(d?a.left:a.right)>b)}function qc(a,b,c,d,e){e-=ta(b);var f=Wb(a,b),g=fc(b),h=0,i=b.text.length,j=!0,k=ya(b,a.doc.direction);if(k){var l=(a.options.lineWrapping?sc:rc)(a,b,c,f,k,d,e);j=1!=l.level,h=j?l.from:l.to-1,i=j?l.to:l.from-1}var m,n,o=null,p=null,q=z((function(b){var c=Xb(a,f,b);return c.top+=g,c.bottom+=g,!!pc(c,d,e,!1)&&(c.top<=e&&c.left<=d&&(o=b,p=c),!0)}),h,i),r=!1;if(p){var s=d-p.left<p.right-d,t=s==j;q=o+(t?0:1),n=t?"after":"before",m=s?p.left:p.right}else{j||q!=i&&q!=h||q++,n=0==q?"after":q==b.text.length?"before":Xb(a,f,q-(j?1:0)).bottom+g<=e==j?"after":"before";var u=jc(a,J(c,q,n),"line",b,f);m=u.left,r=e<u.top||e>=u.bottom}return q=y(b.text,q,1),lc(c,q,n,r,d-m)}function rc(a,b,c,d,e,f,g){var h=z((function(h){var i=e[h],j=1!=i.level;return pc(jc(a,J(c,j?i.to:i.from,j?"before":"after"),"line",b,d),f,g,!0)}),0,e.length-1),i=e[h];if(h>0){var j=1!=i.level,k=jc(a,J(c,j?i.from:i.to,j?"after":"before"),"line",b,d);pc(k,f,g,!0)&&k.top>g&&(i=e[h-1])}return i}function sc(a,b,c,d,e,f,g){var h=nc(a,b,d,g),i=h.begin,j=h.end;/\s/.test(b.text.charAt(j-1))&&j--;for(var k=null,l=null,m=0;m<e.length;m++){var n=e[m];if(!(n.from>=j||n.to<=i)){var o=1!=n.level,p=Xb(a,d,o?Math.min(j,n.to)-1:Math.max(i,n.from)).right,q=p<f?f-p+1e9:p-f;(!k||l>q)&&(k=n,l=q)}}return k||(k=e[e.length-1]),k.from<i&&(k={from:i,to:k.to,level:k.level}),k.to>j&&(k={from:k.from,to:j,level:k.level}),k}function tc(a){if(null!=a.cachedTextHeight)return a.cachedTextHeight;if(null==rh){rh=d("pre");for(var e=0;e<49;++e)rh.appendChild(document.createTextNode("x")),rh.appendChild(d("br"));rh.appendChild(document.createTextNode("x"))}c(a.measure,rh);var f=rh.offsetHeight/50;return f>3&&(a.cachedTextHeight=f),b(a.measure),f||1}function uc(a){if(null!=a.cachedCharWidth)return a.cachedCharWidth;var b=d("span","xxxxxxxxxx"),e=d("pre",[b]);c(a.measure,e);var f=b.getBoundingClientRect(),g=(f.right-f.left)/10;return g>2&&(a.cachedCharWidth=g),g||10}function vc(a){for(var b=a.display,c={},d={},e=b.gutters.clientLeft,f=b.gutters.firstChild,g=0;f;f=f.nextSibling,++g)c[a.options.gutters[g]]=f.offsetLeft+f.clientLeft+e,d[a.options.gutters[g]]=f.clientWidth;return{fixedPos:wc(b),gutterTotalWidth:b.gutters.offsetWidth,gutterLeft:c,gutterWidth:d,wrapperWidth:b.wrapper.clientWidth}}function wc(a){return a.scroller.getBoundingClientRect().left-a.sizer.getBoundingClientRect().left}function xc(a){var b=tc(a.display),c=a.options.lineWrapping,d=c&&Math.max(5,a.display.scroller.clientWidth/uc(a.display)-3);return function(e){if(ra(a.doc,e))return 0;var f=0;if(e.widgets)for(var g=0;g<e.widgets.length;g++)e.widgets[g].height&&(f+=e.widgets[g].height);return c?f+(Math.ceil(e.text.length/d)||1)*b:f+b}}function yc(a){var b=a.doc,c=xc(a);b.iter((function(a){var b=c(a);b!=a.height&&E(a,b)}))}function zc(a,b,c,d){var e=a.display;if(!c&&"true"==Ka(b).getAttribute("cm-not-content"))return null;var f,g,h=e.lineSpace.getBoundingClientRect();try{f=b.clientX-h.left,g=b.clientY-h.top}catch(a){return null}var i,j=mc(a,f,g);if(d&&1==j.xRel&&(i=B(a.doc,j.line).text).length==j.ch){var k=l(i,i.length,a.options.tabSize)-i.length;j=J(j.line,Math.max(0,Math.round((f-Nb(a.display).left)/uc(a.display))-k))}return j}function Ac(a,b){if(b>=a.display.viewTo)return null;if(b-=a.display.viewFrom,b<0)return null;for(var c=a.display.view,d=0;d<c.length;d++)if(b-=c[d].size,b<0)return d}function Bc(a){a.display.input.showSelection(a.display.input.prepareSelection())}function Cc(a,b){void 0===b&&(b=!0);for(var c=a.doc,d={},e=d.cursors=document.createDocumentFragment(),f=d.selection=document.createDocumentFragment(),g=0;g<c.sel.ranges.length;g++)if(b||g!=c.sel.primIndex){var h=c.sel.ranges[g];if(!(h.from().line>=a.display.viewTo||h.to().line<a.display.viewFrom)){var i=h.empty();(i||a.options.showCursorWhenSelecting)&&Dc(a,h.head,e),i||Fc(a,h,f)}}return d}function Dc(a,b,c){var e=jc(a,b,"div",null,null,!a.options.singleCursorHeightPerLine),f=c.appendChild(d("div"," ","CodeMirror-cursor"));if(f.style.left=e.left+"px",f.style.top=e.top+"px",f.style.height=Math.max(0,e.bottom-e.top)*a.options.cursorHeight+"px",e.other){var g=c.appendChild(d("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));g.style.display="",g.style.left=e.other.left+"px",g.style.top=e.other.top+"px",g.style.height=.85*(e.other.bottom-e.other.top)+"px"}}function Ec(a,b){return a.top-b.top||a.left-b.left}function Fc(a,b,c){function e(a,b,c,e){b<0&&(b=0),b=Math.round(b),e=Math.round(e),i.appendChild(d("div",null,"CodeMirror-selected","position: absolute; left: "+a+"px;\n top: "+b+"px; width: "+(null==c?l-a:c)+"px;\n height: "+(e-b)+"px"))}function f(b,c,d){function f(c,d){return ic(a,J(b,c),"div",n,d)}function g(b,c,d){var e=oc(a,n,null,b),g="ltr"==c==("after"==d)?"left":"right",h="after"==d?e.begin:e.end-(/\s/.test(n.text.charAt(e.end-1))?2:1);return f(h,g)[g]}var i,j,n=B(h,b),o=n.text.length,p=ya(n,h.direction);return wa(p,c||0,null==d?o:d,(function(a,b,h,n){var q="ltr"==h,r=f(a,q?"left":"right"),s=f(b-1,q?"right":"left"),t=null==c&&0==a,u=null==d&&b==o,v=0==n,w=!p||n==p.length-1;if(s.top-r.top<=3){var x=(m?t:u)&&v,y=(m?u:t)&&w,z=x?k:(q?r:s).left,A=y?l:(q?s:r).right;e(z,r.top,A-z,r.bottom)}else{var B,C,D,E;q?(B=m&&t&&v?k:r.left,C=m?l:g(a,h,"before"),D=m?k:g(b,h,"after"),E=m&&u&&w?l:s.right):(B=m?g(a,h,"before"):k,C=!m&&t&&v?l:r.right,D=!m&&u&&w?k:s.left,E=m?g(b,h,"after"):l),e(B,r.top,C-B,r.bottom),r.bottom<s.top&&e(k,r.bottom,null,s.top),e(D,s.top,E-D,s.bottom)}(!i||Ec(r,i)<0)&&(i=r),Ec(s,i)<0&&(i=s),(!j||Ec(r,j)<0)&&(j=r),Ec(s,j)<0&&(j=s)})),{start:i,end:j}}var g=a.display,h=a.doc,i=document.createDocumentFragment(),j=Nb(a.display),k=j.left,l=Math.max(g.sizerWidth,Pb(a)-g.sizer.offsetLeft)-j.right,m="ltr"==h.direction,n=b.from(),o=b.to();if(n.line==o.line)f(n.line,n.ch,o.ch);else{var p=B(h,n.line),q=B(h,o.line),r=ma(p)==ma(q),s=f(n.line,n.ch,r?p.text.length+1:null).end,t=f(o.line,r?0:null,o.ch).start;r&&(s.top<t.top-2?(e(s.right,s.top,null,s.bottom),e(k,t.top,t.left,t.bottom)):e(s.right,s.top,t.left-s.right,s.bottom)),s.bottom<t.top&&e(k,s.bottom,null,t.top)}c.appendChild(i)}function Gc(a){if(a.state.focused){var b=a.display;clearInterval(b.blinker);var c=!0;b.cursorDiv.style.visibility="",a.options.cursorBlinkRate>0?b.blinker=setInterval((function(){return b.cursorDiv.style.visibility=(c=!c)?"":"hidden"}),a.options.cursorBlinkRate):a.options.cursorBlinkRate<0&&(b.cursorDiv.style.visibility="hidden")}}function Hc(a){a.state.focused||(a.display.input.focus(),Jc(a))}function Ic(a){a.state.delayingBlurEvent=!0,setTimeout((function(){a.state.delayingBlurEvent&&(a.state.delayingBlurEvent=!1,Kc(a))}),100)}function Jc(a,b){a.state.delayingBlurEvent&&(a.state.delayingBlurEvent=!1),"nocursor"!=a.options.readOnly&&(a.state.focused||(Ba(a,"focus",a,b),a.state.focused=!0,h(a.display.wrapper,"CodeMirror-focused"),a.curOp||a.display.selForContextMenu==a.doc.sel||(a.display.input.reset(),wg&&setTimeout((function(){return a.display.input.reset(!0)}),20)),a.display.input.receivedFocus()),Gc(a))}function Kc(a,b){a.state.delayingBlurEvent||(a.state.focused&&(Ba(a,"blur",a,b),a.state.focused=!1,Ng(a.display.wrapper,"CodeMirror-focused")),clearInterval(a.display.blinker),setTimeout((function(){a.state.focused||(a.display.shift=!1)}),150))}function Lc(a){for(var b=a.display,c=b.lineDiv.offsetTop,d=0;d<b.view.length;d++){var e=b.view[d],f=void 0;if(!e.hidden){if(ug&&vg<8){var g=e.node.offsetTop+e.node.offsetHeight;f=g-c,c=g}else{var h=e.node.getBoundingClientRect();f=h.bottom-h.top}var i=e.line.height-f;if(f<2&&(f=tc(b)),(i>.005||i<-.005)&&(E(e.line,f),Mc(e.line),e.rest))for(var j=0;j<e.rest.length;j++)Mc(e.rest[j])}}}function Mc(a){if(a.widgets)for(var b=0;b<a.widgets.length;++b){var c=a.widgets[b],d=c.node.parentNode;d&&(c.height=d.offsetHeight)}}function Nc(a,b,c){var d=c&&null!=c.top?Math.max(0,c.top):a.scroller.scrollTop;d=Math.floor(d-Lb(a));var e=c&&null!=c.bottom?c.bottom:d+a.wrapper.clientHeight,f=G(b,d),g=G(b,e);if(c&&c.ensure){var h=c.ensure.from.line,i=c.ensure.to.line;h<f?(f=h,g=G(b,ta(B(b,h))+a.wrapper.clientHeight)):Math.min(i,b.lastLine())>=g&&(f=G(b,ta(B(b,i))-a.wrapper.clientHeight),g=i)}return{from:f,to:Math.max(g,f+1)}}function Oc(a){var b=a.display,c=b.view;if(b.alignWidgets||b.gutters.firstChild&&a.options.fixedGutter){for(var d=wc(b)-b.scroller.scrollLeft+a.doc.scrollLeft,e=b.gutters.offsetWidth,f=d+"px",g=0;g<c.length;g++)if(!c[g].hidden){a.options.fixedGutter&&(c[g].gutter&&(c[g].gutter.style.left=f),c[g].gutterBackground&&(c[g].gutterBackground.style.left=f));var h=c[g].alignable;if(h)for(var i=0;i<h.length;i++)h[i].style.left=f}a.options.fixedGutter&&(b.gutters.style.left=d+e+"px")}}function Pc(a){if(!a.options.lineNumbers)return!1;var b=a.doc,c=I(a.options,b.first+b.size-1),e=a.display;if(c.length!=e.lineNumChars){var f=e.measure.appendChild(d("div",[d("div",c)],"CodeMirror-linenumber CodeMirror-gutter-elt")),g=f.firstChild.offsetWidth,h=f.offsetWidth-g;return e.lineGutter.style.width="",e.lineNumInnerWidth=Math.max(g,e.lineGutter.offsetWidth-h)+1,e.lineNumWidth=e.lineNumInnerWidth+h,e.lineNumChars=e.lineNumInnerWidth?c.length:-1,e.lineGutter.style.width=e.lineNumWidth+"px",Gd(a),!0}return!1}function Qc(a,b){if(!Ca(a,"scrollCursorIntoView")){var c=a.display,e=c.sizer.getBoundingClientRect(),f=null;if(b.top+e.top<0?f=!0:b.bottom+e.top>(window.innerHeight||document.documentElement.clientHeight)&&(f=!1),null!=f&&!Cg){var g=d("div","​",null,"position: absolute;\n top: "+(b.top-c.viewOffset-Lb(a.display))+"px;\n height: "+(b.bottom-b.top+Ob(a)+c.barHeight)+"px;\n left: "+b.left+"px; width: "+Math.max(2,b.right-b.left)+"px;");a.display.lineSpace.appendChild(g),g.scrollIntoView(f),a.display.lineSpace.removeChild(g)}}}function Rc(a,b,c,d){null==d&&(d=0);var e;a.options.lineWrapping||b!=c||(b=b.ch?J(b.line,"before"==b.sticky?b.ch-1:b.ch,"after"):b,c="before"==b.sticky?J(b.line,b.ch+1,"before"):b);for(var f=0;f<5;f++){var g=!1,h=jc(a,b),i=c&&c!=b?jc(a,c):h;e={left:Math.min(h.left,i.left),top:Math.min(h.top,i.top)-d,right:Math.max(h.left,i.left),bottom:Math.max(h.bottom,i.bottom)+d};var j=Tc(a,e),k=a.doc.scrollTop,l=a.doc.scrollLeft;if(null!=j.scrollTop&&($c(a,j.scrollTop),Math.abs(a.doc.scrollTop-k)>1&&(g=!0)),null!=j.scrollLeft&&(ad(a,j.scrollLeft),Math.abs(a.doc.scrollLeft-l)>1&&(g=!0)),!g)break}return e}function Sc(a,b){var c=Tc(a,b);null!=c.scrollTop&&$c(a,c.scrollTop),null!=c.scrollLeft&&ad(a,c.scrollLeft)}function Tc(a,b){var c=a.display,d=tc(a.display);b.top<0&&(b.top=0);var e=a.curOp&&null!=a.curOp.scrollTop?a.curOp.scrollTop:c.scroller.scrollTop,f=Qb(a),g={};b.bottom-b.top>f&&(b.bottom=b.top+f);var h=a.doc.height+Mb(c),i=b.top<d,j=b.bottom>h-d;if(b.top<e)g.scrollTop=i?0:b.top;else if(b.bottom>e+f){var k=Math.min(b.top,(j?h:b.bottom)-f);k!=e&&(g.scrollTop=k)}var l=a.curOp&&null!=a.curOp.scrollLeft?a.curOp.scrollLeft:c.scroller.scrollLeft,m=Pb(a)-(a.options.fixedGutter?c.gutters.offsetWidth:0),n=b.right-b.left>m;return n&&(b.right=b.left+m),b.left<10?g.scrollLeft=0:b.left<l?g.scrollLeft=Math.max(0,b.left-(n?0:10)):b.right>m+l-3&&(g.scrollLeft=b.right+(n?0:10)-m),g}function Uc(a,b){null!=b&&(Yc(a),a.curOp.scrollTop=(null==a.curOp.scrollTop?a.doc.scrollTop:a.curOp.scrollTop)+b)}function Vc(a){Yc(a);var b=a.getCursor();a.curOp.scrollToPos={from:b,to:b,margin:a.options.cursorScrollMargin}}function Wc(a,b,c){null==b&&null==c||Yc(a),null!=b&&(a.curOp.scrollLeft=b),null!=c&&(a.curOp.scrollTop=c)}function Xc(a,b){Yc(a),a.curOp.scrollToPos=b}function Yc(a){var b=a.curOp.scrollToPos;if(b){a.curOp.scrollToPos=null;var c=kc(a,b.from),d=kc(a,b.to);Zc(a,c,d,b.margin)}}function Zc(a,b,c,d){var e=Tc(a,{left:Math.min(b.left,c.left),top:Math.min(b.top,c.top)-d,right:Math.max(b.right,c.right),bottom:Math.max(b.bottom,c.bottom)+d});Wc(a,e.scrollLeft,e.scrollTop)}function $c(a,b){Math.abs(a.doc.scrollTop-b)<2||(qg||Ed(a,{top:b}),_c(a,b,!0),qg&&Ed(a),xd(a,100))}function _c(a,b,c){b=Math.min(a.display.scroller.scrollHeight-a.display.scroller.clientHeight,b),(a.display.scroller.scrollTop!=b||c)&&(a.doc.scrollTop=b,a.display.scrollbars.setScrollTop(b),a.display.scroller.scrollTop!=b&&(a.display.scroller.scrollTop=b))}function ad(a,b,c,d){b=Math.min(b,a.display.scroller.scrollWidth-a.display.scroller.clientWidth),(c?b==a.doc.scrollLeft:Math.abs(a.doc.scrollLeft-b)<2)&&!d||(a.doc.scrollLeft=b,Oc(a),a.display.scroller.scrollLeft!=b&&(a.display.scroller.scrollLeft=b),a.display.scrollbars.setScrollLeft(b))}function bd(a){var b=a.display,c=b.gutters.offsetWidth,d=Math.round(a.doc.height+Mb(a.display));return{clientHeight:b.scroller.clientHeight,viewHeight:b.wrapper.clientHeight,scrollWidth:b.scroller.scrollWidth,clientWidth:b.scroller.clientWidth,viewWidth:b.wrapper.clientWidth,barLeft:a.options.fixedGutter?c:0,docHeight:d,scrollHeight:d+Ob(a)+b.barHeight,nativeBarWidth:b.nativeBarWidth,gutterWidth:c}}function cd(a,b){b||(b=bd(a));var c=a.display.barWidth,d=a.display.barHeight;dd(a,b);for(var e=0;e<4&&c!=a.display.barWidth||d!=a.display.barHeight;e++)c!=a.display.barWidth&&a.options.lineWrapping&&Lc(a),dd(a,bd(a)),c=a.display.barWidth,d=a.display.barHeight}function dd(a,b){var c=a.display,d=c.scrollbars.update(b);c.sizer.style.paddingRight=(c.barWidth=d.right)+"px",c.sizer.style.paddingBottom=(c.barHeight=d.bottom)+"px",c.heightForcer.style.borderBottom=d.bottom+"px solid transparent",d.right&&d.bottom?(c.scrollbarFiller.style.display="block",c.scrollbarFiller.style.height=d.bottom+"px",c.scrollbarFiller.style.width=d.right+"px"):c.scrollbarFiller.style.display="",d.bottom&&a.options.coverGutterNextToScrollbar&&a.options.fixedGutter?(c.gutterFiller.style.display="block",c.gutterFiller.style.height=d.bottom+"px",c.gutterFiller.style.width=b.gutterWidth+"px"):c.gutterFiller.style.display=""}function ed(a){a.display.scrollbars&&(a.display.scrollbars.clear(),a.display.scrollbars.addClass&&Ng(a.display.wrapper,a.display.scrollbars.addClass)),a.display.scrollbars=new zh[a.options.scrollbarStyle](function(b){a.display.wrapper.insertBefore(b,a.display.scrollbarFiller),dh(b,"mousedown",(function(){a.state.focused&&setTimeout((function(){return a.display.input.focus()}),0)})),b.setAttribute("cm-not-content","true")},function(b,c){"horizontal"==c?ad(a,b):$c(a,b)},a),a.display.scrollbars.addClass&&h(a.display.wrapper,a.display.scrollbars.addClass)}function fd(a){a.curOp={cm:a,viewChanged:!1,startHeight:a.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Ah},sb(a.curOp)}function gd(a){var b=a.curOp;ub(b,(function(a){for(var b=0;b<a.ops.length;b++)a.ops[b].cm.curOp=null;hd(a)}))}function hd(a){for(var b=a.ops,c=0;c<b.length;c++)id(b[c]);for(var d=0;d<b.length;d++)jd(b[d]);for(var e=0;e<b.length;e++)kd(b[e]);for(var f=0;f<b.length;f++)ld(b[f]);for(var g=0;g<b.length;g++)md(b[g])}function id(a){var b=a.cm,c=b.display;zd(b),a.updateMaxLine&&va(b),a.mustUpdate=a.viewChanged||a.forceUpdate||null!=a.scrollTop||a.scrollToPos&&(a.scrollToPos.from.line<c.viewFrom||a.scrollToPos.to.line>=c.viewTo)||c.maxLineChanged&&b.options.lineWrapping,a.update=a.mustUpdate&&new Bh(b,a.mustUpdate&&{top:a.scrollTop,ensure:a.scrollToPos},a.forceUpdate)}function jd(a){a.updatedDisplay=a.mustUpdate&&Cd(a.cm,a.update)}function kd(a){var b=a.cm,c=b.display;a.updatedDisplay&&Lc(b),a.barMeasure=bd(b),c.maxLineChanged&&!b.options.lineWrapping&&(a.adjustWidthTo=Ub(b,c.maxLine,c.maxLine.text.length).left+3,b.display.sizerWidth=a.adjustWidthTo,a.barMeasure.scrollWidth=Math.max(c.scroller.clientWidth,c.sizer.offsetLeft+a.adjustWidthTo+Ob(b)+b.display.barWidth),a.maxScrollLeft=Math.max(0,c.sizer.offsetLeft+a.adjustWidthTo-Pb(b))),(a.updatedDisplay||a.selectionChanged)&&(a.preparedSelection=c.input.prepareSelection())}function ld(a){var b=a.cm;null!=a.adjustWidthTo&&(b.display.sizer.style.minWidth=a.adjustWidthTo+"px",a.maxScrollLeft<b.doc.scrollLeft&&ad(b,Math.min(b.display.scroller.scrollLeft,a.maxScrollLeft),!0),b.display.maxLineChanged=!1);var c=a.focus&&a.focus==g();a.preparedSelection&&b.display.input.showSelection(a.preparedSelection,c),(a.updatedDisplay||a.startHeight!=b.doc.height)&&cd(b,a.barMeasure),a.updatedDisplay&&Hd(b,a.barMeasure),a.selectionChanged&&Gc(b),b.state.focused&&a.updateInput&&b.display.input.reset(a.typing),c&&Hc(a.cm)}function md(a){var b=a.cm,c=b.display,d=b.doc;if(a.updatedDisplay&&Dd(b,a.update),null==c.wheelStartX||null==a.scrollTop&&null==a.scrollLeft&&!a.scrollToPos||(c.wheelStartX=c.wheelStartY=null),null!=a.scrollTop&&_c(b,a.scrollTop,a.forceScroll),null!=a.scrollLeft&&ad(b,a.scrollLeft,!0,!0),a.scrollToPos){var e=Rc(b,Q(d,a.scrollToPos.from),Q(d,a.scrollToPos.to),a.scrollToPos.margin);Qc(b,e)}var f=a.maybeHiddenMarkers,g=a.maybeUnhiddenMarkers;if(f)for(var h=0;h<f.length;++h)f[h].lines.length||Ba(f[h],"hide");if(g)for(var i=0;i<g.length;++i)g[i].lines.length&&Ba(g[i],"unhide");c.wrapper.offsetHeight&&(d.scrollTop=b.display.scroller.scrollTop),a.changeObjs&&Ba(b,"changes",b,a.changeObjs),a.update&&a.update.finish()}function nd(a,b){if(a.curOp)return b();fd(a);try{return b()}finally{gd(a)}}function od(a,b){return function(){if(a.curOp)return b.apply(a,arguments);fd(a);try{return b.apply(a,arguments)}finally{gd(a)}}}function pd(a){return function(){if(this.curOp)return a.apply(this,arguments);fd(this);try{return a.apply(this,arguments)}finally{gd(this)}}}function qd(a){return function(){var b=this.cm;if(!b||b.curOp)return a.apply(this,arguments);fd(b);try{return a.apply(this,arguments)}finally{gd(b)}}}function rd(a,b,c,d){null==b&&(b=a.doc.first),null==c&&(c=a.doc.first+a.doc.size),d||(d=0);var e=a.display;if(d&&c<e.viewTo&&(null==e.updateLineNumbers||e.updateLineNumbers>b)&&(e.updateLineNumbers=b),a.curOp.viewChanged=!0,b>=e.viewTo)_g&&pa(a.doc,b)<e.viewTo&&td(a);else if(c<=e.viewFrom)_g&&qa(a.doc,c+d)>e.viewFrom?td(a):(e.viewFrom+=d,e.viewTo+=d);else if(b<=e.viewFrom&&c>=e.viewTo)td(a);else if(b<=e.viewFrom){var f=ud(a,c,c+d,1);f?(e.view=e.view.slice(f.index),e.viewFrom=f.lineN,e.viewTo+=d):td(a)}else if(c>=e.viewTo){var g=ud(a,b,b,-1);g?(e.view=e.view.slice(0,g.index),e.viewTo=g.lineN):td(a)}else{var h=ud(a,b,b,-1),i=ud(a,c,c+d,1);h&&i?(e.view=e.view.slice(0,h.index).concat(rb(a,h.lineN,i.lineN)).concat(e.view.slice(i.index)),e.viewTo+=d):td(a)}var j=e.externalMeasured;j&&(c<j.lineN?j.lineN+=d:b<j.lineN+j.size&&(e.externalMeasured=null))}function sd(a,b,c){a.curOp.viewChanged=!0;var d=a.display,e=a.display.externalMeasured;if(e&&b>=e.lineN&&b<e.lineN+e.size&&(d.externalMeasured=null),!(b<d.viewFrom||b>=d.viewTo)){var f=d.view[Ac(a,b)];if(null!=f.node){var g=f.changes||(f.changes=[]);m(g,c)==-1&&g.push(c)}}}function td(a){a.display.viewFrom=a.display.viewTo=a.doc.first,a.display.view=[],a.display.viewOffset=0}function ud(a,b,c,d){var e,f=Ac(a,b),g=a.display.view;if(!_g||c==a.doc.first+a.doc.size)return{index:f,lineN:c};for(var h=a.display.viewFrom,i=0;i<f;i++)h+=g[i].size;if(h!=b){if(d>0){if(f==g.length-1)return null;e=h+g[f].size-b,f++}else e=h-b;b+=e,c+=e}for(;pa(a.doc,c)!=c;){if(f==(d<0?0:g.length-1))return null;c+=d*g[f-(d<0?1:0)].size,f+=d}return{index:f,lineN:c}}function vd(a,b,c){var d=a.display,e=d.view;0==e.length||b>=d.viewTo||c<=d.viewFrom?(d.view=rb(a,b,c),d.viewFrom=b):(d.viewFrom>b?d.view=rb(a,b,d.viewFrom).concat(d.view):d.viewFrom<b&&(d.view=d.view.slice(Ac(a,b))),d.viewFrom=b,d.viewTo<c?d.view=d.view.concat(rb(a,d.viewTo,c)):d.viewTo>c&&(d.view=d.view.slice(0,Ac(a,c)))),d.viewTo=c}function wd(a){for(var b=a.display.view,c=0,d=0;d<b.length;d++){var e=b[d];e.hidden||e.node&&!e.changes||++c}return c}function xd(a,b){a.doc.highlightFrontier<a.display.viewTo&&a.state.highlight.set(b,j(yd,a))}function yd(a){var b=a.doc;if(!(b.highlightFrontier>=a.display.viewTo)){var c=+new Date+a.options.workTime,d=Za(a,b.highlightFrontier),e=[];b.iter(d.line,Math.min(b.first+b.size,a.display.viewTo+500),(function(f){if(d.line>=a.display.viewFrom){var g=f.styles,h=f.text.length>a.options.maxHighlightLength?Ua(b.mode,d.state):null,i=Xa(a,f,d,!0);h&&(d.state=h),f.styles=i.styles;var j=f.styleClasses,k=i.classes;k?f.styleClasses=k:j&&(f.styleClasses=null);for(var l=!g||g.length!=f.styles.length||j!=k&&(!j||!k||j.bgClass!=k.bgClass||j.textClass!=k.textClass),m=0;!l&&m<g.length;++m)l=g[m]!=f.styles[m];l&&e.push(d.line),f.stateAfter=d.save(),d.nextLine()}else f.text.length<=a.options.maxHighlightLength&&$a(a,f.text,d),f.stateAfter=d.line%5==0?d.save():null,d.nextLine();if(+new Date>c)return xd(a,a.options.workDelay),!0})),b.highlightFrontier=d.line,b.modeFrontier=Math.max(b.modeFrontier,d.line),e.length&&nd(a,(function(){for(var b=0;b<e.length;b++)sd(a,e[b],"text")}))}}function zd(a){var b=a.display;!b.scrollbarsClipped&&b.scroller.offsetWidth&&(b.nativeBarWidth=b.scroller.offsetWidth-b.scroller.clientWidth,b.heightForcer.style.height=Ob(a)+"px",b.sizer.style.marginBottom=-b.nativeBarWidth+"px",b.sizer.style.borderRightWidth=Ob(a)+"px",b.scrollbarsClipped=!0)}function Ad(a){if(a.hasFocus())return null;var b=g();if(!b||!f(a.display.lineDiv,b))return null;var c={activeElt:b};if(window.getSelection){var d=window.getSelection();d.anchorNode&&d.extend&&f(a.display.lineDiv,d.anchorNode)&&(c.anchorNode=d.anchorNode,c.anchorOffset=d.anchorOffset,c.focusNode=d.focusNode,c.focusOffset=d.focusOffset)}return c}function Bd(a){if(a&&a.activeElt&&a.activeElt!=g()&&(a.activeElt.focus(),a.anchorNode&&f(document.body,a.anchorNode)&&f(document.body,a.focusNode))){var b=window.getSelection(),c=document.createRange();c.setEnd(a.anchorNode,a.anchorOffset),c.collapse(!1),b.removeAllRanges(),b.addRange(c),b.extend(a.focusNode,a.focusOffset)}}function Cd(a,c){var d=a.display,e=a.doc;if(c.editorIsHidden)return td(a),!1;if(!c.force&&c.visible.from>=d.viewFrom&&c.visible.to<=d.viewTo&&(null==d.updateLineNumbers||d.updateLineNumbers>=d.viewTo)&&d.renderedView==d.view&&0==wd(a))return!1;Pc(a)&&(td(a),c.dims=vc(a));var f=e.first+e.size,g=Math.max(c.visible.from-a.options.viewportMargin,e.first),h=Math.min(f,c.visible.to+a.options.viewportMargin);d.viewFrom<g&&g-d.viewFrom<20&&(g=Math.max(e.first,d.viewFrom)),d.viewTo>h&&d.viewTo-h<20&&(h=Math.min(f,d.viewTo)),_g&&(g=pa(a.doc,g),h=qa(a.doc,h));var i=g!=d.viewFrom||h!=d.viewTo||d.lastWrapHeight!=c.wrapperHeight||d.lastWrapWidth!=c.wrapperWidth;vd(a,g,h),d.viewOffset=ta(B(a.doc,d.viewFrom)),a.display.mover.style.top=d.viewOffset+"px";var j=wd(a);if(!i&&0==j&&!c.force&&d.renderedView==d.view&&(null==d.updateLineNumbers||d.updateLineNumbers>=d.viewTo))return!1;var k=Ad(a);return j>4&&(d.lineDiv.style.display="none"),Fd(a,d.updateLineNumbers,c.dims),j>4&&(d.lineDiv.style.display=""),d.renderedView=d.view,Bd(k),b(d.cursorDiv),b(d.selectionDiv),d.gutters.style.height=d.sizer.style.minHeight=0,i&&(d.lastWrapHeight=c.wrapperHeight,d.lastWrapWidth=c.wrapperWidth,xd(a,400)),d.updateLineNumbers=null,!0}function Dd(a,b){for(var c=b.viewport,d=!0;(d&&a.options.lineWrapping&&b.oldDisplayWidth!=Pb(a)||(c&&null!=c.top&&(c={top:Math.min(a.doc.height+Mb(a.display)-Qb(a),c.top)}),b.visible=Nc(a.display,a.doc,c),!(b.visible.from>=a.display.viewFrom&&b.visible.to<=a.display.viewTo)))&&Cd(a,b);d=!1){Lc(a);var e=bd(a);Bc(a),cd(a,e),Hd(a,e),b.force=!1}b.signal(a,"update",a),a.display.viewFrom==a.display.reportedViewFrom&&a.display.viewTo==a.display.reportedViewTo||(b.signal(a,"viewportChange",a,a.display.viewFrom,a.display.viewTo),a.display.reportedViewFrom=a.display.viewFrom,a.display.reportedViewTo=a.display.viewTo)}function Ed(a,b){var c=new Bh(a,b);if(Cd(a,c)){Lc(a),Dd(a,c);var d=bd(a);Bc(a),cd(a,d),Hd(a,d),c.finish()}}function Fd(a,c,d){function e(b){var c=b.nextSibling;return wg&&Gg&&a.display.currentWheelTarget==b?b.style.display="none":b.parentNode.removeChild(b),c}for(var f=a.display,g=a.options.lineNumbers,h=f.lineDiv,i=h.firstChild,j=f.view,k=f.viewFrom,l=0;l<j.length;l++){var n=j[l];if(n.hidden);else if(n.node&&n.node.parentNode==h){for(;i!=n.node;)i=e(i);var o=g&&null!=c&&c<=k&&n.lineNumber;n.changes&&(m(n.changes,"gutter")>-1&&(o=!1),xb(a,n,k,d)),o&&(b(n.lineNumber),n.lineNumber.appendChild(document.createTextNode(I(a.options,k)))),i=n.node.nextSibling}else{var p=Fb(a,n,k,d);h.insertBefore(p,i)}k+=n.size}for(;i;)i=e(i)}function Gd(a){var b=a.display.gutters.offsetWidth;a.display.sizer.style.marginLeft=b+"px"}function Hd(a,b){a.display.sizer.style.minHeight=b.docHeight+"px",a.display.heightForcer.style.top=b.docHeight+"px",a.display.gutters.style.height=b.docHeight+a.display.barHeight+Ob(a)+"px"}function Id(a){var c=a.display.gutters,e=a.options.gutters;b(c);for(var f=0;f<e.length;++f){var g=e[f],h=c.appendChild(d("div",null,"CodeMirror-gutter "+g));"CodeMirror-linenumbers"==g&&(a.display.lineGutter=h,h.style.width=(a.display.lineNumWidth||1)+"px")}c.style.display=f?"":"none",Gd(a)}function Jd(a){var b=m(a.gutters,"CodeMirror-linenumbers");b==-1&&a.lineNumbers?a.gutters=a.gutters.concat(["CodeMirror-linenumbers"]):b>-1&&!a.lineNumbers&&(a.gutters=a.gutters.slice(0),a.gutters.splice(b,1))}function Kd(a){var b=a.wheelDeltaX,c=a.wheelDeltaY;return null==b&&a.detail&&a.axis==a.HORIZONTAL_AXIS&&(b=a.detail),null==c&&a.detail&&a.axis==a.VERTICAL_AXIS?c=a.detail:null==c&&(c=a.wheelDelta),{x:b,y:c}}function Ld(a){var b=Kd(a);return b.x*=Dh,b.y*=Dh,b}function Md(a,b){var c=Kd(b),d=c.x,e=c.y,f=a.display,g=f.scroller,h=g.scrollWidth>g.clientWidth,i=g.scrollHeight>g.clientHeight;if(d&&h||e&&i){if(e&&Gg&&wg)a:for(var j=b.target,k=f.view;j!=g;j=j.parentNode)for(var l=0;l<k.length;l++)if(k[l].node==j){a.display.currentWheelTarget=j;break a}if(d&&!qg&&!zg&&null!=Dh)return e&&i&&$c(a,Math.max(0,g.scrollTop+e*Dh)),ad(a,Math.max(0,g.scrollLeft+d*Dh)),(!e||e&&i)&&Ga(b),void(f.wheelStartX=null);if(e&&null!=Dh){var m=e*Dh,n=a.doc.scrollTop,o=n+f.wrapper.clientHeight;m<0?n=Math.max(0,n+m-50):o=Math.min(a.doc.height,o+m+50),Ed(a,{top:n,bottom:o})}Ch<20&&(null==f.wheelStartX?(f.wheelStartX=g.scrollLeft,f.wheelStartY=g.scrollTop,f.wheelDX=d,f.wheelDY=e,setTimeout((function(){if(null!=f.wheelStartX){var a=g.scrollLeft-f.wheelStartX,b=g.scrollTop-f.wheelStartY,c=b&&f.wheelDY&&b/f.wheelDY||a&&f.wheelDX&&a/f.wheelDX;f.wheelStartX=f.wheelStartY=null,c&&(Dh=(Dh*Ch+c)/(Ch+1),++Ch)}}),200)):(f.wheelDX+=d,f.wheelDY+=e))}}function Nd(a,b){var c=a[b];a.sort((function(a,b){return K(a.from(),b.from())})),b=m(a,c);for(var d=1;d<a.length;d++){var e=a[d],f=a[d-1];if(K(f.to(),e.from())>=0){var g=O(f.from(),e.from()),h=N(f.to(),e.to()),i=f.empty()?e.from()==e.head:f.from()==f.head;d<=b&&--b,a.splice(--d,2,new Fh(i?h:g,i?g:h))}}return new Eh(a,b)}function Od(a,b){return new Eh([new Fh(a,b||a)],0)}function Pd(a){return a.text?J(a.from.line+a.text.length-1,p(a.text).length+(1==a.text.length?a.from.ch:0)):a.to}function Qd(a,b){if(K(a,b.from)<0)return a;if(K(a,b.to)<=0)return Pd(b);var c=a.line+b.text.length-(b.to.line-b.from.line)-1,d=a.ch;return a.line==b.to.line&&(d+=Pd(b).ch-b.to.ch),J(c,d)}function Rd(a,b){for(var c=[],d=0;d<a.sel.ranges.length;d++){var e=a.sel.ranges[d];c.push(new Fh(Qd(e.anchor,b),Qd(e.head,b)))}return Nd(c,a.sel.primIndex)}function Sd(a,b,c){return a.line==b.line?J(c.line,a.ch-b.ch+c.ch):J(c.line+(a.line-b.line),a.ch)}function Td(a,b,c){for(var d=[],e=J(a.first,0),f=e,g=0;g<b.length;g++){var h=b[g],i=Sd(h.from,e,f),j=Sd(Pd(h),e,f);if(e=h.to,f=j,"around"==c){var k=a.sel.ranges[g],l=K(k.head,k.anchor)<0;d[g]=new Fh(l?j:i,l?i:j)}else d[g]=new Fh(i,i)}return new Eh(d,a.sel.primIndex); }function Ud(a){a.doc.mode=Sa(a.options,a.doc.modeOption),Vd(a)}function Vd(a){a.doc.iter((function(a){a.stateAfter&&(a.stateAfter=null),a.styles&&(a.styles=null)})),a.doc.modeFrontier=a.doc.highlightFrontier=a.doc.first,xd(a,100),a.state.modeGen++,a.curOp&&rd(a)}function Wd(a,b){return 0==b.from.ch&&0==b.to.ch&&""==p(b.text)&&(!a.cm||a.cm.options.wholeLineUpdateBefore)}function Xd(a,b,c,d){function e(a){return c?c[a]:null}function f(a,c,e){gb(a,c,e,d),vb(a,"change",a,b)}function g(a,b){for(var c=[],f=a;f<b;++f)c.push(new qh(j[f],e(f),d));return c}var h=b.from,i=b.to,j=b.text,k=B(a,h.line),l=B(a,i.line),m=p(j),n=e(j.length-1),o=i.line-h.line;if(b.full)a.insert(0,g(0,j.length)),a.remove(j.length,a.size-j.length);else if(Wd(a,b)){var q=g(0,j.length-1);f(l,l.text,n),o&&a.remove(h.line,o),q.length&&a.insert(h.line,q)}else if(k==l)if(1==j.length)f(k,k.text.slice(0,h.ch)+m+k.text.slice(i.ch),n);else{var r=g(1,j.length-1);r.push(new qh(m+k.text.slice(i.ch),n,d)),f(k,k.text.slice(0,h.ch)+j[0],e(0)),a.insert(h.line+1,r)}else if(1==j.length)f(k,k.text.slice(0,h.ch)+j[0]+l.text.slice(i.ch),e(0)),a.remove(h.line+1,o);else{f(k,k.text.slice(0,h.ch)+j[0],e(0)),f(l,m+l.text.slice(i.ch),n);var s=g(1,j.length-1);o>1&&a.remove(h.line+1,o-1),a.insert(h.line+1,s)}vb(a,"change",a,b)}function Yd(a,b,c){function d(a,e,f){if(a.linked)for(var g=0;g<a.linked.length;++g){var h=a.linked[g];if(h.doc!=e){var i=f&&h.sharedHist;c&&!i||(b(h.doc,i),d(h.doc,a,i))}}}d(a,null,!0)}function Zd(a,b){if(b.cm)throw new Error("This document is already in use.");a.doc=b,b.cm=a,yc(a),Ud(a),$d(a),a.options.lineWrapping||va(a),a.options.mode=b.modeOption,rd(a)}function $d(a){("rtl"==a.doc.direction?h:Ng)(a.display.lineDiv,"CodeMirror-rtl")}function _d(a){nd(a,(function(){$d(a),rd(a)}))}function ae(a){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=a||1}function be(a,b){var c={from:M(b.from),to:Pd(b),text:C(a,b.from,b.to)};return ie(a,c,b.from.line,b.to.line+1),Yd(a,(function(a){return ie(a,c,b.from.line,b.to.line+1)}),!0),c}function ce(a){for(;a.length;){var b=p(a);if(!b.ranges)break;a.pop()}}function de(a,b){return b?(ce(a.done),p(a.done)):a.done.length&&!p(a.done).ranges?p(a.done):a.done.length>1&&!a.done[a.done.length-2].ranges?(a.done.pop(),p(a.done)):void 0}function ee(a,b,c,d){var e=a.history;e.undone.length=0;var f,g,h=+new Date;if((e.lastOp==d||e.lastOrigin==b.origin&&b.origin&&("+"==b.origin.charAt(0)&&e.lastModTime>h-(a.cm?a.cm.options.historyEventDelay:500)||"*"==b.origin.charAt(0)))&&(f=de(e,e.lastOp==d)))g=p(f.changes),0==K(b.from,b.to)&&0==K(b.from,g.to)?g.to=Pd(b):f.changes.push(be(a,b));else{var i=p(e.done);for(i&&i.ranges||he(a.sel,e.done),f={changes:[be(a,b)],generation:e.generation},e.done.push(f);e.done.length>e.undoDepth;)e.done.shift(),e.done[0].ranges||e.done.shift()}e.done.push(c),e.generation=++e.maxGeneration,e.lastModTime=e.lastSelTime=h,e.lastOp=e.lastSelOp=d,e.lastOrigin=e.lastSelOrigin=b.origin,g||Ba(a,"historyAdded")}function fe(a,b,c,d){var e=b.charAt(0);return"*"==e||"+"==e&&c.ranges.length==d.ranges.length&&c.somethingSelected()==d.somethingSelected()&&new Date-a.history.lastSelTime<=(a.cm?a.cm.options.historyEventDelay:500)}function ge(a,b,c,d){var e=a.history,f=d&&d.origin;c==e.lastSelOp||f&&e.lastSelOrigin==f&&(e.lastModTime==e.lastSelTime&&e.lastOrigin==f||fe(a,f,p(e.done),b))?e.done[e.done.length-1]=b:he(b,e.done),e.lastSelTime=+new Date,e.lastSelOrigin=f,e.lastSelOp=c,d&&d.clearRedo!==!1&&ce(e.undone)}function he(a,b){var c=p(b);c&&c.ranges&&c.equals(a)||b.push(a)}function ie(a,b,c,d){var e=b["spans_"+a.id],f=0;a.iter(Math.max(a.first,c),Math.min(a.first+a.size,d),(function(c){c.markedSpans&&((e||(e=b["spans_"+a.id]={}))[f]=c.markedSpans),++f}))}function je(a){if(!a)return null;for(var b,c=0;c<a.length;++c)a[c].marker.explicitlyCleared?b||(b=a.slice(0,c)):b&&b.push(a[c]);return b?b.length?b:null:a}function ke(a,b){var c=b["spans_"+a.id];if(!c)return null;for(var d=[],e=0;e<b.text.length;++e)d.push(je(c[e]));return d}function le(a,b){var c=ke(a,b),d=_(a,b);if(!c)return d;if(!d)return c;for(var e=0;e<c.length;++e){var f=c[e],g=d[e];if(f&&g)a:for(var h=0;h<g.length;++h){for(var i=g[h],j=0;j<f.length;++j)if(f[j].marker==i.marker)continue a;f.push(i)}else g&&(c[e]=g)}return c}function me(a,b,c){for(var d=[],e=0;e<a.length;++e){var f=a[e];if(f.ranges)d.push(c?Eh.prototype.deepCopy.call(f):f);else{var g=f.changes,h=[];d.push({changes:h});for(var i=0;i<g.length;++i){var j=g[i],k=void 0;if(h.push({from:j.from,to:j.to,text:j.text}),b)for(var l in j)(k=l.match(/^spans_(\d+)$/))&&m(b,Number(k[1]))>-1&&(p(h)[l]=j[l],delete j[l])}}}return d}function ne(a,b,c,d){if(d){var e=a.anchor;if(c){var f=K(b,e)<0;f!=K(c,e)<0?(e=b,b=c):f!=K(b,c)<0&&(b=c)}return new Fh(e,b)}return new Fh(c||b,b)}function oe(a,b,c,d,e){null==e&&(e=a.cm&&(a.cm.display.shift||a.extend)),ue(a,new Eh([ne(a.sel.primary(),b,c,e)],0),d)}function pe(a,b,c){for(var d=[],e=a.cm&&(a.cm.display.shift||a.extend),f=0;f<a.sel.ranges.length;f++)d[f]=ne(a.sel.ranges[f],b[f],null,e);var g=Nd(d,a.sel.primIndex);ue(a,g,c)}function qe(a,b,c,d){var e=a.sel.ranges.slice(0);e[b]=c,ue(a,Nd(e,a.sel.primIndex),d)}function re(a,b,c,d){ue(a,Od(b,c),d)}function se(a,b,c){var d={ranges:b.ranges,update:function(b){var c=this;this.ranges=[];for(var d=0;d<b.length;d++)c.ranges[d]=new Fh(Q(a,b[d].anchor),Q(a,b[d].head))},origin:c&&c.origin};return Ba(a,"beforeSelectionChange",a,d),a.cm&&Ba(a.cm,"beforeSelectionChange",a.cm,d),d.ranges!=b.ranges?Nd(d.ranges,d.ranges.length-1):b}function te(a,b,c){var d=a.history.done,e=p(d);e&&e.ranges?(d[d.length-1]=b,ve(a,b,c)):ue(a,b,c)}function ue(a,b,c){ve(a,b,c),ge(a,a.sel,a.cm?a.cm.curOp.id:NaN,c)}function ve(a,b,c){(Ea(a,"beforeSelectionChange")||a.cm&&Ea(a.cm,"beforeSelectionChange"))&&(b=se(a,b,c));var d=c&&c.bias||(K(b.primary().head,a.sel.primary().head)<0?-1:1);we(a,ye(a,b,d,!0)),c&&c.scroll===!1||!a.cm||Vc(a.cm)}function we(a,b){b.equals(a.sel)||(a.sel=b,a.cm&&(a.cm.curOp.updateInput=a.cm.curOp.selectionChanged=!0,Da(a.cm)),vb(a,"cursorActivity",a))}function xe(a){we(a,ye(a,a.sel,null,!1))}function ye(a,b,c,d){for(var e,f=0;f<b.ranges.length;f++){var g=b.ranges[f],h=b.ranges.length==a.sel.ranges.length&&a.sel.ranges[f],i=Ae(a,g.anchor,h&&h.anchor,c,d),j=Ae(a,g.head,h&&h.head,c,d);(e||i!=g.anchor||j!=g.head)&&(e||(e=b.ranges.slice(0,f)),e[f]=new Fh(i,j))}return e?Nd(e,b.primIndex):b}function ze(a,b,c,d,e){var f=B(a,b.line);if(f.markedSpans)for(var g=0;g<f.markedSpans.length;++g){var h=f.markedSpans[g],i=h.marker;if((null==h.from||(i.inclusiveLeft?h.from<=b.ch:h.from<b.ch))&&(null==h.to||(i.inclusiveRight?h.to>=b.ch:h.to>b.ch))){if(e&&(Ba(i,"beforeCursorEnter"),i.explicitlyCleared)){if(f.markedSpans){--g;continue}break}if(!i.atomic)continue;if(c){var j=i.find(d<0?1:-1),k=void 0;if((d<0?i.inclusiveRight:i.inclusiveLeft)&&(j=Be(a,j,-d,j&&j.line==b.line?f:null)),j&&j.line==b.line&&(k=K(j,c))&&(d<0?k<0:k>0))return ze(a,j,b,d,e)}var l=i.find(d<0?-1:1);return(d<0?i.inclusiveLeft:i.inclusiveRight)&&(l=Be(a,l,d,l.line==b.line?f:null)),l?ze(a,l,b,d,e):null}}return b}function Ae(a,b,c,d,e){var f=d||1,g=ze(a,b,c,f,e)||!e&&ze(a,b,c,f,!0)||ze(a,b,c,-f,e)||!e&&ze(a,b,c,-f,!0);return g?g:(a.cantEdit=!0,J(a.first,0))}function Be(a,b,c,d){return c<0&&0==b.ch?b.line>a.first?Q(a,J(b.line-1)):null:c>0&&b.ch==(d||B(a,b.line)).text.length?b.line<a.first+a.size-1?J(b.line+1,0):null:new J(b.line,b.ch+c)}function Ce(a){a.setSelection(J(a.firstLine(),0),J(a.lastLine()),Ug)}function De(a,b,c){var d={canceled:!1,from:b.from,to:b.to,text:b.text,origin:b.origin,cancel:function(){return d.canceled=!0}};return c&&(d.update=function(b,c,e,f){b&&(d.from=Q(a,b)),c&&(d.to=Q(a,c)),e&&(d.text=e),void 0!==f&&(d.origin=f)}),Ba(a,"beforeChange",a,d),a.cm&&Ba(a.cm,"beforeChange",a.cm,d),d.canceled?null:{from:d.from,to:d.to,text:d.text,origin:d.origin}}function Ee(a,b,c){if(a.cm){if(!a.cm.curOp)return od(a.cm,Ee)(a,b,c);if(a.cm.state.suppressEdits)return}if(!(Ea(a,"beforeChange")||a.cm&&Ea(a.cm,"beforeChange"))||(b=De(a,b,!0))){var d=$g&&!c&&ba(a,b.from,b.to);if(d)for(var e=d.length-1;e>=0;--e)Fe(a,{from:d[e].from,to:d[e].to,text:e?[""]:b.text,origin:b.origin});else Fe(a,b)}}function Fe(a,b){if(1!=b.text.length||""!=b.text[0]||0!=K(b.from,b.to)){var c=Rd(a,b);ee(a,b,c,a.cm?a.cm.curOp.id:NaN),Ie(a,b,c,_(a,b));var d=[];Yd(a,(function(a,c){c||m(d,a.history)!=-1||(Ne(a.history,b),d.push(a.history)),Ie(a,b,null,_(a,b))}))}}function Ge(a,b,c){var d=a.cm&&a.cm.state.suppressEdits;if(!d||c){for(var e,f=a.history,g=a.sel,h="undo"==b?f.done:f.undone,i="undo"==b?f.undone:f.done,j=0;j<h.length&&(e=h[j],c?!e.ranges||e.equals(a.sel):e.ranges);j++);if(j!=h.length){for(f.lastOrigin=f.lastSelOrigin=null;;){if(e=h.pop(),!e.ranges){if(d)return void h.push(e);break}if(he(e,i),c&&!e.equals(a.sel))return void ue(a,e,{clearRedo:!1});g=e}var k=[];he(g,i),i.push({changes:k,generation:f.generation}),f.generation=e.generation||++f.maxGeneration;for(var l=Ea(a,"beforeChange")||a.cm&&Ea(a.cm,"beforeChange"),n=function(c){var d=e.changes[c];if(d.origin=b,l&&!De(a,d,!1))return h.length=0,{};k.push(be(a,d));var f=c?Rd(a,d):p(h);Ie(a,d,f,le(a,d)),!c&&a.cm&&a.cm.scrollIntoView({from:d.from,to:Pd(d)});var g=[];Yd(a,(function(a,b){b||m(g,a.history)!=-1||(Ne(a.history,d),g.push(a.history)),Ie(a,d,null,le(a,d))}))},o=e.changes.length-1;o>=0;--o){var q=n(o);if(q)return q.v}}}}function He(a,b){if(0!=b&&(a.first+=b,a.sel=new Eh(q(a.sel.ranges,(function(a){return new Fh(J(a.anchor.line+b,a.anchor.ch),J(a.head.line+b,a.head.ch))})),a.sel.primIndex),a.cm)){rd(a.cm,a.first,a.first-b,b);for(var c=a.cm.display,d=c.viewFrom;d<c.viewTo;d++)sd(a.cm,d,"gutter")}}function Ie(a,b,c,d){if(a.cm&&!a.cm.curOp)return od(a.cm,Ie)(a,b,c,d);if(b.to.line<a.first)return void He(a,b.text.length-1-(b.to.line-b.from.line));if(!(b.from.line>a.lastLine())){if(b.from.line<a.first){var e=b.text.length-1-(a.first-b.from.line);He(a,e),b={from:J(a.first,0),to:J(b.to.line+e,b.to.ch),text:[p(b.text)],origin:b.origin}}var f=a.lastLine();b.to.line>f&&(b={from:b.from,to:J(f,B(a,f).text.length),text:[b.text[0]],origin:b.origin}),b.removed=C(a,b.from,b.to),c||(c=Rd(a,b)),a.cm?Je(a.cm,b,d):Xd(a,b,d),ve(a,c,Ug)}}function Je(a,b,c){var d=a.doc,e=a.display,f=b.from,g=b.to,h=!1,i=f.line;a.options.lineWrapping||(i=F(ma(B(d,f.line))),d.iter(i,g.line+1,(function(a){if(a==e.maxLine)return h=!0,!0}))),d.sel.contains(b.from,b.to)>-1&&Da(a),Xd(d,b,c,xc(a)),a.options.lineWrapping||(d.iter(i,f.line+b.text.length,(function(a){var b=ua(a);b>e.maxLineLength&&(e.maxLine=a,e.maxLineLength=b,e.maxLineChanged=!0,h=!1)})),h&&(a.curOp.updateMaxLine=!0)),fb(d,f.line),xd(a,400);var j=b.text.length-(g.line-f.line)-1;b.full?rd(a):f.line!=g.line||1!=b.text.length||Wd(a.doc,b)?rd(a,f.line,g.line+1,j):sd(a,f.line,"text");var k=Ea(a,"changes"),l=Ea(a,"change");if(l||k){var m={from:f,to:g,text:b.text,removed:b.removed,origin:b.origin};l&&vb(a,"change",a,m),k&&(a.curOp.changeObjs||(a.curOp.changeObjs=[])).push(m)}a.display.selForContextMenu=null}function Ke(a,b,c,d,e){if(d||(d=c),K(d,c)<0){var f;f=[d,c],c=f[0],d=f[1]}"string"==typeof b&&(b=a.splitLines(b)),Ee(a,{from:c,to:d,text:b,origin:e})}function Le(a,b,c,d){c<a.line?a.line+=d:b<a.line&&(a.line=b,a.ch=0)}function Me(a,b,c,d){for(var e=0;e<a.length;++e){var f=a[e],g=!0;if(f.ranges){f.copied||(f=a[e]=f.deepCopy(),f.copied=!0);for(var h=0;h<f.ranges.length;h++)Le(f.ranges[h].anchor,b,c,d),Le(f.ranges[h].head,b,c,d)}else{for(var i=0;i<f.changes.length;++i){var j=f.changes[i];if(c<j.from.line)j.from=J(j.from.line+d,j.from.ch),j.to=J(j.to.line+d,j.to.ch);else if(b<=j.to.line){g=!1;break}}g||(a.splice(0,e+1),e=0)}}}function Ne(a,b){var c=b.from.line,d=b.to.line,e=b.text.length-(d-c)-1;Me(a.done,c,d,e),Me(a.undone,c,d,e)}function Oe(a,b,c,d){var e=b,f=b;return"number"==typeof b?f=B(a,P(a,b)):e=F(b),null==e?null:(d(f,e)&&a.cm&&sd(a.cm,e,c),f)}function Pe(a){var b=this;this.lines=a,this.parent=null;for(var c=0,d=0;d<a.length;++d)a[d].parent=b,c+=a[d].height;this.height=c}function Qe(a){var b=this;this.children=a;for(var c=0,d=0,e=0;e<a.length;++e){var f=a[e];c+=f.chunkSize(),d+=f.height,f.parent=b}this.size=c,this.height=d,this.parent=null}function Re(a,b,c){ta(b)<(a.curOp&&a.curOp.scrollTop||a.doc.scrollTop)&&Uc(a,c)}function Se(a,b,c,d){var e=new Gh(a,c,d),f=a.cm;return f&&e.noHScroll&&(f.display.alignWidgets=!0),Oe(a,b,"widget",(function(b){var c=b.widgets||(b.widgets=[]);if(null==e.insertAt?c.push(e):c.splice(Math.min(c.length-1,Math.max(0,e.insertAt)),0,e),e.line=b,f&&!ra(a,b)){var d=ta(b)<a.scrollTop;E(b,b.height+Jb(e)),d&&Uc(f,e.height),f.curOp.forceUpdate=!0}return!0})),f&&vb(f,"lineWidgetAdded",f,e,"number"==typeof b?b:F(b)),e}function Te(a,b,c,d,f){if(d&&d.shared)return Ue(a,b,c,d,f);if(a.cm&&!a.cm.curOp)return od(a.cm,Te)(a,b,c,d,f);var g=new Ih(a,f),h=K(b,c);if(d&&k(d,g,!1),h>0||0==h&&g.clearWhenEmpty!==!1)return g;if(g.replacedWith&&(g.collapsed=!0,g.widgetNode=e("span",[g.replacedWith],"CodeMirror-widget"),d.handleMouseEvents||g.widgetNode.setAttribute("cm-ignore-events","true"),d.insertLeft&&(g.widgetNode.insertLeft=!0)),g.collapsed){if(la(a,b.line,b,c,g)||b.line!=c.line&&la(a,c.line,b,c,g))throw new Error("Inserting collapsed marker partially overlapping an existing one");U()}g.addToHistory&&ee(a,{from:b,to:c,origin:"markText"},a.sel,NaN);var i,j=b.line,l=a.cm;if(a.iter(j,c.line+1,(function(a){l&&g.collapsed&&!l.options.lineWrapping&&ma(a)==l.display.maxLine&&(i=!0),g.collapsed&&j!=b.line&&E(a,0),Y(a,new V(g,j==b.line?b.ch:null,j==c.line?c.ch:null)),++j})),g.collapsed&&a.iter(b.line,c.line+1,(function(b){ra(a,b)&&E(b,0)})),g.clearOnEnter&&dh(g,"beforeCursorEnter",(function(){return g.clear()})),g.readOnly&&(T(),(a.history.done.length||a.history.undone.length)&&a.clearHistory()),g.collapsed&&(g.id=++Hh,g.atomic=!0),l){if(i&&(l.curOp.updateMaxLine=!0),g.collapsed)rd(l,b.line,c.line+1);else if(g.className||g.title||g.startStyle||g.endStyle||g.css)for(var m=b.line;m<=c.line;m++)sd(l,m,"text");g.atomic&&xe(l.doc),vb(l,"markerAdded",l,g)}return g}function Ue(a,b,c,d,e){d=k(d),d.shared=!1;var f=[Te(a,b,c,d,e)],g=f[0],h=d.widgetNode;return Yd(a,(function(a){h&&(d.widgetNode=h.cloneNode(!0)),f.push(Te(a,Q(a,b),Q(a,c),d,e));for(var i=0;i<a.linked.length;++i)if(a.linked[i].isParent)return;g=p(f)})),new Jh(f,g)}function Ve(a){return a.findMarks(J(a.first,0),a.clipPos(J(a.lastLine())),(function(a){return a.parent}))}function We(a,b){for(var c=0;c<b.length;c++){var d=b[c],e=d.find(),f=a.clipPos(e.from),g=a.clipPos(e.to);if(K(f,g)){var h=Te(a,f,g,d.primary,d.primary.type);d.markers.push(h),h.parent=d}}}function Xe(a){for(var b=function(b){var c=a[b],d=[c.primary.doc];Yd(c.primary.doc,(function(a){return d.push(a)}));for(var e=0;e<c.markers.length;e++){var f=c.markers[e];m(d,f.doc)==-1&&(f.parent=null,c.markers.splice(e--,1))}},c=0;c<a.length;c++)b(c)}function Ye(a){var b=this;if(_e(b),!Ca(b,a)&&!Kb(b.display,a)){Ga(a),ug&&(Mh=+new Date);var c=zc(b,a,!0),d=a.dataTransfer.files;if(c&&!b.isReadOnly())if(d&&d.length&&window.FileReader&&window.File)for(var e=d.length,f=Array(e),g=0,h=function(a,d){if(!b.options.allowDropFileTypes||m(b.options.allowDropFileTypes,a.type)!=-1){var h=new FileReader;h.onload=od(b,(function(){var a=h.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(a)&&(a=""),f[d]=a,++g==e){c=Q(b.doc,c);var i={from:c,to:c,text:b.doc.splitLines(f.join(b.doc.lineSeparator())),origin:"paste"};Ee(b.doc,i),te(b.doc,Od(c,Pd(i)))}})),h.readAsText(a)}},i=0;i<e;++i)h(d[i],i);else{if(b.state.draggingText&&b.doc.sel.contains(c)>-1)return b.state.draggingText(a),void setTimeout((function(){return b.display.input.focus()}),20);try{var j=a.dataTransfer.getData("Text");if(j){var k;if(b.state.draggingText&&!b.state.draggingText.copy&&(k=b.listSelections()),ve(b.doc,Od(c,c)),k)for(var l=0;l<k.length;++l)Ke(b.doc,"",k[l].anchor,k[l].head,"drag");b.replaceSelection(j,"around","paste"),b.display.input.focus()}}catch(a){}}}}function Ze(a,b){if(ug&&(!a.state.draggingText||+new Date-Mh<100))return void Ja(b);if(!Ca(a,b)&&!Kb(a.display,b)&&(b.dataTransfer.setData("Text",a.getSelection()),b.dataTransfer.effectAllowed="copyMove",b.dataTransfer.setDragImage&&!Ag)){var c=d("img",null,null,"position: fixed; left: 0; top: 0;");c.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",zg&&(c.width=c.height=1,a.display.wrapper.appendChild(c),c._top=c.offsetTop),b.dataTransfer.setDragImage(c,0,0),zg&&c.parentNode.removeChild(c)}}function $e(a,b){var e=zc(a,b);if(e){var f=document.createDocumentFragment();Dc(a,e,f),a.display.dragCursor||(a.display.dragCursor=d("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),a.display.lineSpace.insertBefore(a.display.dragCursor,a.display.cursorDiv)),c(a.display.dragCursor,f)}}function _e(a){a.display.dragCursor&&(a.display.lineSpace.removeChild(a.display.dragCursor),a.display.dragCursor=null)}function af(a){if(document.getElementsByClassName)for(var b=document.getElementsByClassName("CodeMirror"),c=0;c<b.length;c++){var d=b[c].CodeMirror;d&&a(d)}}function bf(){Nh||(cf(),Nh=!0)}function cf(){var a;dh(window,"resize",(function(){null==a&&(a=setTimeout((function(){a=null,af(df)}),100))})),dh(window,"blur",(function(){return af(Kc)}))}function df(a){var b=a.display;b.cachedCharWidth=b.cachedTextHeight=b.cachedPaddingH=null,b.scrollbarsClipped=!1,a.setSize()}function ef(a){var b=a.split(/-(?!$)/);a=b[b.length-1];for(var c,d,e,f,g=0;g<b.length-1;g++){var h=b[g];if(/^(cmd|meta|m)$/i.test(h))f=!0;else if(/^a(lt)?$/i.test(h))c=!0;else if(/^(c|ctrl|control)$/i.test(h))d=!0;else{if(!/^s(hift)?$/i.test(h))throw new Error("Unrecognized modifier name: "+h);e=!0}}return c&&(a="Alt-"+a),d&&(a="Ctrl-"+a),f&&(a="Cmd-"+a),e&&(a="Shift-"+a),a}function ff(a){var b={};for(var c in a)if(a.hasOwnProperty(c)){var d=a[c];if(/^(name|fallthrough|(de|at)tach)$/.test(c))continue;if("..."==d){delete a[c];continue}for(var e=q(c.split(" "),ef),f=0;f<e.length;f++){var g=void 0,h=void 0;f==e.length-1?(h=e.join(" "),g=d):(h=e.slice(0,f+1).join(" "),g="...");var i=b[h];if(i){if(i!=g)throw new Error("Inconsistent bindings for "+h)}else b[h]=g}delete a[c]}for(var j in b)a[j]=b[j];return a}function gf(a,b,c,d){b=lf(b);var e=b.call?b.call(a,d):b[a];if(e===!1)return"nothing";if("..."===e)return"multi";if(null!=e&&c(e))return"handled";if(b.fallthrough){if("[object Array]"!=Object.prototype.toString.call(b.fallthrough))return gf(a,b.fallthrough,c,d);for(var f=0;f<b.fallthrough.length;f++){var g=gf(a,b.fallthrough[f],c,d);if(g)return g}}}function hf(a){var b="string"==typeof a?a:Oh[a.keyCode];return"Ctrl"==b||"Alt"==b||"Shift"==b||"Mod"==b}function jf(a,b,c){var d=a;return b.altKey&&"Alt"!=d&&(a="Alt-"+a),(Lg?b.metaKey:b.ctrlKey)&&"Ctrl"!=d&&(a="Ctrl-"+a),(Lg?b.ctrlKey:b.metaKey)&&"Cmd"!=d&&(a="Cmd-"+a),!c&&b.shiftKey&&"Shift"!=d&&(a="Shift-"+a),a}function kf(a,b){if(zg&&34==a.keyCode&&a.char)return!1;var c=Oh[a.keyCode];return null!=c&&!a.altGraphKey&&(3==a.keyCode&&a.code&&(c=a.code),jf(c,a,b))}function lf(a){return"string"==typeof a?Sh[a]:a}function mf(a,b){for(var c=a.doc.sel.ranges,d=[],e=0;e<c.length;e++){for(var f=b(c[e]);d.length&&K(f.from,p(d).to)<=0;){var g=d.pop();if(K(g.from,f.from)<0){f.from=g.from;break}}d.push(f)}nd(a,(function(){for(var b=d.length-1;b>=0;b--)Ke(a.doc,"",d[b].from,d[b].to,"+delete");Vc(a)}))}function nf(a,b,c){var d=y(a.text,b+c,c);return d<0||d>a.text.length?null:d}function of(a,b,c){var d=nf(a,b.ch,c);return null==d?null:new J(b.line,d,c<0?"after":"before")}function pf(a,b,c,d,e){if(a){var f=ya(c,b.doc.direction);if(f){var g,h=e<0?p(f):f[0],i=e<0==(1==h.level),j=i?"after":"before";if(h.level>0||"rtl"==b.doc.direction){var k=Wb(b,c);g=e<0?c.text.length-1:0;var l=Xb(b,k,g).top;g=z((function(a){return Xb(b,k,a).top==l}),e<0==(1==h.level)?h.from:h.to-1,g),"before"==j&&(g=nf(c,g,1))}else g=e<0?h.to:h.from;return new J(d,g,j)}}return new J(d,e<0?c.text.length:0,e<0?"before":"after")}function qf(a,b,c,d){var e=ya(b,a.doc.direction);if(!e)return of(b,c,d);c.ch>=b.text.length?(c.ch=b.text.length,c.sticky="before"):c.ch<=0&&(c.ch=0,c.sticky="after");var f=xa(e,c.ch,c.sticky),g=e[f];if("ltr"==a.doc.direction&&g.level%2==0&&(d>0?g.to>c.ch:g.from<c.ch))return of(b,c,d);var h,i=function(a,c){return nf(b,a instanceof J?a.ch:a,c)},j=function(c){return a.options.lineWrapping?(h=h||Wb(a,b),oc(a,b,h,c)):{begin:0,end:b.text.length}},k=j("before"==c.sticky?i(c,-1):c.ch);if("rtl"==a.doc.direction||1==g.level){var l=1==g.level==d<0,m=i(c,l?1:-1);if(null!=m&&(l?m<=g.to&&m<=k.end:m>=g.from&&m>=k.begin)){var n=l?"before":"after";return new J(c.line,m,n)}}var o=function(a,b,d){for(var f=function(a,b){return b?new J(c.line,i(a,1),"before"):new J(c.line,a,"after")};a>=0&&a<e.length;a+=b){var g=e[a],h=b>0==(1!=g.level),j=h?d.begin:i(d.end,-1);if(g.from<=j&&j<g.to)return f(j,h);if(j=h?g.from:i(g.to,-1),d.begin<=j&&j<d.end)return f(j,h)}},p=o(f+d,d,k);if(p)return p;var q=d>0?k.end:i(k.begin,-1);return null==q||d>0&&q==b.text.length||!(p=o(d>0?0:e.length-1,d,j(q)))?null:p}function rf(a,b){var c=B(a.doc,b),d=ma(c);return d!=c&&(b=F(d)),pf(!0,a,d,b,1)}function sf(a,b){var c=B(a.doc,b),d=na(c);return d!=c&&(b=F(d)),pf(!0,a,c,b,-1)}function tf(a,b){var c=rf(a,b.line),d=B(a.doc,c.line),e=ya(d,a.doc.direction);if(!e||0==e[0].level){var f=Math.max(0,d.text.search(/\S/)),g=b.line==c.line&&b.ch<=f&&b.ch;return J(c.line,g?0:f,c.sticky)}return c}function uf(a,b,c){if("string"==typeof b&&(b=Th[b],!b))return!1;a.display.input.ensurePolled();var d=a.display.shift,e=!1;try{a.isReadOnly()&&(a.state.suppressEdits=!0),c&&(a.display.shift=!1),e=b(a)!=Tg}finally{a.display.shift=d,a.state.suppressEdits=!1}return e}function vf(a,b,c){for(var d=0;d<a.state.keyMaps.length;d++){var e=gf(b,a.state.keyMaps[d],c,a);if(e)return e}return a.options.extraKeys&&gf(b,a.options.extraKeys,c,a)||gf(b,a.options.keyMap,c,a)}function wf(a,b,c,d){var e=a.state.keySeq;if(e){if(hf(b))return"handled";if(/\'$/.test(b)?a.state.keySeq=null:Uh.set(50,(function(){a.state.keySeq==e&&(a.state.keySeq=null,a.display.input.reset())})),xf(a,e+" "+b,c,d))return!0}return xf(a,b,c,d)}function xf(a,b,c,d){var e=vf(a,b,d);return"multi"==e&&(a.state.keySeq=b),"handled"==e&&vb(a,"keyHandled",a,b,c),"handled"!=e&&"multi"!=e||(Ga(c),Gc(a)),!!e}function yf(a,b){var c=kf(b,!0);return!!c&&(b.shiftKey&&!a.state.keySeq?wf(a,"Shift-"+c,b,(function(b){return uf(a,b,!0)}))||wf(a,c,b,(function(b){if("string"==typeof b?/^go[A-Z]/.test(b):b.motion)return uf(a,b)})):wf(a,c,b,(function(b){return uf(a,b)})))}function zf(a,b,c){return wf(a,"'"+c+"'",b,(function(b){return uf(a,b,!0)}))}function Af(a){var b=this;if(b.curOp.focus=g(),!Ca(b,a)){ug&&vg<11&&27==a.keyCode&&(a.returnValue=!1);var c=a.keyCode;b.display.shift=16==c||a.shiftKey;var d=yf(b,a);zg&&(Vh=d?c:null,!d&&88==c&&!hh&&(Gg?a.metaKey:a.ctrlKey)&&b.replaceSelection("",null,"cut")),18!=c||/\bCodeMirror-crosshair\b/.test(b.display.lineDiv.className)||Bf(b)}}function Bf(a){function b(a){18!=a.keyCode&&a.altKey||(Ng(c,"CodeMirror-crosshair"),Aa(document,"keyup",b),Aa(document,"mouseover",b))}var c=a.display.lineDiv;h(c,"CodeMirror-crosshair"),dh(document,"keyup",b),dh(document,"mouseover",b)}function Cf(a){16==a.keyCode&&(this.doc.sel.shift=!1),Ca(this,a)}function Df(a){var b=this;if(!(Kb(b.display,a)||Ca(b,a)||a.ctrlKey&&!a.altKey||Gg&&a.metaKey)){var c=a.keyCode,d=a.charCode;if(zg&&c==Vh)return Vh=null,void Ga(a);if(!zg||a.which&&!(a.which<10)||!yf(b,a)){var e=String.fromCharCode(null==d?c:d);"\b"!=e&&(zf(b,a,e)||b.display.input.onKeyPress(a))}}}function Ef(a,b){var c=+new Date;return Zh&&Zh.compare(c,a,b)?(Yh=Zh=null,"triple"):Yh&&Yh.compare(c,a,b)?(Zh=new Xh(c,a,b),Yh=null,"double"):(Yh=new Xh(c,a,b),Zh=null,"single")}function Ff(a){var b=this,c=b.display;if(!(Ca(b,a)||c.activeTouch&&c.input.supportsTouch())){if(c.input.ensurePolled(),c.shift=a.shiftKey,Kb(c,a))return void(wg||(c.scroller.draggable=!1,setTimeout((function(){return c.scroller.draggable=!0}),100)));if(!Of(b,a)){var d=zc(b,a),e=La(a),f=d?Ef(d,e):"single";window.focus(),1==e&&b.state.selectingText&&b.state.selectingText(a),d&&Gf(b,e,d,f,a)||(1==e?d?If(b,d,f,a):Ka(a)==c.scroller&&Ga(a):2==e?(d&&oe(b.doc,d),setTimeout((function(){return c.input.focus()}),20)):3==e&&(Mg?Pf(b,a):Ic(b)))}}}function Gf(a,b,c,d,e){var f="Click";return"double"==d?f="Double"+f:"triple"==d&&(f="Triple"+f),f=(1==b?"Left":2==b?"Middle":"Right")+f,wf(a,jf(f,e),e,(function(b){if("string"==typeof b&&(b=Th[b]),!b)return!1;var d=!1;try{a.isReadOnly()&&(a.state.suppressEdits=!0),d=b(a,c)!=Tg}finally{a.state.suppressEdits=!1}return d}))}function Hf(a,b,c){var d=a.getOption("configureMouse"),e=d?d(a,b,c):{};if(null==e.unit){var f=Hg?c.shiftKey&&c.metaKey:c.altKey;e.unit=f?"rectangle":"single"==b?"char":"double"==b?"word":"line"}return(null==e.extend||a.doc.extend)&&(e.extend=a.doc.extend||c.shiftKey),null==e.addNew&&(e.addNew=Gg?c.metaKey:c.ctrlKey),null==e.moveOnDrag&&(e.moveOnDrag=!(Gg?c.altKey:c.ctrlKey)),e}function If(a,b,c,d){ug?setTimeout(j(Hc,a),0):a.curOp.focus=g();var e,f=Hf(a,c,d),h=a.doc.sel;a.options.dragDrop&&eh&&!a.isReadOnly()&&"single"==c&&(e=h.contains(b))>-1&&(K((e=h.ranges[e]).from(),b)<0||b.xRel>0)&&(K(e.to(),b)>0||b.xRel<0)?Jf(a,d,b,f):Lf(a,d,b,f)}function Jf(a,b,c,d){var e=a.display,f=!1,g=od(a,(function(b){wg&&(e.scroller.draggable=!1),a.state.draggingText=!1,Aa(e.wrapper.ownerDocument,"mouseup",g),Aa(e.wrapper.ownerDocument,"mousemove",h),Aa(e.scroller,"dragstart",i),Aa(e.scroller,"drop",g),f||(Ga(b),d.addNew||oe(a.doc,c,null,null,d.extend),wg||ug&&9==vg?setTimeout((function(){e.wrapper.ownerDocument.body.focus(),e.input.focus()}),20):e.input.focus())})),h=function(a){f=f||Math.abs(b.clientX-a.clientX)+Math.abs(b.clientY-a.clientY)>=10},i=function(){return f=!0};wg&&(e.scroller.draggable=!0),a.state.draggingText=g,g.copy=!d.moveOnDrag,e.scroller.dragDrop&&e.scroller.dragDrop(),dh(e.wrapper.ownerDocument,"mouseup",g),dh(e.wrapper.ownerDocument,"mousemove",h),dh(e.scroller,"dragstart",i),dh(e.scroller,"drop",g),Ic(a),setTimeout((function(){return e.input.focus()}),20)}function Kf(a,b,c){if("char"==c)return new Fh(b,b);if("word"==c)return a.findWordAt(b);if("line"==c)return new Fh(J(b.line,0),Q(a.doc,J(b.line+1,0)));var d=c(a,b);return new Fh(d.from,d.to)}function Lf(a,b,c,d){function e(b){if(0!=K(r,b))if(r=b,"rectangle"==d.unit){for(var e=[],f=a.options.tabSize,g=l(B(j,c.line).text,c.ch,f),h=l(B(j,b.line).text,b.ch,f),i=Math.min(g,h),p=Math.max(g,h),q=Math.min(c.line,b.line),s=Math.min(a.lastLine(),Math.max(c.line,b.line));q<=s;q++){var t=B(j,q).text,u=n(t,i,f);i==p?e.push(new Fh(J(q,u),J(q,u))):t.length>u&&e.push(new Fh(J(q,u),J(q,n(t,p,f))))}e.length||e.push(new Fh(c,c)),ue(j,Nd(o.ranges.slice(0,m).concat(e),m),{origin:"*mouse",scroll:!1}),a.scrollIntoView(b)}else{var v,w=k,x=Kf(a,b,d.unit),y=w.anchor;K(x.anchor,y)>0?(v=x.head,y=O(w.from(),x.anchor)):(v=x.anchor,y=N(w.to(),x.head));var z=o.ranges.slice(0);z[m]=Mf(a,new Fh(Q(j,y),v)),ue(j,Nd(z,m),Vg)}}function f(b){var c=++t,h=zc(a,b,!0,"rectangle"==d.unit);if(h)if(0!=K(h,r)){a.curOp.focus=g(),e(h);var k=Nc(i,j);(h.line>=k.to||h.line<k.from)&&setTimeout(od(a,(function(){t==c&&f(b)})),150)}else{var l=b.clientY<s.top?-20:b.clientY>s.bottom?20:0;l&&setTimeout(od(a,(function(){t==c&&(i.scroller.scrollTop+=l,f(b))})),50)}}function h(b){a.state.selectingText=!1,t=1/0,Ga(b),i.input.focus(),Aa(i.wrapper.ownerDocument,"mousemove",u),Aa(i.wrapper.ownerDocument,"mouseup",v),j.history.lastSelOrigin=null}var i=a.display,j=a.doc;Ga(b);var k,m,o=j.sel,p=o.ranges;if(d.addNew&&!d.extend?(m=j.sel.contains(c),k=m>-1?p[m]:new Fh(c,c)):(k=j.sel.primary(),m=j.sel.primIndex),"rectangle"==d.unit)d.addNew||(k=new Fh(c,c)),c=zc(a,b,!0,!0),m=-1;else{var q=Kf(a,c,d.unit);k=d.extend?ne(k,q.anchor,q.head,d.extend):q}d.addNew?m==-1?(m=p.length,ue(j,Nd(p.concat([k]),m),{scroll:!1,origin:"*mouse"})):p.length>1&&p[m].empty()&&"char"==d.unit&&!d.extend?(ue(j,Nd(p.slice(0,m).concat(p.slice(m+1)),0),{scroll:!1,origin:"*mouse"}),o=j.sel):qe(j,m,k,Vg):(m=0,ue(j,new Eh([k],0),Vg),o=j.sel);var r=c,s=i.wrapper.getBoundingClientRect(),t=0,u=od(a,(function(a){0!==a.buttons&&La(a)?f(a):h(a)})),v=od(a,h);a.state.selectingText=v,dh(i.wrapper.ownerDocument,"mousemove",u),dh(i.wrapper.ownerDocument,"mouseup",v)}function Mf(a,b){var c=b.anchor,d=b.head,e=B(a.doc,c.line);if(0==K(c,d)&&c.sticky==d.sticky)return b;var f=ya(e);if(!f)return b;var g=xa(f,c.ch,c.sticky),h=f[g];if(h.from!=c.ch&&h.to!=c.ch)return b;var i=g+(h.from==c.ch==(1!=h.level)?0:1);if(0==i||i==f.length)return b;var j;if(d.line!=c.line)j=(d.line-c.line)*("ltr"==a.doc.direction?1:-1)>0;else{var k=xa(f,d.ch,d.sticky),l=k-g||(d.ch-c.ch)*(1==h.level?-1:1);j=k==i-1||k==i?l<0:l>0}var m=f[i+(j?-1:0)],n=j==(1==m.level),o=n?m.from:m.to,p=n?"after":"before";return c.ch==o&&c.sticky==p?b:new Fh(new J(c.line,o,p),d)}function Nf(a,b,c,d){var e,f;if(b.touches)e=b.touches[0].clientX,f=b.touches[0].clientY;else try{e=b.clientX,f=b.clientY}catch(a){return!1}if(e>=Math.floor(a.display.gutters.getBoundingClientRect().right))return!1;d&&Ga(b);var g=a.display,h=g.lineDiv.getBoundingClientRect();if(f>h.bottom||!Ea(a,c))return Ia(b);f-=h.top-g.viewOffset;for(var i=0;i<a.options.gutters.length;++i){var j=g.gutters.childNodes[i];if(j&&j.getBoundingClientRect().right>=e){var k=G(a.doc,f),l=a.options.gutters[i];return Ba(a,c,a,k,l,b),Ia(b)}}}function Of(a,b){return Nf(a,b,"gutterClick",!0)}function Pf(a,b){Kb(a.display,b)||Qf(a,b)||Ca(a,b,"contextmenu")||a.display.input.onContextMenu(b)}function Qf(a,b){return!!Ea(a,"gutterContextMenu")&&Nf(a,b,"gutterContextMenu",!1)}function Rf(a){a.display.wrapper.className=a.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+a.options.theme.replace(/(^|\s)\s*/g," cm-s-"),cc(a)}function Sf(a){function b(b,d,e,f){a.defaults[b]=d,e&&(c[b]=f?function(a,b,c){c!=$h&&e(a,b,c)}:e)}var c=a.optionHandlers;a.defineOption=b,a.Init=$h,b("value","",(function(a,b){return a.setValue(b)}),!0),b("mode",null,(function(a,b){a.doc.modeOption=b,Ud(a)}),!0),b("indentUnit",2,Ud,!0),b("indentWithTabs",!1),b("smartIndent",!0),b("tabSize",4,(function(a){Vd(a),cc(a),rd(a)}),!0),b("lineSeparator",null,(function(a,b){if(a.doc.lineSep=b,b){var c=[],d=a.doc.first;a.doc.iter((function(a){for(var e=0;;){var f=a.text.indexOf(b,e);if(f==-1)break;e=f+b.length,c.push(J(d,f))}d++}));for(var e=c.length-1;e>=0;e--)Ke(a.doc,b,c[e],J(c[e].line,c[e].ch+b.length))}})),b("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,(function(a,b,c){a.state.specialChars=new RegExp(b.source+(b.test("\t")?"":"|\t"),"g"),c!=$h&&a.refresh()})),b("specialCharPlaceholder",kb,(function(a){return a.refresh()}),!0),b("electricChars",!0),b("inputStyle",Fg?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),b("spellcheck",!1,(function(a,b){return a.getInputField().spellcheck=b}),!0),b("rtlMoveVisually",!Ig),b("wholeLineUpdateBefore",!0),b("theme","default",(function(a){Rf(a),Tf(a)}),!0),b("keyMap","default",(function(a,b,c){var d=lf(b),e=c!=$h&&lf(c);e&&e.detach&&e.detach(a,d),d.attach&&d.attach(a,e||null)})),b("extraKeys",null),b("configureMouse",null),b("lineWrapping",!1,Vf,!0),b("gutters",[],(function(a){Jd(a.options),Tf(a)}),!0),b("fixedGutter",!0,(function(a,b){a.display.gutters.style.left=b?wc(a.display)+"px":"0",a.refresh()}),!0),b("coverGutterNextToScrollbar",!1,(function(a){return cd(a)}),!0),b("scrollbarStyle","native",(function(a){ed(a),cd(a),a.display.scrollbars.setScrollTop(a.doc.scrollTop),a.display.scrollbars.setScrollLeft(a.doc.scrollLeft)}),!0),b("lineNumbers",!1,(function(a){Jd(a.options),Tf(a)}),!0),b("firstLineNumber",1,Tf,!0),b("lineNumberFormatter",(function(a){return a}),Tf,!0),b("showCursorWhenSelecting",!1,Bc,!0),b("resetSelectionOnContextMenu",!0),b("lineWiseCopyCut",!0),b("pasteLinesPerSelection",!0),b("readOnly",!1,(function(a,b){"nocursor"==b&&(Kc(a),a.display.input.blur()),a.display.input.readOnlyChanged(b)})),b("disableInput",!1,(function(a,b){b||a.display.input.reset()}),!0),b("dragDrop",!0,Uf),b("allowDropFileTypes",null),b("cursorBlinkRate",530), b("cursorScrollMargin",0),b("cursorHeight",1,Bc,!0),b("singleCursorHeightPerLine",!0,Bc,!0),b("workTime",100),b("workDelay",100),b("flattenSpans",!0,Vd,!0),b("addModeClass",!1,Vd,!0),b("pollInterval",100),b("undoDepth",200,(function(a,b){return a.doc.history.undoDepth=b})),b("historyEventDelay",1250),b("viewportMargin",10,(function(a){return a.refresh()}),!0),b("maxHighlightLength",1e4,Vd,!0),b("moveInputWithCursor",!0,(function(a,b){b||a.display.input.resetPosition()})),b("tabindex",null,(function(a,b){return a.display.input.getField().tabIndex=b||""})),b("autofocus",null),b("direction","ltr",(function(a,b){return a.doc.setDirection(b)}),!0),b("phrases",null)}function Tf(a){Id(a),rd(a),Oc(a)}function Uf(a,b,c){var d=c&&c!=$h;if(!b!=!d){var e=a.display.dragFunctions,f=b?dh:Aa;f(a.display.scroller,"dragstart",e.start),f(a.display.scroller,"dragenter",e.enter),f(a.display.scroller,"dragover",e.over),f(a.display.scroller,"dragleave",e.leave),f(a.display.scroller,"drop",e.drop)}}function Vf(a){a.options.lineWrapping?(h(a.display.wrapper,"CodeMirror-wrap"),a.display.sizer.style.minWidth="",a.display.sizerWidth=null):(Ng(a.display.wrapper,"CodeMirror-wrap"),va(a)),yc(a),rd(a),cc(a),setTimeout((function(){return cd(a)}),100)}function Wf(a,b){var c=this;if(!(this instanceof Wf))return new Wf(a,b);this.options=b=b?k(b):{},k(_h,b,!1),Jd(b);var d=b.value;"string"==typeof d?d=new Lh(d,b.mode,null,b.lineSeparator,b.direction):b.mode&&(d.modeOption=b.mode),this.doc=d;var e=new Wf.inputStyles[b.inputStyle](this),f=this.display=new A(a,d,e);f.wrapper.CodeMirror=this,Id(this),Rf(this),b.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),ed(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new Pg,keySeq:null,specialChars:null},b.autofocus&&!Fg&&f.input.focus(),ug&&vg<11&&setTimeout((function(){return c.display.input.reset(!0)}),20),Xf(this),bf(),fd(this),this.curOp.forceUpdate=!0,Zd(this,d),b.autofocus&&!Fg||this.hasFocus()?setTimeout(j(Jc,this),20):Kc(this);for(var g in ai)ai.hasOwnProperty(g)&&ai[g](c,b[g],$h);Pc(this),b.finishInit&&b.finishInit(this);for(var h=0;h<bi.length;++h)bi[h](c);gd(this),wg&&b.lineWrapping&&"optimizelegibility"==getComputedStyle(f.lineDiv).textRendering&&(f.lineDiv.style.textRendering="auto")}function Xf(a){function b(){e.activeTouch&&(f=setTimeout((function(){return e.activeTouch=null}),1e3),g=e.activeTouch,g.end=+new Date)}function c(a){if(1!=a.touches.length)return!1;var b=a.touches[0];return b.radiusX<=1&&b.radiusY<=1}function d(a,b){if(null==b.left)return!0;var c=b.left-a.left,d=b.top-a.top;return c*c+d*d>400}var e=a.display;dh(e.scroller,"mousedown",od(a,Ff)),ug&&vg<11?dh(e.scroller,"dblclick",od(a,(function(b){if(!Ca(a,b)){var c=zc(a,b);if(c&&!Of(a,b)&&!Kb(a.display,b)){Ga(b);var d=a.findWordAt(c);oe(a.doc,d.anchor,d.head)}}}))):dh(e.scroller,"dblclick",(function(b){return Ca(a,b)||Ga(b)})),Mg||dh(e.scroller,"contextmenu",(function(b){return Pf(a,b)}));var f,g={end:0};dh(e.scroller,"touchstart",(function(b){if(!Ca(a,b)&&!c(b)&&!Of(a,b)){e.input.ensurePolled(),clearTimeout(f);var d=+new Date;e.activeTouch={start:d,moved:!1,prev:d-g.end<=300?g:null},1==b.touches.length&&(e.activeTouch.left=b.touches[0].pageX,e.activeTouch.top=b.touches[0].pageY)}})),dh(e.scroller,"touchmove",(function(){e.activeTouch&&(e.activeTouch.moved=!0)})),dh(e.scroller,"touchend",(function(c){var f=e.activeTouch;if(f&&!Kb(e,c)&&null!=f.left&&!f.moved&&new Date-f.start<300){var g,h=a.coordsChar(e.activeTouch,"page");g=!f.prev||d(f,f.prev)?new Fh(h,h):!f.prev.prev||d(f,f.prev.prev)?a.findWordAt(h):new Fh(J(h.line,0),Q(a.doc,J(h.line+1,0))),a.setSelection(g.anchor,g.head),a.focus(),Ga(c)}b()})),dh(e.scroller,"touchcancel",b),dh(e.scroller,"scroll",(function(){e.scroller.clientHeight&&($c(a,e.scroller.scrollTop),ad(a,e.scroller.scrollLeft,!0),Ba(a,"scroll",a))})),dh(e.scroller,"mousewheel",(function(b){return Md(a,b)})),dh(e.scroller,"DOMMouseScroll",(function(b){return Md(a,b)})),dh(e.wrapper,"scroll",(function(){return e.wrapper.scrollTop=e.wrapper.scrollLeft=0})),e.dragFunctions={enter:function(b){Ca(a,b)||Ja(b)},over:function(b){Ca(a,b)||($e(a,b),Ja(b))},start:function(b){return Ze(a,b)},drop:od(a,Ye),leave:function(b){Ca(a,b)||_e(a)}};var h=e.input.getField();dh(h,"keyup",(function(b){return Cf.call(a,b)})),dh(h,"keydown",od(a,Af)),dh(h,"keypress",od(a,Df)),dh(h,"focus",(function(b){return Jc(a,b)})),dh(h,"blur",(function(b){return Kc(a,b)}))}function Yf(a,b,c,d){var e,f=a.doc;null==c&&(c="add"),"smart"==c&&(f.mode.indent?e=Za(a,b).state:c="prev");var g=a.options.tabSize,h=B(f,b),i=l(h.text,null,g);h.stateAfter&&(h.stateAfter=null);var j,k=h.text.match(/^\s*/)[0];if(d||/\S/.test(h.text)){if("smart"==c&&(j=f.mode.indent(e,h.text.slice(k.length),h.text),j==Tg||j>150)){if(!d)return;c="prev"}}else j=0,c="not";"prev"==c?j=b>f.first?l(B(f,b-1).text,null,g):0:"add"==c?j=i+a.options.indentUnit:"subtract"==c?j=i-a.options.indentUnit:"number"==typeof c&&(j=i+c),j=Math.max(0,j);var m="",n=0;if(a.options.indentWithTabs)for(var p=Math.floor(j/g);p;--p)n+=g,m+="\t";if(n<j&&(m+=o(j-n)),m!=k)return Ke(f,m,J(b,0),J(b,k.length),"+input"),h.stateAfter=null,!0;for(var q=0;q<f.sel.ranges.length;q++){var r=f.sel.ranges[q];if(r.head.line==b&&r.head.ch<k.length){var s=J(b,k.length);qe(f,q,new Fh(s,s));break}}}function Zf(a){ci=a}function $f(a,b,c,d,e){var f=a.doc;a.display.shift=!1,d||(d=f.sel);var g=a.state.pasteIncoming||"paste"==e,h=fh(b),i=null;if(g&&d.ranges.length>1)if(ci&&ci.text.join("\n")==b){if(d.ranges.length%ci.text.length==0){i=[];for(var j=0;j<ci.text.length;j++)i.push(f.splitLines(ci.text[j]))}}else h.length==d.ranges.length&&a.options.pasteLinesPerSelection&&(i=q(h,(function(a){return[a]})));for(var k,l=d.ranges.length-1;l>=0;l--){var m=d.ranges[l],n=m.from(),o=m.to();m.empty()&&(c&&c>0?n=J(n.line,n.ch-c):a.state.overwrite&&!g?o=J(o.line,Math.min(B(f,o.line).text.length,o.ch+p(h).length)):ci&&ci.lineWise&&ci.text.join("\n")==b&&(n=o=J(n.line,0))),k=a.curOp.updateInput;var r={from:n,to:o,text:i?i[l%i.length]:h,origin:e||(g?"paste":a.state.cutIncoming?"cut":"+input")};Ee(a.doc,r),vb(a,"inputRead",a,r)}b&&!g&&ag(a,b),Vc(a),a.curOp.updateInput=k,a.curOp.typing=!0,a.state.pasteIncoming=a.state.cutIncoming=!1}function _f(a,b){var c=a.clipboardData&&a.clipboardData.getData("Text");if(c)return a.preventDefault(),b.isReadOnly()||b.options.disableInput||nd(b,(function(){return $f(b,c,0,null,"paste")})),!0}function ag(a,b){if(a.options.electricChars&&a.options.smartIndent)for(var c=a.doc.sel,d=c.ranges.length-1;d>=0;d--){var e=c.ranges[d];if(!(e.head.ch>100||d&&c.ranges[d-1].head.line==e.head.line)){var f=a.getModeAt(e.head),g=!1;if(f.electricChars){for(var h=0;h<f.electricChars.length;h++)if(b.indexOf(f.electricChars.charAt(h))>-1){g=Yf(a,e.head.line,"smart");break}}else f.electricInput&&f.electricInput.test(B(a.doc,e.head.line).text.slice(0,e.head.ch))&&(g=Yf(a,e.head.line,"smart"));g&&vb(a,"electricInput",a,e.head.line)}}}function bg(a){for(var b=[],c=[],d=0;d<a.doc.sel.ranges.length;d++){var e=a.doc.sel.ranges[d].head.line,f={anchor:J(e,0),head:J(e+1,0)};c.push(f),b.push(a.getRange(f.anchor,f.head))}return{text:b,ranges:c}}function cg(a,b){a.setAttribute("autocorrect","off"),a.setAttribute("autocapitalize","off"),a.setAttribute("spellcheck",!!b)}function dg(){var a=d("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),b=d("div",[a],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return wg?a.style.width="1000px":a.setAttribute("wrap","off"),Dg&&(a.style.border="1px solid black"),cg(a),b}function eg(a,b,c,d,e){function f(){var d=b.line+c;return!(d<a.first||d>=a.first+a.size)&&(b=new J(d,b.ch,b.sticky),j=B(a,d))}function g(d){var g;if(g=e?qf(a.cm,j,b,c):of(j,b,c),null==g){if(d||!f())return!1;b=pf(e,a.cm,j,b.line,c)}else b=g;return!0}var h=b,i=c,j=B(a,b.line);if("char"==d)g();else if("column"==d)g(!0);else if("word"==d||"group"==d)for(var k=null,l="group"==d,m=a.cm&&a.cm.getHelper(b,"wordChars"),n=!0;!(c<0)||g(!n);n=!1){var o=j.text.charAt(b.ch)||"\n",p=v(o,m)?"w":l&&"\n"==o?"n":!l||/\s/.test(o)?null:"p";if(!l||n||p||(p="s"),k&&k!=p){c<0&&(c=1,g(),b.sticky="after");break}if(p&&(k=p),c>0&&!g(!n))break}var q=Ae(a,b,h,i,!0);return L(h,q)&&(q.hitSide=!0),q}function fg(a,b,c,d){var e,f=a.doc,g=b.left;if("page"==d){var h=Math.min(a.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),i=Math.max(h-.5*tc(a.display),3);e=(c>0?b.bottom:b.top)+c*i}else"line"==d&&(e=c>0?b.bottom+3:b.top-3);for(var j;j=mc(a,g,e),j.outside;){if(c<0?e<=0:e>=f.height){j.hitSide=!0;break}e+=5*c}return j}function gg(a,b){var c=Vb(a,b.line);if(!c||c.hidden)return null;var d=B(a.doc,b.line),e=Sb(c,d,b.line),f=ya(d,a.doc.direction),g="left";if(f){var h=xa(f,b.ch);g=h%2?"right":"left"}var i=Yb(e.map,b.ch,g);return i.offset="right"==i.collapse?i.end:i.start,i}function hg(a){for(var b=a;b;b=b.parentNode)if(/CodeMirror-gutter-wrapper/.test(b.className))return!0;return!1}function ig(a,b){return b&&(a.bad=!0),a}function jg(a,b,c,d,e){function f(a){return function(b){return b.id==a}}function g(){k&&(j+=l,m&&(j+=l),k=m=!1)}function h(a){a&&(g(),j+=a)}function i(b){if(1==b.nodeType){var c=b.getAttribute("cm-text");if(c)return void h(c);var j,n=b.getAttribute("cm-marker");if(n){var o=a.findMarks(J(d,0),J(e+1,0),f(+n));return void(o.length&&(j=o[0].find(0))&&h(C(a.doc,j.from,j.to).join(l)))}if("false"==b.getAttribute("contenteditable"))return;var p=/^(pre|div|p|li|table|br)$/i.test(b.nodeName);if(!/^br$/i.test(b.nodeName)&&0==b.textContent.length)return;p&&g();for(var q=0;q<b.childNodes.length;q++)i(b.childNodes[q]);/^(pre|p)$/i.test(b.nodeName)&&(m=!0),p&&(k=!0)}else 3==b.nodeType&&h(b.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(var j="",k=!1,l=a.doc.lineSeparator(),m=!1;i(b),b!=c;)b=b.nextSibling,m=!1;return j}function kg(a,b,c){var d;if(b==a.display.lineDiv){if(d=a.display.lineDiv.childNodes[c],!d)return ig(a.clipPos(J(a.display.viewTo-1)),!0);b=null,c=0}else for(d=b;;d=d.parentNode){if(!d||d==a.display.lineDiv)return null;if(d.parentNode&&d.parentNode==a.display.lineDiv)break}for(var e=0;e<a.display.view.length;e++){var f=a.display.view[e];if(f.node==d)return lg(f,b,c)}}function lg(a,b,c){function d(b,c,d){for(var e=-1;e<(l?l.length:0);e++)for(var f=e<0?k.map:l[e],g=0;g<f.length;g+=3){var h=f[g+2];if(h==b||h==c){var i=F(e<0?a.line:a.rest[e]),j=f[g]+d;return(d<0||h!=b)&&(j=f[g+(d?1:0)]),J(i,j)}}}var e=a.text.firstChild,g=!1;if(!b||!f(e,b))return ig(J(F(a.line),0),!0);if(b==e&&(g=!0,b=e.childNodes[c],c=0,!b)){var h=a.rest?p(a.rest):a.line;return ig(J(F(h),h.text.length),g)}var i=3==b.nodeType?b:null,j=b;for(i||1!=b.childNodes.length||3!=b.firstChild.nodeType||(i=b.firstChild,c&&(c=i.nodeValue.length));j.parentNode!=e;)j=j.parentNode;var k=a.measure,l=k.maps,m=d(i,j,c);if(m)return ig(m,g);for(var n=j.nextSibling,o=i?i.nodeValue.length-c:0;n;n=n.nextSibling){if(m=d(n,n.firstChild,0))return ig(J(m.line,m.ch-o),g);o+=n.textContent.length}for(var q=j.previousSibling,r=c;q;q=q.previousSibling){if(m=d(q,q.firstChild,-1))return ig(J(m.line,m.ch+r),g);r+=q.textContent.length}}function mg(a,b){function c(){a.value=i.getValue()}if(b=b?k(b):{},b.value=a.value,!b.tabindex&&a.tabIndex&&(b.tabindex=a.tabIndex),!b.placeholder&&a.placeholder&&(b.placeholder=a.placeholder),null==b.autofocus){var d=g();b.autofocus=d==a||null!=a.getAttribute("autofocus")&&d==document.body}var e;if(a.form&&(dh(a.form,"submit",c),!b.leaveSubmitMethodAlone)){var f=a.form;e=f.submit;try{var h=f.submit=function(){c(),f.submit=e,f.submit(),f.submit=h}}catch(a){}}b.finishInit=function(b){b.save=c,b.getTextArea=function(){return a},b.toTextArea=function(){b.toTextArea=isNaN,c(),a.parentNode.removeChild(b.getWrapperElement()),a.style.display="",a.form&&(Aa(a.form,"submit",c),"function"==typeof a.form.submit&&(a.form.submit=e))}},a.style.display="none";var i=Wf((function(b){return a.parentNode.insertBefore(b,a.nextSibling)}),b);return i}function ng(a){a.off=Aa,a.on=dh,a.wheelEventPixels=Ld,a.Doc=Lh,a.splitLines=fh,a.countColumn=l,a.findColumn=n,a.isWordChar=u,a.Pass=Tg,a.signal=Ba,a.Line=qh,a.changeEnd=Pd,a.scrollbarModel=zh,a.Pos=J,a.cmpPos=K,a.modes=jh,a.mimeModes=kh,a.resolveMode=Ra,a.getMode=Sa,a.modeExtensions=lh,a.extendMode=Ta,a.copyState=Ua,a.startState=Wa,a.innerMode=Va,a.commands=Th,a.keyMap=Sh,a.keyName=kf,a.isModifierKey=hf,a.lookupKey=gf,a.normalizeKeyMap=ff,a.StringStream=mh,a.SharedTextMarker=Jh,a.TextMarker=Ih,a.LineWidget=Gh,a.e_preventDefault=Ga,a.e_stopPropagation=Ha,a.e_stop=Ja,a.addClass=h,a.contains=f,a.rmClass=Ng,a.keyNames=Oh}var og=navigator.userAgent,pg=navigator.platform,qg=/gecko\/\d/i.test(og),rg=/MSIE \d/.test(og),sg=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(og),tg=/Edge\/(\d+)/.exec(og),ug=rg||sg||tg,vg=ug&&(rg?document.documentMode||6:+(tg||sg)[1]),wg=!tg&&/WebKit\//.test(og),xg=wg&&/Qt\/\d+\.\d+/.test(og),yg=!tg&&/Chrome\//.test(og),zg=/Opera\//.test(og),Ag=/Apple Computer/.test(navigator.vendor),Bg=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(og),Cg=/PhantomJS/.test(og),Dg=!tg&&/AppleWebKit/.test(og)&&/Mobile\/\w+/.test(og),Eg=/Android/.test(og),Fg=Dg||Eg||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(og),Gg=Dg||/Mac/.test(pg),Hg=/\bCrOS\b/.test(og),Ig=/win/i.test(pg),Jg=zg&&og.match(/Version\/(\d*\.\d*)/);Jg&&(Jg=Number(Jg[1])),Jg&&Jg>=15&&(zg=!1,wg=!0);var Kg,Lg=Gg&&(xg||zg&&(null==Jg||Jg<12.11)),Mg=qg||ug&&vg>=9,Ng=function(b,c){var d=b.className,e=a(c).exec(d);if(e){var f=d.slice(e.index+e[0].length);b.className=d.slice(0,e.index)+(f?e[1]+f:"")}};Kg=document.createRange?function(a,b,c,d){var e=document.createRange();return e.setEnd(d||a,c),e.setStart(a,b),e}:function(a,b,c){var d=document.body.createTextRange();try{d.moveToElementText(a.parentNode)}catch(a){return d}return d.collapse(!0),d.moveEnd("character",c),d.moveStart("character",b),d};var Og=function(a){a.select()};Dg?Og=function(a){a.selectionStart=0,a.selectionEnd=a.value.length}:ug&&(Og=function(a){try{a.select()}catch(a){}});var Pg=function(){this.id=null};Pg.prototype.set=function(a,b){clearTimeout(this.id),this.id=setTimeout(b,a)};var Qg,Rg,Sg=30,Tg={toString:function(){return"CodeMirror.Pass"}},Ug={scroll:!1},Vg={origin:"*mouse"},Wg={origin:"+move"},Xg=[""],Yg=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Zg=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/,$g=!1,_g=!1,ah=null,bh=(function(){function a(a){return a<=247?c.charAt(a):1424<=a&&a<=1524?"R":1536<=a&&a<=1785?d.charAt(a-1536):1774<=a&&a<=2220?"r":8192<=a&&a<=8203?"w":8204==a?"b":"L"}function b(a,b,c){this.level=a,this.from=b,this.to=c}var c="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",d="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111",e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,f=/[stwN]/,g=/[LRr]/,h=/[Lb1n]/,i=/[1n]/;return function(c,d){var j="ltr"==d?"L":"R";if(0==c.length||"ltr"==d&&!e.test(c))return!1;for(var k=c.length,l=[],m=0;m<k;++m)l.push(a(c.charCodeAt(m)));for(var n=0,o=j;n<k;++n){var q=l[n];"m"==q?l[n]=o:o=q}for(var r=0,s=j;r<k;++r){var t=l[r];"1"==t&&"r"==s?l[r]="n":g.test(t)&&(s=t,"r"==t&&(l[r]="R"))}for(var u=1,v=l[0];u<k-1;++u){var w=l[u];"+"==w&&"1"==v&&"1"==l[u+1]?l[u]="1":","!=w||v!=l[u+1]||"1"!=v&&"n"!=v||(l[u]=v),v=w}for(var x=0;x<k;++x){var y=l[x];if(","==y)l[x]="N";else if("%"==y){var z=void 0;for(z=x+1;z<k&&"%"==l[z];++z);for(var A=x&&"!"==l[x-1]||z<k&&"1"==l[z]?"1":"N",B=x;B<z;++B)l[B]=A;x=z-1}}for(var C=0,D=j;C<k;++C){var E=l[C];"L"==D&&"1"==E?l[C]="L":g.test(E)&&(D=E)}for(var F=0;F<k;++F)if(f.test(l[F])){var G=void 0;for(G=F+1;G<k&&f.test(l[G]);++G);for(var H="L"==(F?l[F-1]:j),I="L"==(G<k?l[G]:j),J=H==I?H?"L":"R":j,K=F;K<G;++K)l[K]=J;F=G-1}for(var L,M=[],N=0;N<k;)if(h.test(l[N])){var O=N;for(++N;N<k&&h.test(l[N]);++N);M.push(new b(0,O,N))}else{var P=N,Q=M.length;for(++N;N<k&&"L"!=l[N];++N);for(var R=P;R<N;)if(i.test(l[R])){P<R&&M.splice(Q,0,new b(1,P,R));var S=R;for(++R;R<N&&i.test(l[R]);++R);M.splice(Q,0,new b(2,S,R)),P=R}else++R;P<N&&M.splice(Q,0,new b(1,P,N))}return"ltr"==d&&(1==M[0].level&&(L=c.match(/^\s+/))&&(M[0].from=L[0].length,M.unshift(new b(0,0,L[0].length))),1==p(M).level&&(L=c.match(/\s+$/))&&(p(M).to-=L[0].length,M.push(new b(0,k-L[0].length,k)))),"rtl"==d?M.reverse():M}})(),ch=[],dh=function(a,b,c){if(a.addEventListener)a.addEventListener(b,c,!1);else if(a.attachEvent)a.attachEvent("on"+b,c);else{var d=a._handlers||(a._handlers={});d[b]=(d[b]||ch).concat(c)}},eh=(function(){if(ug&&vg<9)return!1;var a=d("div");return"draggable"in a||"dragDrop"in a})(),fh=3!="\n\nb".split(/\n/).length?function(a){for(var b=0,c=[],d=a.length;b<=d;){var e=a.indexOf("\n",b);e==-1&&(e=a.length);var f=a.slice(b,"\r"==a.charAt(e-1)?e-1:e),g=f.indexOf("\r");g!=-1?(c.push(f.slice(0,g)),b+=g+1):(c.push(f),b=e+1)}return c}:function(a){return a.split(/\r\n?|\n/)},gh=window.getSelection?function(a){try{return a.selectionStart!=a.selectionEnd}catch(a){return!1}}:function(a){var b;try{b=a.ownerDocument.selection.createRange()}catch(a){}return!(!b||b.parentElement()!=a)&&0!=b.compareEndPoints("StartToEnd",b)},hh=(function(){var a=d("div");return"oncopy"in a||(a.setAttribute("oncopy","return;"),"function"==typeof a.oncopy)})(),ih=null,jh={},kh={},lh={},mh=function(a,b,c){this.pos=this.start=0,this.string=a,this.tabSize=b||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=c};mh.prototype.eol=function(){return this.pos>=this.string.length},mh.prototype.sol=function(){return this.pos==this.lineStart},mh.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},mh.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},mh.prototype.eat=function(a){var b,c=this.string.charAt(this.pos);if(b="string"==typeof a?c==a:c&&(a.test?a.test(c):a(c)))return++this.pos,c},mh.prototype.eatWhile=function(a){for(var b=this.pos;this.eat(a););return this.pos>b},mh.prototype.eatSpace=function(){for(var a=this,b=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++a.pos;return this.pos>b},mh.prototype.skipToEnd=function(){this.pos=this.string.length},mh.prototype.skipTo=function(a){var b=this.string.indexOf(a,this.pos);if(b>-1)return this.pos=b,!0},mh.prototype.backUp=function(a){this.pos-=a},mh.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=l(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?l(this.string,this.lineStart,this.tabSize):0)},mh.prototype.indentation=function(){return l(this.string,null,this.tabSize)-(this.lineStart?l(this.string,this.lineStart,this.tabSize):0)},mh.prototype.match=function(a,b,c){if("string"!=typeof a){var d=this.string.slice(this.pos).match(a);return d&&d.index>0?null:(d&&b!==!1&&(this.pos+=d[0].length),d)}var e=function(a){return c?a.toLowerCase():a},f=this.string.substr(this.pos,a.length);if(e(f)==e(a))return b!==!1&&(this.pos+=a.length),!0},mh.prototype.current=function(){return this.string.slice(this.start,this.pos)},mh.prototype.hideFirstChars=function(a,b){this.lineStart+=a;try{return b()}finally{this.lineStart-=a}},mh.prototype.lookAhead=function(a){var b=this.lineOracle;return b&&b.lookAhead(a)},mh.prototype.baseToken=function(){var a=this.lineOracle;return a&&a.baseToken(this.pos)};var nh=function(a,b){this.state=a,this.lookAhead=b},oh=function(a,b,c,d){this.state=b,this.doc=a,this.line=c,this.maxLookAhead=d||0,this.baseTokens=null,this.baseTokenPos=1};oh.prototype.lookAhead=function(a){var b=this.doc.getLine(this.line+a);return null!=b&&a>this.maxLookAhead&&(this.maxLookAhead=a),b},oh.prototype.baseToken=function(a){var b=this;if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=a;)b.baseTokenPos+=2;var c=this.baseTokens[this.baseTokenPos+1];return{type:c&&c.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-a}},oh.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},oh.fromSaved=function(a,b,c){return b instanceof nh?new oh(a,Ua(a.mode,b.state),c,b.lookAhead):new oh(a,Ua(a.mode,b),c)},oh.prototype.save=function(a){var b=a!==!1?Ua(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new nh(b,this.maxLookAhead):b};var ph=function(a,b,c){this.start=a.start,this.end=a.pos,this.string=a.current(),this.type=b||null,this.state=c},qh=function(a,b,c){this.text=a,da(this,b),this.height=c?c(this):1};qh.prototype.lineNo=function(){return F(this)},Fa(qh);var rh,sh={},th={},uh=null,vh=null,wh={left:0,right:0,top:0,bottom:0},xh=function(a,b,c){this.cm=c;var e=this.vert=d("div",[d("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),f=this.horiz=d("div",[d("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e.tabIndex=f.tabIndex=-1,a(e),a(f),dh(e,"scroll",(function(){e.clientHeight&&b(e.scrollTop,"vertical")})),dh(f,"scroll",(function(){f.clientWidth&&b(f.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,ug&&vg<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};xh.prototype.update=function(a){var b=a.scrollWidth>a.clientWidth+1,c=a.scrollHeight>a.clientHeight+1,d=a.nativeBarWidth;if(c){this.vert.style.display="block",this.vert.style.bottom=b?d+"px":"0";var e=a.viewHeight-(b?d:0);this.vert.firstChild.style.height=Math.max(0,a.scrollHeight-a.clientHeight+e)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(b){this.horiz.style.display="block",this.horiz.style.right=c?d+"px":"0",this.horiz.style.left=a.barLeft+"px";var f=a.viewWidth-a.barLeft-(c?d:0);this.horiz.firstChild.style.width=Math.max(0,a.scrollWidth-a.clientWidth+f)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&a.clientHeight>0&&(0==d&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:c?d:0,bottom:b?d:0}},xh.prototype.setScrollLeft=function(a){this.horiz.scrollLeft!=a&&(this.horiz.scrollLeft=a),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},xh.prototype.setScrollTop=function(a){this.vert.scrollTop!=a&&(this.vert.scrollTop=a),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},xh.prototype.zeroWidthHack=function(){var a=Gg&&!Bg?"12px":"18px";this.horiz.style.height=this.vert.style.width=a,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Pg,this.disableVert=new Pg},xh.prototype.enableZeroWidthBar=function(a,b,c){function d(){var e=a.getBoundingClientRect(),f="vert"==c?document.elementFromPoint(e.right-1,(e.top+e.bottom)/2):document.elementFromPoint((e.right+e.left)/2,e.bottom-1);f!=a?a.style.pointerEvents="none":b.set(1e3,d)}a.style.pointerEvents="auto",b.set(1e3,d)},xh.prototype.clear=function(){var a=this.horiz.parentNode;a.removeChild(this.horiz),a.removeChild(this.vert)};var yh=function(){};yh.prototype.update=function(){return{bottom:0,right:0}},yh.prototype.setScrollLeft=function(){},yh.prototype.setScrollTop=function(){},yh.prototype.clear=function(){};var zh={native:xh,null:yh},Ah=0,Bh=function(a,b,c){var d=a.display;this.viewport=b,this.visible=Nc(d,a.doc,b),this.editorIsHidden=!d.wrapper.offsetWidth,this.wrapperHeight=d.wrapper.clientHeight,this.wrapperWidth=d.wrapper.clientWidth,this.oldDisplayWidth=Pb(a),this.force=c,this.dims=vc(a),this.events=[]};Bh.prototype.signal=function(a,b){Ea(a,b)&&this.events.push(arguments)},Bh.prototype.finish=function(){for(var a=this,b=0;b<this.events.length;b++)Ba.apply(null,a.events[b])};var Ch=0,Dh=null;ug?Dh=-.53:qg?Dh=15:yg?Dh=-.7:Ag&&(Dh=-1/3);var Eh=function(a,b){this.ranges=a,this.primIndex=b};Eh.prototype.primary=function(){return this.ranges[this.primIndex]},Eh.prototype.equals=function(a){var b=this;if(a==this)return!0;if(a.primIndex!=this.primIndex||a.ranges.length!=this.ranges.length)return!1;for(var c=0;c<this.ranges.length;c++){var d=b.ranges[c],e=a.ranges[c];if(!L(d.anchor,e.anchor)||!L(d.head,e.head))return!1}return!0},Eh.prototype.deepCopy=function(){for(var a=this,b=[],c=0;c<this.ranges.length;c++)b[c]=new Fh(M(a.ranges[c].anchor),M(a.ranges[c].head));return new Eh(b,this.primIndex)},Eh.prototype.somethingSelected=function(){for(var a=this,b=0;b<this.ranges.length;b++)if(!a.ranges[b].empty())return!0;return!1},Eh.prototype.contains=function(a,b){var c=this;b||(b=a);for(var d=0;d<this.ranges.length;d++){var e=c.ranges[d];if(K(b,e.from())>=0&&K(a,e.to())<=0)return d}return-1};var Fh=function(a,b){this.anchor=a,this.head=b};Fh.prototype.from=function(){return O(this.anchor,this.head)},Fh.prototype.to=function(){return N(this.anchor,this.head)},Fh.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},Pe.prototype={chunkSize:function(){return this.lines.length},removeInner:function(a,b){for(var c=this,d=a,e=a+b;d<e;++d){var f=c.lines[d];c.height-=f.height,hb(f),vb(f,"delete")}this.lines.splice(a,b)},collapse:function(a){a.push.apply(a,this.lines)},insertInner:function(a,b,c){var d=this;this.height+=c,this.lines=this.lines.slice(0,a).concat(b).concat(this.lines.slice(a));for(var e=0;e<b.length;++e)b[e].parent=d},iterN:function(a,b,c){for(var d=this,e=a+b;a<e;++a)if(c(d.lines[a]))return!0}},Qe.prototype={chunkSize:function(){return this.size},removeInner:function(a,b){var c=this;this.size-=b;for(var d=0;d<this.children.length;++d){var e=c.children[d],f=e.chunkSize();if(a<f){var g=Math.min(b,f-a),h=e.height;if(e.removeInner(a,g),c.height-=h-e.height,f==g&&(c.children.splice(d--,1),e.parent=null),0==(b-=g))break;a=0}else a-=f}if(this.size-b<25&&(this.children.length>1||!(this.children[0]instanceof Pe))){var i=[];this.collapse(i),this.children=[new Pe(i)],this.children[0].parent=this}},collapse:function(a){for(var b=this,c=0;c<this.children.length;++c)b.children[c].collapse(a)},insertInner:function(a,b,c){var d=this;this.size+=b.length,this.height+=c;for(var e=0;e<this.children.length;++e){var f=d.children[e],g=f.chunkSize();if(a<=g){if(f.insertInner(a,b,c),f.lines&&f.lines.length>50){for(var h=f.lines.length%25+25,i=h;i<f.lines.length;){var j=new Pe(f.lines.slice(i,i+=25));f.height-=j.height,d.children.splice(++e,0,j),j.parent=d}f.lines=f.lines.slice(0,h),d.maybeSpill()}break}a-=g}},maybeSpill:function(){if(!(this.children.length<=10)){var a=this;do{var b=a.children.splice(a.children.length-5,5),c=new Qe(b);if(a.parent){a.size-=c.size,a.height-=c.height;var d=m(a.parent.children,a);a.parent.children.splice(d+1,0,c)}else{var e=new Qe(a.children);e.parent=a,a.children=[e,c],a=e}c.parent=a.parent}while(a.children.length>10);a.parent.maybeSpill()}},iterN:function(a,b,c){for(var d=this,e=0;e<this.children.length;++e){var f=d.children[e],g=f.chunkSize();if(a<g){var h=Math.min(b,g-a);if(f.iterN(a,h,c))return!0;if(0==(b-=h))break;a=0}else a-=g}}};var Gh=function(a,b,c){var d=this;if(c)for(var e in c)c.hasOwnProperty(e)&&(d[e]=c[e]);this.doc=a,this.node=b};Gh.prototype.clear=function(){var a=this,b=this.doc.cm,c=this.line.widgets,d=this.line,e=F(d);if(null!=e&&c){for(var f=0;f<c.length;++f)c[f]==a&&c.splice(f--,1);c.length||(d.widgets=null);var g=Jb(this);E(d,Math.max(0,d.height-g)),b&&(nd(b,(function(){Re(b,d,-g),sd(b,e,"widget")})),vb(b,"lineWidgetCleared",b,this,e))}},Gh.prototype.changed=function(){var a=this,b=this.height,c=this.doc.cm,d=this.line;this.height=null;var e=Jb(this)-b;e&&(ra(this.doc,d)||E(d,d.height+e),c&&nd(c,(function(){c.curOp.forceUpdate=!0,Re(c,d,e),vb(c,"lineWidgetChanged",c,a,F(d))})))},Fa(Gh);var Hh=0,Ih=function(a,b){this.lines=[],this.type=b,this.doc=a,this.id=++Hh};Ih.prototype.clear=function(){var a=this;if(!this.explicitlyCleared){var b=this.doc.cm,c=b&&!b.curOp;if(c&&fd(b),Ea(this,"clear")){var d=this.find();d&&vb(this,"clear",d.from,d.to)}for(var e=null,f=null,g=0;g<this.lines.length;++g){var h=a.lines[g],i=W(h.markedSpans,a);b&&!a.collapsed?sd(b,F(h),"text"):b&&(null!=i.to&&(f=F(h)),null!=i.from&&(e=F(h))),h.markedSpans=X(h.markedSpans,i),null==i.from&&a.collapsed&&!ra(a.doc,h)&&b&&E(h,tc(b.display))}if(b&&this.collapsed&&!b.options.lineWrapping)for(var j=0;j<this.lines.length;++j){var k=ma(a.lines[j]),l=ua(k);l>b.display.maxLineLength&&(b.display.maxLine=k,b.display.maxLineLength=l,b.display.maxLineChanged=!0)}null!=e&&b&&this.collapsed&&rd(b,e,f+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,b&&xe(b.doc)),b&&vb(b,"markerCleared",b,this,e,f),c&&gd(b),this.parent&&this.parent.clear()}},Ih.prototype.find=function(a,b){var c=this;null==a&&"bookmark"==this.type&&(a=1);for(var d,e,f=0;f<this.lines.length;++f){var g=c.lines[f],h=W(g.markedSpans,c);if(null!=h.from&&(d=J(b?g:F(g),h.from),a==-1))return d;if(null!=h.to&&(e=J(b?g:F(g),h.to),1==a))return e}return d&&{from:d,to:e}},Ih.prototype.changed=function(){var a=this,b=this.find(-1,!0),c=this,d=this.doc.cm;b&&d&&nd(d,(function(){var e=b.line,f=F(b.line),g=Vb(d,f);if(g&&(ac(g),d.curOp.selectionChanged=d.curOp.forceUpdate=!0),d.curOp.updateMaxLine=!0,!ra(c.doc,e)&&null!=c.height){var h=c.height;c.height=null;var i=Jb(c)-h;i&&E(e,e.height+i)}vb(d,"markerChanged",d,a)}))},Ih.prototype.attachLine=function(a){if(!this.lines.length&&this.doc.cm){var b=this.doc.cm.curOp;b.maybeHiddenMarkers&&m(b.maybeHiddenMarkers,this)!=-1||(b.maybeUnhiddenMarkers||(b.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(a)},Ih.prototype.detachLine=function(a){if(this.lines.splice(m(this.lines,a),1),!this.lines.length&&this.doc.cm){var b=this.doc.cm.curOp;(b.maybeHiddenMarkers||(b.maybeHiddenMarkers=[])).push(this)}},Fa(Ih);var Jh=function(a,b){var c=this;this.markers=a,this.primary=b;for(var d=0;d<a.length;++d)a[d].parent=c; };Jh.prototype.clear=function(){var a=this;if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var b=0;b<this.markers.length;++b)a.markers[b].clear();vb(this,"clear")}},Jh.prototype.find=function(a,b){return this.primary.find(a,b)},Fa(Jh);var Kh=0,Lh=function(a,b,c,d,e){if(!(this instanceof Lh))return new Lh(a,b,c,d,e);null==c&&(c=0),Qe.call(this,[new Pe([new qh("",null)])]),this.first=c,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=c;var f=J(c,0);this.sel=Od(f),this.history=new ae(null),this.id=++Kh,this.modeOption=b,this.lineSep=d,this.direction="rtl"==e?"rtl":"ltr",this.extend=!1,"string"==typeof a&&(a=this.splitLines(a)),Xd(this,{from:f,to:f,text:a}),ue(this,Od(f),Ug)};Lh.prototype=t(Qe.prototype,{constructor:Lh,iter:function(a,b,c){c?this.iterN(a-this.first,b-a,c):this.iterN(this.first,this.first+this.size,a)},insert:function(a,b){for(var c=0,d=0;d<b.length;++d)c+=b[d].height;this.insertInner(a-this.first,b,c)},remove:function(a,b){this.removeInner(a-this.first,b)},getValue:function(a){var b=D(this,this.first,this.first+this.size);return a===!1?b:b.join(a||this.lineSeparator())},setValue:qd((function(a){var b=J(this.first,0),c=this.first+this.size-1;Ee(this,{from:b,to:J(c,B(this,c).text.length),text:this.splitLines(a),origin:"setValue",full:!0},!0),this.cm&&Wc(this.cm,0,0),ue(this,Od(b),Ug)})),replaceRange:function(a,b,c,d){b=Q(this,b),c=c?Q(this,c):b,Ke(this,a,b,c,d)},getRange:function(a,b,c){var d=C(this,Q(this,a),Q(this,b));return c===!1?d:d.join(c||this.lineSeparator())},getLine:function(a){var b=this.getLineHandle(a);return b&&b.text},getLineHandle:function(a){if(H(this,a))return B(this,a)},getLineNumber:function(a){return F(a)},getLineHandleVisualStart:function(a){return"number"==typeof a&&(a=B(this,a)),ma(a)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(a){return Q(this,a)},getCursor:function(a){var b,c=this.sel.primary();return b=null==a||"head"==a?c.head:"anchor"==a?c.anchor:"end"==a||"to"==a||a===!1?c.to():c.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:qd((function(a,b,c){re(this,Q(this,"number"==typeof a?J(a,b||0):a),null,c)})),setSelection:qd((function(a,b,c){re(this,Q(this,a),Q(this,b||a),c)})),extendSelection:qd((function(a,b,c){oe(this,Q(this,a),b&&Q(this,b),c)})),extendSelections:qd((function(a,b){pe(this,S(this,a),b)})),extendSelectionsBy:qd((function(a,b){var c=q(this.sel.ranges,a);pe(this,S(this,c),b)})),setSelections:qd((function(a,b,c){var d=this;if(a.length){for(var e=[],f=0;f<a.length;f++)e[f]=new Fh(Q(d,a[f].anchor),Q(d,a[f].head));null==b&&(b=Math.min(a.length-1,this.sel.primIndex)),ue(this,Nd(e,b),c)}})),addSelection:qd((function(a,b,c){var d=this.sel.ranges.slice(0);d.push(new Fh(Q(this,a),Q(this,b||a))),ue(this,Nd(d,d.length-1),c)})),getSelection:function(a){for(var b,c=this,d=this.sel.ranges,e=0;e<d.length;e++){var f=C(c,d[e].from(),d[e].to());b=b?b.concat(f):f}return a===!1?b:b.join(a||this.lineSeparator())},getSelections:function(a){for(var b=this,c=[],d=this.sel.ranges,e=0;e<d.length;e++){var f=C(b,d[e].from(),d[e].to());a!==!1&&(f=f.join(a||b.lineSeparator())),c[e]=f}return c},replaceSelection:function(a,b,c){for(var d=[],e=0;e<this.sel.ranges.length;e++)d[e]=a;this.replaceSelections(d,b,c||"+input")},replaceSelections:qd((function(a,b,c){for(var d=this,e=[],f=this.sel,g=0;g<f.ranges.length;g++){var h=f.ranges[g];e[g]={from:h.from(),to:h.to(),text:d.splitLines(a[g]),origin:c}}for(var i=b&&"end"!=b&&Td(this,e,b),j=e.length-1;j>=0;j--)Ee(d,e[j]);i?te(this,i):this.cm&&Vc(this.cm)})),undo:qd((function(){Ge(this,"undo")})),redo:qd((function(){Ge(this,"redo")})),undoSelection:qd((function(){Ge(this,"undo",!0)})),redoSelection:qd((function(){Ge(this,"redo",!0)})),setExtending:function(a){this.extend=a},getExtending:function(){return this.extend},historySize:function(){for(var a=this.history,b=0,c=0,d=0;d<a.done.length;d++)a.done[d].ranges||++b;for(var e=0;e<a.undone.length;e++)a.undone[e].ranges||++c;return{undo:b,redo:c}},clearHistory:function(){this.history=new ae(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(a){return a&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(a){return this.history.generation==(a||this.cleanGeneration)},getHistory:function(){return{done:me(this.history.done),undone:me(this.history.undone)}},setHistory:function(a){var b=this.history=new ae(this.history.maxGeneration);b.done=me(a.done.slice(0),null,!0),b.undone=me(a.undone.slice(0),null,!0)},setGutterMarker:qd((function(a,b,c){return Oe(this,a,"gutter",(function(a){var d=a.gutterMarkers||(a.gutterMarkers={});return d[b]=c,!c&&w(d)&&(a.gutterMarkers=null),!0}))})),clearGutter:qd((function(a){var b=this;this.iter((function(c){c.gutterMarkers&&c.gutterMarkers[a]&&Oe(b,c,"gutter",(function(){return c.gutterMarkers[a]=null,w(c.gutterMarkers)&&(c.gutterMarkers=null),!0}))}))})),lineInfo:function(a){var b;if("number"==typeof a){if(!H(this,a))return null;if(b=a,a=B(this,a),!a)return null}else if(b=F(a),null==b)return null;return{line:b,handle:a,text:a.text,gutterMarkers:a.gutterMarkers,textClass:a.textClass,bgClass:a.bgClass,wrapClass:a.wrapClass,widgets:a.widgets}},addLineClass:qd((function(b,c,d){return Oe(this,b,"gutter"==c?"gutter":"class",(function(b){var e="text"==c?"textClass":"background"==c?"bgClass":"gutter"==c?"gutterClass":"wrapClass";if(b[e]){if(a(d).test(b[e]))return!1;b[e]+=" "+d}else b[e]=d;return!0}))})),removeLineClass:qd((function(b,c,d){return Oe(this,b,"gutter"==c?"gutter":"class",(function(b){var e="text"==c?"textClass":"background"==c?"bgClass":"gutter"==c?"gutterClass":"wrapClass",f=b[e];if(!f)return!1;if(null==d)b[e]=null;else{var g=f.match(a(d));if(!g)return!1;var h=g.index+g[0].length;b[e]=f.slice(0,g.index)+(g.index&&h!=f.length?" ":"")+f.slice(h)||null}return!0}))})),addLineWidget:qd((function(a,b,c){return Se(this,a,b,c)})),removeLineWidget:function(a){a.clear()},markText:function(a,b,c){return Te(this,Q(this,a),Q(this,b),c,c&&c.type||"range")},setBookmark:function(a,b){var c={replacedWith:b&&(null==b.nodeType?b.widget:b),insertLeft:b&&b.insertLeft,clearWhenEmpty:!1,shared:b&&b.shared,handleMouseEvents:b&&b.handleMouseEvents};return a=Q(this,a),Te(this,a,a,c,"bookmark")},findMarksAt:function(a){a=Q(this,a);var b=[],c=B(this,a.line).markedSpans;if(c)for(var d=0;d<c.length;++d){var e=c[d];(null==e.from||e.from<=a.ch)&&(null==e.to||e.to>=a.ch)&&b.push(e.marker.parent||e.marker)}return b},findMarks:function(a,b,c){a=Q(this,a),b=Q(this,b);var d=[],e=a.line;return this.iter(a.line,b.line+1,(function(f){var g=f.markedSpans;if(g)for(var h=0;h<g.length;h++){var i=g[h];null!=i.to&&e==a.line&&a.ch>=i.to||null==i.from&&e!=a.line||null!=i.from&&e==b.line&&i.from>=b.ch||c&&!c(i.marker)||d.push(i.marker.parent||i.marker)}++e})),d},getAllMarks:function(){var a=[];return this.iter((function(b){var c=b.markedSpans;if(c)for(var d=0;d<c.length;++d)null!=c[d].from&&a.push(c[d].marker)})),a},posFromIndex:function(a){var b,c=this.first,d=this.lineSeparator().length;return this.iter((function(e){var f=e.text.length+d;return f>a?(b=a,!0):(a-=f,void++c)})),Q(this,J(c,b))},indexFromPos:function(a){a=Q(this,a);var b=a.ch;if(a.line<this.first||a.ch<0)return 0;var c=this.lineSeparator().length;return this.iter(this.first,a.line,(function(a){b+=a.text.length+c})),b},copy:function(a){var b=new Lh(D(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return b.scrollTop=this.scrollTop,b.scrollLeft=this.scrollLeft,b.sel=this.sel,b.extend=!1,a&&(b.history.undoDepth=this.history.undoDepth,b.setHistory(this.getHistory())),b},linkedDoc:function(a){a||(a={});var b=this.first,c=this.first+this.size;null!=a.from&&a.from>b&&(b=a.from),null!=a.to&&a.to<c&&(c=a.to);var d=new Lh(D(this,b,c),a.mode||this.modeOption,b,this.lineSep,this.direction);return a.sharedHist&&(d.history=this.history),(this.linked||(this.linked=[])).push({doc:d,sharedHist:a.sharedHist}),d.linked=[{doc:this,isParent:!0,sharedHist:a.sharedHist}],We(d,Ve(this)),d},unlinkDoc:function(a){var b=this;if(a instanceof Wf&&(a=a.doc),this.linked)for(var c=0;c<this.linked.length;++c){var d=b.linked[c];if(d.doc==a){b.linked.splice(c,1),a.unlinkDoc(b),Xe(Ve(b));break}}if(a.history==this.history){var e=[a.id];Yd(a,(function(a){return e.push(a.id)}),!0),a.history=new ae(null),a.history.done=me(this.history.done,e),a.history.undone=me(this.history.undone,e)}},iterLinkedDocs:function(a){Yd(this,a)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(a){return this.lineSep?a.split(this.lineSep):fh(a)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:qd((function(a){"rtl"!=a&&(a="ltr"),a!=this.direction&&(this.direction=a,this.iter((function(a){return a.order=null})),this.cm&&_d(this.cm))}))}),Lh.prototype.eachLine=Lh.prototype.iter;for(var Mh=0,Nh=!1,Oh={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",127:"Delete",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Ph=0;Ph<10;Ph++)Oh[Ph+48]=Oh[Ph+96]=String(Ph);for(var Qh=65;Qh<=90;Qh++)Oh[Qh]=String.fromCharCode(Qh);for(var Rh=1;Rh<=12;Rh++)Oh[Rh+111]=Oh[Rh+63235]="F"+Rh;var Sh={};Sh.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Sh.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Sh.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Sh.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Sh.default=Gg?Sh.macDefault:Sh.pcDefault;var Th={selectAll:Ce,singleSelection:function(a){return a.setSelection(a.getCursor("anchor"),a.getCursor("head"),Ug)},killLine:function(a){return mf(a,(function(b){if(b.empty()){var c=B(a.doc,b.head.line).text.length;return b.head.ch==c&&b.head.line<a.lastLine()?{from:b.head,to:J(b.head.line+1,0)}:{from:b.head,to:J(b.head.line,c)}}return{from:b.from(),to:b.to()}}))},deleteLine:function(a){return mf(a,(function(b){return{from:J(b.from().line,0),to:Q(a.doc,J(b.to().line+1,0))}}))},delLineLeft:function(a){return mf(a,(function(a){return{from:J(a.from().line,0),to:a.from()}}))},delWrappedLineLeft:function(a){return mf(a,(function(b){var c=a.charCoords(b.head,"div").top+5,d=a.coordsChar({left:0,top:c},"div");return{from:d,to:b.from()}}))},delWrappedLineRight:function(a){return mf(a,(function(b){var c=a.charCoords(b.head,"div").top+5,d=a.coordsChar({left:a.display.lineDiv.offsetWidth+100,top:c},"div");return{from:b.from(),to:d}}))},undo:function(a){return a.undo()},redo:function(a){return a.redo()},undoSelection:function(a){return a.undoSelection()},redoSelection:function(a){return a.redoSelection()},goDocStart:function(a){return a.extendSelection(J(a.firstLine(),0))},goDocEnd:function(a){return a.extendSelection(J(a.lastLine()))},goLineStart:function(a){return a.extendSelectionsBy((function(b){return rf(a,b.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(a){return a.extendSelectionsBy((function(b){return tf(a,b.head)}),{origin:"+move",bias:1})},goLineEnd:function(a){return a.extendSelectionsBy((function(b){return sf(a,b.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(a){return a.extendSelectionsBy((function(b){var c=a.cursorCoords(b.head,"div").top+5;return a.coordsChar({left:a.display.lineDiv.offsetWidth+100,top:c},"div")}),Wg)},goLineLeft:function(a){return a.extendSelectionsBy((function(b){var c=a.cursorCoords(b.head,"div").top+5;return a.coordsChar({left:0,top:c},"div")}),Wg)},goLineLeftSmart:function(a){return a.extendSelectionsBy((function(b){var c=a.cursorCoords(b.head,"div").top+5,d=a.coordsChar({left:0,top:c},"div");return d.ch<a.getLine(d.line).search(/\S/)?tf(a,b.head):d}),Wg)},goLineUp:function(a){return a.moveV(-1,"line")},goLineDown:function(a){return a.moveV(1,"line")},goPageUp:function(a){return a.moveV(-1,"page")},goPageDown:function(a){return a.moveV(1,"page")},goCharLeft:function(a){return a.moveH(-1,"char")},goCharRight:function(a){return a.moveH(1,"char")},goColumnLeft:function(a){return a.moveH(-1,"column")},goColumnRight:function(a){return a.moveH(1,"column")},goWordLeft:function(a){return a.moveH(-1,"word")},goGroupRight:function(a){return a.moveH(1,"group")},goGroupLeft:function(a){return a.moveH(-1,"group")},goWordRight:function(a){return a.moveH(1,"word")},delCharBefore:function(a){return a.deleteH(-1,"char")},delCharAfter:function(a){return a.deleteH(1,"char")},delWordBefore:function(a){return a.deleteH(-1,"word")},delWordAfter:function(a){return a.deleteH(1,"word")},delGroupBefore:function(a){return a.deleteH(-1,"group")},delGroupAfter:function(a){return a.deleteH(1,"group")},indentAuto:function(a){return a.indentSelection("smart")},indentMore:function(a){return a.indentSelection("add")},indentLess:function(a){return a.indentSelection("subtract")},insertTab:function(a){return a.replaceSelection("\t")},insertSoftTab:function(a){for(var b=[],c=a.listSelections(),d=a.options.tabSize,e=0;e<c.length;e++){var f=c[e].from(),g=l(a.getLine(f.line),f.ch,d);b.push(o(d-g%d))}a.replaceSelections(b)},defaultTab:function(a){a.somethingSelected()?a.indentSelection("add"):a.execCommand("insertTab")},transposeChars:function(a){return nd(a,(function(){for(var b=a.listSelections(),c=[],d=0;d<b.length;d++)if(b[d].empty()){var e=b[d].head,f=B(a.doc,e.line).text;if(f)if(e.ch==f.length&&(e=new J(e.line,e.ch-1)),e.ch>0)e=new J(e.line,e.ch+1),a.replaceRange(f.charAt(e.ch-1)+f.charAt(e.ch-2),J(e.line,e.ch-2),e,"+transpose");else if(e.line>a.doc.first){var g=B(a.doc,e.line-1).text;g&&(e=new J(e.line,1),a.replaceRange(f.charAt(0)+a.doc.lineSeparator()+g.charAt(g.length-1),J(e.line-1,g.length-1),e,"+transpose"))}c.push(new Fh(e,e))}a.setSelections(c)}))},newlineAndIndent:function(a){return nd(a,(function(){for(var b=a.listSelections(),c=b.length-1;c>=0;c--)a.replaceRange(a.doc.lineSeparator(),b[c].anchor,b[c].head,"+input");b=a.listSelections();for(var d=0;d<b.length;d++)a.indentLine(b[d].from().line,null,!0);Vc(a)}))},openLine:function(a){return a.replaceSelection("\n","start")},toggleOverwrite:function(a){return a.toggleOverwrite()}},Uh=new Pg,Vh=null,Wh=400,Xh=function(a,b,c){this.time=a,this.pos=b,this.button=c};Xh.prototype.compare=function(a,b,c){return this.time+Wh>a&&0==K(b,this.pos)&&c==this.button};var Yh,Zh,$h={toString:function(){return"CodeMirror.Init"}},_h={},ai={};Wf.defaults=_h,Wf.optionHandlers=ai;var bi=[];Wf.defineInitHook=function(a){return bi.push(a)};var ci=null,di=function(a){var b=a.optionHandlers,c=a.helpers={};a.prototype={constructor:a,focus:function(){window.focus(),this.display.input.focus()},setOption:function(a,c){var d=this.options,e=d[a];d[a]==c&&"mode"!=a||(d[a]=c,b.hasOwnProperty(a)&&od(this,b[a])(this,c,e),Ba(this,"optionChange",this,a))},getOption:function(a){return this.options[a]},getDoc:function(){return this.doc},addKeyMap:function(a,b){this.state.keyMaps[b?"push":"unshift"](lf(a))},removeKeyMap:function(a){for(var b=this.state.keyMaps,c=0;c<b.length;++c)if(b[c]==a||b[c].name==a)return b.splice(c,1),!0},addOverlay:pd((function(b,c){var d=b.token?b:a.getMode(this.options,b);if(d.startState)throw new Error("Overlays may not be stateful.");r(this.state.overlays,{mode:d,modeSpec:b,opaque:c&&c.opaque,priority:c&&c.priority||0},(function(a){return a.priority})),this.state.modeGen++,rd(this)})),removeOverlay:pd((function(a){for(var b=this,c=this.state.overlays,d=0;d<c.length;++d){var e=c[d].modeSpec;if(e==a||"string"==typeof a&&e.name==a)return c.splice(d,1),b.state.modeGen++,void rd(b)}})),indentLine:pd((function(a,b,c){"string"!=typeof b&&"number"!=typeof b&&(b=null==b?this.options.smartIndent?"smart":"prev":b?"add":"subtract"),H(this.doc,a)&&Yf(this,a,b,c)})),indentSelection:pd((function(a){for(var b=this,c=this.doc.sel.ranges,d=-1,e=0;e<c.length;e++){var f=c[e];if(f.empty())f.head.line>d&&(Yf(b,f.head.line,a,!0),d=f.head.line,e==b.doc.sel.primIndex&&Vc(b));else{var g=f.from(),h=f.to(),i=Math.max(d,g.line);d=Math.min(b.lastLine(),h.line-(h.ch?0:1))+1;for(var j=i;j<d;++j)Yf(b,j,a);var k=b.doc.sel.ranges;0==g.ch&&c.length==k.length&&k[e].from().ch>0&&qe(b.doc,e,new Fh(g,k[e].to()),Ug)}}})),getTokenAt:function(a,b){return bb(this,a,b)},getLineTokens:function(a,b){return bb(this,J(a),b,!0)},getTokenTypeAt:function(a){a=Q(this.doc,a);var b,c=Ya(this,B(this.doc,a.line)),d=0,e=(c.length-1)/2,f=a.ch;if(0==f)b=c[2];else for(;;){var g=d+e>>1;if((g?c[2*g-1]:0)>=f)e=g;else{if(!(c[2*g+1]<f)){b=c[2*g+2];break}d=g+1}}var h=b?b.indexOf("overlay "):-1;return h<0?b:0==h?null:b.slice(0,h-1)},getModeAt:function(b){var c=this.doc.mode;return c.innerMode?a.innerMode(c,this.getTokenAt(b).state).mode:c},getHelper:function(a,b){return this.getHelpers(a,b)[0]},getHelpers:function(a,b){var d=this,e=[];if(!c.hasOwnProperty(b))return e;var f=c[b],g=this.getModeAt(a);if("string"==typeof g[b])f[g[b]]&&e.push(f[g[b]]);else if(g[b])for(var h=0;h<g[b].length;h++){var i=f[g[b][h]];i&&e.push(i)}else g.helperType&&f[g.helperType]?e.push(f[g.helperType]):f[g.name]&&e.push(f[g.name]);for(var j=0;j<f._global.length;j++){var k=f._global[j];k.pred(g,d)&&m(e,k.val)==-1&&e.push(k.val)}return e},getStateAfter:function(a,b){var c=this.doc;return a=P(c,null==a?c.first+c.size-1:a),Za(this,a+1,b).state},cursorCoords:function(a,b){var c,d=this.doc.sel.primary();return c=null==a?d.head:"object"==typeof a?Q(this.doc,a):a?d.from():d.to(),jc(this,c,b||"page")},charCoords:function(a,b){return ic(this,Q(this.doc,a),b||"page")},coordsChar:function(a,b){return a=hc(this,a,b||"page"),mc(this,a.left,a.top)},lineAtHeight:function(a,b){return a=hc(this,{top:a,left:0},b||"page").top,G(this.doc,a+this.display.viewOffset)},heightAtLine:function(a,b,c){var d,e=!1;if("number"==typeof a){var f=this.doc.first+this.doc.size-1;a<this.doc.first?a=this.doc.first:a>f&&(a=f,e=!0),d=B(this.doc,a)}else d=a;return gc(this,d,{top:0,left:0},b||"page",c||e).top+(e?this.doc.height-ta(d):0)},defaultTextHeight:function(){return tc(this.display)},defaultCharWidth:function(){return uc(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(a,b,c,d,e){var f=this.display;a=jc(this,Q(this.doc,a));var g=a.bottom,h=a.left;if(b.style.position="absolute",b.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(b),f.sizer.appendChild(b),"over"==d)g=a.top;else if("above"==d||"near"==d){var i=Math.max(f.wrapper.clientHeight,this.doc.height),j=Math.max(f.sizer.clientWidth,f.lineSpace.clientWidth);("above"==d||a.bottom+b.offsetHeight>i)&&a.top>b.offsetHeight?g=a.top-b.offsetHeight:a.bottom+b.offsetHeight<=i&&(g=a.bottom),h+b.offsetWidth>j&&(h=j-b.offsetWidth)}b.style.top=g+"px",b.style.left=b.style.right="","right"==e?(h=f.sizer.clientWidth-b.offsetWidth,b.style.right="0px"):("left"==e?h=0:"middle"==e&&(h=(f.sizer.clientWidth-b.offsetWidth)/2),b.style.left=h+"px"),c&&Sc(this,{left:h,top:g,right:h+b.offsetWidth,bottom:g+b.offsetHeight})},triggerOnKeyDown:pd(Af),triggerOnKeyPress:pd(Df),triggerOnKeyUp:Cf,triggerOnMouseDown:pd(Ff),execCommand:function(a){if(Th.hasOwnProperty(a))return Th[a].call(null,this)},triggerElectric:pd((function(a){ag(this,a)})),findPosH:function(a,b,c,d){var e=this,f=1;b<0&&(f=-1,b=-b);for(var g=Q(this.doc,a),h=0;h<b&&(g=eg(e.doc,g,f,c,d),!g.hitSide);++h);return g},moveH:pd((function(a,b){var c=this;this.extendSelectionsBy((function(d){return c.display.shift||c.doc.extend||d.empty()?eg(c.doc,d.head,a,b,c.options.rtlMoveVisually):a<0?d.from():d.to()}),Wg)})),deleteH:pd((function(a,b){var c=this.doc.sel,d=this.doc;c.somethingSelected()?d.replaceSelection("",null,"+delete"):mf(this,(function(c){var e=eg(d,c.head,a,b,!1);return a<0?{from:e,to:c.head}:{from:c.head,to:e}}))})),findPosV:function(a,b,c,d){var e=this,f=1,g=d;b<0&&(f=-1,b=-b);for(var h=Q(this.doc,a),i=0;i<b;++i){var j=jc(e,h,"div");if(null==g?g=j.left:j.left=g,h=fg(e,j,f,c),h.hitSide)break}return h},moveV:pd((function(a,b){var c=this,d=this.doc,e=[],f=!this.display.shift&&!d.extend&&d.sel.somethingSelected();if(d.extendSelectionsBy((function(g){if(f)return a<0?g.from():g.to();var h=jc(c,g.head,"div");null!=g.goalColumn&&(h.left=g.goalColumn),e.push(h.left);var i=fg(c,h,a,b);return"page"==b&&g==d.sel.primary()&&Uc(c,ic(c,i,"div").top-h.top),i}),Wg),e.length)for(var g=0;g<d.sel.ranges.length;g++)d.sel.ranges[g].goalColumn=e[g]})),findWordAt:function(a){var b=this.doc,c=B(b,a.line).text,d=a.ch,e=a.ch;if(c){var f=this.getHelper(a,"wordChars");"before"!=a.sticky&&e!=c.length||!d?++e:--d;for(var g=c.charAt(d),h=v(g,f)?function(a){return v(a,f)}:/\s/.test(g)?function(a){return/\s/.test(a)}:function(a){return!/\s/.test(a)&&!v(a)};d>0&&h(c.charAt(d-1));)--d;for(;e<c.length&&h(c.charAt(e));)++e}return new Fh(J(a.line,d),J(a.line,e))},toggleOverwrite:function(a){null!=a&&a==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?h(this.display.cursorDiv,"CodeMirror-overwrite"):Ng(this.display.cursorDiv,"CodeMirror-overwrite"),Ba(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==g()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:pd((function(a,b){Wc(this,a,b)})),getScrollInfo:function(){var a=this.display.scroller;return{left:a.scrollLeft,top:a.scrollTop,height:a.scrollHeight-Ob(this)-this.display.barHeight,width:a.scrollWidth-Ob(this)-this.display.barWidth,clientHeight:Qb(this),clientWidth:Pb(this)}},scrollIntoView:pd((function(a,b){null==a?(a={from:this.doc.sel.primary().head,to:null},null==b&&(b=this.options.cursorScrollMargin)):"number"==typeof a?a={from:J(a,0),to:null}:null==a.from&&(a={from:a,to:null}),a.to||(a.to=a.from),a.margin=b||0,null!=a.from.line?Xc(this,a):Zc(this,a.from,a.to,a.margin)})),setSize:pd((function(a,b){var c=this,d=function(a){return"number"==typeof a||/^\d+$/.test(String(a))?a+"px":a};null!=a&&(this.display.wrapper.style.width=d(a)),null!=b&&(this.display.wrapper.style.height=d(b)),this.options.lineWrapping&&bc(this);var e=this.display.viewFrom;this.doc.iter(e,this.display.viewTo,(function(a){if(a.widgets)for(var b=0;b<a.widgets.length;b++)if(a.widgets[b].noHScroll){sd(c,e,"widget");break}++e})),this.curOp.forceUpdate=!0,Ba(this,"refresh",this)})),operation:function(a){return nd(this,a)},startOperation:function(){return fd(this)},endOperation:function(){return gd(this)},refresh:pd((function(){var a=this.display.cachedTextHeight;rd(this),this.curOp.forceUpdate=!0,cc(this),Wc(this,this.doc.scrollLeft,this.doc.scrollTop),Gd(this),(null==a||Math.abs(a-tc(this.display))>.5)&&yc(this),Ba(this,"refresh",this)})),swapDoc:pd((function(a){var b=this.doc;return b.cm=null,Zd(this,a),cc(this),this.display.input.reset(),Wc(this,a.scrollLeft,a.scrollTop),this.curOp.forceScroll=!0,vb(this,"swapDoc",this,b),b})),phrase:function(a){var b=this.options.phrases;return b&&Object.prototype.hasOwnProperty.call(b,a)?b[a]:a},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Fa(a),a.registerHelper=function(b,d,e){c.hasOwnProperty(b)||(c[b]=a[b]={_global:[]}),c[b][d]=e},a.registerGlobalHelper=function(b,d,e,f){a.registerHelper(b,d,f),c[b]._global.push({pred:e,val:f})}},ei=function(a){this.cm=a,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Pg,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};ei.prototype.init=function(a){function b(a){if(!Ca(e,a)){if(e.somethingSelected())Zf({lineWise:!1,text:e.getSelections()}),"cut"==a.type&&e.replaceSelection("",null,"cut");else{if(!e.options.lineWiseCopyCut)return;var b=bg(e);Zf({lineWise:!0,text:b.text}),"cut"==a.type&&e.operation((function(){e.setSelections(b.ranges,0,Ug),e.replaceSelection("",null,"cut")}))}if(a.clipboardData){a.clipboardData.clearData();var c=ci.text.join("\n");if(a.clipboardData.setData("Text",c),a.clipboardData.getData("Text")==c)return void a.preventDefault()}var g=dg(),h=g.firstChild;e.display.lineSpace.insertBefore(g,e.display.lineSpace.firstChild),h.value=ci.text.join("\n");var i=document.activeElement;Og(h),setTimeout((function(){e.display.lineSpace.removeChild(g),i.focus(),i==f&&d.showPrimarySelection()}),50)}}var c=this,d=this,e=d.cm,f=d.div=a.lineDiv;cg(f,e.options.spellcheck),dh(f,"paste",(function(a){Ca(e,a)||_f(a,e)||vg<=11&&setTimeout(od(e,(function(){return c.updateFromDOM()})),20)})),dh(f,"compositionstart",(function(a){c.composing={data:a.data,done:!1}})),dh(f,"compositionupdate",(function(a){c.composing||(c.composing={data:a.data,done:!1})})),dh(f,"compositionend",(function(a){c.composing&&(a.data!=c.composing.data&&c.readFromDOMSoon(),c.composing.done=!0)})),dh(f,"touchstart",(function(){return d.forceCompositionEnd()})),dh(f,"input",(function(){c.composing||c.readFromDOMSoon()})),dh(f,"copy",b),dh(f,"cut",b)},ei.prototype.prepareSelection=function(){var a=Cc(this.cm,!1);return a.focus=this.cm.state.focused,a},ei.prototype.showSelection=function(a,b){a&&this.cm.display.view.length&&((a.focus||b)&&this.showPrimarySelection(),this.showMultipleSelections(a))},ei.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},ei.prototype.showPrimarySelection=function(){var a=this.getSelection(),b=this.cm,c=b.doc.sel.primary(),d=c.from(),e=c.to();if(b.display.viewTo==b.display.viewFrom||d.line>=b.display.viewTo||e.line<b.display.viewFrom)return void a.removeAllRanges();var f=kg(b,a.anchorNode,a.anchorOffset),g=kg(b,a.focusNode,a.focusOffset);if(!f||f.bad||!g||g.bad||0!=K(O(f,g),d)||0!=K(N(f,g),e)){var h=b.display.view,i=d.line>=b.display.viewFrom&&gg(b,d)||{node:h[0].measure.map[2],offset:0},j=e.line<b.display.viewTo&&gg(b,e);if(!j){var k=h[h.length-1].measure,l=k.maps?k.maps[k.maps.length-1]:k.map;j={node:l[l.length-1],offset:l[l.length-2]-l[l.length-3]}}if(!i||!j)return void a.removeAllRanges();var m,n=a.rangeCount&&a.getRangeAt(0);try{m=Kg(i.node,i.offset,j.offset,j.node)}catch(a){}m&&(!qg&&b.state.focused?(a.collapse(i.node,i.offset),m.collapsed||(a.removeAllRanges(),a.addRange(m))):(a.removeAllRanges(),a.addRange(m)),n&&null==a.anchorNode?a.addRange(n):qg&&this.startGracePeriod()),this.rememberSelection()}},ei.prototype.startGracePeriod=function(){var a=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout((function(){a.gracePeriod=!1,a.selectionChanged()&&a.cm.operation((function(){return a.cm.curOp.selectionChanged=!0}))}),20)},ei.prototype.showMultipleSelections=function(a){c(this.cm.display.cursorDiv,a.cursors),c(this.cm.display.selectionDiv,a.selection)},ei.prototype.rememberSelection=function(){var a=this.getSelection();this.lastAnchorNode=a.anchorNode,this.lastAnchorOffset=a.anchorOffset,this.lastFocusNode=a.focusNode,this.lastFocusOffset=a.focusOffset},ei.prototype.selectionInEditor=function(){var a=this.getSelection();if(!a.rangeCount)return!1;var b=a.getRangeAt(0).commonAncestorContainer;return f(this.div,b)},ei.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()||this.showSelection(this.prepareSelection(),!0),this.div.focus())},ei.prototype.blur=function(){this.div.blur()},ei.prototype.getField=function(){return this.div},ei.prototype.supportsTouch=function(){return!0},ei.prototype.receivedFocus=function(){function a(){b.cm.state.focused&&(b.pollSelection(),b.polling.set(b.cm.options.pollInterval,a))}var b=this;this.selectionInEditor()?this.pollSelection():nd(this.cm,(function(){return b.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,a)},ei.prototype.selectionChanged=function(){var a=this.getSelection();return a.anchorNode!=this.lastAnchorNode||a.anchorOffset!=this.lastAnchorOffset||a.focusNode!=this.lastFocusNode||a.focusOffset!=this.lastFocusOffset},ei.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var a=this.getSelection(),b=this.cm;if(Eg&&yg&&this.cm.options.gutters.length&&hg(a.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var c=kg(b,a.anchorNode,a.anchorOffset),d=kg(b,a.focusNode,a.focusOffset);c&&d&&nd(b,(function(){ue(b.doc,Od(c,d),Ug),(c.bad||d.bad)&&(b.curOp.selectionChanged=!0)}))}}},ei.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var a=this.cm,b=a.display,c=a.doc.sel.primary(),d=c.from(),e=c.to();if(0==d.ch&&d.line>a.firstLine()&&(d=J(d.line-1,B(a.doc,d.line-1).length)),e.ch==B(a.doc,e.line).text.length&&e.line<a.lastLine()&&(e=J(e.line+1,0)),d.line<b.viewFrom||e.line>b.viewTo-1)return!1;var f,g,h;d.line==b.viewFrom||0==(f=Ac(a,d.line))?(g=F(b.view[0].line),h=b.view[0].node):(g=F(b.view[f].line),h=b.view[f-1].node.nextSibling);var i,j,k=Ac(a,e.line);if(k==b.view.length-1?(i=b.viewTo-1,j=b.lineDiv.lastChild):(i=F(b.view[k+1].line)-1,j=b.view[k+1].node.previousSibling),!h)return!1;for(var l=a.doc.splitLines(jg(a,h,j,g,i)),m=C(a.doc,J(g,0),J(i,B(a.doc,i).text.length));l.length>1&&m.length>1;)if(p(l)==p(m))l.pop(),m.pop(),i--;else{if(l[0]!=m[0])break;l.shift(),m.shift(),g++}for(var n=0,o=0,q=l[0],r=m[0],s=Math.min(q.length,r.length);n<s&&q.charCodeAt(n)==r.charCodeAt(n);)++n;for(var t=p(l),u=p(m),v=Math.min(t.length-(1==l.length?n:0),u.length-(1==m.length?n:0));o<v&&t.charCodeAt(t.length-o-1)==u.charCodeAt(u.length-o-1);)++o;if(1==l.length&&1==m.length&&g==d.line)for(;n&&n>d.ch&&t.charCodeAt(t.length-o-1)==u.charCodeAt(u.length-o-1);)n--, o++;l[l.length-1]=t.slice(0,t.length-o).replace(/^\u200b+/,""),l[0]=l[0].slice(n).replace(/\u200b+$/,"");var w=J(g,n),x=J(i,m.length?p(m).length-o:0);return l.length>1||l[0]||K(w,x)?(Ke(a.doc,l,w,x,"+input"),!0):void 0},ei.prototype.ensurePolled=function(){this.forceCompositionEnd()},ei.prototype.reset=function(){this.forceCompositionEnd()},ei.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},ei.prototype.readFromDOMSoon=function(){var a=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(a.readDOMTimeout=null,a.composing){if(!a.composing.done)return;a.composing=null}a.updateFromDOM()}),80))},ei.prototype.updateFromDOM=function(){var a=this;!this.cm.isReadOnly()&&this.pollContent()||nd(this.cm,(function(){return rd(a.cm)}))},ei.prototype.setUneditable=function(a){a.contentEditable="false"},ei.prototype.onKeyPress=function(a){0==a.charCode||this.composing||(a.preventDefault(),this.cm.isReadOnly()||od(this.cm,$f)(this.cm,String.fromCharCode(null==a.charCode?a.keyCode:a.charCode),0))},ei.prototype.readOnlyChanged=function(a){this.div.contentEditable=String("nocursor"!=a)},ei.prototype.onContextMenu=function(){},ei.prototype.resetPosition=function(){},ei.prototype.needsContentAttribute=!0;var fi=function(a){this.cm=a,this.prevInput="",this.pollingFast=!1,this.polling=new Pg,this.hasSelection=!1,this.composing=null};fi.prototype.init=function(a){function b(a){if(!Ca(e,a)){if(e.somethingSelected())Zf({lineWise:!1,text:e.getSelections()});else{if(!e.options.lineWiseCopyCut)return;var b=bg(e);Zf({lineWise:!0,text:b.text}),"cut"==a.type?e.setSelections(b.ranges,null,Ug):(d.prevInput="",f.value=b.text.join("\n"),Og(f))}"cut"==a.type&&(e.state.cutIncoming=!0)}}var c=this,d=this,e=this.cm;this.createField(a);var f=this.textarea;a.wrapper.insertBefore(this.wrapper,a.wrapper.firstChild),Dg&&(f.style.width="0px"),dh(f,"input",(function(){ug&&vg>=9&&c.hasSelection&&(c.hasSelection=null),d.poll()})),dh(f,"paste",(function(a){Ca(e,a)||_f(a,e)||(e.state.pasteIncoming=!0,d.fastPoll())})),dh(f,"cut",b),dh(f,"copy",b),dh(a.scroller,"paste",(function(b){Kb(a,b)||Ca(e,b)||(e.state.pasteIncoming=!0,d.focus())})),dh(a.lineSpace,"selectstart",(function(b){Kb(a,b)||Ga(b)})),dh(f,"compositionstart",(function(){var a=e.getCursor("from");d.composing&&d.composing.range.clear(),d.composing={start:a,range:e.markText(a,e.getCursor("to"),{className:"CodeMirror-composing"})}})),dh(f,"compositionend",(function(){d.composing&&(d.poll(),d.composing.range.clear(),d.composing=null)}))},fi.prototype.createField=function(a){this.wrapper=dg(),this.textarea=this.wrapper.firstChild},fi.prototype.prepareSelection=function(){var a=this.cm,b=a.display,c=a.doc,d=Cc(a);if(a.options.moveInputWithCursor){var e=jc(a,c.sel.primary().head,"div"),f=b.wrapper.getBoundingClientRect(),g=b.lineDiv.getBoundingClientRect();d.teTop=Math.max(0,Math.min(b.wrapper.clientHeight-10,e.top+g.top-f.top)),d.teLeft=Math.max(0,Math.min(b.wrapper.clientWidth-10,e.left+g.left-f.left))}return d},fi.prototype.showSelection=function(a){var b=this.cm,d=b.display;c(d.cursorDiv,a.cursors),c(d.selectionDiv,a.selection),null!=a.teTop&&(this.wrapper.style.top=a.teTop+"px",this.wrapper.style.left=a.teLeft+"px")},fi.prototype.reset=function(a){if(!this.contextMenuPending&&!this.composing){var b=this.cm;if(b.somethingSelected()){this.prevInput="";var c=b.getSelection();this.textarea.value=c,b.state.focused&&Og(this.textarea),ug&&vg>=9&&(this.hasSelection=c)}else a||(this.prevInput=this.textarea.value="",ug&&vg>=9&&(this.hasSelection=null))}},fi.prototype.getField=function(){return this.textarea},fi.prototype.supportsTouch=function(){return!1},fi.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!Fg||g()!=this.textarea))try{this.textarea.focus()}catch(a){}},fi.prototype.blur=function(){this.textarea.blur()},fi.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},fi.prototype.receivedFocus=function(){this.slowPoll()},fi.prototype.slowPoll=function(){var a=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){a.poll(),a.cm.state.focused&&a.slowPoll()}))},fi.prototype.fastPoll=function(){function a(){var d=c.poll();d||b?(c.pollingFast=!1,c.slowPoll()):(b=!0,c.polling.set(60,a))}var b=!1,c=this;c.pollingFast=!0,c.polling.set(20,a)},fi.prototype.poll=function(){var a=this,b=this.cm,c=this.textarea,d=this.prevInput;if(this.contextMenuPending||!b.state.focused||gh(c)&&!d&&!this.composing||b.isReadOnly()||b.options.disableInput||b.state.keySeq)return!1;var e=c.value;if(e==d&&!b.somethingSelected())return!1;if(ug&&vg>=9&&this.hasSelection===e||Gg&&/[\uf700-\uf7ff]/.test(e))return b.display.input.reset(),!1;if(b.doc.sel==b.display.selForContextMenu){var f=e.charCodeAt(0);if(8203!=f||d||(d="​"),8666==f)return this.reset(),this.cm.execCommand("undo")}for(var g=0,h=Math.min(d.length,e.length);g<h&&d.charCodeAt(g)==e.charCodeAt(g);)++g;return nd(b,(function(){$f(b,e.slice(g),d.length-g,null,a.composing?"*compose":null),e.length>1e3||e.indexOf("\n")>-1?c.value=a.prevInput="":a.prevInput=e,a.composing&&(a.composing.range.clear(),a.composing.range=b.markText(a.composing.start,b.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},fi.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},fi.prototype.onKeyPress=function(){ug&&vg>=9&&(this.hasSelection=null),this.fastPoll()},fi.prototype.onContextMenu=function(a){function b(){if(null!=g.selectionStart){var a=e.somethingSelected(),b="​"+(a?g.value:"");g.value="⇚",g.value=b,d.prevInput=a?"":"​",g.selectionStart=1,g.selectionEnd=b.length,f.selForContextMenu=e.doc.sel}}function c(){if(d.contextMenuPending=!1,d.wrapper.style.cssText=l,g.style.cssText=k,ug&&vg<9&&f.scrollbars.setScrollTop(f.scroller.scrollTop=i),null!=g.selectionStart){(!ug||ug&&vg<9)&&b();var a=0,c=function(){f.selForContextMenu==e.doc.sel&&0==g.selectionStart&&g.selectionEnd>0&&"​"==d.prevInput?od(e,Ce)(e):a++<10?f.detectingSelectAll=setTimeout(c,500):(f.selForContextMenu=null,f.input.reset())};f.detectingSelectAll=setTimeout(c,200)}}var d=this,e=d.cm,f=e.display,g=d.textarea,h=zc(e,a),i=f.scroller.scrollTop;if(h&&!zg){var j=e.options.resetSelectionOnContextMenu;j&&e.doc.sel.contains(h)==-1&&od(e,ue)(e.doc,Od(h),Ug);var k=g.style.cssText,l=d.wrapper.style.cssText;d.wrapper.style.cssText="position: absolute";var m=d.wrapper.getBoundingClientRect();g.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(a.clientY-m.top-5)+"px; left: "+(a.clientX-m.left-5)+"px;\n z-index: 1000; background: "+(ug?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";var n;if(wg&&(n=window.scrollY),f.input.focus(),wg&&window.scrollTo(null,n),f.input.reset(),e.somethingSelected()||(g.value=d.prevInput=" "),d.contextMenuPending=!0,f.selForContextMenu=e.doc.sel,clearTimeout(f.detectingSelectAll),ug&&vg>=9&&b(),Mg){Ja(a);var o=function(){Aa(window,"mouseup",o),setTimeout(c,20)};dh(window,"mouseup",o)}else setTimeout(c,50)}},fi.prototype.readOnlyChanged=function(a){a||this.reset(),this.textarea.disabled="nocursor"==a},fi.prototype.setUneditable=function(){},fi.prototype.needsContentAttribute=!1,Sf(Wf),di(Wf);var gi="iter insert remove copy getEditor constructor".split(" ");for(var hi in Lh.prototype)Lh.prototype.hasOwnProperty(hi)&&m(gi,hi)<0&&(Wf.prototype[hi]=(function(a){return function(){return a.apply(this.doc,arguments)}})(Lh.prototype[hi]));return Fa(Lh),Wf.inputStyles={textarea:fi,contenteditable:ei},Wf.defineMode=function(a){Wf.defaults.mode||"null"==a||(Wf.defaults.mode=a),Pa.apply(this,arguments)},Wf.defineMIME=Qa,Wf.defineMode("null",(function(){return{token:function(a){return a.skipToEnd()}}})),Wf.defineMIME("text/plain","null"),Wf.defineExtension=function(a,b){Wf.prototype[a]=b},Wf.defineDocExtension=function(a,b){Lh.prototype[a]=b},Wf.fromTextArea=mg,ng(Wf),Wf.version="5.40.0",Wf}));
28,101.5
32,204
0.68972
46cad005026479de5e066b1ea0b933e3a6ea4a98
143
js
JavaScript
assets/scripts/site.js
mhulse/jekyll-boiler
4f4f708af67c6e2171110410823d2e7a568e8ade
[ "Apache-2.0" ]
2
2015-11-08T08:58:47.000Z
2018-01-25T20:33:18.000Z
assets/scripts/site.js
mhulse/jekyll-boiler
4f4f708af67c6e2171110410823d2e7a568e8ade
[ "Apache-2.0" ]
1
2016-07-02T08:19:25.000Z
2016-07-02T08:19:25.000Z
assets/scripts/site.js
mhulse/jekyll-boiler
4f4f708af67c6e2171110410823d2e7a568e8ade
[ "Apache-2.0" ]
null
null
null
--- --- {% include_relative _includes/jquery/jquery.min.js %} {% include_relative _includes/foo.js %} {% include_relative _includes/bar.js %}
20.428571
53
0.713287
46cb18b7799f1b678807b0215e025d9d4306638a
5,118
js
JavaScript
SilverReactor/silver_reactor/192.168.25.244/Scripts/imagemanager.js
ANURAGWARRING/HyasynthBioAllCode
60afd8c7609f9cf9982cc8a4ee85e42c8f48cd05
[ "MIT" ]
null
null
null
SilverReactor/silver_reactor/192.168.25.244/Scripts/imagemanager.js
ANURAGWARRING/HyasynthBioAllCode
60afd8c7609f9cf9982cc8a4ee85e42c8f48cd05
[ "MIT" ]
null
null
null
SilverReactor/silver_reactor/192.168.25.244/Scripts/imagemanager.js
ANURAGWARRING/HyasynthBioAllCode
60afd8c7609f9cf9982cc8a4ee85e42c8f48cd05
[ "MIT" ]
null
null
null
function imageManager() { // this.getImageSrc = function(a_name) // { // if(images[a_name] == undefined) // { // if(sources[a_name] != undefined) // { // images[a_name] = new Image(); // images[a_name].src = sources[a_name]; // } // else // { // return ""; // } // } // return images[a_name].src; // }; // // this.getImage = function(a_name) // { // if(images[a_name] == undefined) // { // if(sources[a_name] != undefined) // { // images[a_name] = new Image(); // images[a_name].src = sources[a_name]; // } // else // { // return ""; // } // } // return images[a_name]; // }; // // this.$getImage = function(a_name) // { // if(images[a_name] == undefined) // { // if(sources[a_name] != undefined) // { // images[a_name] = new Image(); // images[a_name].src = sources[a_name]; // } // else // { // return ""; // } // } // return $(images[a_name]); // }; // // this.showImages = function() // { // console.log(images); // }; const preload = function(a_sources) { var names = Object.keys(a_sources); for( var i = 0; i < names.length; i++) { if(images[names[i]] == undefined) { images[names[i]] = new Image(); images[names[i]].src = a_sources[names[i]]; } } }; var images = {}; const sources = { "accept":"images/accept.png", "arrowdown":"images/arrowdown.png", "arrowup":"images/arrowup.png", "cancel":"images/cancel.png", // "deviceinfo":"images/deviceinfo.png", "inoctimer":"images/inoctimer.png", "logintitle":"images/logintitle.png", // "logo":"images/logo.png", "minus":"images/logintitle.png", "reactor":"images/synoptic/reactor.png", "navactuators": "images/navigationicons/actuators.png", "navalarm": "images/navigationicons/alarm.png", "navcalibrate": "images/navigationicons/calibrate.png", "navconfigure": "images/navigationicons/configure.png", "navcontrols": "images/navigationicons/controls.png", "navdose": "images/navigationicons/dose.png", "navhome": "images/navigationicons/home.png", "navnetwork": "images/navigationicons/network.png", "navservice": "images/navigationicons/service.png", "navsettings": "images/navigationicons/settings.png", "navsystem": "images/navigationicons/system.png", "navtgf": "images/navigationicons/tgf.png", "navupdate": "images/navigationicons/update.png", "tabaccess": "images/tabicons/access.png", "tabdebug": "images/tabicons/debug.png", "tabfactory": "images/tabicons/factory.png", "tabfilehandling": "images/tabicons/filehandling.png", "tableftdash": "images/tabicons/leftDash.png", "tableftdashblack": "images/tabicons/leftDashBlack.png", "tablicenses": "images/tabicons/licenses.png", "tablimits": "images/tabicons/limits.png", "tabloop": "images/tabicons/loop.png", "tabmanual": "images/tabicons/manual.png", "tabnetwork": "images/tabicons/network.png", "tabquestion": "images/tabicons/question.png", "tabreactortype": "images/tabicons/reactortype.png", "tabrightdash": "images/tabicons/rightDash.png", "tabrightdashblack": "images/tabicons/rightDashBlack.png", "tabsensor": "images/tabicons/sensor.png", "tabsettings": "images/tabicons/settings.png", "tabsetup": "images/tabicons/setup.png", "sensorgreenanalog": "images/sensoricons/green/analog.png", "sensorgreenbalance": "images/sensoricons/green/balance.png", "sensorgreenbiomass": "images/sensoricons/green/biomass.png", "sensorgreendigital": "images/sensoricons/green/digital.png", "sensorgreendo2": "images/sensoricons/green/do2.png", "sensorgreenlevel": "images/sensoricons/green/level.png", "sensorgreenph": "images/sensoricons/green/ph.png", "sensorgreenpressure": "images/sensoricons/green/pressure.png", "sensorgreenpuzzle": "images/sensoricons/green/puzzle.png", "sensorgreenredox": "images/sensoricons/green/redox.png", "sensorgreensensor": "images/sensoricons/green/sensor.png", "sensorgreenstirrer": "images/sensoricons/green/stirrer.png", "sensorgreentemperature": "images/sensoricons/green/temperature.png" }; preload(sources); }; // var iMan = new imageManager();
36.820144
77
0.539664
46cc791878c679c6ab271c3f19d7a0f4739feb8b
602
js
JavaScript
10-propriedades-no-react/src/App.js
profoswaldo/ReactJS_31-1_a_02-02
b549471a4a5b20b6eec2cecc68b4f9d1249b2e3f
[ "MIT" ]
4
2022-01-31T19:08:18.000Z
2022-03-17T19:29:13.000Z
10-propriedades-no-react/src/App.js
profoswaldo/ReactJS_31-1_a_02-02
b549471a4a5b20b6eec2cecc68b4f9d1249b2e3f
[ "MIT" ]
null
null
null
10-propriedades-no-react/src/App.js
profoswaldo/ReactJS_31-1_a_02-02
b549471a4a5b20b6eec2cecc68b4f9d1249b2e3f
[ "MIT" ]
null
null
null
import logo from './logo.svg'; import './App.css'; import { Component } from 'react'; class Botao extends Component{ render(){ return <button>{this.props.text}</button> } } class Mensagem extends Component{ render(){ return <p>Selcione uma das opções abaixo:</p> } } class App extends Component{ render(){ return( <div> <Mensagem/> <Botao text="Incluir"/> <Botao text="Excluir"/> <Botao text="Alterar"/> <Botao text="Consultar"/> <Botao text="Limpar"/> </div> ) } } export default App;
17.705882
49
0.55814
46cdeaa133028ebcbc0954d7907ee8661952f4a4
854
js
JavaScript
src/components/App/SEO.js
DJFriar/ambitiousNerds
9ef95e793f7c6b6b7d06134014a8d086faacbca6
[ "MIT" ]
null
null
null
src/components/App/SEO.js
DJFriar/ambitiousNerds
9ef95e793f7c6b6b7d06134014a8d086faacbca6
[ "MIT" ]
null
null
null
src/components/App/SEO.js
DJFriar/ambitiousNerds
9ef95e793f7c6b6b7d06134014a8d086faacbca6
[ "MIT" ]
null
null
null
import React from 'react' import { Helmet } from "react-helmet" const SEO = () => { return ( <div> <Helmet> <title>ambitiousNerds - Modern Full-Stack Web, iOS, and Android Development</title> <meta name="description" content="ambitiousNerds - Modern Full-Stack Web, iOS, and Android Development" /> <meta name="og:title" property="og:title" content="ambitiousNerds - Modern Full-Stack Web, iOS, and Android Development"></meta> <meta name="twitter:card" content="ambitiousNerds - Modern Full-Stack Web, iOS, and Android Development"></meta> <link rel="canonical" href="https://www.ambitiousnerds.com/"></link> {/* <meta property="og:image" content="https://res.cloudinary.com/dev-empty/image/upload/v1593069801/explore-learning.jpg" /> */} </Helmet> </div> ) } export default SEO
42.7
137
0.667447
46d03dc8998102ede7d9bee190f6899f0fde5fcd
269
js
JavaScript
src/routes/tokens.js
yereby/template-hapi-mongo
fa0b15ced3001ea55e0845acc20f8faa7b6de270
[ "MIT" ]
1
2018-02-14T16:42:20.000Z
2018-02-14T16:42:20.000Z
src/routes/tokens.js
yereby/template-hapi-mongo
fa0b15ced3001ea55e0845acc20f8faa7b6de270
[ "MIT" ]
null
null
null
src/routes/tokens.js
yereby/template-hapi-mongo
fa0b15ced3001ea55e0845acc20f8faa7b6de270
[ "MIT" ]
null
null
null
const Tokens = require('../controllers/tokens') module.exports = [ { method: 'POST', path: '/tokens', options: Tokens.ask }, { method: 'DELETE', path: '/tokens', options: Tokens.revoke }, { method: 'GET', path: '/tokens/{token}', options: Tokens.connection }, ]
33.625
73
0.639405
46d38c64c4a8ac8cb8b9513665cd90756c7239f3
1,872
js
JavaScript
src/Urbem/TributarioBundle/Resources/public/javascripts/imobiliario/lote-desmembrar.js
evandojunior/urbem3.0
ba8d54109e51e82b689d1881e582fb0bce4375e0
[ "MIT" ]
null
null
null
src/Urbem/TributarioBundle/Resources/public/javascripts/imobiliario/lote-desmembrar.js
evandojunior/urbem3.0
ba8d54109e51e82b689d1881e582fb0bce4375e0
[ "MIT" ]
null
null
null
src/Urbem/TributarioBundle/Resources/public/javascripts/imobiliario/lote-desmembrar.js
evandojunior/urbem3.0
ba8d54109e51e82b689d1881e582fb0bce4375e0
[ "MIT" ]
1
2020-01-29T20:35:57.000Z
2020-01-29T20:35:57.000Z
$(function () { "use strict"; var codCadastro = UrbemSonata.giveMeBackMyField('codCadastro'), codLote = UrbemSonata.giveMeBackMyField('codLote'), qtdLotes = UrbemSonata.giveMeBackMyField('quantidadeLotes'), areaOriginal = UrbemSonata.giveMeBackMyField('areaOriginal'), areaResultante = UrbemSonata.giveMeBackMyField('areaResultante'), unidadeMedida = UrbemSonata.giveMeBackMyField('fkAdministracaoUnidadeMedida'); qtdLotes.mask('000'); areaOriginal.attr('disabled', true); areaResultante.attr('disabled', true); unidadeMedida.attr('disabled', true); qtdLotes.on('change', function () { areaResultante.val(UrbemSonata.convertFloatToMoney(UrbemSonata.convertMoneyToFloat(areaOriginal.val()) / parseInt($(this).val()))); }); carregaAtributos(codCadastro.val()); function carregaAtributos(codCadastro) { var data = { urbano: { entidade: "CoreBundle:Imobiliario\\LoteUrbano", getFkEntidadeAtributoValor: "getFkImobiliarioAtributoLoteUrbanoValores" }, rural: { entidade: "CoreBundle:Imobiliario\\LoteRural", getFkEntidadeAtributoValor: "getFkImobiliarioAtributoLoteRuralValores" } }; var params = { entidade: (codCadastro == 2) ? data.urbano.entidade : data.rural.entidade, fkEntidadeAtributoValor:(codCadastro == 2) ? data.urbano.getFkEntidadeAtributoValor : data.rural.getFkEntidadeAtributoValor, codModulo: "12", codCadastro: codCadastro }; if(codLote.val() != 0 || codLote.val() != '') { params.codEntidade = { codLote: codLote.val() }; } AtributoDinamicoPorCadastroComponent.getAtributoDinamicoFields(params); } }());
38.204082
139
0.637286
46d3d4979758f2be0840be9e5ce61f4263763e8c
1,062
js
JavaScript
CodiAprendisado/desafios/desafio2.js
LeticiaCaldas/Inova
0a76575c564528514eacdcf1cb220da0ea81fe77
[ "MIT" ]
null
null
null
CodiAprendisado/desafios/desafio2.js
LeticiaCaldas/Inova
0a76575c564528514eacdcf1cb220da0ea81fe77
[ "MIT" ]
null
null
null
CodiAprendisado/desafios/desafio2.js
LeticiaCaldas/Inova
0a76575c564528514eacdcf1cb220da0ea81fe77
[ "MIT" ]
null
null
null
/*Em uma academia estão cadastrando nome, idade e altura de vários usuários. Um determinado treino exige os seguintes requisitos: Ter 18 anos ou mais e ter uma altura igual ou maior a 1,70. Crie uma função chamada maiorAlto. Essa função irá receber um array como parâmetro. Este array terá o nome na primeira posição, a idade na segunda posição e a altura em centímetros na terceira posição. Ela também deve retornar verdadeiro (true) caso o aluno atenda os requisitos, ou falso (false) caso contrário. */ function maiorAlto(array) { for (var i = 0; i < array.length; i++){ if(array[1]>=18 && array[2] >= 170){ return true; }else{ return false; } } //return array[1] >= 18 && array[2] >= 170 ? 1 : 0; //Operador ternário } console.log(maiorAlto((["Et da Estônia", 18, 170]))) console.log(maiorAlto(['Homem da Lua Virada', 21, 149])) console.log(maiorAlto(['Pequena Paulistana', 18, 171])) console.log(maiorAlto(['Pessoa do Pântano', 39, 198])) console.log(maiorAlto(['Menino da Porteira', 13, 180]))
44.25
82
0.682674
46d4acf8de6a2843f7e2a583eb5bb07cb5d7e441
40
js
JavaScript
src/state/epics/checkForWin/index.js
CliffRobinson/tic-tac-toe-iv-a-new-hope
df1e39582413716f617fe52c364a9747706a9997
[ "MIT" ]
null
null
null
src/state/epics/checkForWin/index.js
CliffRobinson/tic-tac-toe-iv-a-new-hope
df1e39582413716f617fe52c364a9747706a9997
[ "MIT" ]
null
null
null
src/state/epics/checkForWin/index.js
CliffRobinson/tic-tac-toe-iv-a-new-hope
df1e39582413716f617fe52c364a9747706a9997
[ "MIT" ]
null
null
null
// src/state/epics/checkForWin/index.js
20
39
0.775
46d509dcd924036b4b6a710e26f4d39322edff44
42
js
JavaScript
flow/StringStub.js
kontur-recognition/retail-ui
d1fcf63d7225e4e85afc39df96637b4dbc740d4a
[ "MIT" ]
null
null
null
flow/StringStub.js
kontur-recognition/retail-ui
d1fcf63d7225e4e85afc39df96637b4dbc740d4a
[ "MIT" ]
null
null
null
flow/StringStub.js
kontur-recognition/retail-ui
d1fcf63d7225e4e85afc39df96637b4dbc740d4a
[ "MIT" ]
null
null
null
/* @flow */ export default ('': string);
10.5
28
0.547619
46d599d4bd10437b197d190d9e38c25eece70a1e
4,699
js
JavaScript
tests/gulp-tasks/modules/read-csproj-package-version.spec.js
fluffynuts/zarro
2a1e71815307dd97586e5efe3ccb98e2de28f1a7
[ "BSD-3-Clause" ]
1
2020-04-18T15:27:18.000Z
2020-04-18T15:27:18.000Z
tests/gulp-tasks/modules/read-csproj-package-version.spec.js
fluffynuts/zarro
2a1e71815307dd97586e5efe3ccb98e2de28f1a7
[ "BSD-3-Clause" ]
6
2020-04-10T20:17:53.000Z
2022-03-22T10:37:30.000Z
tests/gulp-tasks/modules/read-csproj-package-version.spec.js
fluffynuts/zarro
2a1e71815307dd97586e5efe3ccb98e2de28f1a7
[ "BSD-3-Clause" ]
null
null
null
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); require("expect-even-more-jest"); const filesystem_sandbox_1 = require("filesystem-sandbox"); describe(`read-csproj-package-version`, () => { const sut = require("../../../gulp-tasks/modules/read-csproj-package-version"); it(`should read the version from a csproj file`, async () => { // Arrange const sandbox = await filesystem_sandbox_1.Sandbox.create(), fileName = "package.nuspec", fullPath = await sandbox.writeFile(fileName, csprojXml); // Act const result = await sut(fullPath); // Assert expect(result) .toEqual("1.0.171"); }); const csprojXml = ` <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <DebugType>full</DebugType> <LangVersion>latest</LangVersion> <TargetFrameworks>netstandard2.0;net452;net462</TargetFrameworks> <Configurations>Debug;Release;BuildForRelease</Configurations> <TreatWarningsAsErrors>True</TreatWarningsAsErrors> <GenerateDocumentationFile>true</GenerateDocumentationFile> </PropertyGroup> <PropertyGroup> <PackageVersion>1.0.171</PackageVersion> <DefaultLanguage>en-US</DefaultLanguage> <PackageProjectUrl>https://github.com/fluffynuts/NExpect</PackageProjectUrl> <PackageLicenseExpression>BSD-3-Clause</PackageLicenseExpression> <PackageRequireLicenseAcceptance>False</PackageRequireLicenseAcceptance> <PackageIcon>icon.png</PackageIcon> <PackageIconUrl>https://raw.githubusercontent.com/fluffynuts/NExpect/master/src/NExpect/icon.png</PackageIconUrl> <Copyright>Copyright 2017</Copyright> <Authors> Davyd McColl Cobus Smit </Authors> <Description> Unit-test-framework-agnostic Expect-style assertions for .NET NExpect Provides Expect() syntax for doing assertions in .NET. Framework-agnostic, throwing UnmetExpectationExceptions for failures. Assertion exception type can be overridden at run-time. NExpect has grammar inspired by Chai and extensibility inspired by Jasmine. </Description> </PropertyGroup> <PropertyGroup Condition="'$(TargetFramework)'=='netstandard2.0'"> <DefineConstants>NETSTANDARD</DefineConstants> </PropertyGroup> <PropertyGroup> <DefineConstants>BUILD_PEANUTBUTTER_INTERNAL</DefineConstants> </PropertyGroup> <ItemGroup> <Compile Include="..\\PeanutButter\\source\\Utils\\PeanutButter.Utils\\ArrayExtensions.cs" Link="Imported\\ArrayExtensions.cs"/> <Compile Include="..\\PeanutButter\\source\\Utils\\PeanutButter.Utils\\AutoLocker.cs" Link="Imported\\AutoLocker.cs"/> <Compile Include="..\\PeanutButter\\source\\Utils\\PeanutButter.Utils\\ByteArrayExtensions.cs" Link="Imported\\ByteArrayExtensions.cs"/> <Compile Include="..\\PeanutButter\\source\\Utils\\PeanutButter.Utils\\DeepEqualityTester.cs" Link="Imported\\DeepEqualityTester.cs"/> <Compile Include="..\\PeanutButter\\source\\Utils\\PeanutButter.Utils\\EnumerableWrapper.cs" Link="Imported\\EnumerableWrapper.cs"/> <Compile Include="..\\PeanutButter\\source\\Utils\\PeanutButter.Utils\\ObjectExtensions.cs" Link="Imported\\ObjectExtensions.cs"/> <Compile Include="..\\PeanutButter\\source\\Utils\\PeanutButter.Utils\\ExtensionsForIEnumerables.cs" Link="Imported\\ExtensionsForIEnumerables.cs"/> <Compile Include="..\\PeanutButter\\source\\Utils\\PeanutButter.Utils\\MetadataExtensions.cs" Link="Imported\\MetadataExtensions.cs"/> <Compile Include="..\\PeanutButter\\source\\Utils\\PeanutButter.Utils\\MemberNotFoundException.cs" Link="Imported\\MemberNotFoundException.cs"/> <Compile Include="..\\PeanutButter\\source\\Utils\\PeanutButter.Utils\\PropertyOrField.cs" Link="Imported\\PropertyOrField.cs"/> <Compile Include="..\\PeanutButter\\source\\Utils\\PeanutButter.Utils\\PyLike.cs" Link="Imported\\PyLike.cs"/> <Compile Include="..\\PeanutButter\\source\\Utils\\PeanutButter.Utils\\StringExtensions.cs" Link="Imported\\StringExtensions.cs"/> <Compile Include="..\\PeanutButter\\source\\Utils\\PeanutButter.Utils\\Stringifier.cs" Link="Imported\\Stringifier.cs"/> <Compile Include="..\\PeanutButter\\source\\Utils\\PeanutButter.Utils\\TypeExtensions.cs" Link="Imported\\TypeExtensions.cs"/> <Compile Include="..\\PeanutButter\\source\\Utils\\PeanutButter.Utils\\Types.cs" Link="Imported\\Types.cs"/> </ItemGroup> <ItemGroup Condition="'$(TargetFramework)'=='netstandard1.6'"> <Reference Include="System.Diagnostics.StackTrace"/> </ItemGroup> <ItemGroup> <None Include="icon.png" Pack="true" PackagePath=""/> </ItemGroup> <Import Project="..\\MonoForFramework.targets"/> </Project> `; });
52.797753
154
0.733135
46d684edd71e5f8d644764953605f45c8a6df4ee
981
js
JavaScript
src/api/authority/menu.js
GHWXY/video_admin_platform
70593aed475541d830b1f002b9d36fc57cd7177d
[ "MIT" ]
null
null
null
src/api/authority/menu.js
GHWXY/video_admin_platform
70593aed475541d830b1f002b9d36fc57cd7177d
[ "MIT" ]
null
null
null
src/api/authority/menu.js
GHWXY/video_admin_platform
70593aed475541d830b1f002b9d36fc57cd7177d
[ "MIT" ]
null
null
null
import request from '@/utils/request' const api_name = '/services_authority/admin/menu' export default { /** 获取所有菜单*/ getNestedTreeList() { return request({ url: `${api_name}/getAllMenu`, method: 'get' }) }, /** 删除菜单*/ removeById(id) { return request({ url: `${api_name}/removeMenu/${id}`, method: 'post' }) }, /** 保存菜单*/ saveMenu(menu) { return request({ url: `${api_name}/saveMenu`, method: 'post', data: menu }) }, /** 更新菜单*/ update(menu) { return request({ url: `${api_name}/updateMenu`, method: 'post', data: menu }) }, /** 根据角色获取菜单*/ getMenuWithRoleId(roleId) { return request({ url: `${api_name}/getMenuWithRoleId/${roleId}`, method: 'get' }) }, /** 根据角色分配权限*/ doAssignRoleAuth(roleId, menus) { return request({ url: `${api_name}/doAssignRoleAuth`, method: 'post', params: { roleId, menus } }) } }
18.865385
53
0.541284
46d7300d2c90e97a9492e7edd99d45a7c2ba1191
1,778
js
JavaScript
website/static/website/js/ajax_requests.js
Riphiphip/website
dc5bf64f24d5cf78661686af0281705f4d1d2576
[ "MIT" ]
25
2016-04-13T20:25:37.000Z
2021-11-26T14:41:00.000Z
website/static/website/js/ajax_requests.js
Riphiphip/website
dc5bf64f24d5cf78661686af0281705f4d1d2576
[ "MIT" ]
358
2016-02-20T21:13:27.000Z
2022-03-31T20:06:03.000Z
website/static/website/js/ajax_requests.js
Riphiphip/website
dc5bf64f24d5cf78661686af0281705f4d1d2576
[ "MIT" ]
7
2016-04-18T14:03:15.000Z
2022-02-04T14:19:47.000Z
// Global function for post requests with ajax function ajax_post($form, url, redirectUrl) { // Remove all error messages before submitting $(".errorlist").each(function () { $(this).remove(); }); // Remove all the red lines before submitting $(".invalid").each(function () { $(this).removeClass('invalid'); }); // Serialize data and do ajax request var serializedData = $form.serialize(); $.ajax({ url: url, type: "post", data: serializedData, success: function (data, textStatus, jqXHR) { Materialize.toast(data, 5000); if (redirectUrl != undefined) { setTimeout(function () { window.location.replace(redirectUrl); }, 2000); } }, // If statusCode is 400, the request is bad, then it will show all the error messages received statusCode: { 400: function (jqXHR, textStatus, errorThrown) { var response = JSON.parse(JSON.parse(jqXHR['responseText'])); for (var key in response) { if (response.hasOwnProperty(key)) { var $inputField = $form.find("#" + key); $inputField.append('<ul class="errorlist"><li>' + response[key] + '</li></ul>'); $inputField.find('input').addClass("invalid"); $inputField.find('textarea').addClass("invalid"); } } } }, // If errors exists, show them in the console error: function (jqXHR, textStatus, errorThrown) { console.log("The following error occured: " + textStatus, errorThrown); } }); }
35.56
104
0.523622
46d79238e91f7baf02a4020f68eeca4596029a6b
681
js
JavaScript
src/redux/reducer/authReducer.js
chuhoanglong/AppShopManager
c22f56af5af8d6cc70159f07233d5fe17e3e8a12
[ "MIT" ]
null
null
null
src/redux/reducer/authReducer.js
chuhoanglong/AppShopManager
c22f56af5af8d6cc70159f07233d5fe17e3e8a12
[ "MIT" ]
8
2020-09-07T17:46:06.000Z
2022-02-26T20:35:54.000Z
src/redux/reducer/authReducer.js
chuhoanglong/AppShopManager
c22f56af5af8d6cc70159f07233d5fe17e3e8a12
[ "MIT" ]
null
null
null
import * as Types from '../action/actionType'; const initState = { users: null, error: null } const authReducer = (state = initState, action) => { switch (action.type) { case Types.LOGIN_WITH_FIREBASE: { return { ...state } } case Types.LOGIN_WITH_FIREBASE_SUCCESS: { return { ...state, users: action.currentUser } } case Types.LOGIN_WITH_FIREBASE_FAILD: { return { ...state, error: action.error } } default: return state; } } export default authReducer;
21.967742
52
0.481645
46d82420d4441a3bc9f224725773117270373f17
3,584
js
JavaScript
src/modules/charge-versions/controllers/charge-version-workflow.js
uk-gov-mirror/defra.water-abstraction-service
82b74a08825f319896e1e7a2bcd2865c42e4c876
[ "Unlicense" ]
4
2018-01-29T19:28:25.000Z
2022-03-23T17:32:53.000Z
src/modules/charge-versions/controllers/charge-version-workflow.js
uk-gov-mirror/defra.water-abstraction-service
82b74a08825f319896e1e7a2bcd2865c42e4c876
[ "Unlicense" ]
1,384
2018-02-09T16:33:44.000Z
2022-03-31T20:20:56.000Z
src/modules/charge-versions/controllers/charge-version-workflow.js
uk-gov-mirror/defra.water-abstraction-service
82b74a08825f319896e1e7a2bcd2865c42e4c876
[ "Unlicense" ]
3
2020-07-06T16:28:24.000Z
2021-04-10T21:31:10.000Z
'use strict'; const Boom = require('@hapi/boom'); const chargeVersionsWorkflowService = require('../services/charge-version-workflows'); const licencesService = require('../../../lib/services/licences'); const controller = require('../../../lib/controller'); const userMapper = require('../../../lib/mappers/user'); const mapErrorResponse = require('../../../lib/map-error-response'); const { logger } = require('../../../logger'); /** * Gets all charge version workflow or * those for the given licence id * @param {String} request.query.licenceId */ const getChargeVersionWorkflows = async request => { const { licenceId } = request.query; if (licenceId) { return { data: await chargeVersionsWorkflowService.getManyByLicenceId(licenceId) }; } else { return chargeVersionsWorkflowService.getAllWithLicenceHolder(); } }; /** * Get a specific charge version workflow by ID * @param {String} request.params.chargeVersionWorkflowId */ const getChargeVersionWorkflow = request => controller.getEntity(request.params.chargeVersionWorkflowId, chargeVersionsWorkflowService.getByIdWithLicenceHolder); /** * Creates a new charge version workflow record * @param {String} request.payload.licenceId - the licence for the new charge version * @param {ChargeVersion} request.pre.chargeVersion * @param {User} request.pre.user */ const postChargeVersionWorkflow = async request => { const { licenceId } = request.payload; const { chargeVersion, user } = request.pre; chargeVersion.status = 'draft'; // Find licence or 404 const licence = await licencesService.getLicenceById(licenceId); if (!licence) { return Boom.notFound(`Licence ${licenceId} not found`); } return chargeVersionsWorkflowService.create(licence, chargeVersion, user); }; /** * Updates a charge version workflow record * @param {String} [request.payload.status] * @param {String} [request.payload.approverComments] * @param {Object} [request.payload.chargeVersion] */ const patchChargeVersionWorkflow = async (request, h) => { const { chargeVersionWorkflowId } = request.params; const { approverComments, status, createdBy } = request.payload; const { chargeVersion } = request.pre; const changes = { ...request.payload, ...chargeVersion && { chargeVersion } }; if (createdBy) { try { changes.createdBy = userMapper.pojoToModel(createdBy); } catch (err) { logger.error('Error mapping user', err); return Boom.badData('Invalid user in charge version data'); } } try { if (status === 'changes_requested') { const chargeVersionWorkflow = await chargeVersionsWorkflowService.update(chargeVersionWorkflowId, { approverComments, status }); return chargeVersionWorkflow; } else { const chargeVersionWorkflow = await chargeVersionsWorkflowService.update(chargeVersionWorkflowId, changes); return chargeVersionWorkflow; } } catch (err) { return mapErrorResponse(err); } }; const deleteChargeVersionWorkflow = async (request, h) => { const { chargeVersionWorkflow } = request.pre; try { await chargeVersionsWorkflowService.delete(chargeVersionWorkflow); return h.response().code(204); } catch (err) { return mapErrorResponse(err); } }; exports.getChargeVersionWorkflows = getChargeVersionWorkflows; exports.getChargeVersionWorkflow = getChargeVersionWorkflow; exports.postChargeVersionWorkflow = postChargeVersionWorkflow; exports.patchChargeVersionWorkflow = patchChargeVersionWorkflow; exports.deleteChargeVersionWorkflow = deleteChargeVersionWorkflow;
34.133333
134
0.731027
46d9ddf6de50c1142098567e07198fe58b4b49f2
646
js
JavaScript
mongoNative/server.js
pjlinn/meanStack
b12c3d2a5d536cc8a75c445e8c529d34a7ac3f5a
[ "MIT" ]
null
null
null
mongoNative/server.js
pjlinn/meanStack
b12c3d2a5d536cc8a75c445e8c529d34a7ac3f5a
[ "MIT" ]
null
null
null
mongoNative/server.js
pjlinn/meanStack
b12c3d2a5d536cc8a75c445e8c529d34a7ac3f5a
[ "MIT" ]
null
null
null
#!/usr/bin/env node var MongoClient = require('mongodb').MongoClient; MongoClient.connect('mongodb://localhost/homeTheaterComponents', function(err, db) { if (err) throw err; // console.log("Connected to Database"); var collection = db.collection('components'); // collection.count(function(err, count) { // console.log("There are " + count + " records."); // }); // collection.find().each(function(err, doc) { // if(doc != null) { // console.dir(doc); // } // db.close(); // }); // collection.find().toArray(function(err, docs) { // console.log(docs); // }); console.log(collection.find()); })
23.925926
84
0.608359
46da1750828d1955a34b84f01aef1f8f5fd1593d
864
js
JavaScript
utils/MagicProperty.js
mrfishie/larwan
97dfe40cdd90114e0fdd5b8e73c6fcea3fa4bf79
[ "MIT" ]
null
null
null
utils/MagicProperty.js
mrfishie/larwan
97dfe40cdd90114e0fdd5b8e73c6fcea3fa4bf79
[ "MIT" ]
null
null
null
utils/MagicProperty.js
mrfishie/larwan
97dfe40cdd90114e0fdd5b8e73c6fcea3fa4bf79
[ "MIT" ]
null
null
null
var EventEmitter = require('events').EventEmitter; var util = require('util'); function MagicProperty() { EventEmitter.call(this); this._subscribers = []; this.on('refresh', this._apply.bind(this)); } util.inherits(MagicProperty, EventEmitter); module.exports = MagicProperty; MagicProperty.prototype._subscribe = function(component, update) { this._subscribers.push(component); this._subscribers.push(update || function() { }); if (update) update(); }; MagicProperty.prototype._unsubscribe = function(component) { var index = this._subscribers.indexOf(component); if (index !== -1) this._subscribers.splice(index, 2); }; MagicProperty.prototype._apply = function() { for (var i = 0; i < this._subscribers.length; i += 2) { this._subscribers[i + 1](); this._subscribers[i].emit('refresh', this); } };
27
66
0.679398
46da8e651718d4392fb50ef099a60d1af4c30bf2
4,786
js
JavaScript
scripts/node_modules/@terra-money/terra.js/dist/core/gov/msgs/MsgDeposit.js
BenReilly19/Terra-AMM-Prototype
d51f1694e3f513653f10a46221106ebc8ab64d7b
[ "Apache-2.0" ]
4
2021-12-14T14:07:46.000Z
2022-03-20T04:11:37.000Z
scripts/node_modules/@terra-money/terra.js/dist/core/gov/msgs/MsgDeposit.js
BenReilly19/Terra-Smart-Contract-Tutorial
d51f1694e3f513653f10a46221106ebc8ab64d7b
[ "Apache-2.0" ]
null
null
null
scripts/node_modules/@terra-money/terra.js/dist/core/gov/msgs/MsgDeposit.js
BenReilly19/Terra-Smart-Contract-Tutorial
d51f1694e3f513653f10a46221106ebc8ab64d7b
[ "Apache-2.0" ]
null
null
null
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.MsgDeposit = void 0; var Coins_1 = require("../../Coins"); var json_1 = require("../../../util/json"); var any_1 = require("@terra-money/terra.proto/google/protobuf/any"); var tx_1 = require("@terra-money/terra.proto/cosmos/gov/v1beta1/tx"); var Long = __importStar(require("long")); /** * Add a deposit for a proposal */ var MsgDeposit = /** @class */ (function (_super) { __extends(MsgDeposit, _super); /** * @param proposal_id Id of porposal to deposit to * @param depositor depositor's account address * @param amount amount to deposit */ function MsgDeposit(proposal_id, depositor, amount) { var _this = _super.call(this) || this; _this.proposal_id = proposal_id; _this.depositor = depositor; _this.amount = new Coins_1.Coins(amount); return _this; } MsgDeposit.fromAmino = function (data) { var _a = data.value, proposal_id = _a.proposal_id, depositor = _a.depositor, amount = _a.amount; return new MsgDeposit(Number.parseInt(proposal_id), depositor, Coins_1.Coins.fromAmino(amount)); }; MsgDeposit.prototype.toAmino = function () { var _a = this, proposal_id = _a.proposal_id, depositor = _a.depositor, amount = _a.amount; return { type: 'gov/MsgDeposit', value: { proposal_id: proposal_id.toString(), depositor: depositor, amount: amount.toAmino(), }, }; }; MsgDeposit.fromData = function (data) { var proposal_id = data.proposal_id, depositor = data.depositor, amount = data.amount; return new MsgDeposit(Number.parseInt(proposal_id), depositor, Coins_1.Coins.fromData(amount)); }; MsgDeposit.prototype.toData = function () { var _a = this, proposal_id = _a.proposal_id, depositor = _a.depositor, amount = _a.amount; return { '@type': '/cosmos.gov.v1beta1.MsgDeposit', proposal_id: proposal_id.toString(), depositor: depositor, amount: amount.toData(), }; }; MsgDeposit.fromProto = function (proto) { return new MsgDeposit(proto.proposalId.toNumber(), proto.depositor, Coins_1.Coins.fromProto(proto.amount)); }; MsgDeposit.prototype.toProto = function () { var _a = this, proposal_id = _a.proposal_id, depositor = _a.depositor, amount = _a.amount; return tx_1.MsgDeposit.fromPartial({ amount: amount.toProto(), depositor: depositor, proposalId: Long.fromNumber(proposal_id), }); }; MsgDeposit.prototype.packAny = function () { return any_1.Any.fromPartial({ typeUrl: '/cosmos.gov.v1beta1.MsgDeposit', value: tx_1.MsgDeposit.encode(this.toProto()).finish(), }); }; MsgDeposit.unpackAny = function (msgAny) { return MsgDeposit.fromProto(tx_1.MsgDeposit.decode(msgAny.value)); }; return MsgDeposit; }(json_1.JSONSerializable)); exports.MsgDeposit = MsgDeposit; //# sourceMappingURL=MsgDeposit.js.map
43.117117
141
0.615336
46dcbb426e89f0264bceefeb94cafab235662f35
218
js
JavaScript
inClassExamples/prodmgmtwebapp/db/dbconfig.js
Shadi-Aldabbas/Shadi-Aldabbas.github.io
69a5a6654fe51f7d25c7f461b5f01b6d6173e86b
[ "Apache-2.0" ]
null
null
null
inClassExamples/prodmgmtwebapp/db/dbconfig.js
Shadi-Aldabbas/Shadi-Aldabbas.github.io
69a5a6654fe51f7d25c7f461b5f01b6d6173e86b
[ "Apache-2.0" ]
null
null
null
inClassExamples/prodmgmtwebapp/db/dbconfig.js
Shadi-Aldabbas/Shadi-Aldabbas.github.io
69a5a6654fe51f7d25c7f461b5f01b6d6173e86b
[ "Apache-2.0" ]
null
null
null
/** * dbconfig.js */ "use strict"; const dbConfig = { host: "localhost", user: "cs472-202203-prodmgmt-db-sys", password: "test1234", database: "cs472-202203-prodmgmt-db" }; module.exports = dbConfig;
18.166667
41
0.637615
46dff643bde2bb733c6db2cd4a2a867d585ef72c
129
js
JavaScript
backend/resources/js/constants/ride.js
shm11C3/group-ride-notice
dc27fbe6b63749f4b0a18c578f8592865c3234af
[ "MIT" ]
2
2021-10-15T05:38:47.000Z
2021-10-22T03:21:34.000Z
backend/resources/js/constants/ride.js
shm11C3/group-ride-notice
dc27fbe6b63749f4b0a18c578f8592865c3234af
[ "MIT" ]
null
null
null
backend/resources/js/constants/ride.js
shm11C3/group-ride-notice
dc27fbe6b63749f4b0a18c578f8592865c3234af
[ "MIT" ]
null
null
null
export const commentRule = { max : 1024 } export const nameRule = { max: 32 } export const lapRule = { max : 255 }
10.75
28
0.596899
46e197dd95f4473f7eb9e58ce649786f827dcded
984
js
JavaScript
.eslintrc.js
zaida04/rent-a-ni.co
e386759592a5076f7ee3da95fbad7f173e4f9f53
[ "MIT" ]
5
2021-05-21T13:04:43.000Z
2021-10-31T16:55:23.000Z
.eslintrc.js
zaida04/rent-a-ni.co
e386759592a5076f7ee3da95fbad7f173e4f9f53
[ "MIT" ]
null
null
null
.eslintrc.js
zaida04/rent-a-ni.co
e386759592a5076f7ee3da95fbad7f173e4f9f53
[ "MIT" ]
null
null
null
module.exports = { root: true, extends: [ "plugin:@typescript-eslint/recommended", "plugin:prettier/recommended" ], env: { node: true, es2020: true, }, ignorePatterns: ["__tests__/**", "node_modules/**", "dist/**", "types/**", "*.js"], parserOptions: { project: "./tsconfig.json", }, rules: { "no-console": "off", "consistent-return": "off", "@typescript-eslint/naming-convention": "off", "@typescript-eslint/no-non-null-assertion": "off", "@typescript-eslint/no-misused-promises": "off", "@typescript-eslint/restrict-template-expressions": "off", "prefer-const": "off", "@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }], "@typescript-eslint/explicit-module-boundary-types": "off", 'prettier/prettier': [ 2, { endOfLine: 'auto', printWidth: 150, semi: true, tabWidth: 4, trailingComma: 'all', }, ], }, };
26.594595
85
0.570122
46e32ef94794eb11609373bf62e3d9583c63b08d
565
js
JavaScript
src/components/Atom/BaseNuxtLink/index.js
t--takai/helper-of-godmother
89af52a9cbbcc9a0dfdc9be553b76b8b012a44e6
[ "MIT" ]
null
null
null
src/components/Atom/BaseNuxtLink/index.js
t--takai/helper-of-godmother
89af52a9cbbcc9a0dfdc9be553b76b8b012a44e6
[ "MIT" ]
30
2020-05-19T09:00:31.000Z
2021-12-15T17:46:00.000Z
src/components/Atom/BaseNuxtLink/index.js
t--takai/helper-of-godmother
89af52a9cbbcc9a0dfdc9be553b76b8b012a44e6
[ "MIT" ]
null
null
null
export default { name: 'BaseNuxtLink', props: { colorType: { type: String, default: 'green', validator(value) { return ['green', 'grey', 'white'].includes(value) }, }, exactActiveClass: { type: String, default: '', }, text: { type: String, require: true, default: 'Text', }, url: { type: String, default: '###', }, }, computed: { className() { const lowercase = this.colorType.toLowerCase() return this.$style[lowercase] }, }, }
17.65625
57
0.495575
46e3361d8ea9c5e20d9c1310b06fa6b51d448871
630
js
JavaScript
Documentation/a00078.js
rzoller/OpenMesh
f84bca0b26c61eab5f9335b2191962ca8545c5f6
[ "BSD-3-Clause" ]
null
null
null
Documentation/a00078.js
rzoller/OpenMesh
f84bca0b26c61eab5f9335b2191962ca8545c5f6
[ "BSD-3-Clause" ]
null
null
null
Documentation/a00078.js
rzoller/OpenMesh
f84bca0b26c61eab5f9335b2191962ca8545c5f6
[ "BSD-3-Clause" ]
null
null
null
var a00078 = [ [ "_STLReader_", "a00078.html#aecca39e09b28cfd0e1b54e6531037a83", null ], [ "~_STLReader_", "a00078.html#a88db910f48bfa7c42c873888bed4cfc6", null ], [ "epsilon", "a00078.html#a453b5bc39c6256dae86d72e73d9ece7e", null ], [ "get_description", "a00078.html#a3f2d2f8443ad016d81ad1506cf22f5db", null ], [ "get_extensions", "a00078.html#a1313e21a04264133ffca2be46c47697f", null ], [ "read", "a00078.html#ab13615c05aef446846cf177b439bdeb7", null ], [ "read", "a00078.html#ab0015a00f47a24d94dde0ee81a76666a", null ], [ "set_epsilon", "a00078.html#a858cd5bae3eea93ecc33ca12a3e6c475", null ] ];
57.272727
81
0.733333
46e382dd96de0315659a28a00f586f5b53ea55cc
301
js
JavaScript
src/utils/fetchApi.js
CharitReddy/github-readme-quotes
227681ef35bb06bcbb644481780f2c03331e84f6
[ "MIT" ]
155
2020-11-20T03:56:00.000Z
2022-03-30T12:19:21.000Z
src/utils/fetchApi.js
CharitReddy/github-readme-quotes
227681ef35bb06bcbb644481780f2c03331e84f6
[ "MIT" ]
54
2020-11-18T06:06:26.000Z
2022-03-03T09:20:25.000Z
src/utils/fetchApi.js
CharitReddy/github-readme-quotes
227681ef35bb06bcbb644481780f2c03331e84f6
[ "MIT" ]
77
2020-11-17T10:25:04.000Z
2022-01-31T13:23:31.000Z
const fetch = require('node-fetch'); const fetchCall = async ( url, options ) => { try { let response = await fetch(url, options); return await response.json(); } catch (e) { console.log(e); throw e; } } module.exports = fetchCall;
21.5
52
0.521595
46e45e071ea7ad17efee76d1d836abafe269abef
200
js
JavaScript
pwa/web-worker/web-worker.js
LuckyChou710/ReStart-FE
699de220e22d8c6ce31d63a9fdb7f8ff418668d1
[ "Apache-2.0" ]
5
2021-08-25T13:24:44.000Z
2021-09-13T07:11:08.000Z
pwa/web-worker/web-worker.js
LuckyChou710/ReStart-FE
699de220e22d8c6ce31d63a9fdb7f8ff418668d1
[ "Apache-2.0" ]
null
null
null
pwa/web-worker/web-worker.js
LuckyChou710/ReStart-FE
699de220e22d8c6ce31d63a9fdb7f8ff418668d1
[ "Apache-2.0" ]
1
2021-09-14T09:53:00.000Z
2021-09-14T09:53:00.000Z
const sum = eval(Array.from({ length: 1000000 }, (__, idx) => idx).join('+')); // 发消息给主线程 self.postMessage({ sum }); // 监听主进程的消息 self.addEventListener('message', (e) => { console.log(e.data); });
20
78
0.61
46e4bf37d61d334f86cdc4aaf7f4170ad3bd36f9
3,769
js
JavaScript
helpers/google.js
fossabot/cloudboost
ecb89adca75a766d4f329fe557f5ee154abd0135
[ "Apache-2.0" ]
1,586
2016-02-08T14:34:45.000Z
2022-03-30T09:39:48.000Z
helpers/google.js
fossabot/cloudboost
ecb89adca75a766d4f329fe557f5ee154abd0135
[ "Apache-2.0" ]
187
2016-02-12T07:01:06.000Z
2021-01-13T13:37:43.000Z
helpers/google.js
fossabot/cloudboost
ecb89adca75a766d4f329fe557f5ee154abd0135
[ "Apache-2.0" ]
220
2016-02-11T17:08:29.000Z
2022-03-16T12:00:16.000Z
/* # CloudBoost - Core Engine that powers Bakend as a Service # (c) 2014 HackerBay, Inc. # CloudBoost may be freely distributed under the Apache 2 License */ const q = require('q'); const google = require('googleapis'); const OAuth2Client = google.auth.OAuth2; const plus = google.plus('v1'); const winston = require('winston'); const { getNestedValue: gnv } = require('./util'); function _getGoogleFieldString(authSettings) { const json = gnv(['google', 'attributes'], authSettings) || {}; let isFirst = false; const scopeString = Object.keys(json).reduce((acc, key) => { if (Object.prototype.hasOwnProperty.call(json, key) && json[key].enabled) { let _scope; if (!isFirst) { _scope = json[key].scope; isFirst = true; } else { _scope = ` ${json[key].scope}`; } return acc.concat(_scope); } return acc; }, ''); return scopeString; } function _getGoogleScopeString(authSettings) { const json = gnv(['google', 'permissions'], authSettings) || {}; const scopeString = Object.keys(json) .filter(key => Object.prototype.hasOwnProperty.call(json, key) && json[key].enabled) .reduce((acc, key) => acc.concat(` ${json[key].scope}`), ''); return scopeString; } module.exports = { getLoginUrl(req, appId, authSettings) { const deferred = q.defer(); try { const clientId = authSettings.google.appId; const clientSecret = authSettings.google.appSecret; const redirect = `${req.protocol}://${req.headers.host}/auth/${appId}/google/callback`; const oauth2Client = new OAuth2Client(clientId, clientSecret, redirect); const url = oauth2Client.generateAuthUrl({ access_type: 'offline', scope: _getGoogleFieldString(authSettings).concat(_getGoogleScopeString(authSettings)), }); deferred.resolve({ loginUrl: url, }); } catch (err) { winston.log('error', { error: String(err), stack: new Error().stack, }); deferred.reject(err); } return deferred.promise; }, getToken(req, appId, authSettings, code) { const deferred = q.defer(); try { const clientId = authSettings.google.appId; const clientSecret = authSettings.google.appSecret; const redirect = `${req.protocol}://${req.headers.host}/auth/${appId}/google/callback`; const oauth2Client = new OAuth2Client(clientId, clientSecret, redirect); oauth2Client.getToken(code, (err, tokens) => { if (err) { deferred.reject(err); } else { deferred.resolve(tokens); } }); } catch (err) { winston.log('error', { error: String(err), stack: new Error().stack, }); deferred.reject(err); } return deferred.promise; }, getUserByTokens(req, appId, authSettings, accessToken, refreshToken) { const deferred = q.defer(); try { const clientId = authSettings.google.appId; const clientSecret = authSettings.google.appSecret; const redirect = `${req.protocol}://${req.headers.host}/auth/${appId}/google/callback`; const oauth2Client = new OAuth2Client(clientId, clientSecret, redirect); oauth2Client.setCredentials({ access_token: accessToken, refresh_token: refreshToken, }); plus.people.get({ userId: 'me', auth: oauth2Client, }, (err, profile) => { if (err) { deferred.reject(err); } else { deferred.resolve(profile); } }); } catch (err) { winston.log('error', { error: String(err), stack: new Error().stack, }); deferred.reject(err); } return deferred.promise; }, };
26.173611
95
0.60865
46e4f3623f105590dc17c3d127997aefa7f50b51
861
js
JavaScript
source/js/modules/members/views/MembersView.js
mstronge/wellness
f6ff00bb8780a3919491f3bd73dfa6e6d4b3f778
[ "MIT" ]
null
null
null
source/js/modules/members/views/MembersView.js
mstronge/wellness
f6ff00bb8780a3919491f3bd73dfa6e6d4b3f778
[ "MIT" ]
null
null
null
source/js/modules/members/views/MembersView.js
mstronge/wellness
f6ff00bb8780a3919491f3bd73dfa6e6d4b3f778
[ "MIT" ]
null
null
null
define([ 'App', 'backbone', 'marionette', 'hbs!modules/members/templates/tmpl-members--home', 'modules/members/views/SubHeaderView', 'eventBus' ], function ( App, Backbone, Marionette, template, SubHeaderView, eventBus ) { return Backbone.View.extend({ className: 'members', regions: { subheader: '.js-region--subheader', content: '.js-region--content' }, template: template, initialize: function() { eventBus.trigger(eventBus.eventKeys.ROUTE_MEMBERS); }, render: function() { this.$el.html(this.template); this.subheader = new SubHeaderView(); console.log($(this.regions.subheader).html(this.subheader.render().el)); return this; } }); });
20.5
84
0.545877
46e514df5484a759542aa33732738366f6797e8e
1,385
js
JavaScript
node_modules/caniuse-lite/data/features/streams.js
raunaqnijhawan/task
4846e02c0a8acd64722d6a3cc48eb9dcef2bc055
[ "MIT" ]
2
2022-03-20T13:40:47.000Z
2022-03-20T13:51:41.000Z
node_modules/caniuse-lite/data/features/streams.js
raunaqnijhawan/task
4846e02c0a8acd64722d6a3cc48eb9dcef2bc055
[ "MIT" ]
9
2022-03-06T01:53:33.000Z
2022-03-09T03:35:15.000Z
node_modules/caniuse-lite/data/features/streams.js
raunaqnijhawan/task
4846e02c0a8acd64722d6a3cc48eb9dcef2bc055
[ "MIT" ]
null
null
null
module.exports={A:{A:{"2":"J D E F A rB","130":"B"},B:{"1":"a b c d e f g T h H","16":"C K","260":"L G","1028":"P Q R S V W X Y Z","5124":"M N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 sB gB I i J D E F A B C K L G M N O j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB tB uB","6148":"QB RB SB TB UB VB WB XB YB ZB aB bB cB dB P Q R jB S V W X Y Z a b c d e f g T h H kB","6722":"LB MB hB NB iB OB PB U"},D:{"1":"a b c d e f g T h H kB vB wB xB","2":"0 1 2 3 4 5 6 7 8 9 I i J D E F A B C K L G M N O j k l m n o p q r s t u v w x y z AB BB CB DB EB FB","260":"GB HB IB JB KB LB MB","1028":"hB NB iB OB PB U QB RB SB TB UB VB WB XB YB ZB aB bB cB dB P Q R S V W X Y Z"},E:{"2":"I i J D E F yB lB zB 0B 1B 2B","1028":"G 4B 5B nB oB 6B","3076":"A B C K L mB eB fB 3B"},F:{"1":"bB cB dB P Q R jB S","2":"0 1 2 F B C G M N O j k l m n o p q r s t u v w x y z 7B 8B 9B AC eB pB BC fB","260":"3 4 5 6 7 8 9","1028":"AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB U QB RB SB TB UB VB WB XB YB ZB aB"},G:{"2":"E lB CC qB DC EC FC GC HC IC","16":"JC","1028":"KC LC MC NC OC PC QC RC SC TC UC VC nB oB"},H:{"2":"WC"},I:{"1":"H","2":"gB I XC YC ZC aC qB bC cC"},J:{"2":"D A"},K:{"1":"U","2":"A B C eB pB fB"},L:{"1":"H"},M:{"6148":"T"},N:{"2":"A B"},O:{"2":"dC"},P:{"1":"nC oC","2":"I eC fC","1028":"gC hC iC mB jC kC lC mC"},Q:{"1028":"pC"},R:{"2":"qC"},S:{"2":"rC"}},B:1,C:"Streams"};
692.5
1,384
0.514079
46e5ef5418fab6956b7edfb5988ba0f524f7b854
3,023
js
JavaScript
src/pages/SpecialAnnounce.js
Schmidt-Aaron/SchemaGenerator
47b732fa04b57c768dbe4506c509a20e0755a5bb
[ "MIT" ]
null
null
null
src/pages/SpecialAnnounce.js
Schmidt-Aaron/SchemaGenerator
47b732fa04b57c768dbe4506c509a20e0755a5bb
[ "MIT" ]
3
2021-03-10T14:50:58.000Z
2022-02-19T00:38:32.000Z
src/pages/SpecialAnnounce.js
Schmidt-Aaron/SchemaGenerator
47b732fa04b57c768dbe4506c509a20e0755a5bb
[ "MIT" ]
null
null
null
import React, { useReducer } from "react"; import InputPanel from "../components/SA/SAinputPanel"; import OutputPanel from "../components/SA/SAoutputPanel"; import Controls from "../components/controls"; import About from "../components/SA/aboutSA"; import Banner from "../components/banner"; import { SAProvider } from "../context/specialAnnouncement"; import initialState from "../initialState/specialAnnouncement"; import NavBar from "../components/nav"; function SpecialAnnouncement() { const codeRef = React.createRef(); // reducer to reset state const reducer = (state, action) => { switch (action.type) { case "RESET": return { ...initialState, }; case "UPDATE": return { ...state, [action.name]: action.value, }; default: return state; } }; const [announcementData, dispatch] = useReducer(reducer, initialState); // update function that can be passed into components const updateState = async (name, value) => { dispatch({ type: "UPDATE", name, value, }); dispatch({ type: "UPDATE", name: "schema", value: codeRef.current.textContent, }); }; const resetState = () => { dispatch({ type: "RESET" }); console.log("reset"); }; const clearBanner = () => { setTimeout(() => { dispatch({ type: "UPDATE", name: "msg", value: null }); dispatch({ type: "UPDATE", name: "error", value: null }); }, 2000); }; const setBanner = async (msg) => { if (announcementData.schema === null) { dispatch({ type: "UPDATE", name: "msg", value: "Schema Not Copied. Update the input fields and try again.", }); dispatch({ type: "UPDATE", name: "error", value: true, }); console.log("Please enter valid schema data"); } else { await dispatch({ type: "UPDATE", name: "msg", value: msg, }); } clearBanner(); }; return ( <div className="App"> {announcementData.msg ? ( <Banner className="banner" msg={announcementData.msg} error={announcementData.error} /> ) : null} <NavBar /> <main className="main"> <h1>Special Announcement Schema Generator *WIP*</h1> <About /> <section> <SAProvider value={announcementData}> <Controls schema={announcementData.schema} reset={resetState} setBanner={setBanner} /> <div className="schemaContainer"> <InputPanel updateState={updateState} /> <OutputPanel ref={codeRef} /> </div> <Controls schema={announcementData.schema} reset={resetState} setBanner={setBanner} /> </SAProvider> </section> </main> </div> ); } export default SpecialAnnouncement;
25.618644
75
0.548793
46e6932251d701e2bd58ec8e75b30f5618c2a4cf
14,186
js
JavaScript
.c9/metadata/workspace/routes/transaction.server.routes.js
macostea/term-paper-backend
b25acf8f9b8c3bf5e62b0f5312c7c93bd2e15707
[ "MIT" ]
null
null
null
.c9/metadata/workspace/routes/transaction.server.routes.js
macostea/term-paper-backend
b25acf8f9b8c3bf5e62b0f5312c7c93bd2e15707
[ "MIT" ]
null
null
null
.c9/metadata/workspace/routes/transaction.server.routes.js
macostea/term-paper-backend
b25acf8f9b8c3bf5e62b0f5312c7c93bd2e15707
[ "MIT" ]
null
null
null
{"filter":false,"title":"transaction.server.routes.js","tooltip":"/routes/transaction.server.routes.js","undoManager":{"mark":100,"position":100,"stack":[[{"group":"doc","deltas":[{"start":{"row":13,"column":12},"end":{"row":13,"column":13},"action":"insert","lines":["e"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":13},"end":{"row":13,"column":15},"action":"insert","lines":["()"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":14},"end":{"row":13,"column":16},"action":"insert","lines":["''"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":15},"end":{"row":13,"column":16},"action":"insert","lines":["/"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":16},"end":{"row":13,"column":17},"action":"insert","lines":["t"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":17},"end":{"row":13,"column":18},"action":"insert","lines":["r"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":18},"end":{"row":13,"column":19},"action":"insert","lines":["a"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":19},"end":{"row":13,"column":20},"action":"insert","lines":["m"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":19},"end":{"row":13,"column":20},"action":"remove","lines":["m"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":19},"end":{"row":13,"column":20},"action":"insert","lines":["n"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":20},"end":{"row":13,"column":21},"action":"insert","lines":["s"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":21},"end":{"row":13,"column":22},"action":"insert","lines":["a"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":22},"end":{"row":13,"column":23},"action":"insert","lines":["c"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":23},"end":{"row":13,"column":24},"action":"insert","lines":["t"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":24},"end":{"row":13,"column":25},"action":"insert","lines":["i"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":25},"end":{"row":13,"column":26},"action":"insert","lines":["o"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":26},"end":{"row":13,"column":27},"action":"insert","lines":["n"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":27},"end":{"row":13,"column":28},"action":"insert","lines":["s"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":28},"end":{"row":13,"column":29},"action":"insert","lines":["/"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":29},"end":{"row":13,"column":30},"action":"insert","lines":[":"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":30},"end":{"row":13,"column":31},"action":"insert","lines":["t"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":31},"end":{"row":13,"column":32},"action":"insert","lines":["r"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":32},"end":{"row":13,"column":33},"action":"insert","lines":["a"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":33},"end":{"row":13,"column":34},"action":"insert","lines":["n"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":34},"end":{"row":13,"column":35},"action":"insert","lines":["s"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":35},"end":{"row":13,"column":36},"action":"insert","lines":["a"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":36},"end":{"row":13,"column":37},"action":"insert","lines":["c"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":37},"end":{"row":13,"column":38},"action":"insert","lines":["t"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":38},"end":{"row":13,"column":39},"action":"insert","lines":["i"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":39},"end":{"row":13,"column":40},"action":"insert","lines":["o"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":40},"end":{"row":13,"column":41},"action":"insert","lines":["n"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":41},"end":{"row":13,"column":42},"action":"insert","lines":["I"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":42},"end":{"row":13,"column":43},"action":"insert","lines":["d"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":45},"end":{"row":14,"column":0},"action":"insert","lines":["",""]},{"start":{"row":14,"column":0},"end":{"row":14,"column":4},"action":"insert","lines":[" "]}]}],[{"group":"doc","deltas":[{"start":{"row":14,"column":4},"end":{"row":14,"column":8},"action":"insert","lines":[" "]}]}],[{"group":"doc","deltas":[{"start":{"row":14,"column":8},"end":{"row":14,"column":9},"action":"insert","lines":["."]}]}],[{"group":"doc","deltas":[{"start":{"row":14,"column":8},"end":{"row":14,"column":9},"action":"remove","lines":["."]}]}],[{"group":"doc","deltas":[{"start":{"row":14,"column":4},"end":{"row":14,"column":8},"action":"remove","lines":[" "]}]}],[{"group":"doc","deltas":[{"start":{"row":14,"column":0},"end":{"row":14,"column":4},"action":"remove","lines":[" "]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":45},"end":{"row":14,"column":0},"action":"remove","lines":["",""]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":43},"end":{"row":13,"column":44},"action":"insert","lines":["/"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":44},"end":{"row":13,"column":45},"action":"insert","lines":["s"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":45},"end":{"row":13,"column":46},"action":"insert","lines":["t"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":46},"end":{"row":13,"column":47},"action":"insert","lines":["a"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":47},"end":{"row":13,"column":48},"action":"insert","lines":["t"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":48},"end":{"row":13,"column":49},"action":"insert","lines":["u"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":49},"end":{"row":13,"column":50},"action":"insert","lines":["s"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":52},"end":{"row":14,"column":0},"action":"insert","lines":["",""]},{"start":{"row":14,"column":0},"end":{"row":14,"column":4},"action":"insert","lines":[" "]}]}],[{"group":"doc","deltas":[{"start":{"row":14,"column":4},"end":{"row":14,"column":8},"action":"insert","lines":[" "]}]}],[{"group":"doc","deltas":[{"start":{"row":14,"column":8},"end":{"row":14,"column":9},"action":"insert","lines":["."]}]}],[{"group":"doc","deltas":[{"start":{"row":14,"column":9},"end":{"row":14,"column":10},"action":"insert","lines":["g"]},{"start":{"row":14,"column":10},"end":{"row":14,"column":11},"action":"insert","lines":["e"]}]}],[{"group":"doc","deltas":[{"start":{"row":14,"column":11},"end":{"row":14,"column":12},"action":"insert","lines":["t"]}]}],[{"group":"doc","deltas":[{"start":{"row":14,"column":12},"end":{"row":14,"column":13},"action":"insert","lines":[")"]}]}],[{"group":"doc","deltas":[{"start":{"row":14,"column":12},"end":{"row":14,"column":13},"action":"remove","lines":[")"]}]}],[{"group":"doc","deltas":[{"start":{"row":14,"column":12},"end":{"row":14,"column":14},"action":"insert","lines":["()"]}]}],[{"group":"doc","deltas":[{"start":{"row":14,"column":14},"end":{"row":15,"column":0},"action":"insert","lines":["",""]},{"start":{"row":15,"column":0},"end":{"row":15,"column":8},"action":"insert","lines":[" "]}]}],[{"group":"doc","deltas":[{"start":{"row":15,"column":8},"end":{"row":15,"column":9},"action":"insert","lines":["."]}]}],[{"group":"doc","deltas":[{"start":{"row":15,"column":9},"end":{"row":15,"column":10},"action":"insert","lines":["p"]}]}],[{"group":"doc","deltas":[{"start":{"row":15,"column":10},"end":{"row":15,"column":11},"action":"insert","lines":["o"]}]}],[{"group":"doc","deltas":[{"start":{"row":15,"column":11},"end":{"row":15,"column":12},"action":"insert","lines":["s"]}]}],[{"group":"doc","deltas":[{"start":{"row":15,"column":12},"end":{"row":15,"column":13},"action":"insert","lines":["t"]}]}],[{"group":"doc","deltas":[{"start":{"row":15,"column":13},"end":{"row":15,"column":15},"action":"insert","lines":["()"]}]}],[{"group":"doc","deltas":[{"start":{"row":10,"column":4},"end":{"row":10,"column":61},"action":"remove","lines":["app.param('transactionId', transactions.transactionByID);"]}]}],[{"group":"doc","deltas":[{"start":{"row":15,"column":15},"end":{"row":16,"column":0},"action":"insert","lines":["",""]},{"start":{"row":16,"column":0},"end":{"row":16,"column":8},"action":"insert","lines":[" "]}]}],[{"group":"doc","deltas":[{"start":{"row":16,"column":4},"end":{"row":16,"column":8},"action":"remove","lines":[" "]}]}],[{"group":"doc","deltas":[{"start":{"row":16,"column":4},"end":{"row":16,"column":61},"action":"insert","lines":["app.param('transactionId', transactions.transactionByID);"]}]}],[{"group":"doc","deltas":[{"start":{"row":10,"column":0},"end":{"row":10,"column":4},"action":"remove","lines":[" "]}]}],[{"group":"doc","deltas":[{"start":{"row":9,"column":37},"end":{"row":10,"column":0},"action":"remove","lines":["",""]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":0},"end":{"row":14,"column":0},"action":"remove","lines":[" .get()",""]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":14},"end":{"row":13,"column":15},"action":"insert","lines":["t"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":15},"end":{"row":13,"column":16},"action":"insert","lines":["r"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":16},"end":{"row":13,"column":17},"action":"insert","lines":["a"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":17},"end":{"row":13,"column":18},"action":"insert","lines":["n"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":18},"end":{"row":13,"column":19},"action":"insert","lines":["s"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":19},"end":{"row":13,"column":20},"action":"insert","lines":["a"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":20},"end":{"row":13,"column":21},"action":"insert","lines":["c"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":21},"end":{"row":13,"column":22},"action":"insert","lines":["t"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":22},"end":{"row":13,"column":23},"action":"insert","lines":["i"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":23},"end":{"row":13,"column":24},"action":"insert","lines":["o"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":24},"end":{"row":13,"column":25},"action":"insert","lines":["n"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":25},"end":{"row":13,"column":26},"action":"insert","lines":["s"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":26},"end":{"row":13,"column":27},"action":"insert","lines":["."]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":27},"end":{"row":13,"column":28},"action":"insert","lines":["s"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":28},"end":{"row":13,"column":29},"action":"insert","lines":["e"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":29},"end":{"row":13,"column":30},"action":"insert","lines":["t"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":27},"end":{"row":13,"column":30},"action":"remove","lines":["set"]},{"start":{"row":13,"column":27},"end":{"row":13,"column":49},"action":"insert","lines":["setTransactionStatus()"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":47},"end":{"row":13,"column":49},"action":"remove","lines":["()"]}]}],[{"group":"doc","deltas":[{"start":{"row":13,"column":48},"end":{"row":13,"column":49},"action":"insert","lines":[";"]}]}],[{"group":"doc","deltas":[{"start":{"row":12,"column":16},"end":{"row":12,"column":28},"action":"remove","lines":["transactions"]},{"start":{"row":12,"column":16},"end":{"row":12,"column":28},"action":"insert","lines":["transactions"]}]}],[{"group":"doc","deltas":[{"start":{"row":12,"column":30},"end":{"row":12,"column":43},"action":"remove","lines":["transactionId"]},{"start":{"row":12,"column":30},"end":{"row":12,"column":43},"action":"insert","lines":["transactionId"]}]}],[{"group":"doc","deltas":[{"start":{"row":1,"column":0},"end":{"row":2,"column":0},"action":"remove","lines":["",""]},{"start":{"row":1,"column":0},"end":{"row":2,"column":0},"action":"insert","lines":["var authorization = require('authorization');",""]}]}],[{"group":"doc","deltas":[{"start":{"row":1,"column":45},"end":{"row":2,"column":0},"action":"insert","lines":["",""]}]}],[{"group":"doc","deltas":[{"start":{"row":5,"column":14},"end":{"row":5,"column":46},"action":"insert","lines":["authorization.ensureAuthorized, "]}]}],[{"group":"doc","deltas":[{"start":{"row":6,"column":13},"end":{"row":6,"column":45},"action":"insert","lines":["authorization.ensureAuthorized, "]}]}],[{"group":"doc","deltas":[{"start":{"row":8,"column":13},"end":{"row":8,"column":45},"action":"insert","lines":["authorization.ensureAuthorized, "]}]}],[{"group":"doc","deltas":[{"start":{"row":9,"column":13},"end":{"row":9,"column":45},"action":"insert","lines":["authorization.ensureAuthorized, "]}]}],[{"group":"doc","deltas":[{"start":{"row":10,"column":16},"end":{"row":10,"column":48},"action":"insert","lines":["authorization.ensureAuthorized, "]}]}],[{"group":"doc","deltas":[{"start":{"row":12,"column":13},"end":{"row":12,"column":45},"action":"insert","lines":["authorization.ensureAuthorized, "]}]}],[{"group":"doc","deltas":[{"start":{"row":14,"column":14},"end":{"row":14,"column":46},"action":"insert","lines":["authorization.ensureAuthorized, "]}]}],[{"group":"doc","deltas":[{"start":{"row":1,"column":29},"end":{"row":1,"column":30},"action":"insert","lines":["."]}]}],[{"group":"doc","deltas":[{"start":{"row":1,"column":30},"end":{"row":1,"column":31},"action":"insert","lines":["/"]}]}]]},"ace":{"folds":[],"scrolltop":0,"scrollleft":0,"selection":{"start":{"row":8,"column":23},"end":{"row":8,"column":23},"isBackwards":false},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":0},"timestamp":1426700143000,"hash":"0f5bc6dee4de17e96dd860ba3e8192abd3317cf9"}
14,186
14,186
0.547018
46e76342410917096074d3c867f2667a9f5d5b3d
1,345
js
JavaScript
aws-sam-client/app/controllers/users/new.js
computationalcore/emberjs-aws-serverless
3eb0dc2bd9b41cc2ae9a9e16e045633dff81b5d5
[ "MIT" ]
2
2020-09-09T05:52:18.000Z
2020-12-31T16:37:05.000Z
aws-sam-client/app/controllers/users/new.js
computationalcore/emberjs-aws-serverless
3eb0dc2bd9b41cc2ae9a9e16e045633dff81b5d5
[ "MIT" ]
null
null
null
aws-sam-client/app/controllers/users/new.js
computationalcore/emberjs-aws-serverless
3eb0dc2bd9b41cc2ae9a9e16e045633dff81b5d5
[ "MIT" ]
1
2021-07-09T21:37:20.000Z
2021-07-09T21:37:20.000Z
import Controller from '@ember/controller'; export default Controller.extend({ loading: false, loadingText: '', actions: { addUser() { const self = this; const firstName = this.get('firstName') ? this.get('firstName') : ' '; const lastName = this.get('lastName') ? this.get('lastName') : ' '; const address = this.get('address') ? this.get('address') : ' '; const newUser = this.store.createRecord('user', { firstName, lastName, address }); // Show loader self.setProperties({ loading: true, loadingText: `Saving ${firstName} ${lastName}...` }); newUser.save().then(function(){ // Clear self.setProperties({ firstName: '', lastName: '', address: '', loading: false, loadingText: '' }); self.transitionToRoute('index'); }) .catch(function(error){ console.log(error); // Clear self.setProperties({ loading: false, loadingText: '' }); alert('Error while saving the data. Check the connection if the API server if up and running'); }); }, } });
25.865385
105
0.480297
46e937f3061866e41b1b4d1aa2f26a12bb81b22a
2,780
js
JavaScript
src/homeScreen/User/AddTouchdown/AddTouchdown.js
KennyHammerlund/apollogqlbowl
88c542847680c4ebd123cb46f013f4c73ed2f4dc
[ "MIT" ]
1
2020-01-10T14:01:18.000Z
2020-01-10T14:01:18.000Z
src/homeScreen/User/AddTouchdown/AddTouchdown.js
KennyHammerlund/apollogqlbowl
88c542847680c4ebd123cb46f013f4c73ed2f4dc
[ "MIT" ]
1
2022-02-18T09:38:28.000Z
2022-02-18T09:38:28.000Z
src/homeScreen/User/AddTouchdown/AddTouchdown.js
KennyHammerlund/apollogqlbowl
88c542847680c4ebd123cb46f013f4c73ed2f4dc
[ "MIT" ]
null
null
null
import React, { useEffect } from "react"; import { Text, Button } from "native-base"; import { useMutation } from "@apollo/react-hooks"; import moment from "moment"; import ApolloClient from "../../../apollo/apollo"; import { withImageContext } from "../../../contexts/imageContext"; import { withTouchdownContext } from "../../../contexts/touchdownContext"; import MUTATION from "./scoreMutation"; import GET_VIEWER from "../../../apollo/queries/viewer"; const AddTouchdown = ({ props, image, touchdown }) => { const [addTouchdown, { loading }] = useMutation(MUTATION, { optimisticResponse: ({ input }) => { // mock up the object we expect to return // cache uses id + __typename as a way to control result values // therefore they are required in the optimistic response return { addGameAction: { id: moment() .utc() .unix(), ...input, optimistic: true, __typename: "GameAction" } }; }, update: (cache, { data: { addGameAction } }) => { const { viewer } = cache.readQuery({ query: GET_VIEWER }); if (!viewer || !viewer.actions) return; // remove the optimistic Item. const cleanArr = viewer.actions.filter(action => { if ( addGameAction.timeStamp === action.timeStamp && addGameAction.type === action.type ) { return false; } return true; }); cache.writeQuery({ query: GET_VIEWER, // the return from our mutation `addGameAction` returns a single game action // we need to amend our viewer query to include the new action. data: { viewer: { ...viewer, actions: [addGameAction, ...cleanArr] }, addGameAction: addGameAction } }); }, variables: { input: { type: "TOUCHDOWN", value: 6, timeStamp: moment() .utc() .unix() } } }); useEffect(() => {}, [loading]); return ( <Button disabled={touchdown.ui} style={{ minWidth: 100, justifyContent: "center" }} onPress={() => { image.changePhoto("touchdown"); // when the mutation returns we can toggle the touchdown on the server addTouchdown().then(() => { touchdown.addServerReturn({ timeStamp: moment() .utc() .unix(), text: "Touchdown!" }); }); // we dont have to wait to toggle the ui we are optimistic! touchdown.toggleUI(); }} > <Text>{touchdown.ui ? ". . ." : "Touchdown"}</Text> </Button> ); }; export default withTouchdownContext(withImageContext(AddTouchdown));
29.574468
84
0.551079
226bd3652ea234004fb45e5cf96742494c835f7f
10,575
js
JavaScript
cardinal-kit-web/src/common/static_data/index.js
geoffrosen/CardinalKit-Web-Dashboard
dc3f32b5fce2479e4ef462cb34cc325974954a19
[ "MIT" ]
1
2022-01-29T15:54:44.000Z
2022-01-29T15:54:44.000Z
cardinal-kit-web/src/common/static_data/index.js
geoffrosen/CardinalKit-Web-Dashboard
dc3f32b5fce2479e4ef462cb34cc325974954a19
[ "MIT" ]
2
2022-01-08T21:52:14.000Z
2022-01-23T16:31:07.000Z
cardinal-kit-web/src/common/static_data/index.js
geoffrosen/CardinalKit-Web-Dashboard
dc3f32b5fce2479e4ef462cb34cc325974954a19
[ "MIT" ]
4
2022-01-08T01:58:23.000Z
2022-02-13T17:57:56.000Z
/** Apple Categories and icons */ export const CategoriesList = [ { id:"activity", name: "Activity", icon: require("@/assets/icons/Flame.png") }, { id:"body", name: "Body Measurements", icon: require("@/assets/icons/Body.png") }, { id:"hearing", name: "Hearing", icon: require("@/assets/icons/Hearing.png") }, { id:"heart", name: "Heart", icon: require("@/assets/icons/Heart.png") }, { id:"mindfulness", name: "Mindfulness", icon: require("@/assets/icons/Mindfulness.png") }, { id:"mobility", name: "Mobility", icon: require("@/assets/icons/Mobility.png") }, { id:"nutrition", name: "Nutrition", icon: require("@/assets/icons/Nutrition.png") }, { id:"respiratory", name: "Respiratory", icon: require("@/assets/icons/Respiratory.png") }, { id:"sleep", name: "Sleep", icon: require("@/assets/icons/Sleep.png") }, { id:"symtoms", name: "Symptoms", icon: require("@/assets/icons/Symtoms.png") }, { id:"vitals", name: "Vitals", icon: require("@/assets/icons/Vitals.png") }, { id:"other", name: "Other Data", icon: require("@/assets/icons/Other.png") }, { id:"survey", name: "Surveys", icon: require("@/assets/icons/Other.png"), customAction:"surveyUser" }, ]; /** Apple Categories that need average instead of summation */ export const dataTypeToCalculateAverage = [ "HKQuantityTypeIdentifierRestingHeartRate", "HKQuantityTypeIdentifierHeartRate", "HKQuantityTypeIdentifierHeartRateVariabilitySDNN", "HKQuantityTypeIdentifierBodyFatPercentage", "HKQuantityTypeIdentifierEnvironmentalAudioExposure", "HKQuantityTypeIdentifierOxygenSaturation", "HKQuantityTypeIdentifierBloodAlcoholContent", "HKQuantityTypeIdentifierRespiratoryRate", "HKQuantityTypeIdentifierWalkingDoubleSupportPercentage" ] export const dataTypeToRounded = [ "HKQuantityTypeIdentifierRestingHeartRate", "HKQuantityTypeIdentifierHeartRate", "HKQuantityTypeIdentifierHeartRateVariabilitySDNN", "HKQuantityTypeIdentifierRespiratoryRate" ] export const logosByCategory = { 'Activity':require("@/assets/icons/Flame.png"), 'Body':require("@/assets/icons/Body.png"), "Hearing":require("@/assets/icons/Hearing.png"), "Heart": require("@/assets/icons/Heart.png"), "Mindfulness": require("@/assets/icons/Mindfulness.png"), "Mobility": require("@/assets/icons/Mobility.png"), "Nutrition": require("@/assets/icons/Nutrition.png"), "Respiratory": require("@/assets/icons/Respiratory.png"), "Sleep": require("@/assets/icons/Sleep.png"), "Symptoms": require("@/assets/icons/Symtoms.png"), "Vitals": require("@/assets/icons/Vitals.png"), "Other Data": require("@/assets/icons/Other.png"), "Surveys": require("@/assets/icons/Other.png"), } export const categoriesOfSubcategories = { 'HKQuantityTypeIdentifierDistanceWalkingRunning': 'Activity', 'HKQuantityTypeIdentifierActiveEnergyBurned':'Activity', 'HKQuantityTypeIdentifierAppleStandTime':'Activity', 'HKQuantityTypeIdentifierAppleStandHour':'Activity', 'HKQuantityTypeIdentifierAppleExerciseTime':'Activity', 'HKQuantityTypeIdentifierFlightsClimbed':'Activity', 'HKQuantityTypeIdentifierPushCount':'Activity', 'HKQuantityTypeIdentifierDistanceWheelchair':'Activity', 'HKQuantityTypeIdentifierDistanceCycling':'Activity', 'HKQuantityTypeIdentifierDistanceDownhillSnowSports':'Activity', 'HKQuantityTypeIdentifierBasalEnergyBurned':'Activity', 'HKQuantityTypeIdentifierSwimmingStrokeCount':'Activity', 'HKQuantityTypeIdentifierDistanceSwimming':'Activity', 'HKQuantityTypeIdentifierStepCount':'Activity', "HKQuantityTypeIdentifierBasalBodyTemperature":"Body", "HKQuantityTypeIdentifierBodyFatPercentage":"Body", "HKQuantityTypeIdentifierLeanBodyMass":"Body", "HKQuantityTypeIdentifierBodyTemperature":"Body", "HKQuantityTypeIdentifierBodyMass":"Body", "HKQuantityTypeIdentifierBodyMassIndex":"Body", "HKQuantityTypeIdentifierElectrodermalActivity":"Body", "HKQuantityTypeIdentifierHeight":"Body", "HKQuantityTypeIdentifierWaistCircumference":"Body", "HKSampleTypeIdentifierAudiogram":"Hearing", "HKQuantityTypeIdentifierEnvironmentalAudioExposure":"Hearing", "HKQuantityTypeIdentifierBloodPressureSystolic":"Heart", "HKQuantityTypeIdentifierBloodPressureDiastolic":"Heart", "HKQuantityTypeIdentifierHeartRateVariabilitySDNN":"Heart", "HKQuantityTypeIdentifierPeripheralPerfusionIndex":"Heart", "HKQuantityTypeIdentifierRestingHeartRate":"Heart", "HKQuantityTypeIdentifierHeartRate":"Heart", "HKCategoryTypeIdentifierMindfulSession":"Mindfulness", "HKQuantityTypeIdentifierWalkingDoubleSupportPercentage":"Mobility", "HKQuantityTypeIdentifierStairDescentSpeed":"Mobility", "HKQuantityTypeIdentifierStairAscentSpeed":"Mobility", "HKQuantityTypeIdentifierWalkingSpeed":"Mobility", "HKQuantityTypeIdentifierSixMinuteWalkTestDistance":"Mobility", "HKQuantityTypeIdentifierwalkingAsymmetryPercentage":"Mobility", "HKQuantityTypeIdentifierDietaryPantothenicAcid":"Nutrition", "HKQuantityTypeIdentifierDietarySelenium":"Nutrition", "HKQuantityTypeIdentifierDietarySodium":"Nutrition", "HKQuantityTypeIdentifierDietaryThiamin":"Nutrition", "HKQuantityTypeIdentifierDietaryVitaminA":"Nutrition", "HKQuantityTypeIdentifierDietaryEnergyConsumed":"Nutrition", "HKQuantityTypeIdentifierDietaryIron":"Nutrition", "HKQuantityTypeIdentifierDietaryMagnesium":"Nutrition", "HKQuantityTypeIdentifierDietaryManganese":"Nutrition", "HKQuantityTypeIdentifierDietaryMolybdenum":"Nutrition", "HKQuantityTypeIdentifierDietaryNiacin":"Nutrition", "HKQuantityTypeIdentifierDietaryPotassium":"Nutrition", "HKQuantityTypeIdentifierDietaryProtein":"Nutrition", "HKQuantityTypeIdentifierDietaryPhosphorus":"Nutrition", "HKQuantityTypeIdentifierDietaryRiboflavin":"Nutrition", "HKQuantityTypeIdentifierDietaryFatTotal":"Nutrition", "HKQuantityTypeIdentifierDietaryCarbohydrates":"Nutrition", "HKQuantityTypeIdentifierDietaryChloride":"Nutrition", "HKQuantityTypeIdentifierDietaryChromium":"Nutrition", "HKQuantityTypeIdentifierDietaryCholesterol":"Nutrition", "HKQuantityTypeIdentifierDietaryCopper":"Nutrition", "HKQuantityTypeIdentifierDietaryFiber":"Nutrition", "HKQuantityTypeIdentifierDietaryFatSaturated":"Nutrition", "HKQuantityTypeIdentifierDietaryFatMonounsaturated":"Nutrition", "HKQuantityTypeIdentifierDietaryFatPolyunsaturated":"Nutrition", "HKQuantityTypeIdentifierDietaryBiotin":"Nutrition", "HKQuantityTypeIdentifierDietaryCaffeine":"Nutrition", "HKQuantityTypeIdentifierDietaryCalcium":"Nutrition", "HKQuantityTypeIdentifierDietarySugar":"Nutrition", "HKQuantityTypeIdentifierDietaryFolate":"Nutrition", "HKQuantityTypeIdentifierDietaryWater":"Nutrition", "HKQuantityTypeIdentifierDietaryIodine":"Nutrition", "HKQuantityTypeIdentifierDietaryVitaminB6":"Nutrition", "HKQuantityTypeIdentifierDietaryVitaminB12":"Nutrition", "HKQuantityTypeIdentifierDietaryVitaminC":"Nutrition", "HKQuantityTypeIdentifierDietaryVitaminD":"Nutrition", "HKQuantityTypeIdentifierDietaryVitaminE":"Nutrition", "HKQuantityTypeIdentifierDietaryVitaminK":"Nutrition", "HKQuantityTypeIdentifierDietaryZinc":"Nutrition", "HKQuantityTypeIdentifierBloodAlcoholContent":"Other Data", "HKQuantityTypeIdentifierInhalerUsage":"Other Data", "HKQuantityTypeIdentifierInsulinDelivery":"Other Data", "HKQuantityTypeIdentifierNumberOfTimesFallen":"Other Data", "HKQuantityTypeIdentifierSexualActivity":"Other Data", "HKQuantityTypeIdentifierUvExposure":"Other Data", "HKQuantityTypeIdentifierBloodGlucose":"Other Data", "HKCategoryTypeIdentifierToothbrushingEvent":"Other Data", "HKCategoryTypeIdentifierSexualActivity":"Other Data", "HKCategoryTypeIdentifierHandwashingEvent":"Other Data", "HKQuantityTypeIdentifierOxygenSaturation":"Respiratory", "HKQuantityTypeIdentifierInhalerUsage":"Respiratory", "HKQuantityTypeIdentifierRespiratoryRate":"Respiratory", "HKQuantityTypeIdentifierForcedExpiratoryVolume1":"Respiratory", "HKQuantityTypeIdentifierForcedVitalCapacity":"Respiratory", "HKQuantityTypeIdentifierSixMinuteWalkTestDistance":"Respiratory", "HKQuantityTypeIdentifierPeakExpiratoryFlowRate":"Respiratory", "HKCategoryTypeIdentifierSleepAnalysis":"Sleep", "HKCategoryTypeIdentifierAppetiteChanges":"Symptoms", "HKCategoryTypeIdentifierAbdominalCramps":"Symptoms", "HKCategoryTypeIdentifierBloating":"Symptoms", "HKCategoryTypeIdentifierConstipation":"Symptoms", "HKCategoryTypeIdentifierDiarrhea":"Symptoms", "HKCategoryTypeIdentifierHeartburn":"Symptoms", "HKCategoryTypeIdentifierNausea":"Symptoms", "HKCategoryTypeIdentifierVomiting":"Symptoms", "HKCategoryTypeIdentifierChills":"Symptoms", "HKCategoryTypeIdentifierDizziness":"Symptoms", "HKCategoryTypeIdentifierFainting":"Symptoms", "HKCategoryTypeIdentifierFatigue":"Symptoms", "HKCategoryTypeIdentifierFever":"Symptoms", "HKCategoryTypeIdentifierGeneralizedBodyAche":"Symptoms", "HKCategoryTypeIdentifierHotFlashes":"Symptoms", "HKCategoryTypeIdentifierChestTightnessOrPain":"Symptoms", "HKCategoryTypeIdentifierCoughing":"Symptoms", "HKCategoryTypeIdentifierRapidPoundingOrFlutteringHeartbeat":"Symptoms", "HKCategoryTypeIdentifierShortnessOfBreath":"Symptoms", "HKCategoryTypeIdentifierSkippedHeartbeat":"Symptoms", "HKCategoryTypeIdentifierWheezing":"Symptoms", "HKCategoryTypeIdentifierLowerBackPain":"Symptoms", "HKCategoryTypeIdentifierHeadache":"Symptoms", "HKCategoryTypeIdentifierMemoryLapse":"Symptoms", "HKCategoryTypeIdentifierMoodChanges":"Symptoms", "HKCategoryTypeIdentifierLossOfSmell":"Symptoms", "HKCategoryTypeIdentifierLossOfTaste":"Symptoms", "HKCategoryTypeIdentifierRunnyNose":"Symptoms", "HKCategoryTypeIdentifierSoreThroat":"Symptoms", "HKCategoryTypeIdentifierSinusCongestion":"Symptoms", "HKCategoryTypeIdentifierBreastPain":"Symptoms", "HKCategoryTypeIdentifierPelvicPain":"Symptoms", "HKCategoryTypeIdentifierVaginalDryness":"Symptoms", "HKCategoryTypeIdentifierAcne":"Symptoms", "HKCategoryTypeIdentifierDrySkin":"Symptoms", "HKCategoryTypeIdentifierHairLoss":"Symptoms", "HKCategoryTypeIdentifierNightSweats":"Symptoms", "HKCategoryTypeIdentifierSleepChanges":"Symptoms", "HKCategoryTypeIdentifierBladderIncontinence":"Symptoms", "HKQuantityTypeIdentifierOxygenSaturation":"Vitals", "HKQuantityTypeIdentifierBasalBodyTemperature":"Vitals", "HKQuantityTypeIdentifierBloodPressureSystolic":"Vitals", "HKQuantityTypeIdentifierBloodPressureDiastolic":"Vitals", "HKQuantityTypeIdentifierBloodGlucose":"Vitals", "HKQuantityTypeIdentifierMenstrualFlow":"Vitals", }
50.841346
105
0.806052
226c233375f4c94772b1ee8edb611129fc7209f9
8,477
js
JavaScript
assets/js/script.js
kstensing/weather-dashboard
a663eb4dba5e7e20a22c4025e2016af2e998d2f4
[ "MIT" ]
null
null
null
assets/js/script.js
kstensing/weather-dashboard
a663eb4dba5e7e20a22c4025e2016af2e998d2f4
[ "MIT" ]
null
null
null
assets/js/script.js
kstensing/weather-dashboard
a663eb4dba5e7e20a22c4025e2016af2e998d2f4
[ "MIT" ]
null
null
null
var cityFormEl = document.querySelector("#city-form"); var cityInputEl = document.querySelector("#city"); var currentContainerEl = document.querySelector("#current-conditions-container"); var currentCity = document.querySelector("#current-city-weather"); var forecastContainerEl = document.querySelector("#forecast-container"); var forecast = document.querySelector("#forecast"); var currentDay = moment().format(' (MM/DD/YYYY)'); // handler to accept 'submit'event var formSubmitHandler = function (event) { event.preventDefault(); var city = cityInputEl.value.trim(); // if the city is entered, run the getCIty function if (city) { getCity(city); // get 'history' form local storage -seeing if it exists var storedCityHistory = localStorage.getItem("history"); var cityHistory = JSON.parse(storedCityHistory); //if there's nothing in local storage, create a list if (cityHistory == null) { cityHistory = []; }; // add the new city to the list & add to local storage cityHistory.push(city); localStorage.setItem("history", JSON.stringify(cityHistory)); // for each item in the list... for (var i = 0; i < cityHistory.length; i++) { // see if there are any prior added city buttons on the page, if so delete them var onPageButton = document.getElementById("new-button" + i); if (onPageButton) { onPageButton.remove(); } //create a button on the page for each item in the city history list var cityHistoryLi = document.createElement("button"); cityHistoryLi.classList = "btn btn-secondary btn-block"; cityHistoryLi.textContent = cityHistory[i]; cityHistoryLi.id = "new-button" + i; document.getElementById("history-container").appendChild(cityHistoryLi); // when the city button is clicked, run getCity function cityHistoryLi.addEventListener("click", function (event) { getCity(event.currentTarget.textContent); }); }; } else { // error handling if no city is entered alert("Please enter a valid city"); }; }; // gather current city weather data and pass that info on var getCity = function (city) { // format the api url var requestUrl = "https://api.openweathermap.org/data/2.5/weather?q=" + city + "&units=imperial&appid=55b53b07c2e560aae2f3aeb2fb43fe2f"; // make a request to the url fetch(requestUrl) .then(function (response) { response.json().then(function (data) { displayCity(data, city); displayForecast(data, city); }); }); }; // function to display sections of the current weather api we want to show var displayCity = function (cityInfo) { currentContainerEl.textContent = ""; // display current day and cityname currentCity.textContent = cityInfo.name + currentDay; // obtain icon, create & display image element to the page var source = "http://openweathermap.org/img/wn/" + cityInfo.weather[0].icon + ".png"; var imgEl = document.createElement("img"); imgEl.setAttribute("src", source); var conditionEl = document.createElement("span"); conditionEl.appendChild(imgEl); // obtain temp info from api and add to page var cityWeather = "Temp: " + cityInfo.main.temp + "°F"; var tempEl = document.createElement("p"); tempEl.textContent = cityWeather; conditionEl.appendChild(tempEl); // obtain wind info from api and add to page var cityWeatherWind = "Wind: " + cityInfo.wind.speed + " MPH"; var windEl = document.createElement("p"); windEl.textContent = cityWeatherWind; conditionEl.appendChild(windEl); // obtain humidity info from api and add to page var cityWeatherHumidity = "Humidity: " + cityInfo.main.humidity + "%"; var humidityEl = document.createElement("p"); humidityEl.textContent = cityWeatherHumidity; conditionEl.appendChild(humidityEl); // obtain uv index from api using lat & lon from current weather api & adding to page var uvUrl = "https://api.openweathermap.org/data/2.5/onecall?lat=" + cityInfo.coord.lat + "&lon=" + cityInfo.coord.lon + "&appid=55b53b07c2e560aae2f3aeb2fb43fe2f"; fetch(uvUrl) .then(function (response) { response.json().then(function (data) { var uvEl = document.createElement("div"); var titleUvEl = document.createElement("p"); titleUvEl.textContent = "UV Index: " titleUvEl.appendChild(uvEl) uvEl.textContent = data.current.uvi; // change background of UV index depending on severity if (data.current.uvi <= 2) { uvEl.classList = "badge low"; } else if (data.current.uvi > 2 && data.current.uvi < 6) { uvEl.classList = "badge moderate"; } else if (data.current.uvi > 5 && data.current.uvi < 8) { uvEl.classList = "badge high"; } else if (data.current.uvi >= 8) { uvEl.classList = "badge veryHigh"; }; conditionEl.appendChild(titleUvEl); }); }); currentContainerEl.appendChild(conditionEl); // hide html code until this part of code is hit var pageContent = document.getElementById("page-content"); pageContent.style.display = "block"; }; // 5 day forecast API call var displayForecast = function (cityInfo) { forecastContainerEl.textContent = ""; var forecastUrl = "https://api.openweathermap.org/data/2.5/forecast?lat=" + cityInfo.coord.lat + "&lon=" + cityInfo.coord.lon + "&units=imperial&appid=55b53b07c2e560aae2f3aeb2fb43fe2f"; fetch(forecastUrl) .then(function (response) { response.json().then(function (data) { //for each day, create an element containing below info for (var i = 0; i < data.list.length; i += 8) { // check to see if days are present on page, if so, delete them var dayId = document.getElementById("day" + i) if (dayId) { dayId.remove(); } var forecastDay = document.querySelector("[data-day='" + i + "']"); var conditionEl = document.createElement("span"); conditionEl.id = "day" + i; // obtain date using moment and append to day var cityDate = data.list[i].dt; var forecastDate = moment.unix(cityDate).format("MM/DD/YYYY"); var dateEl = document.createElement("h5"); dateEl.textContent = forecastDate; conditionEl.appendChild(dateEl); // obtain icon and append to day var source = "http://openweathermap.org/img/wn/" + data.list[i].weather[0].icon + ".png"; var imgEl = document.createElement("img"); imgEl.setAttribute("src", source); conditionEl.appendChild(imgEl); // obtain temp and append to day var cityWeather = "Temp: " + data.list[i].main.temp + "°F"; var tempEl = document.createElement("p"); tempEl.textContent = cityWeather; conditionEl.appendChild(tempEl); // obtain wind and append to day var cityWeatherWind = "Wind: " + data.list[i].wind.speed + " MPH"; var windEl = document.createElement("p"); windEl.textContent = cityWeatherWind; conditionEl.appendChild(windEl); //obtain humidity and append to day var cityWeatherHumidity = "Humidity: " + data.list[i].main.humidity + "%"; var humidityEl = document.createElement("p"); humidityEl.textContent = cityWeatherHumidity; conditionEl.appendChild(humidityEl); forecastDay.appendChild(conditionEl); } }); }); }; // submit city button event listener to trigger form submit handler cityFormEl.addEventListener("submit", formSubmitHandler);
45.331551
189
0.594904
226d1cf47811b524a8c49fb0e36760e058a6a6c7
171
js
JavaScript
utils/npm/peers/index.js
Roms1383/generator-kroms
14487b420ae44b3bfc7b2c855a2e324795941046
[ "MIT" ]
null
null
null
utils/npm/peers/index.js
Roms1383/generator-kroms
14487b420ae44b3bfc7b2c855a2e324795941046
[ "MIT" ]
27
2019-05-29T16:34:24.000Z
2021-10-21T10:59:18.000Z
utils/npm/peers/index.js
Roms1383/generator-kroms
14487b420ae44b3bfc7b2c855a2e324795941046
[ "MIT" ]
null
null
null
const fetch = require('./fetch') const parse = require('./parse') module.exports = async dependency => { const output = await fetch(dependency) return parse(output) }
24.428571
40
0.701754
226d26338115fe4ded8149f10b1c8b5785f248ff
523
js
JavaScript
common/icons/components/Expand.js
saltaf07/Public-Scripts
3262512679e16f0442e2ff21b79f14267da14d6a
[ "MIT" ]
null
null
null
common/icons/components/Expand.js
saltaf07/Public-Scripts
3262512679e16f0442e2ff21b79f14267da14d6a
[ "MIT" ]
null
null
null
common/icons/components/Expand.js
saltaf07/Public-Scripts
3262512679e16f0442e2ff21b79f14267da14d6a
[ "MIT" ]
null
null
null
const SvgExpand = props => ( <svg viewBox="0 0 24 24" {...props}> <path className="icon__shape" fillRule="nonzero" d="M19.07 11.2a1 1 0 0 0 1-1v-5a1 1 0 0 0-1-1h-5a1 1 0 1 0 0 2h2.59L12 10.88 7.29 6.2h2.78a1 1 0 1 0 0-2h-5a1 1 0 0 0-1 1v5a1 1 0 1 0 2 0V7.81l4.49 4.49-4.49 4.49V14.2a1 1 0 1 0-2 0v5a1 1 0 0 0 1 1h5a1 1 0 0 0 0-2H7.48L12 13.71l4.49 4.49h-2.42a1 1 0 0 0 0 2h5a1 1 0 0 0 1-1v-5a1 1 0 0 0-2 0V17l-4.69-4.7 4.68-4.68v2.58a1 1 0 0 0 1.01 1z" /> </svg> ); export default SvgExpand;
43.583333
343
0.608031
226de280e9053565ab8ed375cdd73371fee6e7dc
99
js
JavaScript
lib/elements/buttons/index.js
MadhavaRaoKonda/redux-form-datagrid
ca013ecb15a963a6385e667eb04df95c940de0c6
[ "ISC" ]
null
null
null
lib/elements/buttons/index.js
MadhavaRaoKonda/redux-form-datagrid
ca013ecb15a963a6385e667eb04df95c940de0c6
[ "ISC" ]
null
null
null
lib/elements/buttons/index.js
MadhavaRaoKonda/redux-form-datagrid
ca013ecb15a963a6385e667eb04df95c940de0c6
[ "ISC" ]
null
null
null
import StyledButton from './button'; class Button extends StyledButton { } export default Button;
19.8
37
0.777778
226f1f07c467f864611ecde308ce5ac7eec8d85d
4,351
js
JavaScript
node_modules/sw-router/src/index.js
ZhaojiaLii/weatherPWA
ce765271eebc98354c75ae88cde45d008a57650a
[ "MIT" ]
1
2020-10-01T12:37:43.000Z
2020-10-01T12:37:43.000Z
node_modules/sw-router/src/index.js
ZhaojiaLii/weatherPWA
ce765271eebc98354c75ae88cde45d008a57650a
[ "MIT" ]
null
null
null
node_modules/sw-router/src/index.js
ZhaojiaLii/weatherPWA
ce765271eebc98354c75ae88cde45d008a57650a
[ "MIT" ]
null
null
null
import pathtoRegexp from '../lib/path-to-regexp'; import Log from '../lib/log'; const log = new Log('web-service-router'); /** * method match rule: * 0: all * 1: get * 2: post * 3: patch * 4: put */ class Router { constructor() { // noop /** * save registered routes * format: [method,urls,cb] * @method {Number} * @urls {Array} * @cb {Function} */ this._routes = []; this._request; // save the route } // initially call `watch` function watch(request) { // check the type of url if (!this._extract(request)) return; let { method, url } = this._request; url = this ._resolve(url) .pathname; method = this._methodMatch(method.toLowerCase()); var tempArr = this ._routes .filter(route => { return route[0] === method }); let flag = false; for (var route of tempArr) { let urls = route[1]; for (var destUrl of urls) { if (!!pathtoRegexp(destUrl).exec(url)) { flag = true; break; } } if (!flag) continue; route[2](this._event, this._request); break; } } _extract(event) { // only accept 'event' if (this._getType(event) !== 'fetchevent') { log.e('watch(event) only accept <event> param from fetch callback'); return false; } this._request = event.request; this._event = event; return true; } _getType(obj) { return Object .prototype .toString .call(obj) .match(/\s([a-zA-Z]+)/)[1] .toLowerCase(); } _resolve(href) { return new URL(href); } _urlDB(urls, cb, method = 0) { this ._routes .push([method, urls, cb]); } _methodMatch(name) { switch (name) { case 'all': return 0; case 'get': return 1; case 'post': return 2; case 'patch': return 3; case 'put': return 4; default: return 0; } } _paramResolve(params, method = 'get') { if (params.length === 0) { log.e('the param of route is empty') return; } // check the last param is callback let cb = params.pop(); if (this._getType(cb) !== 'function') { log.e("the type of callback is incorrect, your cb is " + cb); return; } // save urls let routes = []; params.forEach(url => { if (this._getType(url) === 'array') { routes = url; } else if (this._getType(url) === 'string') { routes.push(url) } else { log.e("the urls of get(urls) should only be array or string. like '/path' || ['/path','" + "/demo']"); return; } }); method = this._methodMatch(method); this._urlDB(routes, cb, method); } get(...params) { this._paramResolve(params, 'get'); return this; } post(...params) { this._paramResolve(params, 'post'); return this; } patch(...params) { this._paramResolve(params, 'patch'); return this; } put(...params) { this._paramResolve(params, 'put'); return this; } all(...params) { this._paramResolve(params, 'all'); return this; } save(cacheName, event) { if (event === undefined) { event = cacheName; cacheName = 'defaultName'; } if (this._getType(event) !== 'fetchevent') { // check fetchevent log.e('the param [' + this._getType(event) + '] of save is wrong' + '/n' + 'it only accpet [event]'); return; } let request = event.request; event.respondWith(caches.match(request).then(res => { if (res) return res; let reqClone = request.clone(); return fetch(request).then(res => { // failed if (!res || res.status !== 200 || res.type !== 'basic') { return res; } let resClone = res.clone(); caches .open(cacheName) .then(cache => { cache.put(reqClone, resClone); }); return res; }) })) } } self.Router = new Router(); /** * trigger method is Router.watch(event or request or string) */ /** * the calling ways: * get('/path','/demo',cb) or * get(['/path','/demo'],cb) or * get('/path',cb) only one route */
20.620853
98
0.518501
226f5501f75cabca6f67e9165b5a5439ff175d89
174
js
JavaScript
examples/config/protected/controllers/~.js
ifnode/ifnode
d80bcb1d8dd0bf66edb104715794bc958cf854e6
[ "MIT" ]
9
2017-02-13T14:26:34.000Z
2021-01-26T22:09:13.000Z
examples/config/protected/controllers/~.js
ifnode/ifnode
d80bcb1d8dd0bf66edb104715794bc958cf854e6
[ "MIT" ]
17
2017-08-22T17:41:35.000Z
2021-02-26T23:01:34.000Z
examples/config/protected/controllers/~.js
ifnode/ifnode
d80bcb1d8dd0bf66edb104715794bc958cf854e6
[ "MIT" ]
1
2019-12-24T13:48:31.000Z
2019-12-24T13:48:31.000Z
'use strict'; var app = require('./../../../..')('middleware-test'); var controller = app.Controller(); controller.get(function(request, response) { response.ok(); });
19.333333
54
0.62069
226f6febdfd9577fdcb1acf8a5af876d9c77b5eb
98
js
JavaScript
src/components/greenButton.js
pushkar100/webpack4course-MF-example
d4fbe697b2c63ffd5ac7fe2127c090f9aaa066d0
[ "MIT" ]
null
null
null
src/components/greenButton.js
pushkar100/webpack4course-MF-example
d4fbe697b2c63ffd5ac7fe2127c090f9aaa066d0
[ "MIT" ]
4
2021-10-06T21:01:00.000Z
2022-02-27T04:52:22.000Z
buttons/src/components/greenButton.js
pushkar100/webpack4course-MF-example
d4fbe697b2c63ffd5ac7fe2127c090f9aaa066d0
[ "MIT" ]
1
2020-05-17T16:58:41.000Z
2020-05-17T16:58:41.000Z
import buttonCreator from '../utils/buttonCreator' export default buttonCreator('green', 'green')
32.666667
50
0.785714
2270a3c72122f4a797acc00666e9db3bc2627862
2,455
js
JavaScript
data/db-memory.js
Ken-Richard/tincan_nodejs
665ed7e8da926fb7327e68d20dfe10b6b11cac5a
[ "Apache-2.0" ]
16
2015-02-11T02:33:01.000Z
2021-05-05T16:56:00.000Z
data/db-memory.js
Ken-Richard/tincan_nodejs
665ed7e8da926fb7327e68d20dfe10b6b11cac5a
[ "Apache-2.0" ]
null
null
null
data/db-memory.js
Ken-Richard/tincan_nodejs
665ed7e8da926fb7327e68d20dfe10b6b11cac5a
[ "Apache-2.0" ]
1
2015-06-24T00:30:21.000Z
2015-06-24T00:30:21.000Z
// // Simple In-Memory Data Store // var registrations = {}; function Registration(id) { this.id = id; this.states = {}; this.statements = {}; } exports.reset = function(callback) { console.log("*** RESET DATABASE ***"); registrations = {}; exports.createRegistration('SAMPLE-REGISTRATION-ID', callback); }; // // Public Interface - Registrations // // All Registrations - Just for Debugging exports.allRegistrations = function() { return registrations; }; // Load Specific Registration exports.getRegistration = function(registrationId, callback) { callback(registrations[registrationId]); }; exports.createRegistration = function(id, callback) { var reg = new Registration(id); registrations[id] = reg; callback(id); }; // // Public Interface - States // exports.getState = function(context, callback) { if (context.registrationId==null) { callback(null); } else { var reg = registrations[context.registrationId]; if (reg) { callback(reg.states[context.stateId]); } else { callback(null); } } }; exports.getStateKeys = function(context, callback) { if (context.registrationId==null) { callback(null); } else { var reg = registrations[context.registrationId]; if (reg) { callback(Object.keys(reg.states)); } else { callback(null); } } }; exports.setState = function(context, data, callback) { var reg = registrations[context.registrationId]; reg.states[context.stateId] = data; callback(); }; exports.deleteState = function(context, callback) { var reg = registrations[context.registrationId]; if (reg==null) { callback(null); } else { if (context.stateId) { delete reg.states[context.stateId]; } else { reg.states = {}; } callback(true); } }; // // Public Interface - Statements // exports.getStatement = function(context, callback) { if (context.registrationId==null) { callback(null); } else { var reg = registrations[context.registrationId]; if (reg) { callback(reg.statements[context.statementId]); } else { callback(null); } } }; exports.addStatement = function(context,data,callback) { var reg = registrations[context.registrationId]; reg.statements[context.statementId] = data; callback(data); }; exports.findStatements = function(context, callback) { var reg = registrations[context.registrationId]; callback(reg.statements); };
20.122951
65
0.665173
22711804eb65158fca1d8502290cf7d2b38ffa5f
3,148
js
JavaScript
lib/redux/watchers.js
kenvilar/chonky
af666e3c94604aa70b7dc592e5ce11bca730a4bd
[ "MIT" ]
null
null
null
lib/redux/watchers.js
kenvilar/chonky
af666e3c94604aa70b7dc592e5ce11bca730a4bd
[ "MIT" ]
null
null
null
lib/redux/watchers.js
kenvilar/chonky
af666e3c94604aa70b7dc592e5ce11bca730a4bd
[ "MIT" ]
1
2022-02-27T06:09:12.000Z
2022-02-27T06:09:12.000Z
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.useStoreWatchers = void 0; var react_1 = require("react"); var redux_watch_1 = __importDefault(require("redux-watch")); var action_definitions_1 = require("../action-definitions"); var reducers_1 = require("./reducers"); var selectors_1 = require("./selectors"); var dispatchers_thunks_1 = require("./thunks/dispatchers.thunks"); exports.useStoreWatchers = function (store) { react_1.useEffect(function () { var selectionWatcher = redux_watch_1.default(function () { return selectors_1.selectSelectionMap(store.getState()); }); var onSelectionChange = function (newSelection, oldSelection) { // We don't check for deep equality here as we expect the // reducers to prevent all unnecessary updates. if (newSelection === oldSelection) return; // Notify users the selection has changed. var selectedFilesIds = selectors_1.selectSelectedFileIds(store.getState()); var selection = new Set(selectedFilesIds); store.dispatch(dispatchers_thunks_1.thunkRequestFileAction(action_definitions_1.ChonkyActions.ChangeSelection, { selection: selection, })); }; var displayFileIdsWatcher = redux_watch_1.default(function () { return selectors_1.selectDisplayFileIds(store.getState()); }); var onDisplayFileIdsChange = function (oldDisplayFileIds, newDisplayFileIds) { var oldLastClickIndex = selectors_1.selectLastClickIndex(store.getState()); var newLastClickIndex = oldLastClickIndex; if (typeof oldLastClickIndex === 'number') { if (oldLastClickIndex > newDisplayFileIds.length - 1) { // Reset last click index if it goes beyond the size of the new // array. newLastClickIndex = null; } else if (oldDisplayFileIds[oldLastClickIndex] !== newDisplayFileIds[oldLastClickIndex]) { // Reset last click index if the file ID at the last index has // changed. newLastClickIndex = null; } } // Update last click index in the interface if (oldLastClickIndex !== newLastClickIndex) { store.dispatch(reducers_1.reduxActions.setLastClickIndex(newLastClickIndex)); } }; var unsubscribeCallbacks = [ store.subscribe(selectionWatcher(onSelectionChange)), store.subscribe(displayFileIdsWatcher(onDisplayFileIdsChange)), ]; return function () { for (var _i = 0, unsubscribeCallbacks_1 = unsubscribeCallbacks; _i < unsubscribeCallbacks_1.length; _i++) { var unsubscribe = unsubscribeCallbacks_1[_i]; unsubscribe(); } }; }, [store]); };
49.1875
127
0.620712
2272430521c7387d989396779fb57a3004263734
199
js
JavaScript
src/RCContext.js
marouanekadiri/react-relative-container
e8cecbcb545c397fb3922fbc83dd3bbe870f7574
[ "MIT" ]
null
null
null
src/RCContext.js
marouanekadiri/react-relative-container
e8cecbcb545c397fb3922fbc83dd3bbe870f7574
[ "MIT" ]
null
null
null
src/RCContext.js
marouanekadiri/react-relative-container
e8cecbcb545c397fb3922fbc83dd3bbe870f7574
[ "MIT" ]
null
null
null
import { createContext, useContext } from "react"; const RCContext = createContext(); export const useRCContext = () => useContext(RCContext); export const RCContextProvider = RCContext.Provider;
24.875
56
0.763819
22738ce819c94da0511baeadf22351f7021e781c
354
js
JavaScript
src/storage/storage.module.js
HumanBrainProject/angular-hbp-collaboratory
e905efe40ecb7f436a6d728942d36eca949e3d04
[ "MIT" ]
2
2016-03-09T00:47:34.000Z
2016-08-04T08:01:55.000Z
src/storage/storage.module.js
HumanBrainProject/angular-hbp-collaboratory
e905efe40ecb7f436a6d728942d36eca949e3d04
[ "MIT" ]
26
2016-03-16T08:43:30.000Z
2018-01-22T10:58:34.000Z
src/storage/storage.module.js
HumanBrainProject/angular-hbp-collaboratory
e905efe40ecb7f436a6d728942d36eca949e3d04
[ "MIT" ]
3
2016-05-25T09:31:46.000Z
2018-01-15T11:41:52.000Z
/** * @module clb-storage * @desc * The ``clb-storage`` module contains tools needed to access and work with the * HBP Document Service. It is targeted to integrate easily with the HBP * Collaboratory, even if the service is more generic. */ angular.module('clb-storage', [ 'uuid4', 'clb-error', 'clb-env', 'clb-rest', 'clb-identity' ]);
23.6
79
0.675141
2273d10f7aa351a7fde9c3f4e76f3c0b95489b9d
3,573
js
JavaScript
src/Afpa/OthelloGameBundle/Resources/public/js/functions.js
F2000-FR-AFPA-WebDev2016/othello-game
622ba8007e34558a45d0eb7ada169ee959fa6143
[ "MIT" ]
null
null
null
src/Afpa/OthelloGameBundle/Resources/public/js/functions.js
F2000-FR-AFPA-WebDev2016/othello-game
622ba8007e34558a45d0eb7ada169ee959fa6143
[ "MIT" ]
20
2016-05-25T13:05:39.000Z
2016-06-09T14:39:12.000Z
src/Afpa/OthelloGameBundle/Resources/public/js/functions.js
F2000-FR-AFPA-WebDev2016/othello-game
622ba8007e34558a45d0eb7ada169ee959fa6143
[ "MIT" ]
null
null
null
$(function () { var bAide = false; var aPossibilities = false; function getGameId() { return $('#board').data('id'); } function displayPopupEndGame() { url = START_URL + "/game/end"; idGame = getGameId(); if (idGame) { url += "/" + idGame; } $.ajax({ async: true, type: 'POST', url: url, error: function (errorData) { console.log(errorData); }, success: function (data) { console.log(data); $('#popup').html(data); $('#popup').show('scale', null, 500); } }); } function doAction(l, c) { url = START_URL + "/game/action"; idGame = getGameId(); if (idGame) { url += "/" + idGame; } $.ajax({ async: true, type: 'POST', url: url, data: { l: l, c: c }, error: function (errorData) { console.log(errorData); }, success: function (data) { console.log(data); aPossibilities = data.possibilities; if (data.status == 'success') { refresh(); } if (data.bEndGame) { console.log('end game'); displayPopupEndGame(); } } }); } function refresh() { url = START_URL + "/game/refresh"; idGame = getGameId(); if (idGame) { url += '/' + idGame; } $.ajax({ async: true, type: 'POST', url: url, success: function (view) { $('#game').html(view); // rafraichi la DIV if (bAide) { $('.helpBtn').attr('checked', 'checked'); for (var i = 0; i < aPossibilities.length; i++) { console.log(aPossibilities[i]); x = aPossibilities[i][0]; y = aPossibilities[i][1]; console.log($('#L' + x + 'C' + y)); $('#L' + x + 'C' + y).css('background-color', '#90cf7d'); } } } }); } function reset() { url = START_URL + "/game/reset"; idGame = getGameId(); if (idGame) { url += '/' + idGame; } $.ajax({ async: true, type: 'POST', url: url, success: function () { refresh(); } }); } $(document).on('click', '#resetBtn', function () { reset(); }); $(document).on('click', '#board td', function () { console.log($(this).data('l') + ' ' + $(this).data('c')); // test : est-ce que la case est vide if ($(this).html().indexOf("img") == -1) { // si oui, appel AJAX obtenir les x,y doAction($(this).data('l'), $(this).data('c')); } }); $(document).on('click', '.helpBtn', function () { bAide = !bAide; refresh(); }); doAction(-1, -1); // auto-refresh sur la partie en ligne : if (getGameId()) { setInterval(refresh, 2000); } });
26.664179
82
0.366359
22742326dc3d0ccfd48e98b06d3f2caa7dc0e6c6
1,985
js
JavaScript
lib/plugins/access/common/authremover.js
motin/envoy
afaeb138b2a1084096ab8e85a017578748f0ac0c
[ "Apache-2.0" ]
null
null
null
lib/plugins/access/common/authremover.js
motin/envoy
afaeb138b2a1084096ab8e85a017578748f0ac0c
[ "Apache-2.0" ]
null
null
null
lib/plugins/access/common/authremover.js
motin/envoy
afaeb138b2a1084096ab8e85a017578748f0ac0c
[ "Apache-2.0" ]
null
null
null
var stream = require('stream'); module.exports = function(myId, removeOwnerId) { // stream transformer that removes auth details from documents return function(onlyuser) { // whether we owe a comma to the next line out output var commaOwed = false; // output the response, adding the owed comma or not var formatResponse = function(str, addComma) { if (addComma) { return ',\n' + str; } return '\n' + str; } var stripAuth = function (obj, onlyuser) { var chunk = obj; var endsInComma = false; // If the line ends with a comma, this would break JSON parsing. if (obj.endsWith(',')) { chunk = obj.slice(0, -1); endsInComma = true; } try { var row = JSON.parse(chunk); } catch (e) { return obj+'\n'; // An incomplete fragment: pass along as is. } // if this line doesn't belong to the owner, filter it outs if (onlyuser && row.id && !myId(row.id, onlyuser)) { return ''; } // remove ownerid from the id if (row.id) { row.id = removeOwnerId(row.id); } if (row.key) { row.key = removeOwnerId(row.key); } if (row._id) { row._id = removeOwnerId(row._id); } if (row.doc && row.doc._id) { row.doc._id = removeOwnerId(row.doc._id); } // Repack, and add the trailling comma if required var retval = JSON.stringify(row); var str = formatResponse(retval, commaOwed); // recalculate whether we owe another comma next time commaOwed = endsInComma; return str; }; var tr = new stream.Transform({objectMode: true}); tr._transform = function (obj, encoding, done) { var data = stripAuth(obj, onlyuser); if (data) { this.push(data); } done(); }; return tr; }; }
26.466667
72
0.538539
22748b79387905ccf48a30b4f57c02cd8aa958b8
152
js
JavaScript
utils/Buffer.js
horacioh/Aven
977fe13047446d8b407eaabdabef7a1a88305e27
[ "Apache-2.0" ]
null
null
null
utils/Buffer.js
horacioh/Aven
977fe13047446d8b407eaabdabef7a1a88305e27
[ "Apache-2.0" ]
null
null
null
utils/Buffer.js
horacioh/Aven
977fe13047446d8b407eaabdabef7a1a88305e27
[ "Apache-2.0" ]
null
null
null
/* eslint-disable no-undef */ // This file just exists for people to avoid the lint warning and pretend Buffer is not a global export default Buffer;
25.333333
96
0.756579
227548745356d84a4c33853ca4e798cb2c4636fe
201
js
JavaScript
tasks/concat.js
MarkdownDocs/markdowndocs-theme-default
223fb2cff2741a75c7d0ba4a452479b25515e035
[ "MIT" ]
null
null
null
tasks/concat.js
MarkdownDocs/markdowndocs-theme-default
223fb2cff2741a75c7d0ba4a452479b25515e035
[ "MIT" ]
null
null
null
tasks/concat.js
MarkdownDocs/markdowndocs-theme-default
223fb2cff2741a75c7d0ba4a452479b25515e035
[ "MIT" ]
null
null
null
'use strict'; //clean config module.exports = { assets: { src: ['node_modules/jquery-highlight/jquery.highlight.js', 'pre/js/search.js', 'pre/js/nav.js'], dest: 'assets/js/main.js', }, };
20.1
100
0.631841
227569b08c5741862201e769902113e3b5915bf7
8,710
js
JavaScript
client/src/routes/orders/OrderCreateDialog.js
IgorSolovyoff/8base-app
cbf566f32bdf9bb4d9ecc40507b6dd1b3baeff65
[ "MIT" ]
null
null
null
client/src/routes/orders/OrderCreateDialog.js
IgorSolovyoff/8base-app
cbf566f32bdf9bb4d9ecc40507b6dd1b3baeff65
[ "MIT" ]
null
null
null
client/src/routes/orders/OrderCreateDialog.js
IgorSolovyoff/8base-app
cbf566f32bdf9bb4d9ecc40507b6dd1b3baeff65
[ "MIT" ]
null
null
null
import React from 'react'; import {Field, FieldArray, Form} from '@8base/forms'; import { Button, DateInputField, Dialog, Grid, Icon, InputField, ModalContext, SelectField } from '@8base/boost'; import {graphql, Query} from 'react-apollo'; import * as sharedGraphQL from 'shared/graphql'; import {TOAST_SUCCESS_MESSAGE} from 'shared/constants'; const ORDER_CREATE_DIALOG_ID = 'ORDER_CREATE_DIALOG_ID'; const parse = value => (isNaN(parseInt(value)) ? "" : parseInt(value)); class OrderCreateDialog extends React.Component { static contextType = ModalContext; onSubmit = async (data) => { await this.props.orderCreate({variables: {data}}); this.context.closeModal(ORDER_CREATE_DIALOG_ID); }; onClose = () => { this.context.closeModal(ORDER_CREATE_DIALOG_ID); }; renderFormContent = ({handleSubmit, invalid, submitting, pristine, form: {mutators: {push}}}) => ( <form onSubmit={handleSubmit}> <Dialog.Header title="New Order" onClose={this.onClose}/> <Dialog.Body scrollable> <Grid.Layout gap="sm" stretch> <Grid.Box> <Query query={sharedGraphQL.CLIENTS_LIST_QUERY}> { ({data, loading}) => { return ( <Field name="client.connect.id" label="Client" placeholder="Select a client" component={SelectField} loading={loading} options={loading ? [] : (data.clientsList.items || []).map(client => ({ value: client.id, label: `${client.firstName}` }))} stretch /> ) } } </Query> </Grid.Box> <Grid.Box> </Grid.Box> <Grid.Box> <Field name="address" label="Address" placeholder="Type address" component={InputField} stretch /> </Grid.Box> <Grid.Box> <Field name="deliveryDt" label="Delivery dt" placeholder="Type address" component={DateInputField} withTime stretch /> </Grid.Box> <Grid.Box> <Field name="comment" label="Comment" type="text" placeholder="Leave a comment" component={InputField} stretch /> </Grid.Box> <Grid.Box> <Field name="status" label="Status" placeholder="Select a status" component={ SelectField } options={ [ { label: 'Opened', value: 'Opened' }, { label: 'Paid', value: 'Paid' }, { label: 'Ready to delivery', value: 'ReadyToDelivery' }, { label: 'Delivering', value: 'Delivering' }, { label: 'Closed', value: 'Closed' }, { label: 'Cancelled', value: 'Cancelled' }, ] } stretch /> </Grid.Box> <FieldArray name="orderItems.create"> {({fields}) => fields.map((name, index) => ( <div key={name}> <Grid.Box style={{display: "flex", flexDirection: "row", justifyContent: "space-between", alignItems: "center", paddingTop: "10px"}}> <span style={{fontSize: "16px"}}> Product {index + 1} </span> <Button size="sm" squared onClick={() => fields.remove(index)}><Icon size="sm" name="Trashcan"/></Button> </Grid.Box> <Grid.Box> <Query query={sharedGraphQL.PRODUCTS_LIST_QUERY}> { ({data, loading}) => { return ( <Field name={`${name}.product.connect.id`} label="Name" placeholder="Select a product" component={SelectField} loading={loading} options={loading ? [] : (data.productsList.items || []).map(product => ({ value: product.id, label: `${product.name}` }))} stretch /> ) } } </Query> </Grid.Box> <Grid.Box> <Field type="number" name={`${name}.quantity`} label="Quantity" placeholder="Number" component={InputField} value={0} stretch required parse={parse} /> </Grid.Box> </div> )) } </FieldArray> <Button color={"primary"} type="button" onClick={() => push('orderItems.create', undefined)}>Add a Product</Button> </Grid.Layout> </Dialog.Body> <Dialog.Footer> <Button color="neutral" variant="outlined" disabled={submitting} onClick={this.onClose}>Cancel</Button> <Button color="primary" type="submit" loading={submitting}>Create Order</Button> </Dialog.Footer> </form> ); render() { return ( <Dialog id={ORDER_CREATE_DIALOG_ID} size="sm"> <Form type="CREATE" tableSchemaName="Order" onSubmit={this.onSubmit}> {this.renderFormContent} </Form> </Dialog> ); } } OrderCreateDialog = graphql(sharedGraphQL.ORDER_CREATE_MUTATION, { name: 'orderCreate', options: { refetchQueries: ['Orders'], context: { [TOAST_SUCCESS_MESSAGE]: 'Order successfully created' }, }, })(OrderCreateDialog); OrderCreateDialog.id = ORDER_CREATE_DIALOG_ID; export {OrderCreateDialog};
44.896907
169
0.331573
227744c62cf789edfd6097029e8a7eca416dd0a0
448
js
JavaScript
miniprogram/pages/plan-edit/components/edit-box/edit-box.js
cleves0315/kelp-and-broccoli
7ccfc3d5573104e44d4ae8bb71d50ae1478e9d7d
[ "MIT" ]
8
2021-12-28T15:28:01.000Z
2022-03-26T09:58:29.000Z
miniprogram/pages/plan-edit/components/edit-box/edit-box.js
cleves0315/kelp-and-broccoli
7ccfc3d5573104e44d4ae8bb71d50ae1478e9d7d
[ "MIT" ]
2
2022-01-13T16:03:29.000Z
2022-03-26T14:48:09.000Z
miniprogram/pages/plan-edit/components/edit-box/edit-box.js
cleves0315/kelp-and-broccoli
7ccfc3d5573104e44d4ae8bb71d50ae1478e9d7d
[ "MIT" ]
1
2022-03-20T13:17:04.000Z
2022-03-20T13:17:04.000Z
// pages/plan-edit/components/edit-box/edit-box.js Component({ /** * 组件的属性列表 */ properties: { placeholder: { type: String, value: '添加备注' }, value: { type: String, value: '' }, maxlength: { type: Number, value: -1 }, }, /** * 组件的初始数据 */ data: { }, /** * 组件的方法列表 */ methods: { handleBlur(e) { this.triggerEvent('blur', e.detail); } } })
12.108108
50
0.453125
2277d34bc407acd3c825f563e00d23471bed83c2
1,021
js
JavaScript
client/src/components/PopularityCategories/PopularityCategories.js
knsanchez0001/babynames
76da2c90cfb3a176df6d76016b32873d43ac1f77
[ "MIT" ]
null
null
null
client/src/components/PopularityCategories/PopularityCategories.js
knsanchez0001/babynames
76da2c90cfb3a176df6d76016b32873d43ac1f77
[ "MIT" ]
null
null
null
client/src/components/PopularityCategories/PopularityCategories.js
knsanchez0001/babynames
76da2c90cfb3a176df6d76016b32873d43ac1f77
[ "MIT" ]
null
null
null
import React from 'react'; import PopularityCategory from './PopularityCategory'; const PopularityCategories = () => { return ( <section> <div className='wrapper icons-wrapper'> <h3>View Popularity of Names By:</h3> <div className='icons-div'> <PopularityCategory link='/rankchange' name={'Change in popularity'} pic={'https://www.ssa.gov/OACT/babynames/assets/images/popularity.svg'} /> <PopularityCategory link='/top5names' name={'Top 5 names'} pic={'https://www.ssa.gov/OACT/babynames/assets/images/top5.svg'} /> <PopularityCategory link='/timespan' name={'Time span'} pic={'https://www.ssa.gov/OACT/babynames/assets/images/decade.svg'} /> <PopularityCategory link='/state' name={'State'} pic={'https://www.ssa.gov/OACT/babynames/assets/images/state.svg'} /> <PopularityCategory link='/territories' name={'U.S. territories'} pic={'https://www.ssa.gov/OACT/babynames/assets/images/territory.svg'} /> </div> </div> </section> ); }; export default PopularityCategories;
46.409091
148
0.698335
2277eaca04fad9dca2a320035556431de4c57608
9,426
js
JavaScript
test/dates-and-times.js
GetFeedback/rethinkdb-js
a757a044fe303c907d64cdd4787f0244b7231d8f
[ "MIT" ]
27
2018-09-24T15:14:43.000Z
2021-04-25T14:38:30.000Z
test/dates-and-times.js
GetFeedback/rethinkdb-js
a757a044fe303c907d64cdd4787f0244b7231d8f
[ "MIT" ]
5
2018-05-23T14:54:45.000Z
2018-07-12T17:42:27.000Z
test/dates-and-times.js
GetFeedback/rethinkdb-js
a757a044fe303c907d64cdd4787f0244b7231d8f
[ "MIT" ]
3
2020-03-06T20:09:30.000Z
2021-09-14T23:03:33.000Z
const path = require('path') const config = require('./config.js') const rethinkdbdash = require(path.join(__dirname, '/../lib')) const assert = require('assert') const {before, after, describe, it} = require('mocha') describe('dates and times', () => { let r before(async () => { r = await rethinkdbdash(config) }) after(async () => { await r.getPoolMaster().drain() }) it('`r.now` should return a date', async () => { let result = await r.now().run() assert(result instanceof Date) result = await r.expr({a: r.now()}).run() assert(result.a instanceof Date) result = await r.expr([r.now()]).run() assert(result[0] instanceof Date) result = await r.expr([{}, {a: r.now()}]).run() assert(result[1].a instanceof Date) result = await r.expr({b: [{}, {a: r.now()}]}).run() assert(result.b[1].a instanceof Date) }) it('`now` is not defined after a term', async () => { try { await r.expr(1).now('foo').run() assert.fail('should throw') } catch (e) { assert.equal(e.message, '`now` is not defined after:\nr.expr(1)') } }) it('`r.time` should return a date -- with date and time', async () => { let result = await r.time(1986, 11, 3, 12, 0, 0, 'Z').run() assert.equal(result instanceof Date, true) result = await r.time(1986, 11, 3, 12, 20, 0, 'Z').minutes().run() assert.equal(result, 20) }) it('`r.time` should work with r.args', async () => { const result = await r.time(r.args([1986, 11, 3, 12, 0, 0, 'Z'])).run() assert.equal(result instanceof Date, true) }) it('`r.time` should return a date -- just with a date', async () => { let result = await r.time(1986, 11, 3, 'Z').run() assert.equal(result instanceof Date, true) result = await r.time(1986, 11, 3, 0, 0, 0, 'Z').run() assert.equal(result instanceof Date, true) }) it('`r.time` should throw if no argument has been given', async () => { try { await r.time().run() assert.fail('should throw') } catch (e) { assert.equal(e.message, '`r.time` called with 0 argument.\n`r.time` takes 4 or 7 arguments') } }) it('`r.time` should throw if no 5 arguments', async () => { try { await r.time(1, 1, 1, 1, 1).run() assert.fail('should throw') } catch (e) { assert.equal(e.message, '`r.time` called with 5 arguments.\n`r.time` takes 4 or 7 arguments') } }) it('`time` is not defined after a term', async () => { try { await r.expr(1).time(1, 2, 3, 'Z').run() assert.fail('should throw') } catch (e) { assert.equal(e.message, '`time` is not defined after:\nr.expr(1)') } }) it('`epochTime` should work', async () => { const now = new Date() const result = await r.epochTime(now.getTime() / 1000).run() assert.deepEqual(now, result) }) it('`r.epochTime` should throw if no argument has been given', async () => { try { await r.epochTime().run() assert.fail('should throw') } catch (e) { assert.equal(e.message, '`r.epochTime` takes 1 argument, 0 provided.') } }) it('`epochTime` is not defined after a term', async () => { try { await r.expr(1).epochTime(Date.now()).run() assert.fail('should throw') } catch (e) { assert.equal(e.message, '`epochTime` is not defined after:\nr.expr(1)') } }) it('`ISO8601` should work', async () => { const result = await r.ISO8601('1986-11-03T08:30:00-08:00').run() assert(result, new Date(1986, 11, 3, 8, 30, 0, -8)) }) it('`ISO8601` should work with a timezone', async () => { const result = await r.ISO8601('1986-11-03T08:30:00', {defaultTimezone: '-08:00'}).run() assert(result, new Date(1986, 11, 3, 8, 30, 0, -8)) }) it('`r.ISO8601` should throw if no argument has been given', async () => { try { await r.ISO8601().run() assert.fail('should throw') } catch (e) { assert.equal(e.message, '`r.ISO8601` takes at least 1 argument, 0 provided.') } }) it('`r.ISO8601` should throw if too many arguments', async () => { try { await r.ISO8601(1, 1, 1).run() assert.fail('should throw') } catch (e) { assert.equal(e.message, '`r.ISO8601` takes at most 2 arguments, 3 provided.') } }) it('`ISO8601` is not defined after a term', async () => { try { await r.expr(1).ISO8601('validISOstring').run() assert.fail('should throw') } catch (e) { assert.equal(e.message, '`ISO8601` is not defined after:\nr.expr(1)') } }) it('`inTimezone` should work', async () => { const result = await r.now().inTimezone('-08:00').hours().do(function (h) { return r.branch( h.eq(0), r.expr(23).eq(r.now().inTimezone('-09:00').hours()), h.eq(r.now().inTimezone('-09:00').hours().add(1)) ) }).run() assert.equal(result, true) }) it('`inTimezone` should throw if no argument has been given', async () => { try { await r.now().inTimezone().run() assert.fail('should throw') } catch (e) { assert.equal(e.message, '`inTimezone` takes 1 argument, 0 provided after:\nr.now()') } }) it('`timezone` should work', async () => { const result = await r.ISO8601('1986-11-03T08:30:00-08:00').timezone().run() assert.equal(result, '-08:00') }) it('`during` should work', async () => { let result = await r.now().during(r.time(2013, 12, 1, 'Z'), r.now().add(1000)).run() assert.equal(result, true) result = await r.now().during(r.time(2013, 12, 1, 'Z'), r.now(), { leftBound: 'closed', rightBound: 'closed' }).run() assert.equal(result, true) result = await r.now().during(r.time(2013, 12, 1, 'Z'), r.now(), { leftBound: 'closed', rightBound: 'open' }).run() assert.equal(result, false) }) it('`during` should throw if no argument has been given', async () => { try { await r.now().during().run() assert.fail('should throw') } catch (e) { assert.equal(e.message, '`during` takes at least 2 arguments, 0 provided after:\nr.now()') } }) it('`during` should throw if just one argument has been given', async () => { try { await r.now().during(1).run() assert.fail('should throw') } catch (e) { assert.equal(e.message, '`during` takes at least 2 arguments, 1 provided after:\nr.now()') } }) it('`during` should throw if too many arguments', async () => { try { await r.now().during(1, 1, 1, 1, 1).run() assert.fail('should throw') } catch (e) { assert.equal(e.message, '`during` takes at most 3 arguments, 5 provided after:\nr.now()') } }) it('`date` should work', async () => { let result = await r.now().date().hours().run() assert.equal(result, 0) result = await r.now().date().minutes().run() assert.equal(result, 0) result = await r.now().date().seconds().run() assert.equal(result, 0) }) it('`timeOfDay` should work', async () => { const result = await r.now().timeOfDay().run() assert(result >= 0) }) it('`year` should work', async () => { const result = await r.now().inTimezone(new Date().toString().match(' GMT([^ ]*)')[1]).year().run() assert.equal(result, new Date().getFullYear()) }) it('`month` should work', async () => { const result = await r.now().inTimezone(new Date().toString().match(' GMT([^ ]*)')[1]).month().run() assert.equal(result, new Date().getMonth() + 1) }) it('`day` should work', async () => { const result = await r.now().inTimezone(new Date().toString().match(' GMT([^ ]*)')[1]).day().run() assert.equal(result, new Date().getDate()) }) it('`dayOfYear` should work', async () => { const result = await r.now().inTimezone(new Date().toString().match(' GMT([^ ]*)')[1]).dayOfYear().run() assert(result > (new Date()).getMonth() * 28 + (new Date()).getDate() - 1) }) it('`dayOfWeek` should work', async () => { let result = await r.now().inTimezone(new Date().toString().match(' GMT([^ ]*)')[1]).dayOfWeek().run() if (result === 7) result = 0 assert.equal(result, new Date().getDay()) }) it('`toISO8601` should work', async () => { const result = await r.now().toISO8601().run() assert.equal(typeof result, 'string') }) it('`toEpochTime` should work', async () => { const result = await r.now().toEpochTime().run() assert.equal(typeof result, 'number') }) it('Constant terms should work', async () => { let result = await r.monday.run() assert.equal(result, 1) result = await r.expr([r.monday, r.tuesday, r.wednesday, r.thursday, r.friday, r.saturday, r.sunday, r.january, r.february, r.march, r.april, r.may, r.june, r.july, r.august, r.september, r.october, r.november, r.december]).run() assert.deepEqual(result, [1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]) }) it('`epochTime` should work', async () => { const now = new Date() const result = await r.epochTime(now.getTime() / 1000).run({timeFormat: 'raw'}) assert.equal(result.$reql_type$, 'TIME') }) it('`ISO8601` run parameter should work', async () => { const result = await r.time(2018, 5, 2, 13, 0, 0, '-03:00').run({timeFormat: 'ISO8601'}) assert.equal(typeof result, 'string') assert.equal(result, '2018-05-02T13:00:00.000-03:00') }) })
32.061224
233
0.5784
2277f1f5a4952fbaa63994b9eba596d39078ebe9
302
js
JavaScript
dist/es/hooks/useIsomorphicLayoutEffect.js
galexandrade/react-menu
1c2166ea7ccca1f14d70a91d301b504e80e6111a
[ "MIT" ]
1
2022-03-02T12:45:29.000Z
2022-03-02T12:45:29.000Z
dist/es/hooks/useIsomorphicLayoutEffect.js
galexandrade/react-menu
1c2166ea7ccca1f14d70a91d301b504e80e6111a
[ "MIT" ]
null
null
null
dist/es/hooks/useIsomorphicLayoutEffect.js
galexandrade/react-menu
1c2166ea7ccca1f14d70a91d301b504e80e6111a
[ "MIT" ]
null
null
null
import { useLayoutEffect, useEffect } from 'react'; var useIsomorphicLayoutEffect = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined' ? useLayoutEffect : useEffect; export { useIsomorphicLayoutEffect as useLayoutEffect };
50.333333
190
0.764901
227923e83856ce4e9e221dc528243aaf5bf77eff
2,405
js
JavaScript
test/util.spec.js
jovey-zheng/aliyun-push
0dbcc9ac026b2b66c275065f2578c1a07aa6be34
[ "MIT" ]
2
2017-05-11T02:03:18.000Z
2018-10-09T07:07:30.000Z
test/util.spec.js
jovey-zheng/aliyun-push
0dbcc9ac026b2b66c275065f2578c1a07aa6be34
[ "MIT" ]
null
null
null
test/util.spec.js
jovey-zheng/aliyun-push
0dbcc9ac026b2b66c275065f2578c1a07aa6be34
[ "MIT" ]
1
2021-06-01T09:35:20.000Z
2021-06-01T09:35:20.000Z
'use strict'; const assert = require('assert'); const urlencode = require('urlencode'); const crypto = require('crypto'); const qs = require('querystring'); const util = require('../util'); const md5 = require('md5'); const _ = require('lodash'); const moment = require('moment'); describe ('util.js', () => { describe ('isEmail:', () => { it ('should return true when insert a right email `test@shanchain.com`', () => { assert.equal(util.isEmail('test@shanchain.com'), true); }) it ('should return false when insert a wrong string `testtest`', () => { assert.equal(util.isEmail('testtest'), false); }) }) describe ('isPhone:', () => { it ('should return true when insert a right number `13123123123`', () => { assert.equal(util.isPhone('13123123123'), true); }) it ('should return true when insert a wrong number `123123`', () => { assert.equal(util.isPhone('123123'), false); }) }) describe ('nonce:', () => { it ('should return return an value when call', () => { assert.ok(util.nonce()); }) }) describe ('reSort:', () => { it ('should return return an value when call', () => { const secret = 'test'; const params = { name: 'test', form: 'test' }; const opts = { age: 10, sexy: 'male' }; assert.ok(util.reSort(secret, params, opts)); }) }) describe ('signature:', () => { it ('should return equal value when insert the same params', () => { const opt = { name: 'shanchain', version: '1.0' }; const key = 'test'; const sts = `POST&${urlencode('/')}&${urlencode(qs.stringify(opt))}`; const signature = crypto.createHmac('sha1', key).update(sts).digest().toString('base64') assert.equal(util.signature(opt, key), signature); }) }) describe ('push:', () => { it ('should return 200 value when insert the right params', (done) => { util.push({ host: 'https://www.baidu.com', method: 'GET' }, (err, res, body) => { if (res.statusCode === 200) { done(); } }) }) it ('should return err when insert the wrong params', (done) => { util.push({ host: 'test.com', method: 'GET' }, (err, res, body) => { if (err) { done(); } }) }) }) })
25.860215
94
0.530146
227950d87228e4635a186b0359fa87de9f35d9a5
12,585
js
JavaScript
test/server/cards/14.1-RaW/EducatedHeimin.spec.js
kepac122/ringteki
edc980e64c911b169ba532086175896934579641
[ "MIT" ]
15
2020-02-15T23:31:29.000Z
2021-02-17T07:19:26.000Z
test/server/cards/14.1-RaW/EducatedHeimin.spec.js
kepac122/ringteki
edc980e64c911b169ba532086175896934579641
[ "MIT" ]
890
2020-01-31T23:22:08.000Z
2021-07-30T23:46:20.000Z
test/server/cards/14.1-RaW/EducatedHeimin.spec.js
kepac122/ringteki
edc980e64c911b169ba532086175896934579641
[ "MIT" ]
20
2020-01-29T03:25:41.000Z
2022-03-10T17:50:48.000Z
describe('Educated Heimin', function() { integration(function() { beforeEach(function() { this.setupTest({ phase: 'conflict', player1: { fate: 20, hand: ['educated-heimin'], dynastyDiscard: ['akodo-zentaro', 'matsu-berserker', 'doji-whisperer', 'moto-chagatai', 'samurai-of-integrity', 'akodo-toturi'], inPlay: ['doji-kuwanan', 'kakita-yoshi'], provinces: ['manicured-garden', 'city-of-the-rich-frog', 'kakudaira'] }, player2: { inPlay: ['naive-student'], dynastyDiscard: ['bustling-academy'], provinces: ['fertile-fields'], hand: ['sabotage'] } }); this.matsuBerseker = this.player1.findCardByName('matsu-berserker'); this.whisperer = this.player1.findCardByName('doji-whisperer'); this.zentaro = this.player1.findCardByName('akodo-zentaro'); this.chagatai = this.player1.findCardByName('moto-chagatai'); this.samuraiOfIntegrity = this.player1.findCardByName('samurai-of-integrity'); this.akodoToturi = this.player1.findCardByName('akodo-toturi'); this.kuwanan = this.player1.findCardByName('doji-kuwanan'); this.heimin = this.player1.findCardByName('educated-heimin'); this.academy = this.player2.findCardByName('bustling-academy'); this.player2.findCardByName('sabotage'); this.garden = this.player1.findCardByName('manicured-garden'); this.frog = this.player1.findCardByName('city-of-the-rich-frog'); this.eminient = this.player1.findCardByName('kakudaira'); this.fields = this.player2.findCardByName('fertile-fields'); this.player2.placeCardInProvince(this.academy, 'province 1'); }); it('should be able to played on a province you control', function() { this.player1.clickCard(this.heimin); expect(this.player1).toBeAbleToSelect(this.garden); expect(this.player1).toBeAbleToSelect(this.eminient); expect(this.player1).toBeAbleToSelect(this.frog); expect(this.player1).not.toBeAbleToSelect(this.fields); this.player1.clickCard(this.garden); expect(this.heimin.parent).toBe(this.garden); }); it('should let you pick cards to refill (province is facedown) and work with refill faceup effects', function() { this.player1.placeCardInProvince(this.kuwanan, this.garden.location); this.player1.playAttachment(this.heimin, this.garden); this.player1.reduceDeckToNumber('dynasty deck', 0); this.player1.moveCard(this.matsuBerseker, 'dynasty deck'); this.player1.moveCard(this.whisperer, 'dynasty deck'); this.player1.moveCard(this.zentaro, 'dynasty deck'); this.player1.moveCard(this.chagatai, 'dynasty deck'); this.player1.moveCard(this.samuraiOfIntegrity, 'dynasty deck'); this.player1.moveCard(this.akodoToturi, 'dynasty deck'); this.player2.clickCard(this.academy); let cards = this.player1.player.getDynastyCardsInProvince(this.garden.location); cards.forEach(card => { if(card !== this.kuwanan) { this.player1.moveCard(card, 'dynasty discard pile'); } }); expect(this.player1.player.getDynastyCardsInProvince(this.garden.location).length).toBe(1); this.player2.clickCard(this.kuwanan); expect(this.player1).toHavePrompt('Choose a card to refill the province with'); expect(this.player1).toHavePromptButton('Akodo Toturi'); expect(this.player1).toHavePromptButton('Samurai of Integrity'); expect(this.player1).toHavePromptButton('Moto Chagatai'); expect(this.player1).toHavePromptButton('Akodo Zentarō'); this.player1.clickPrompt('Moto Chagatai'); expect(this.chagatai.location).toBe(this.garden.location); expect(this.chagatai.facedown).toBe(false); expect(this.getChatLogs(1)).toContain('player1 chooses a card to put into a facedown province and discards Akodo Toturi, Samurai of Integrity and Akodo Zentarō from the constant effect of Educated Heimin'); expect(this.akodoToturi.location).toBe('dynasty discard pile'); expect(this.samuraiOfIntegrity.location).toBe('dynasty discard pile'); expect(this.zentaro.location).toBe('dynasty discard pile'); expect(this.player1).toHavePrompt('Action Window'); }); it('should let you pick cards to refill (province is faceup) and work with refill faceup effects', function() { this.player1.placeCardInProvince(this.kuwanan, this.eminient.location); this.player1.playAttachment(this.heimin, this.eminient); this.player1.reduceDeckToNumber('dynasty deck', 0); this.player1.moveCard(this.matsuBerseker, 'dynasty deck'); this.player1.moveCard(this.whisperer, 'dynasty deck'); this.player1.moveCard(this.zentaro, 'dynasty deck'); this.player1.moveCard(this.chagatai, 'dynasty deck'); this.player1.moveCard(this.samuraiOfIntegrity, 'dynasty deck'); this.player1.moveCard(this.akodoToturi, 'dynasty deck'); this.player2.clickCard(this.academy); let cards = this.player1.player.getDynastyCardsInProvince(this.eminient.location); cards.forEach(card => { if(card !== this.kuwanan) { this.player1.moveCard(card, 'dynasty discard pile'); } }); this.player2.clickCard(this.kuwanan); expect(this.player1).toHavePrompt('Choose a card to refill the province with'); expect(this.player1).toHavePromptButton('Akodo Toturi'); expect(this.player1).toHavePromptButton('Samurai of Integrity'); expect(this.player1).not.toHavePromptButton('Moto Chagatai'); expect(this.player1).not.toHavePromptButton('Akodo Zentarō'); this.player1.clickPrompt('Akodo Toturi'); expect(this.akodoToturi.location).toBe(this.eminient.location); expect(this.akodoToturi.facedown).toBe(false); expect(this.getChatLogs(1)).toContain('player1 chooses a card to put into Kakudaira and discards Samurai of Integrity from the constant effect of Educated Heimin'); expect(this.samuraiOfIntegrity.location).toBe('dynasty discard pile'); }); it('should let you pick cards to refill (rich frog)', function() { this.player1.placeCardInProvince(this.kuwanan, this.frog.location); this.player1.playAttachment(this.heimin, this.frog); this.player1.reduceDeckToNumber('dynasty deck', 0); this.player1.moveCard(this.matsuBerseker, 'dynasty deck'); this.player1.moveCard(this.whisperer, 'dynasty deck'); this.player1.moveCard(this.zentaro, 'dynasty deck'); this.player1.moveCard(this.chagatai, 'dynasty deck'); this.player1.moveCard(this.samuraiOfIntegrity, 'dynasty deck'); this.player1.moveCard(this.akodoToturi, 'dynasty deck'); this.player2.clickCard(this.academy); let cards = this.player1.player.getDynastyCardsInProvince(this.frog.location); cards.forEach(card => { if(card !== this.kuwanan) { this.player1.moveCard(card, 'dynasty discard pile'); } }); this.player2.clickCard(this.kuwanan); expect(this.player1).toHavePrompt('Choose a card to refill the province with'); expect(this.player1).toHavePromptButton('Akodo Toturi'); expect(this.player1).toHavePromptButton('Samurai of Integrity'); expect(this.player1).not.toHavePromptButton('Moto Chagatai'); expect(this.player1).not.toHavePromptButton('Akodo Zentarō'); this.player1.clickPrompt('Akodo Toturi'); expect(this.akodoToturi.location).toBe(this.frog.location); expect(this.getChatLogs(1)).toContain('player1 chooses a card to put into City of the Rich Frog and discards Samurai of Integrity from the constant effect of Educated Heimin'); expect(this.samuraiOfIntegrity.location).toBe('dynasty discard pile'); expect(this.player1).toHavePrompt('Choose a card to refill the province with'); expect(this.player1).toHavePromptButton('Moto Chagatai'); expect(this.player1).toHavePromptButton('Akodo Zentarō'); this.player1.clickPrompt('Moto Chagatai'); expect(this.chagatai.location).toBe(this.frog.location); expect(this.getChatLogs(1)).toContain('player1 chooses a card to put into City of the Rich Frog and discards Akodo Zentarō from the constant effect of Educated Heimin'); expect(this.zentaro.location).toBe('dynasty discard pile'); expect(this.player1).toHavePrompt('Choose a card to refill the province with'); expect(this.player1).toHavePromptButton('Doji Whisperer'); expect(this.player1).toHavePromptButton('Matsu Berserker'); this.player1.clickPrompt('Matsu Berserker'); expect(this.matsuBerseker.location).toBe(this.frog.location); expect(this.getChatLogs(1)).toContain('player1 chooses a card to put into City of the Rich Frog and discards Doji Whisperer from the constant effect of Educated Heimin'); expect(this.whisperer.location).toBe('dynasty discard pile'); expect(this.player1).toHavePrompt('Action Window'); expect(this.akodoToturi.facedown).toBe(false); expect(this.chagatai.facedown).toBe(false); expect(this.matsuBerseker.facedown).toBe(false); }); it('should let you pick cards to refill (province is facedown) and work without refill faceup effects', function() { this.player1.placeCardInProvince(this.kuwanan, this.garden.location); this.player1.playAttachment(this.heimin, this.garden); this.player1.reduceDeckToNumber('dynasty deck', 0); this.player1.moveCard(this.matsuBerseker, 'dynasty deck'); this.player1.moveCard(this.whisperer, 'dynasty deck'); this.player1.moveCard(this.zentaro, 'dynasty deck'); this.player1.moveCard(this.chagatai, 'dynasty deck'); this.player1.moveCard(this.samuraiOfIntegrity, 'dynasty deck'); this.player1.moveCard(this.akodoToturi, 'dynasty deck'); this.noMoreActions(); this.initiateConflict({ attackers: ['kakita-yoshi'], defenders: [], type: 'military' }); this.player2.clickCard('sabotage'); let cards = this.player1.player.getDynastyCardsInProvince(this.garden.location); cards.forEach(card => { if(card !== this.kuwanan) { this.player1.moveCard(card, 'dynasty discard pile'); } }); this.player2.clickCard(this.kuwanan); expect(this.player1).toHavePrompt('Choose a card to refill the province with'); expect(this.player1).toHavePromptButton('Akodo Toturi'); expect(this.player1).toHavePromptButton('Samurai of Integrity'); expect(this.player1).toHavePromptButton('Moto Chagatai'); expect(this.player1).toHavePromptButton('Akodo Zentarō'); this.player1.clickPrompt('Moto Chagatai'); expect(this.chagatai.location).toBe(this.garden.location); expect(this.chagatai.facedown).toBe(true); expect(this.getChatLogs(10)).toContain('player1 chooses a card to put into a facedown province and discards Akodo Toturi, Samurai of Integrity and Akodo Zentarō from the constant effect of Educated Heimin'); expect(this.akodoToturi.location).toBe('dynasty discard pile'); expect(this.samuraiOfIntegrity.location).toBe('dynasty discard pile'); expect(this.zentaro.location).toBe('dynasty discard pile'); expect(this.player1).toHavePrompt('Conflict Action Window'); }); }); });
56.689189
219
0.635677
22798418f79e28eca45bd44fc3e694d24be55578
958
js
JavaScript
db/seeders/3-DemoUser.js
thesilentelegy/sage
1acb667296abe6cd3de733fa136c802449ebf7bd
[ "MIT" ]
null
null
null
db/seeders/3-DemoUser.js
thesilentelegy/sage
1acb667296abe6cd3de733fa136c802449ebf7bd
[ "MIT" ]
null
null
null
db/seeders/3-DemoUser.js
thesilentelegy/sage
1acb667296abe6cd3de733fa136c802449ebf7bd
[ "MIT" ]
null
null
null
'use strict'; module.exports = { up: (queryInterface, Sequelize) => { return queryInterface.bulkInsert('Users', [ { username: 'user1', password: '1234', sectionId: 1, role: 'voter', active: 1 }, { username: 'user2', password: '5678', sectionId: 10, role: 'voter', active: 0 }, { username: 'admin1', password: '1234', role: 'admin', active: 1 }, { username: 'admin2', password: '5678', role: 'admin', active: 0 }, { username: 'viewer1', password: '1234', role: 'viewer', active: 1 }, { username: 'viewer2', password: '5678', role: 'viewer', active: 0 } ]); }, down: (queryInterface, Sequelize) => { return queryInterface.bulkDelete('Users', null, {}); } };
18.784314
56
0.441545
2279f2f1dbff37a2d3603793953ff4d2fd5d0d20
16,730
js
JavaScript
app/js/admin.js
neureal/neureal-dapp-join
dabd2da4889994a5023e63fdaf19fbf10516bc52
[ "MIT" ]
null
null
null
app/js/admin.js
neureal/neureal-dapp-join
dabd2da4889994a5023e63fdaf19fbf10516bc52
[ "MIT" ]
null
null
null
app/js/admin.js
neureal/neureal-dapp-join
dabd2da4889994a5023e63fdaf19fbf10516bc52
[ "MIT" ]
null
null
null
/* globals web3 */ import $ from 'jquery'; import EmbarkJS from 'Embark/EmbarkJS'; import NeurealRewards from 'Embark/contracts/NeurealRewards'; // import EmbarkJS from './embarkArtifacts/embarkjs'; // import Token from './embarkArtifacts/contracts/Token'; const ipfsApiProvider = ipfsOptionsURL('https://ipfs.neureal.io:8443'); const ipfsLiveGateway = 'https://cloudflare-ipfs.com'; const netInfo = { // TODO limit this to main network on deploy // 1: { desc: 'Main Ethereum Network', explorer: 'https://etherscan.io', opensea: 'https://opensea.io', DAI: '0x89d24A6b4CcB1B6fAA2625fE562bDD9a23260359' }, // 3: { desc: 'Ropsten Test Network', explorer: 'https://ropsten.etherscan.io', opensea: '' }, // 4: { desc: 'Rinkeby Test Network', explorer: 'https://rinkeby.etherscan.io', opensea: 'https://rinkeby.opensea.io' }, 42: { desc: 'Kovan Test Network', explorer: 'https://kovan.etherscan.io', opensea: '', DAI: '0xC4375B7De8af5a38a93548eb8453a498222C4fF2' }, // 1337: { desc: 'Local Network', explorer: '', opensea: '' } }; function ipfsOptionsURL (urltxt) { const url = new URL(urltxt); return { host: url.hostname, port: url.port, protocol: url.protocol.slice(0, -1), getUrl: `${url.protocol}//${url.hostname}/ipfs/` }; } function error (err) { $('#div_error').removeClass('w3-hide'); $('#div_error #text_description').text(err); } // const uint256MAX = web3.utils.toBN('0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF'); // function inputToUint256 (inv) { // const invt = +inv; // if (isNaN(invt) || invt % 1 !== 0) inv = web3.utils.utf8ToHex(inv); // inv = web3.utils.toBN(inv).abs(); // if (inv.gt(uint256MAX)) throw new Error('web3 uint256 overflow!'); // return inv; // } window.addEventListener('load', async () => { try { if (!window.ethereum && !window.web3) throw new Error('Non-Ethereum browser detected.'); if (window.ethereum) await EmbarkJS.enableEthereum(); // if (window.ethereum) await window.ethereum.enable(); EmbarkJS.onReady(async (err) => { try { // ** Check blockchain if (err) throw new Error(err); console.log('Blockchain OK'); // // ** Check communication // await EmbarkJS.Messages.Providers.whisper.getWhisperVersion(); // console.log('whisper OK'); // ** Check storage const result = await EmbarkJS.Storage.isAvailable(); if (!result) throw new Error('Storage not available.'); console.log('Storage OK'); // console.log('web3.version: ', web3.version); // ** Main var curContract = NeurealRewards; const netid = await web3.eth.net.getId(); if (netInfo[netid] === undefined) throw new Error(`Incompatable network for this dapp. Please choose ${netInfo[Object.keys(netInfo)[0]].desc}.`); // Setup objects const urlParams = new URLSearchParams(window.location.search); const ipfsUrl = urlParams.get('ipfs'); const ipfsApiPvdrBkup = (ipfsUrl === null) ? null : ipfsOptionsURL(ipfsUrl); if (ipfsApiPvdrBkup !== null) { EmbarkJS.Storage.setProvider('ipfs', ipfsApiPvdrBkup); const result = await EmbarkJS.Storage.isAvailable(); if (!result) throw new Error('Backup storage not available.'); console.log('Backup Storage OK'); EmbarkJS.Storage.setProvider('ipfs', ipfsApiProvider); } const contractAddr = urlParams.get('contract'); if (web3.utils.isAddress(contractAddr)) { curContract = new EmbarkJS.Blockchain.Contract({ abi: NeurealRewards.options.jsonInterface, address: contractAddr, // from: contract.deploymentAccount || web3.eth.defaultAccount, // gas: constants.tests.gasLimit, web3: web3 }); } else { // Deploy new contract $('#div_deploy').removeClass('w3-hide'); $('#div_deploy #text_network').text(netInfo[netid].desc); $('#div_deploy #button_deploy').click(async function () { try { $('#div_error').addClass('w3-hide'); $('#modal_progress').addClass('w3-show'); // const minter = $('#div_deploy #input_address').val(); if (!web3.utils.isAddress(minter)) throw new Error('Address is not a correctly formated Ethereum address.'); // const inputname = $('#div_deploy #input_name').val(); if (inputname.length > 32) throw new Error('Contract name too long.'); // const inputsymbol = $('#div_deploy #input_symbol').val(); if (inputsymbol.length > 8) throw new Error('Contract symbol too long.'); // const inputcap = web3.utils.toBN($('#div_deploy #input_cap').val()).toString(); // curContract = await NeurealRewards.deploy({ arguments: [minter, inputcap, inputname, inputsymbol], data: NeurealRewards.options.data }).send(); curContract = await NeurealRewards.deploy({ data: NeurealRewards.options.data }).send(); window.location.search = 'contract=' + encodeURI(curContract.options.address); } catch (err) { error(err); } $('#modal_progress').removeClass('w3-show'); }); return; } $('#div_withdraw #hdr').click(async function () { $('#div_withdraw #span_content').toggleClass('w3-hide'); }); $('#div_mint #hdr').click(async function () { $('#div_mint #span_content').toggleClass('w3-hide'); }); $('#div_list_id #hdr').click(async function () { $('#div_list_id #span_content').toggleClass('w3-hide'); }); $('#div_list_owner #hdr').click(async function () { $('#div_list_owner #span_content').toggleClass('w3-hide'); }); $('#div_list #hdr').click(async function () { $('#div_list #span_content').toggleClass('w3-hide'); }); // Contract Info const name = await curContract.methods.name().call(); $('#div_info #text_name').text(name); const symbol = await curContract.methods.symbol().call(); $('#div_info #text_symbol').text(symbol); $('#div_info #text_network').text(netInfo[netid].desc); $('#div_info #text_address').text(curContract.options.address); $('#div_info #text_details').html(`&rarr; <a href="${netInfo[netid].explorer}/address/${curContract.options.address}" target="_blank">View&nbsp;Contract&nbsp;Details</a>`); const accounts = await web3.eth.getAccounts(); if (accounts.length < 1) throw new Error('No Ethereum accounts available.'); const minter = await curContract.methods.isMinter(accounts[0]).call(); const owner = await curContract.methods.isOwner().call(); $('#div_info #text_account').text(accounts[0]); $('#div_info #text_minter').text(minter); $('#div_info #text_owner').text(owner); const curId = await curContract.methods.tokenId().call(); const cap = await curContract.methods.MAX_SUPPLY().call(); $('#div_info #text_curId').text(curId); $('#div_info #text_cap').text(cap); const balDAI = await curContract.methods.getTokenBalance(netInfo[netid].DAI).call(); const balETH = await web3.eth.getBalance(curContract.options.address); $('#div_info #text_balDAI').text(web3.utils.fromWei(balDAI)); $('#div_info #text_balETH').text(web3.utils.fromWei(balETH)); // Withdraw DAI $('#div_withdraw #button_DAI').click(async function () { try { $('#div_error').addClass('w3-hide'); $('#modal_progress').addClass('w3-show'); $('#div_withdraw #span_content #d').remove(); const receipt = await curContract.methods.withdrawToken(netInfo[netid].DAI).send(); // TODO Embark is not returning from the previous await because its not detecting the transaction finishing // const amount = receipt.events['TokenWithdraw'].returnValues.amount; const balDAI = await curContract.methods.getTokenBalance(netInfo[netid].DAI).call(); $('#div_info #text_balDAI').text(web3.utils.fromWei(balDAI)); // $('#div_withdraw #span_content').append(`<p id="d"><b>SUCCESS</b> | <b>${web3.utils.fromWei(amount)}</b> DAI withdrawn</p>`); } catch (err) { error(err); } $('#modal_progress').removeClass('w3-show'); }); // Withdraw ETH $('#div_withdraw #button_ETH').click(async function () { try { $('#div_error').addClass('w3-hide'); $('#modal_progress').addClass('w3-show'); $('#div_withdraw #span_content #d').remove(); // TODO I have not tested if any of this works const receipt = await curContract.methods.withdrawEther().send(); const amount = receipt.events['EtherWithdraw'].returnValues.amount; const balETH = await web3.eth.getBalance(curContract.options.address); $('#div_info #text_balETH').text(web3.utils.fromWei(balETH)); $('#div_withdraw #span_content').append(`<p id="d"><b>SUCCESS</b> | <b>${web3.utils.fromWei(amount)}</b> ETH withdrawn</p>`); } catch (err) { error(err); } $('#modal_progress').removeClass('w3-show'); }); // Mint NFT // $('#div_mint #input_json').val(jsonex); // TODO ping this after change: https://rinkeby-api.opensea.io/api/v1/asset/<your_contract_address>/<token_id>/?force_update=true $('#div_mint #button_execute').click(async function () { try { $('#div_error').addClass('w3-hide'); $('#modal_progress').addClass('w3-show'); $('#div_mint #span_content #d').remove(); const id = web3.utils.toBN($('#div_mint #input_id').val()).toString(); let json = {}; const inputimageurl = $('#div_mint #input_image_url'); if (inputimageurl.prop('files').length > 0) { const hash = await EmbarkJS.Storage.uploadFile(inputimageurl); if (ipfsApiPvdrBkup !== null) { EmbarkJS.Storage.setProvider('ipfs', ipfsApiPvdrBkup); await EmbarkJS.Storage.uploadFile(inputimageurl); EmbarkJS.Storage.setProvider('ipfs', ipfsApiProvider); } json['image_url'] = ipfsLiveGateway + '/ipfs/' + hash; } const inputname = $('#div_mint #input_name').val(); if (inputname !== '') json['name'] = inputname; const inputdescription = $('#div_mint #input_description').val(); if (inputdescription !== '') json['description'] = inputdescription; const inputbackgroundcolor = $('#div_mint #input_background_color').val(); if (inputbackgroundcolor !== '') json['background_color'] = inputbackgroundcolor; const inputtraits = JSON.parse('[' + $('#div_mint #input_traits').val() + ']'); if (inputtraits.length > 0) json['traits'] = inputtraits; json = JSON.stringify(json); const hash = await EmbarkJS.Storage.saveText(json); if (ipfsApiPvdrBkup !== null) { EmbarkJS.Storage.setProvider('ipfs', ipfsApiPvdrBkup); await EmbarkJS.Storage.saveText(json); EmbarkJS.Storage.setProvider('ipfs', ipfsApiProvider); } const uri = ipfsLiveGateway + '/ipfs/' + hash; // 'fs:/ipfs/','/ipfs/','ipfs/' didn't work on OpenSea const receipt = await curContract.methods.mintAllocated(id, uri).send(); const owner = receipt.events['Transfer'].returnValues.to; const item = `<p id="d"><b>NFT</b> | <a href="${uri}" target="_blank">MetaData</a> | <a href="${netInfo[netid].opensea}/assets/${curContract.options.address}/${id}" target="_blank">OpenSea</a>` + ` | <a href="${netInfo[netid].explorer}/token/${curContract.options.address}?a=${id}" target="_blank">History</a> | ID[${id}] Owner[${owner}]</p>`; $('#div_mint #span_content').append(item); const curId = await curContract.methods.tokenId().call(); $('#div_info #text_curId').text(curId); } catch (err) { error(err); } $('#modal_progress').removeClass('w3-show'); }); // Get an NFT by ID $('#div_list_id #button_query').click(async function () { try { $('#div_error').addClass('w3-hide'); $('#div_list_id #span_content #d').remove(); // const id = inputToUint256($('#div_list_id #input_id').val()); const id = web3.utils.toBN($('#div_list_id #input_id').val()).toString(); const owner = await curContract.methods.ownerOf(id).call(); const uri = await curContract.methods.tokenURI(id).call(); const item = `<p id="d"><b>NFT</b> | <a href="${uri}" target="_blank">MetaData</a> | <a href="${netInfo[netid].opensea}/assets/${curContract.options.address}/${id}" target="_blank">OpenSea</a>` + ` | <a href="${netInfo[netid].explorer}/token/${curContract.options.address}?a=${id}" target="_blank">History</a> | ID[${id}] Owner[${owner}]</p>`; $('#div_list_id #span_content').append(item); } catch (err) { error(err); } }); // List NFTs owned by address $('#div_list_owner #button_list').click(async function () { try { $('#div_error').addClass('w3-hide'); $('#div_list_owner #span_content #d').remove(); const owner = $('#div_list_owner #input_address').val(); if (!web3.utils.isAddress(owner)) throw new Error('Address is not a correctly formated Ethereum address.'); const count = await curContract.methods.balanceOf(owner).call(); for (let i = 0; i < count; i++) { const id = await curContract.methods.tokenOfOwnerByIndex(owner, i).call(); const uri = await curContract.methods.tokenURI(id).call(); const item = `<p id="d"><b>NFT</b> | <a href="${uri}" target="_blank">MetaData</a> | <a href="${netInfo[netid].opensea}/assets/${curContract.options.address}/${id}" target="_blank">OpenSea</a>` + ` | <a href="${netInfo[netid].explorer}/token/${curContract.options.address}?a=${id}" target="_blank">History</a> | ID[${id}]</p>`; $('#div_list_owner #span_content').append(item); } } catch (err) { error(err); } }); // List all minted NFTs $('#div_list #button_list').click(async function () { try { $('#div_error').addClass('w3-hide'); $('#div_list #span_content #d').remove(); const count = await curContract.methods.totalSupply().call(); for (let i = 0; i < count; i++) { const id = await curContract.methods.tokenByIndex(i).call(); const owner = await curContract.methods.ownerOf(id).call(); const uri = await curContract.methods.tokenURI(id).call(); const item = `<p id="d"><b>NFT</b> | <a href="${uri}" target="_blank">MetaData</a> | <a href="${netInfo[netid].opensea}/assets/${curContract.options.address}/${id}" target="_blank">OpenSea</a>` + ` | <a href="${netInfo[netid].explorer}/token/${curContract.options.address}?a=${id}" target="_blank">History</a> | ID[${id}] Owner[${owner}]</p>`; $('#div_list #span_content').append(item); } } catch (err) { error(err); } }); $('#span_admin').removeClass('w3-hide'); } catch (err) { error(err); } }); } catch (err) { error(err); } }); // const jsonex = ` // { // "name": "Dave Starbelly", // "description": "Friendly OpenSea Creature that enjoys long swims in the ocean.", // "image_url": "https://ipfs.infura.io/ipfs/QmNNbkdPJPeScw3gZGnDQxsM7wDKzehZ6inMq2HSqm9SBk", // "external_link": "https://join.neureal.net/nft/3", // "background_color": "FFFFFF", // "traits": [ // { // "trait_type": "base", // "value": "starfish" // }, // { // "trait_type": "eyes", // "value": "big" // }, // { // "trait_type": "mouth", // "value": "surprised" // }, // { // "trait_type": "level", // "value": 5 // }, // { // "trait_type": "stamina", // "value": 1.4 // }, // { // "trait_type": "personality", // "value": "sad" // }, // { // "trait_type": "aqua_power", // "display_type": "boost_number", // "value": 40 // }, // { // "trait_type": "stamina_increase", // "display_type": "boost_percentage", // "value": 10 // }, // { // "trait_type": "generation", // "display_type": "number", // "value": 2 // } // ] // } // `;
54.142395
209
0.592767
227a1692ee442833e8305fc68fe4dd0f3267b1a7
450
js
JavaScript
qa-auto/A003_edit_item.js
sassyfox/qachallenge
0fa56a1570b4bcdd25fdce335bdd2d194f355a80
[ "MIT" ]
null
null
null
qa-auto/A003_edit_item.js
sassyfox/qachallenge
0fa56a1570b4bcdd25fdce335bdd2d194f355a80
[ "MIT" ]
null
null
null
qa-auto/A003_edit_item.js
sassyfox/qachallenge
0fa56a1570b4bcdd25fdce335bdd2d194f355a80
[ "MIT" ]
null
null
null
module.exports = { 'A003-Double clicking allows you to edit the task': function(client) { client .url('http://todomvc.com/examples/angular2/') .waitForElementVisible('#header h1', 1000) .setValue('#new-todo', 'TaskA003-1') .submitForm('#todo-form') .doubleClick('#todo-list li:first-child label') .assert.visible('#todo-list li:first-child form') .saveScreenshot('A003-edit-test.png .end(); };
37.5
71
0.635556
227c5738fda384242e34da4d7bdf282c9ff4a543
3,609
js
JavaScript
SDK-Test/test/modern/regression/KitchenSink/Charts/ColumnCharts/100%Stacked.js
CelestialSystem/SenchaTestDemo
4bd5085e5f874d6be6d080be1f7a29c4a667dbf0
[ "Apache-2.0" ]
22
2015-12-17T16:45:46.000Z
2019-02-16T19:21:49.000Z
SDK-Test/test/modern/regression/KitchenSink/Charts/ColumnCharts/100%Stacked.js
CelestialSystem/SenchaTestDemo
4bd5085e5f874d6be6d080be1f7a29c4a667dbf0
[ "Apache-2.0" ]
8
2016-02-16T21:28:07.000Z
2019-07-26T07:14:59.000Z
SDK-Test/test/modern/regression/KitchenSink/Charts/ColumnCharts/100%Stacked.js
CelestialSystem/SenchaTestDemo
4bd5085e5f874d6be6d080be1f7a29c4a667dbf0
[ "Apache-2.0" ]
43
2015-12-17T19:03:04.000Z
2021-07-26T04:44:35.000Z
/** * modern KS > Charts > Column Charts > 100% Stacked * tested on: * desktop: * Chrome 59 * Firefox 54 * IE 11 * Edge 15 * tablet: * Safari 10 * Android 4.4, 5.0 * Edge 14 * mobile: * Safari 9 * Edge 15 * Android 5,6,7 * themes: * Triton * Neptune * iOS * Material * Sencha Test: * 2.1.1.27 */ describe("100% Stacked", function() { //------------------------------------------------variables-------------------------------------------------------// var desc = 'Column 100% Stacked'; var toolbar = "toolbar[id^=ext-toolbar]"; var buttons = ['Theme']; var w, h; var graph_id_main; var dataFromStore = []; //------------------------------------------------functions-------------------------------------------------------// //functions in file libraryFunctions.js //------------------------------------------------navigation------------------------------------------------------// beforeAll(function() { Lib.Chart.beforeAll("#column-stacked-100") .and(function(){ dataFromStore = document['dataFromStore']; graph_id_main = document['graph_id_main']; w = document['w']; h = document['h']; }); }); afterAll(function () { Lib.Chart.afterAll("column-stacked-100"); }); //------------------------------------------------tests-----------------------------------------------------------// describe(desc, function () { afterEach(function() { Lib.Chart.afterEach(dataFromStore); }); it('Chart is rendered', function () { Lib.Chart.isRendered(desc); }); describe('Theme button is working properly', function () { Lib.Chart.themeComplex(desc); }); it('Tooltip is present', function(){ if(Lib.isDesktop) { ST.component('chart') .and(function () { Lib.Chart.mouseover(desc, graph_id_main, 1 * w / 16, 95 * h / 100, 'Toyota in 2006: 28.4%'); }) .and(function () { Lib.Chart.mouseover(desc, graph_id_main, 3 * w / 16, 60 * h / 100, 'GM'); }) .and(function () { Lib.Chart.mouseover(desc, graph_id_main, 7 * w / 16, 40 * h / 100, 'Volkswagen'); }) .and(function () { Lib.Chart.mouseover(desc, graph_id_main, 13 * w / 16, 20 * h / 100, 'Hyundai'); }) .and(function () { Lib.Chart.mouseover(desc, graph_id_main, 15 * w / 16, 5 * h / 100, 'Ford in 2013: 9.5%'); }); } else{ pending('Tooltips are disabled for touch devices'); } }); describe('Legend is working and always fill whole y-axis', function(){ it('click inside legend and check if is chosen browser disabled after click and last one stays visible', function(){ Lib.Chart.legend(desc, graph_id_main.replace('main', 'legend'), 410); }); }); it('Source click', function(){ Lib.sourceClick('KitchenSink.view.chart.column.Stacked100'); }) }); });
35.038835
128
0.401496
227c906baf66e4dde9b64576b5a6fa95248f1d04
2,093
js
JavaScript
lib/modules/release/install.js
raftario/lib-cemu
1d5ebed12081aec5465dcd7a774d2ad03b91606e
[ "MIT" ]
2
2019-05-03T10:03:25.000Z
2019-06-21T23:05:53.000Z
lib/modules/release/install.js
raftario/lib-cemu
1d5ebed12081aec5465dcd7a774d2ad03b91606e
[ "MIT" ]
3
2020-03-14T00:23:00.000Z
2020-05-19T00:40:56.000Z
lib/modules/release/install.js
raftario/lib-cemu
1d5ebed12081aec5465dcd7a774d2ad03b91606e
[ "MIT" ]
null
null
null
'use strict' const fs = require('fs') const path = require('path') const yauzl = require('yauzl') const ReleaseInstall = require('../../classes').ReleaseInstall const download = require('./download') /** * Download and install a Cemu release * @param {Release(2)} release - Release to install * @param {string} dir - Install directory * @param {function} [callback] - Callback, receives a ReleaseInstall (or null) and error object if an error occurs * @return {Promise<ReleaseInstall>} * @memberOf module:release */ function install (release, dir, callback) { const zipPath = path.join(dir, 'cemu.zip') return new Promise((resolve, reject) => { fs.mkdir(dir, err => { if (err && err.code !== 'EEXIST') throw err download(release, zipPath) .then(() => { yauzl.open(zipPath, { lazyEntries: true }, (err, file) => { if (err) throw err file.readEntry() file.on('entry', entry => { const entryPath = path.join(dir, entry.fileName) if (/\/$/.test(entry.fileName)) { fs.mkdir(entryPath, { recursive: true }, err => { if (err && err.code !== 'EEXIST') throw err file.readEntry() }) } else { file.openReadStream(entry, (err, readStream) => { if (err) throw err readStream.on('end', () => { file.readEntry() }) readStream.pipe(fs.createWriteStream(entryPath)) }) } }) file.once('close', () => { fs.unlink(zipPath, err => { if (err) throw err }) const install = new ReleaseInstall(release.version, path.resolve(dir), []) if (callback) callback(install, err) resolve(install) }) }) }) .catch(err => { if (callback) callback(null, err) reject(err) }) }) }) } module.exports = install
29.478873
115
0.509317
227d1aaee57e25469249d0d21278c22af92c3fc2
19,312
js
JavaScript
src/Components/Projects.js
manishk-99/ReactClonePortfolio
0fdd16c293434dd8e04eeb80b0f2599c71e783e1
[ "MIT" ]
null
null
null
src/Components/Projects.js
manishk-99/ReactClonePortfolio
0fdd16c293434dd8e04eeb80b0f2599c71e783e1
[ "MIT" ]
1
2021-04-02T08:44:12.000Z
2021-04-02T08:44:12.000Z
src/Components/Projects.js
manishk-99/ReactClonePortfolio
0fdd16c293434dd8e04eeb80b0f2599c71e783e1
[ "MIT" ]
1
2021-04-01T14:14:33.000Z
2021-04-01T14:14:33.000Z
import React from "react"; import { Link } from "react-router-dom"; const Projects = () => { return ( <div> <nav className="navigation container"> <div className="nav-brand"> <strong> <a className="link" href="https://dz6om.csb.app/"> ManishKumar </a> </strong>{" "} </div> <ul className="list-non-bullet nav-pills"> <li className="list-item-inline"> <Link className="link link" to="/"> Home </Link> </li> <li className="list-item-inline"> <Link className="link link-active" to="/Projects"> Projects </Link> </li> <li className="list-item-inline"> <Link className="link" to="/blogs"> Blogs </Link> </li> <li className="list-item-inline"> <Link className="link" to="/About"> About me </Link> </li> </ul> </nav> <body> <div className="clr-section"> <header className="hero"> <img className="hero-img" src="/images/projectImage.svg" /> <h1 className="hero-heading"> See my <span className="heading-inverted">Code</span> </h1> </header> <ul className="list-non-bullet"> <li> <article class="section ow showcase-list container container-center"> <h1><img src="https://upload.wikimedia.org/wikipedia/commons/thumb/7/71/Arrow_east.svg/1280px-Arrow_east.svg.png" alt="" class="arrow"/> FireGitHubBase</h1> <small>March, 2021</small> <p>Here, I created a <strong>User Authentication login portal comprising of a sign-up, sign-in and a logout</strong> functionality page with <strong>firebase</strong> using react.js and once the user is logged in, there I designed a simple <strong>GitHub Requestor</strong> using GitHub API which shows the user data and his/her repositories.</p> <a class="link link-primary" href="https://tmx1k.csb.app/Signin">Live Project</a> <a class="link link-secondary" href="https://github.com/manishk-99/FireGitHubBase">View Source</a> </article> </li> <br/> <li> <article class="section showcase-list container container-center"> <h1><img src="https://upload.wikimedia.org/wikipedia/commons/thumb/7/71/Arrow_east.svg/1280px-Arrow_east.svg.png" alt="" class="arrow"/> EcommerceWebsite-Demo </h1> <small>March, 2021</small> <p>This is a React <strong>EcommerceWebsite-Demo</strong> that I've created using some <strong>npm dependencies</strong> like <strong>Reactstrap, bootstrap, React-icons, React-toastify, faker for generating random data, and npm package axios for fetching API. Here, I created 2 url's. One is localurl i.e incase the PEXELS url doesnot work and the other one is PEXELS real API url. </strong> and some CSS. I implemented this on <strong>codesandbox.io</strong>.</p> <a class="link link-primary" href="https://04t4d.csb.app/">Live Project</a> <a class="link link-secondary" href="https://github.com/manishk-99/EcommerceWebsite-Demo">View Source</a> </article> </li> <br/> <li> <article class="section ow showcase-list container container-center"> <h1><img src="https://upload.wikimedia.org/wikipedia/commons/thumb/7/71/Arrow_east.svg/1280px-Arrow_east.svg.png" alt="" class="arrow"/> RandomUserApp</h1> <small>March, 2021</small> <p>This is a React <strong>RandomUserApp</strong> that I've made using some <strong>npm dependencies</strong> like <strong>Reactstrap, bootstrap, React-icons, uuid, and npm package axios for fetching API</strong> and some CSS. I implemented this on <strong>codesandbox.io</strong>.</p> <a class="link link-primary" href="https://zbzlm.csb.app/">Live Project</a> <a class="link link-secondary" href="https://github.com/manishk-99/RandomUser">View Source</a> </article> </li> <br/> <li> <article class="section showcase-list container container-center"> <h1><img src="https://upload.wikimedia.org/wikipedia/commons/thumb/7/71/Arrow_east.svg/1280px-Arrow_east.svg.png" alt="" class="arrow"/> localStorageTODO</h1> <small>March, 2021</small> <p>This is a React <strong>LocalStorage-TodoApp</strong> that I've made using some <strong>npm dependencies</strong> like <strong>Reactstrap, bootstrap, React-icons, uuid,</strong> and some CSS. I implemented this on <strong>codesandbox.io</strong>.</p> <a class="link link-primary" href="https://xon5t.csb.app/">Live Project</a> <a class="link link-secondary" href="https://github.com/manishk-99/useEffectTodo">View Source</a> </article> </li> <br/> <li> <article className="section ow showcase-list container container-center"> <h1> <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/7/71/Arrow_east.svg/1280px-Arrow_east.svg.png" alt="" className="arrow"/> Mobile-TodoApp</h1> <small>March, 2021</small> <p>This is a React <strong>Mobile-TodoApp</strong> that I've made using some <strong>npm dependencies</strong> like <strong>Reactstrap, bootstrap, React-icons, uuid,</strong> and some CSS. I implemented this on <strong>VS code</strong> and then host the same on <strong>codesandbox.io</strong> so that all of you can have a look at this.</p> <a class="link link-primary" href="https://gqsop.csb.app/">Live Project</a> <a class="link link-secondary" href="https://github.com/manishk-99/ReducerTodo">View Source</a> </article> </li> <br/> <li> <article className="section showcase-list container container-center"> <h1> <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/7/71/Arrow_east.svg/1280px-Arrow_east.svg.png" alt="" className="arrow" />{" "} ReactClonePortfolio </h1> <small>February, 2021</small> <p> This is the <strong>React clone</strong> of my{" "} <strong>Portfolio.</strong> </p> <a className="link link-primary" href="https://dz6om.csb.app/"> Live Project </a> <a className="link link-secondary" href="https://github.com/manishk-99/ReactClonePortfolio" > View Source </a> </article> </li> <br /> <li> <article className="section ow showcase-list container container-center"> <h1> <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/7/71/Arrow_east.svg/1280px-Arrow_east.svg.png" alt="" className="arrow" />{" "} TikTakToe-React </h1> <small>February, 2021</small> <p> This is a React <strong>TikTakToe</strong> game that I've made using some <strong>npm dependencies</strong> like{" "} <strong>Reactstrap, React-icons, React-toastify,</strong> and some CSS. I implemented this on <strong>VS code</strong> and then host the same on <strong>codesandbox.io</strong> so that all of you can have a look at this. </p> <a className="link link-primary" href="https://n4vsd.csb.app/"> Live Project </a> <a className="link link-secondary" href="https://github.com/manishk-99/ticTacToe-React" > View Source </a> </article> </li> <br /> <li> <article className="section showcase-list container container-center"> <h1> <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/7/71/Arrow_east.svg/1280px-Arrow_east.svg.png" alt="" className="arrow" />{" "} counterReactApp </h1> <small>February, 2021</small> <p> I Created this <strong>React App</strong> by using{" "} <strong>States/hooks</strong>. I implemented this on{" "} <strong>VS code</strong> and then host the same on{" "} <strong>codesandbox.io</strong> so that all of you can have a look at this. </p> <a className="link link-primary" href="https://qqwne.csb.app/"> Live Project </a> <a className="link link-secondary" href="https://github.com/manishk-99/counterReactApp" > View Source </a> </article> </li> <br /> <li> <article className="section ow showcase-list container container-center"> <h1> <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/7/71/Arrow_east.svg/1280px-Arrow_east.svg.png" alt="" className="arrow" />{" "} ReactTemplatePractise </h1> <small>February, 2021</small> <p> I Created this <strong>React Template</strong> by modifying a{" "} <strong>FREELANCER HTML, CSS, JS template</strong> available on the <strong>Startbootstrap website.</strong> I implemented this on <strong>VS code</strong> and then host the same on{" "} <strong>codesandbox.io</strong> so that all of you can have a look at this. </p> <a className="link link-primary" href="https://kqk1y.csb.app/"> Live Project </a> <a className="link link-secondary" href="https://github.com/manishk-99/ReactTemplateWork" > View Source </a> </article> </li> <br /> <li> <article className="section showcase-list container container-center"> <h1> <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/7/71/Arrow_east.svg/1280px-Arrow_east.svg.png" alt="" className="arrow" />{" "} FoodApp! </h1> <small>January, 2021</small> <p> This is a <strong>food</strong> recommendation app that i created using reactjs on codesandbox.io </p> <a className="link link-primary" href="https://55kv8.csb.app/"> Live Project </a> <a className="link link-secondary" href="https://github.com/manishk-99/FoodApp" > View Source </a> </article> </li> <br /> <li> <article className="section ow showcase-list container container-center"> <h1> <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/7/71/Arrow_east.svg/1280px-Arrow_east.svg.png" alt="" className="arrow" />{" "} Emoji's Interpreter! </h1> <small>January, 2021</small> <p> This is a demo <strong>emoji</strong> interpreter app that i created using reactjs on codesandbox.io </p> <a className="link link-primary" href="https://gy4oo.csb.app/"> Live Project </a> <a className="link link-secondary" href="https://github.com/manishk-99/EmojiInterpreter" > View Source </a> </article> </li> <br /> <li> <article className="section showcase-list container container-center"> <h1> {" "} <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/7/71/Arrow_east.svg/1280px-Arrow_east.svg.png" alt="" className="arrow" />{" "} Groot Translator! </h1> <small>January, 2021</small> <p> Are you a fan of <strong>Marvel?</strong> who don't!! So, This is a <strong>GrootTranslator</strong> app that converts our English sentence into Groot Language. I created this app using vanilla js and some CSS. "GROOT - The Guardian Of The Galaxy"." </p> <a className="link link-primary" href="https://manishsgroottranslator.netlify.app/" > Live Project </a> <a className="link link-secondary" href="https://github.com/manishk-99/FunTranslation" > View Source </a> </article> </li> <br /> <li> <article className="section ow showcase-list container container-center"> <h1> {" "} <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/7/71/Arrow_east.svg/1280px-Arrow_east.svg.png" alt="" className="arrow" />{" "} Minions Translator! </h1> <small>January, 2021</small> <p> This is a Translator app that converts our{" "} <strong>ENGLISH</strong> sentence into{" "} <strong>MINIONS </strong>language. It is created by using some vanilla JS with some CSS style sheets.{" "} </p> <a className="link link-primary" href="https://manishsminiongame.netlify.app/" > Live Project </a> <a className="link link-secondary" href="https://github.com/manishk-99/neogcamp-banana-speak" > View Source </a> </article> </li> <br /> <li> <article className="section showcase-list container container-center"> <h1> <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/7/71/Arrow_east.svg/1280px-Arrow_east.svg.png" alt="" className="arrow" />{" "} HarryPotter Fan? </h1> <small>January, 2021</small> <p> Another CLI app built with <strong>nodeJS</strong>. This is an easy level <strong>HarryPotter</strong> quiz of 10 questions. You can send this to any of your friend who is a fan of HarryPotter to check what score he gets? ;){" "} </p> <a className="link link-primary" href="https://repl.it/@manishhit2800/end-game-HARRYPOTTER?embed=1&output=1" > Live Project </a> <a className="link link-secondary" href="https://github.com/manishk-99/HarryPotterGame-manish" > View Source </a> </article> </li> <br /> <li> <article className="section ow showcase-list container container-center"> <h1> <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/7/71/Arrow_east.svg/1280px-Arrow_east.svg.png" alt="" className="arrow" />{" "} How well do you know me? </h1> <small>January, 2021</small> <p> A CLI app built with <strong>nodeJS</strong>. You can send this to your friends and find out who really knows you. </p> <a className="link link-primary" href="https://repl.it/@manishhit2800/Quizforfriends?embed=1&output=1" > Live Project </a> <a className="link link-secondary" href="https://github.com/manishk-99/quizForFriends-manish" > View Source </a> </article> </li> <br /> </ul> </div> <footer className="footer"> <div className="footer-header">Socially connect with me</div> <ul className="social-links list-non-bullet"> <li className="list-item-inline"> <a className="link" href="https://github.com/manishk-99"> github </a> </li> <li className="list-item-inline"> <a className="link" href="https://twitter.com/Beingmanishh"> twitter </a> </li> <li className="list-item-inline"> <a className="link" href="https://www.linkedin.com/in/manish-kumar18" > linkedin </a> </li> </ul> </footer> </body> </div> ); }; export default Projects;
43.107143
481
0.478355
227dc53f71566957afe20b3ac6c9343ab638b34c
350
js
JavaScript
firebase/functions/src/functions/syncPhotoList.js
imagitama/vrphotobuddy
b73469a56fe764b669c3a889f3506583e6371998
[ "MIT" ]
null
null
null
firebase/functions/src/functions/syncPhotoList.js
imagitama/vrphotobuddy
b73469a56fe764b669c3a889f3506583e6371998
[ "MIT" ]
null
null
null
firebase/functions/src/functions/syncPhotoList.js
imagitama/vrphotobuddy
b73469a56fe764b669c3a889f3506583e6371998
[ "MIT" ]
null
null
null
const functions = require('firebase-functions') const { hydratePhotoList } = require('../photos') module.exports = functions.https.onRequest(async (req, res) => { try { await hydratePhotoList() res.status(200).send('Synced!') } catch (err) { console.error(err) throw new functions.https.HttpsError('unknown', err.message) } })
26.923077
64
0.677143
227e983983bc9ba6b8f5778e88677ecf735da679
500
js
JavaScript
board-game-client/src/components/BoardGameList.js
johanesteves/fi-final-board-game-app
a54da0c9d89ccc6bd54e8a1e6af49de99d5d3f0e
[ "MIT" ]
1
2018-01-09T01:55:54.000Z
2018-01-09T01:55:54.000Z
board-game-client/src/components/BoardGameList.js
johanesteves/fi-final-board-game-app
a54da0c9d89ccc6bd54e8a1e6af49de99d5d3f0e
[ "MIT" ]
null
null
null
board-game-client/src/components/BoardGameList.js
johanesteves/fi-final-board-game-app
a54da0c9d89ccc6bd54e8a1e6af49de99d5d3f0e
[ "MIT" ]
null
null
null
import React from 'react'; import BoardGameCard from '../components/BoardGameCard'; const BoardGameList = (props) => { return ( <div className="album text-muted"> <div className="container"> <div className="row"> {props.boardgames.map((boardgame) => { return (<BoardGameCard key={boardgame.id} boardgame={boardgame}/>) })} </div> </div> </div> ) }; export default BoardGameList;
27.777778
82
0.54
227fa4fca46a8a18bcb0b74232ae1406cc831334
108
js
JavaScript
docs/doxygen-html/fibonacci_8cpp.js
Neeraj2K18/Mordern_Cpp
0be7a846fd72ad48e408729f0cbf2d9da1c25ee8
[ "MIT" ]
1
2022-01-04T20:29:39.000Z
2022-01-04T20:29:39.000Z
docs/doxygen-html/fibonacci_8cpp.js
Neeraj2K18/Mordern_Cpp
0be7a846fd72ad48e408729f0cbf2d9da1c25ee8
[ "MIT" ]
null
null
null
docs/doxygen-html/fibonacci_8cpp.js
Neeraj2K18/Mordern_Cpp
0be7a846fd72ad48e408729f0cbf2d9da1c25ee8
[ "MIT" ]
null
null
null
var fibonacci_8cpp = [ [ "fibonacci", "fibonacci_8cpp.html#ab93142d864eaee74a3645ac9c809e897", null ] ];
27
82
0.75
228003918787dca47b1654020fe24c552bd45a6a
2,590
js
JavaScript
app/models/News.js
wisdomsuzhihui/zczj
113641c3c1fd1eed86f9bfaea53dfab94c9a0d0e
[ "MIT" ]
null
null
null
app/models/News.js
wisdomsuzhihui/zczj
113641c3c1fd1eed86f9bfaea53dfab94c9a0d0e
[ "MIT" ]
null
null
null
app/models/News.js
wisdomsuzhihui/zczj
113641c3c1fd1eed86f9bfaea53dfab94c9a0d0e
[ "MIT" ]
null
null
null
/* jshint indent: 2 */ module.exports = function (sequelize, DataTypes) { return sequelize.define('News', { NewsID: { type: DataTypes.INTEGER, allowNull: false, primaryKey: true, autoIncrement: true }, UserID: { type: DataTypes.INTEGER, allowNull: false, defaultValue: "((0))" }, CategoryID: { type: DataTypes.INTEGER, allowNull: false, references: { model: 'Category', key: 'CategoryID' } }, CategoryLevel: { type: DataTypes.STRING, allowNull: false }, newtitle: { type: DataTypes.STRING, allowNull: false }, newheader: { type: "BIT", allowNull: true, defaultValue: "((0))" }, newcontent: { type: DataTypes.TEXT, allowNull: true }, newsynopsis: { type: DataTypes.TEXT, allowNull: true }, newkey: { type: DataTypes.STRING, allowNull: true }, newdate: { type: DataTypes.DATE, allowNull: true }, newman: { type: DataTypes.STRING, allowNull: true }, newform: { type: DataTypes.STRING, allowNull: true }, newpoint: { type: DataTypes.INTEGER, allowNull: true }, newimages: { type: DataTypes.STRING, allowNull: true }, filepath: { type: DataTypes.STRING, allowNull: true }, Recommend: { type: "BIT", allowNull: true, defaultValue: "((0))" }, HeaderTime: { type: DataTypes.DATE, allowNull: true }, RecommendTime: { type: DataTypes.DATE, allowNull: true }, NeedLogin: { type: DataTypes.INTEGER, allowNull: false, defaultValue: "((0))" }, JinFen: { type: DataTypes.DECIMAL, allowNull: true }, ProbationContent: { type: DataTypes.STRING, allowNull: true }, CommentCount: { type: DataTypes.INTEGER, allowNull: false, defaultValue: "((0))" }, DisplayMode: { type: DataTypes.INTEGER, allowNull: false, defaultValue: "((1))" }, IsTimedPublish: { type: "BIT", allowNull: false, defaultValue: "((0))" }, IsPublish: { type: "BIT", allowNull: false, defaultValue: "((1))" }, PublishTimed: { type: DataTypes.DATE, allowNull: true }, PlateID: { type: DataTypes.INTEGER, allowNull: false, defaultValue: "((0))" } }, { tableName: 'News', timestamps: false, }); };
19.621212
50
0.527027
22800fba29f8ee19515abb07d13777888932f172
2,965
js
JavaScript
public/selection_handlers/Role.js
ZQWhiting/employee-tracker
dd096a61739f52bc4a3b4dcbcbc35dd16a9fc1d7
[ "ISC" ]
null
null
null
public/selection_handlers/Role.js
ZQWhiting/employee-tracker
dd096a61739f52bc4a3b4dcbcbc35dd16a9fc1d7
[ "ISC" ]
null
null
null
public/selection_handlers/Role.js
ZQWhiting/employee-tracker
dd096a61739f52bc4a3b4dcbcbc35dd16a9fc1d7
[ "ISC" ]
null
null
null
require('console.table'); const fetch = require('node-fetch'); const inquirer = require('inquirer'); const paths = require('../../utils/paths') const { getData, getSingleDataRow } = require('../../utils/getData'); const { toTitleCaseTrim, createChoicesArray } = require('../../utils/utils'); class Role { static async viewRoles() { // get the roles to view const rolesData = await getData(paths.getRoles) .catch((err) => { throw 'No role data found (required). Please create a role.' }) // display the data console.table(rolesData) } static async addRole() { // get the department data for department_id const departmentData = await getData(paths.getDepartments) .catch((err) => { throw 'No department data found (required). Please create a department.' }) // populate the choices arrays const choices = createChoicesArray(departmentData, 'department') // get user input const { title, salary, department } = await inquirer.prompt([ { type: 'input', name: 'title', message: 'Name the new role', validate: input => input.match(/^[a-zA-Z ]+$/) ? true : "Please enter a name (characters and spaces only).", filter: input => toTitleCaseTrim(input) }, { type: 'input', name: 'salary', message: "What is the new role's salary?", validate: input => input.match(/^\d+$/) ? true : 'Please enter a number (no symbols or decimals).', }, { type: 'list', name: 'department', message: 'What deparment does the new role belong to?', choices: choices } ]) // save the role to the database const response = await fetch(paths.addRole, { method: 'POST', body: JSON.stringify({ title: title, salary: salary, department_id: department }), headers: { 'Content-Type': 'application/json' } }) // display the response if (!response.ok) { throw response } console.log('Role was successfully added') } static async deleteRole() { // get the role to delete const roleId = await getSingleDataRow('role') .catch((err) => { throw 'No role data found (required). Please create a role.' }) // delete the role from the database const path = paths.deleteRole.replace(':id', roleId) const response = await fetch(path, { method: 'DELETE' }) // display the response if (response.ok) { console.log('Role was successfully deleted.') } else { throw response } } } module.exports = Role;
33.693182
124
0.534907
2280bfaf35be219a8063fe9096004ab162f4d656
427
js
JavaScript
others/09-while.js
HecFranco/Javascript-by-Samples
1eec34c9ff7412e6710937b2713ac81893881ac1
[ "MIT" ]
null
null
null
others/09-while.js
HecFranco/Javascript-by-Samples
1eec34c9ff7412e6710937b2713ac81893881ac1
[ "MIT" ]
null
null
null
others/09-while.js
HecFranco/Javascript-by-Samples
1eec34c9ff7412e6710937b2713ac81893881ac1
[ "MIT" ]
null
null
null
'use strict' // Bucle while var year = 2018; while(year != 1991){ // ejecuta esto console.log("Estamos en el alio: "+year); year--; } // Break while(year != 1991){ // ejecuta esto console.log("Estamos en el alio: "+year); if(year == 2000){ break; } year--; } // Do while var years = 30; do{ alert("SOLO CUANDO SEA DIFERENTE A 20, AHORA VALE: "+years); years--; }while(years > 25)
15.814815
63
0.571429
2280c5635e8bb1f3f48ba46694c370358f8260a3
841
js
JavaScript
src/utils/cookies.js
pierrecabriere/-plugandwork-core-ui
9171b249b0e612f5487c6d160f7cb2a5e6c4799a
[ "MIT" ]
null
null
null
src/utils/cookies.js
pierrecabriere/-plugandwork-core-ui
9171b249b0e612f5487c6d160f7cb2a5e6c4799a
[ "MIT" ]
null
null
null
src/utils/cookies.js
pierrecabriere/-plugandwork-core-ui
9171b249b0e612f5487c6d160f7cb2a5e6c4799a
[ "MIT" ]
null
null
null
export const tokenKey = 'paw_token' export const cookieParser = () => { const { cookie } = document const parsed = {} cookie.split('; ').forEach((c) => { const spc = c.split('=') const key = spc[0] const val = spc[1] parsed[key] = val }) return parsed } export const getTokenFromCookie = () => { // Get cookies as an object; const parsed = cookieParser() // If cookies innclude token if (Object.keys(parsed).includes(tokenKey)) { return parsed[tokenKey] } } export const setTokenFromCookie = () => { // Get cookies as an object; const parsed = cookieParser() // If cookies innclude token if (Object.keys(parsed).includes(tokenKey)) { // Get token value and set to localStorage localStorage.setItem(tokenKey, parsed[tokenKey]) } else { localStorage.removeItem(tokenKey) } }
23.361111
52
0.649227
2281fa54ad6784d85542b6a12c57677df3cf9509
8,445
js
JavaScript
api/controllers/streams.js
JobKlimop/TheCircle-API-Stream
ffce612109b64f36fca65b7173f9d0a706a1136b
[ "MIT" ]
null
null
null
api/controllers/streams.js
JobKlimop/TheCircle-API-Stream
ffce612109b64f36fca65b7173f9d0a706a1136b
[ "MIT" ]
null
null
null
api/controllers/streams.js
JobKlimop/TheCircle-API-Stream
ffce612109b64f36fca65b7173f9d0a706a1136b
[ "MIT" ]
null
null
null
const hashChecker = require('../../hash_checker'); const _ = require('lodash'); const request = require('request'); function getStreams(req, res, next) { let stats = {}; this.sessions.forEach(function (session, id) { if (session.isStarting) { let regRes = /\/(.*)\/(.*)/gi.exec(session.publishStreamPath || session.playStreamPath); if (regRes === null) return; let [app, stream] = _.slice(regRes, 1); if (!_.get(stats, [app, stream])) { _.set(stats, [app, stream], { publisher: null, subscribers: [] }); } switch (true) { case session.isPublishing: { _.set(stats, [app, stream, 'publisher'], { app: app, stream: stream, clientId: session.id, connectCreated: session.connectTime, bytes: session.socket.bytesRead, ip: session.socket.remoteAddress, audio: session.audioCodec > 0 ? { codec: session.audioCodecName, profile: session.audioProfileName, samplerate: session.audioSamplerate, channels: session.audioChannels } : null, video: session.videoCodec > 0 ? { codec: session.videoCodecName, width: session.videoWidth, height: session.videoHeight, profile: session.videoProfileName, level: session.videoLevel, fps: session.videoFps } : null, }); break; } case !!session.playStreamPath: { switch (session.constructor.name) { case 'NodeRtmpSession': { stats[app][stream]['subscribers'].push({ app: app, stream: stream, clientId: session.id, connectCreated: session.connectTime, bytes: session.socket.bytesWritten, ip: session.socket.remoteAddress, protocol: 'rtmp' }); break; } case 'NodeFlvSession': { stats[app][stream]['subscribers'].push({ app: app, stream: stream, clientId: session.id, connectCreated: session.connectTime, bytes: session.req.connection.bytesWritten, ip: session.req.connection.remoteAddress, protocol: session.TAG === 'websocket-flv' ? 'ws' : 'http' }); break; } } break; } } } }); res.json(stats); } function getStream(req, res, next) { let publishStreamPath = `/${req.params.app}/${req.params.stream}`; let publisherName = req.params.stream; let streamStats = { isLive: false, viewers: 0, duration: 0, bitrate: 0, startTime: null }; let publisherSession = this.sessions.get(this.publishers.get(publishStreamPath)); if (!!publisherSession === false) { console.log(publisherSession); streamStats.isLive = !!publisherSession; streamStats.viewers = _.filter(Array.from(this.sessions.values()), (session) => { return session.playStreamPath === publishStreamPath; }).length; streamStats.duration = streamStats.isLive ? Math.ceil((Date.now() - publisherSession.startTimestamp) / 1000) : 0; streamStats.bitrate = streamStats.duration > 0 ? Math.ceil(_.get(publisherSession, ['socket', 'bytesRead'], 0) * 8 / streamStats.duration / 1024) : 0; streamStats.startTime = streamStats.isLive ? publisherSession.connectTime : null; res.json(streamStats); } else { console.log('streamer is live'); getPublisher(publisherName) .then(response => { let streamerInfo = { username : response.username, email : response.email, slogan : response.slogan }; streamStats.isLive = !!publisherSession; streamStats.viewers = _.filter(Array.from(this.sessions.values()), (session) => {return session.playStreamPath === publishStreamPath; }).length; streamStats.duration = streamStats.isLive ? Math.ceil((Date.now() - publisherSession.startTimestamp) / 1000) : 0; streamStats.bitrate = streamStats.duration > 0 ? Math.ceil(_.get(publisherSession, ['socket', 'bytesRead'], 0) * 8 / streamStats.duration / 1024) : 0; streamStats.startTime = streamStats.isLive ? publisherSession.connectTime : null; streamStats.userinfo = streamerInfo; res.json(streamStats); }) .catch(error => res.status(400).json(error)); } } function getEncryptedHash(req, res, next) { console.log({'GETTING encrypted hash' : req.body}); let publisherName = req.params.stream; let publisherPath = req.params.app; let response = { path: publisherPath, publisher: publisherName, }; console.log(response); res.status(200).json('RECEIVED'); // // let stats = {}; // let app = ''; // let stream = ''; // // // let publishStreamPath = `/${req.params.app}/${req.params.stream}`; // // console.log(publishStreamPath); // // let publishLive = req.params.app; // let publishStream = req.params.stream; // // this.sessions.forEach(function (session, id) { // if (session.isStarting) { // let regRes = /\/(.*)\/(.*)/gi.exec(session.publishStreamPath || session.playStreamPath); // // if (regRes === null) return; // // [app, stream] = _.slice(regRes, 1); // // let [app, stream] = _.slice(regRes, 1); // // console.log(app, stream); // // if (!_.get(stats, [app, stream])) { // _.set(stats, [app, stream], { // publisher: null, // subscribers: [] // }); // } // // switch (true) { // case session.isPublishing: { // _.set(stats, [app, stream, 'publisher'], { // app: app, // stream: stream, // clientId: session.id, // connectCreated: session.connectTime, // bytes: session.socket.bytesRead, // ip: session.socket.remoteAddress, // audio: session.audioCodec > 0 ? { // codec: session.audioCodecName, // profile: session.audioProfileName, // samplerate: session.audioSamplerate, // channels: session.audioChannels // } : null, // video: session.videoCodec > 0 ? { // codec: session.videoCodecName, // width: session.videoWidth, // height: session.videoHeight, // profile: session.videoProfileName, // level: session.videoLevel, // fps: session.videoFps // } : null, // }); // // break; // } // case !!session.playStreamPath: { // switch (session.constructor.name) { // case 'NodeRtmpSession': { // stats[app][stream]['subscribers'].push({ // app: app, // stream: stream, // clientId: session.id, // connectCreated: session.connectTime, // bytes: session.socket.bytesWritten, // ip: session.socket.remoteAddress, // protocol: 'rtmp' // }); // // break; // } // case 'NodeFlvSession': { // stats[app][stream]['subscribers'].push({ // app: app, // stream: stream, // clientId: session.id, // connectCreated: session.connectTime, // bytes: session.req.connection.bytesWritten, // ip: session.req.connection.remoteAddress, // protocol: session.TAG === 'websocket-flv' ? 'ws' : 'http' // }); // // break; // } // } // // break; // } // } // } // }); // // if (app == '' && stream == '') { // console.log('no stream available'); // } // // if (publishLive === app && publishStream === stream) { // console.log({ // path: app, // name: stream // }); // let body = req.body; // // if (req.body === undefined) { // console.log('undefined'); // body = 'undefined'; // } // // let hash = req.body.hash; // // let response = { // apipoint: 'getEncryptedHash', // path: app, // streamName: stream, // hash: hash // }; // let equal = hashChecker.compareHash(hash); // if (equal) { // console.log('it is equal'); // response.equal = true; // res.status(200).json(response); // next(); // } else { // console.log('it is not equal'); // response.equal = false; // res.status(200).json(response); // next(); // } // } else { // res.json('No publishers'); // next(); // } } function getPublisher(streamerName) { return new Promise(function (resolve, reject) { var url = 'https://the-circle-account.herokuapp.com/api/account/user/' + streamerName; request(url, {json: true}, function(error, response, body) { console.log(body); if (error) { reject(error); } if (response) { let publishers = response.body; console.log(publishers); resolve(publishers); } }); }); } exports.getStreams = getStreams; exports.getStream = getStream; exports.getEncryptedHash = getEncryptedHash;
28.244147
154
0.602487
22828aab753fde8374892f0ea1ddd4803b3c4f04
19,456
js
JavaScript
src/static/gx09k0.js
ronaldomg/Valim_EFS_REDIS
67ce6769fccffef1455cbb616ab3a02e30e034b2
[ "Unlicense" ]
null
null
null
src/static/gx09k0.js
ronaldomg/Valim_EFS_REDIS
67ce6769fccffef1455cbb616ab3a02e30e034b2
[ "Unlicense" ]
null
null
null
src/static/gx09k0.js
ronaldomg/Valim_EFS_REDIS
67ce6769fccffef1455cbb616ab3a02e30e034b2
[ "Unlicense" ]
null
null
null
/**@preserve GeneXus Java 10_3_12-110051 on December 12, 2020 20:32:52.31 */ gx.evt.autoSkip = false; gx.define('gx09k0', false, function () { this.ServerClass = "gx09k0" ; this.PackageName = "" ; this.setObjectType("web"); this.setOnAjaxSessionTimeout("Warn"); this.hasEnterEvent = true; this.skipOnEnter = false; this.addKeyListener("5", "REFRESH"); this.addKeyListener("12", "CANCEL"); this.addKeyListener("1", "HELP"); this.autoRefresh = true; this.SetStandaloneVars=function() { this.AV13pParmLocLancEmpresa=gx.fn.getControlValue("vPPARMLOCLANCEMPRESA") ; this.AV14pParmLocLancUsuario=gx.fn.getControlValue("vPPARMLOCLANCUSUARIO") ; }; this.e131o12_client=function() { this.executeServerEvent("ENTER", true, arguments[0], false, false); }; this.e141o11_client=function() { this.executeServerEvent("CANCEL", true, null, false, false); }; this.GXValidFnc = []; var GXValidFnc = this.GXValidFnc ; this.GXCtrlIds=[2,8,9,12,14,17,19,22,24,27,29,32,34,37,39,42,44,47,48,52,53,54,55,56,57,60]; this.GXLastCtrlId =60; this.Grid1Container = new gx.grid.grid(this, 2,"WbpLvl2",51,"Grid1","Grid1","Grid1Container",this.CmpContext,this.IsMasterPage,"gx09k0",[],false,1,false,true,10,true,false,false,"",0,"px","Novo registro",true,false,false,null,null,false,"",false,[1,1,1,1]); var Grid1Container = this.Grid1Container; Grid1Container.addBitmap("&Linkselection","vLINKSELECTION",52,0,"px",17,"px",null,"","","Image",""); Grid1Container.addSingleLineEdit(3197,53,"PARMLOCLANCEMPRESA","Parm Loc Lanc Empresa","","ParmLocLancEmpresa","char",0,"px",10,10,"left",null,[],3197,"ParmLocLancEmpresa",true,0,false,false,"Attribute",1,""); Grid1Container.addSingleLineEdit(3198,54,"PARMLOCLANCUSUARIO","Parm Loc Lanc Usuario","","ParmLocLancUsuario","char",0,"px",12,12,"left",null,[],3198,"ParmLocLancUsuario",true,0,false,false,"Attribute",1,""); Grid1Container.addSingleLineEdit(3178,55,"PARMLOCLANCDATAINI","Parm Loc Lanc Data Ini","Selecionar","ParmLocLancDataIni","date",0,"px",10,10,"right",null,[],3178,"ParmLocLancDataIni",true,0,false,false,"Attribute",1,""); Grid1Container.addSingleLineEdit(3179,56,"PARMLOCLANCDATAFIN","Parm Loc Lanc Data Fin","","ParmLocLancDataFin","date",0,"px",10,10,"right",null,[],3179,"ParmLocLancDataFin",true,0,false,false,"Attribute",1,""); Grid1Container.addSingleLineEdit(3180,57,"PARMLOCLANCEMPCCONTA","Parm Loc Lanc Emp CConta","","ParmLocLancEmpCConta","char",0,"px",10,10,"left",null,[],3180,"ParmLocLancEmpCConta",true,0,false,false,"Attribute",1,""); this.setGrid(Grid1Container); GXValidFnc[2]={fld:"TABLE1",grid:0}; GXValidFnc[8]={fld:"GROUP1",grid:0}; GXValidFnc[9]={fld:"TABLE2",grid:0}; GXValidFnc[12]={fld:"TEXTBLOCKPARMLOCLANCEMPRESA", format:0,grid:0}; GXValidFnc[14]={lvl:0,type:"char",len:10,dec:0,sign:false,pic:"@!",ro:0,grid:0,gxgrid:null,fnc:null,isvalid:null,rgrid:[this.Grid1Container],fld:"vCPARMLOCLANCEMPRESA",gxz:"ZV6cParmLocLancEmpresa",gxold:"OV6cParmLocLancEmpresa",gxvar:"AV6cParmLocLancEmpresa",ucs:[],op:[],ip:[],nacdep:[],ctrltype:"edit",v2v:function(Value){gx.O.AV6cParmLocLancEmpresa=Value},v2z:function(Value){gx.O.ZV6cParmLocLancEmpresa=Value},v2c:function(){gx.fn.setControlValue("vCPARMLOCLANCEMPRESA",gx.O.AV6cParmLocLancEmpresa,0)},c2v:function(){gx.O.AV6cParmLocLancEmpresa=this.val()},val:function(){return gx.fn.getControlValue("vCPARMLOCLANCEMPRESA")},nac:gx.falseFn}; GXValidFnc[17]={fld:"TEXTBLOCKPARMLOCLANCUSUARIO", format:0,grid:0}; GXValidFnc[19]={lvl:0,type:"char",len:12,dec:0,sign:false,pic:"@!",ro:0,grid:0,gxgrid:null,fnc:null,isvalid:null,rgrid:[this.Grid1Container],fld:"vCPARMLOCLANCUSUARIO",gxz:"ZV7cParmLocLancUsuario",gxold:"OV7cParmLocLancUsuario",gxvar:"AV7cParmLocLancUsuario",ucs:[],op:[],ip:[],nacdep:[],ctrltype:"edit",v2v:function(Value){gx.O.AV7cParmLocLancUsuario=Value},v2z:function(Value){gx.O.ZV7cParmLocLancUsuario=Value},v2c:function(){gx.fn.setControlValue("vCPARMLOCLANCUSUARIO",gx.O.AV7cParmLocLancUsuario,0)},c2v:function(){gx.O.AV7cParmLocLancUsuario=this.val()},val:function(){return gx.fn.getControlValue("vCPARMLOCLANCUSUARIO")},nac:gx.falseFn}; GXValidFnc[22]={fld:"TEXTBLOCKPARMLOCLANCDATAINI", format:0,grid:0}; GXValidFnc[24]={lvl:0,type:"date",len:10,dec:0,sign:false,ro:0,grid:0,gxgrid:null,fnc:null,isvalid:null,rgrid:[this.Grid1Container],fld:"vCPARMLOCLANCDATAINI",gxz:"ZV8cParmLocLancDataIni",gxold:"OV8cParmLocLancDataIni",gxvar:"AV8cParmLocLancDataIni",dp:{f:0,st:false,wn:false,mf:false,pic:"99/99/9999",dec:0},ucs:[],op:[],ip:[],nacdep:[],ctrltype:"edit",v2v:function(Value){gx.O.AV8cParmLocLancDataIni=gx.fn.toDatetimeValue(Value)},v2z:function(Value){gx.O.ZV8cParmLocLancDataIni=gx.fn.toDatetimeValue(Value)},v2c:function(){gx.fn.setControlValue("vCPARMLOCLANCDATAINI",gx.O.AV8cParmLocLancDataIni,0)},c2v:function(){gx.O.AV8cParmLocLancDataIni=gx.fn.toDatetimeValue(this.val())},val:function(){return gx.fn.getControlValue("vCPARMLOCLANCDATAINI")},nac:gx.falseFn}; GXValidFnc[27]={fld:"TEXTBLOCKPARMLOCLANCDATAFIN", format:0,grid:0}; GXValidFnc[29]={lvl:0,type:"date",len:10,dec:0,sign:false,ro:0,grid:0,gxgrid:null,fnc:null,isvalid:null,rgrid:[this.Grid1Container],fld:"vCPARMLOCLANCDATAFIN",gxz:"ZV9cParmLocLancDataFin",gxold:"OV9cParmLocLancDataFin",gxvar:"AV9cParmLocLancDataFin",dp:{f:0,st:false,wn:false,mf:false,pic:"99/99/9999",dec:0},ucs:[],op:[],ip:[],nacdep:[],ctrltype:"edit",v2v:function(Value){gx.O.AV9cParmLocLancDataFin=gx.fn.toDatetimeValue(Value)},v2z:function(Value){gx.O.ZV9cParmLocLancDataFin=gx.fn.toDatetimeValue(Value)},v2c:function(){gx.fn.setControlValue("vCPARMLOCLANCDATAFIN",gx.O.AV9cParmLocLancDataFin,0)},c2v:function(){gx.O.AV9cParmLocLancDataFin=gx.fn.toDatetimeValue(this.val())},val:function(){return gx.fn.getControlValue("vCPARMLOCLANCDATAFIN")},nac:gx.falseFn}; GXValidFnc[32]={fld:"TEXTBLOCKPARMLOCLANCEMPCCONTA", format:0,grid:0}; GXValidFnc[34]={lvl:0,type:"char",len:10,dec:0,sign:false,pic:"@!",ro:0,grid:0,gxgrid:null,fnc:null,isvalid:null,rgrid:[this.Grid1Container],fld:"vCPARMLOCLANCEMPCCONTA",gxz:"ZV10cParmLocLancEmpCConta",gxold:"OV10cParmLocLancEmpCConta",gxvar:"AV10cParmLocLancEmpCConta",ucs:[],op:[],ip:[],nacdep:[],ctrltype:"edit",v2v:function(Value){gx.O.AV10cParmLocLancEmpCConta=Value},v2z:function(Value){gx.O.ZV10cParmLocLancEmpCConta=Value},v2c:function(){gx.fn.setControlValue("vCPARMLOCLANCEMPCCONTA",gx.O.AV10cParmLocLancEmpCConta,0)},c2v:function(){gx.O.AV10cParmLocLancEmpCConta=this.val()},val:function(){return gx.fn.getControlValue("vCPARMLOCLANCEMPCCONTA")},nac:gx.falseFn}; GXValidFnc[37]={fld:"TEXTBLOCKPARMLOCLANCCCONTAINI", format:0,grid:0}; GXValidFnc[39]={lvl:0,type:"svchar",len:30,dec:0,sign:false,ro:0,grid:0,gxgrid:null,fnc:null,isvalid:null,rgrid:[this.Grid1Container],fld:"vCPARMLOCLANCCCONTAINI",gxz:"ZV11cParmLocLancCContaIni",gxold:"OV11cParmLocLancCContaIni",gxvar:"AV11cParmLocLancCContaIni",ucs:[],op:[],ip:[],nacdep:[],ctrltype:"edit",v2v:function(Value){gx.O.AV11cParmLocLancCContaIni=Value},v2z:function(Value){gx.O.ZV11cParmLocLancCContaIni=Value},v2c:function(){gx.fn.setControlValue("vCPARMLOCLANCCCONTAINI",gx.O.AV11cParmLocLancCContaIni,0)},c2v:function(){gx.O.AV11cParmLocLancCContaIni=this.val()},val:function(){return gx.fn.getControlValue("vCPARMLOCLANCCCONTAINI")},nac:gx.falseFn}; GXValidFnc[42]={fld:"TEXTBLOCKPARMLOCLANCCCONTAFIN", format:0,grid:0}; GXValidFnc[44]={lvl:0,type:"svchar",len:30,dec:0,sign:false,ro:0,grid:0,gxgrid:null,fnc:null,isvalid:null,rgrid:[this.Grid1Container],fld:"vCPARMLOCLANCCCONTAFIN",gxz:"ZV12cParmLocLancCContaFin",gxold:"OV12cParmLocLancCContaFin",gxvar:"AV12cParmLocLancCContaFin",ucs:[],op:[],ip:[],nacdep:[],ctrltype:"edit",v2v:function(Value){gx.O.AV12cParmLocLancCContaFin=Value},v2z:function(Value){gx.O.ZV12cParmLocLancCContaFin=Value},v2c:function(){gx.fn.setControlValue("vCPARMLOCLANCCCONTAFIN",gx.O.AV12cParmLocLancCContaFin,0)},c2v:function(){gx.O.AV12cParmLocLancCContaFin=this.val()},val:function(){return gx.fn.getControlValue("vCPARMLOCLANCCCONTAFIN")},nac:gx.falseFn}; GXValidFnc[47]={fld:"GROUP2",grid:0}; GXValidFnc[48]={fld:"TABLE3",grid:0}; GXValidFnc[52]={lvl:2,type:"bits",len:1024,dec:0,sign:false,ro:1,isacc:0,grid:51,gxgrid:this.Grid1Container,fnc:null,isvalid:null,rgrid:[],fld:"vLINKSELECTION",gxz:"ZV5LinkSelection",gxold:"OV5LinkSelection",gxvar:"AV5LinkSelection",ucs:[],op:[],ip:[],nacdep:[],ctrltype:"edit",inputType:'text',v2v:function(Value){gx.O.AV5LinkSelection=Value},v2z:function(Value){gx.O.ZV5LinkSelection=Value},v2c:function(row){gx.fn.setGridMultimediaValue("vLINKSELECTION",row || gx.fn.currentGridRowImpl(51),gx.O.AV5LinkSelection,gx.O.AV17Linkselection_GXI)},c2v:function(){gx.O.AV17Linkselection_GXI=this.val_GXI();gx.O.AV5LinkSelection=this.val()},val:function(row){return gx.fn.getGridControlValue("vLINKSELECTION",row || gx.fn.currentGridRowImpl(51))},val_GXI:function(row){return gx.fn.getGridControlValue("vLINKSELECTION_GXI",row || gx.fn.currentGridRowImpl(51))}, gxvar_GXI:'AV17Linkselection_GXI',nac:gx.falseFn}; GXValidFnc[53]={lvl:2,type:"char",len:10,dec:0,sign:false,pic:"@!",ro:1,isacc:0,grid:51,gxgrid:this.Grid1Container,fnc:null,isvalid:null,rgrid:[],fld:"PARMLOCLANCEMPRESA",gxz:"Z3197ParmLocLancEmpresa",gxold:"O3197ParmLocLancEmpresa",gxvar:"A3197ParmLocLancEmpresa",ucs:[],op:[],ip:[],nacdep:[],ctrltype:"edit",inputType:'text',autoCorrect:"1",v2v:function(Value){gx.O.A3197ParmLocLancEmpresa=Value},v2z:function(Value){gx.O.Z3197ParmLocLancEmpresa=Value},v2c:function(row){gx.fn.setGridControlValue("PARMLOCLANCEMPRESA",row || gx.fn.currentGridRowImpl(51),gx.O.A3197ParmLocLancEmpresa,0);if (typeof(this.dom_hdl) == 'function') this.dom_hdl.call(gx.O);},c2v:function(){gx.O.A3197ParmLocLancEmpresa=this.val()},val:function(row){return gx.fn.getGridControlValue("PARMLOCLANCEMPRESA",row || gx.fn.currentGridRowImpl(51))},nac:gx.falseFn}; GXValidFnc[54]={lvl:2,type:"char",len:12,dec:0,sign:false,pic:"@!",ro:1,isacc:0,grid:51,gxgrid:this.Grid1Container,fnc:null,isvalid:null,rgrid:[],fld:"PARMLOCLANCUSUARIO",gxz:"Z3198ParmLocLancUsuario",gxold:"O3198ParmLocLancUsuario",gxvar:"A3198ParmLocLancUsuario",ucs:[],op:[],ip:[],nacdep:[],ctrltype:"edit",inputType:'text',autoCorrect:"1",v2v:function(Value){gx.O.A3198ParmLocLancUsuario=Value},v2z:function(Value){gx.O.Z3198ParmLocLancUsuario=Value},v2c:function(row){gx.fn.setGridControlValue("PARMLOCLANCUSUARIO",row || gx.fn.currentGridRowImpl(51),gx.O.A3198ParmLocLancUsuario,0);if (typeof(this.dom_hdl) == 'function') this.dom_hdl.call(gx.O);},c2v:function(){gx.O.A3198ParmLocLancUsuario=this.val()},val:function(row){return gx.fn.getGridControlValue("PARMLOCLANCUSUARIO",row || gx.fn.currentGridRowImpl(51))},nac:gx.falseFn}; GXValidFnc[55]={lvl:2,type:"date",len:10,dec:0,sign:false,ro:1,isacc:0,grid:51,gxgrid:this.Grid1Container,fnc:null,isvalid:null,rgrid:[],fld:"PARMLOCLANCDATAINI",gxz:"Z3178ParmLocLancDataIni",gxold:"O3178ParmLocLancDataIni",gxvar:"A3178ParmLocLancDataIni",dp:{f:0,st:false,wn:false,mf:false,pic:"99/99/9999",dec:0},ucs:[],op:[],ip:[],nacdep:[],ctrltype:"edit",inputType:'text',v2v:function(Value){gx.O.A3178ParmLocLancDataIni=gx.fn.toDatetimeValue(Value)},v2z:function(Value){gx.O.Z3178ParmLocLancDataIni=gx.fn.toDatetimeValue(Value)},v2c:function(row){gx.fn.setGridControlValue("PARMLOCLANCDATAINI",row || gx.fn.currentGridRowImpl(51),gx.O.A3178ParmLocLancDataIni,0);if (typeof(this.dom_hdl) == 'function') this.dom_hdl.call(gx.O);},c2v:function(){gx.O.A3178ParmLocLancDataIni=gx.fn.toDatetimeValue(this.val())},val:function(row){return gx.fn.getGridDateTimeValue("PARMLOCLANCDATAINI",row || gx.fn.currentGridRowImpl(51))},nac:gx.falseFn}; GXValidFnc[56]={lvl:2,type:"date",len:10,dec:0,sign:false,ro:1,isacc:0,grid:51,gxgrid:this.Grid1Container,fnc:null,isvalid:null,rgrid:[],fld:"PARMLOCLANCDATAFIN",gxz:"Z3179ParmLocLancDataFin",gxold:"O3179ParmLocLancDataFin",gxvar:"A3179ParmLocLancDataFin",dp:{f:0,st:false,wn:false,mf:false,pic:"99/99/9999",dec:0},ucs:[],op:[],ip:[],nacdep:[],ctrltype:"edit",inputType:'text',v2v:function(Value){gx.O.A3179ParmLocLancDataFin=gx.fn.toDatetimeValue(Value)},v2z:function(Value){gx.O.Z3179ParmLocLancDataFin=gx.fn.toDatetimeValue(Value)},v2c:function(row){gx.fn.setGridControlValue("PARMLOCLANCDATAFIN",row || gx.fn.currentGridRowImpl(51),gx.O.A3179ParmLocLancDataFin,0);if (typeof(this.dom_hdl) == 'function') this.dom_hdl.call(gx.O);},c2v:function(){gx.O.A3179ParmLocLancDataFin=gx.fn.toDatetimeValue(this.val())},val:function(row){return gx.fn.getGridDateTimeValue("PARMLOCLANCDATAFIN",row || gx.fn.currentGridRowImpl(51))},nac:gx.falseFn}; GXValidFnc[57]={lvl:2,type:"char",len:10,dec:0,sign:false,pic:"@!",ro:1,isacc:0,grid:51,gxgrid:this.Grid1Container,fnc:null,isvalid:null,rgrid:[],fld:"PARMLOCLANCEMPCCONTA",gxz:"Z3180ParmLocLancEmpCConta",gxold:"O3180ParmLocLancEmpCConta",gxvar:"A3180ParmLocLancEmpCConta",ucs:[],op:[],ip:[],nacdep:[],ctrltype:"edit",inputType:'text',autoCorrect:"1",v2v:function(Value){gx.O.A3180ParmLocLancEmpCConta=Value},v2z:function(Value){gx.O.Z3180ParmLocLancEmpCConta=Value},v2c:function(row){gx.fn.setGridControlValue("PARMLOCLANCEMPCCONTA",row || gx.fn.currentGridRowImpl(51),gx.O.A3180ParmLocLancEmpCConta,0);if (typeof(this.dom_hdl) == 'function') this.dom_hdl.call(gx.O);},c2v:function(){gx.O.A3180ParmLocLancEmpCConta=this.val()},val:function(row){return gx.fn.getGridControlValue("PARMLOCLANCEMPCCONTA",row || gx.fn.currentGridRowImpl(51))},nac:gx.falseFn}; GXValidFnc[60]={fld:"TABLE4",grid:0}; this.AV6cParmLocLancEmpresa = "" ; this.ZV6cParmLocLancEmpresa = "" ; this.OV6cParmLocLancEmpresa = "" ; this.AV7cParmLocLancUsuario = "" ; this.ZV7cParmLocLancUsuario = "" ; this.OV7cParmLocLancUsuario = "" ; this.AV8cParmLocLancDataIni = gx.date.nullDate() ; this.ZV8cParmLocLancDataIni = gx.date.nullDate() ; this.OV8cParmLocLancDataIni = gx.date.nullDate() ; this.AV9cParmLocLancDataFin = gx.date.nullDate() ; this.ZV9cParmLocLancDataFin = gx.date.nullDate() ; this.OV9cParmLocLancDataFin = gx.date.nullDate() ; this.AV10cParmLocLancEmpCConta = "" ; this.ZV10cParmLocLancEmpCConta = "" ; this.OV10cParmLocLancEmpCConta = "" ; this.AV11cParmLocLancCContaIni = "" ; this.ZV11cParmLocLancCContaIni = "" ; this.OV11cParmLocLancCContaIni = "" ; this.AV12cParmLocLancCContaFin = "" ; this.ZV12cParmLocLancCContaFin = "" ; this.OV12cParmLocLancCContaFin = "" ; this.ZV5LinkSelection = "" ; this.OV5LinkSelection = "" ; this.Z3197ParmLocLancEmpresa = "" ; this.O3197ParmLocLancEmpresa = "" ; this.Z3198ParmLocLancUsuario = "" ; this.O3198ParmLocLancUsuario = "" ; this.Z3178ParmLocLancDataIni = gx.date.nullDate() ; this.O3178ParmLocLancDataIni = gx.date.nullDate() ; this.Z3179ParmLocLancDataFin = gx.date.nullDate() ; this.O3179ParmLocLancDataFin = gx.date.nullDate() ; this.Z3180ParmLocLancEmpCConta = "" ; this.O3180ParmLocLancEmpCConta = "" ; this.AV6cParmLocLancEmpresa = "" ; this.AV7cParmLocLancUsuario = "" ; this.AV8cParmLocLancDataIni = gx.date.nullDate() ; this.AV9cParmLocLancDataFin = gx.date.nullDate() ; this.AV10cParmLocLancEmpCConta = "" ; this.AV11cParmLocLancCContaIni = "" ; this.AV12cParmLocLancCContaFin = "" ; this.AV13pParmLocLancEmpresa = "" ; this.AV14pParmLocLancUsuario = "" ; this.A3182ParmLocLancCContaFin = "" ; this.A3181ParmLocLancCContaIni = "" ; this.AV5LinkSelection = "" ; this.A3197ParmLocLancEmpresa = "" ; this.A3198ParmLocLancUsuario = "" ; this.A3178ParmLocLancDataIni = gx.date.nullDate() ; this.A3179ParmLocLancDataFin = gx.date.nullDate() ; this.A3180ParmLocLancEmpCConta = "" ; this.Events = {"e131o12_client": ["ENTER", true] ,"e141o11_client": ["CANCEL", true]}; this.EvtParms["REFRESH"] = [[{av:'GRID1_nFirstRecordOnPage'},{av:'GRID1_nEOF'},{av:'subGrid1_Rows'},{av:'AV6cParmLocLancEmpresa',fld:'vCPARMLOCLANCEMPRESA'},{av:'AV7cParmLocLancUsuario',fld:'vCPARMLOCLANCUSUARIO'},{av:'AV8cParmLocLancDataIni',fld:'vCPARMLOCLANCDATAINI'},{av:'AV9cParmLocLancDataFin',fld:'vCPARMLOCLANCDATAFIN'},{av:'AV10cParmLocLancEmpCConta',fld:'vCPARMLOCLANCEMPCCONTA'},{av:'AV11cParmLocLancCContaIni',fld:'vCPARMLOCLANCCCONTAINI'},{av:'AV12cParmLocLancCContaFin',fld:'vCPARMLOCLANCCCONTAFIN'}],[]]; this.EvtParms["LOAD"] = [[],[{av:'AV5LinkSelection',fld:'vLINKSELECTION'}]]; this.EvtParms["ENTER"] = [[{av:'A3197ParmLocLancEmpresa',fld:'PARMLOCLANCEMPRESA'},{av:'A3198ParmLocLancUsuario',fld:'PARMLOCLANCUSUARIO'}],[{av:'AV13pParmLocLancEmpresa',fld:'vPPARMLOCLANCEMPRESA'},{av:'AV14pParmLocLancUsuario',fld:'vPPARMLOCLANCUSUARIO'}]]; this.EvtParms["GRID1_FIRSTPAGE"] = [[{av:'GRID1_nFirstRecordOnPage'},{av:'GRID1_nEOF'},{av:'subGrid1_Rows'},{av:'AV6cParmLocLancEmpresa',fld:'vCPARMLOCLANCEMPRESA'},{av:'AV7cParmLocLancUsuario',fld:'vCPARMLOCLANCUSUARIO'},{av:'AV8cParmLocLancDataIni',fld:'vCPARMLOCLANCDATAINI'},{av:'AV9cParmLocLancDataFin',fld:'vCPARMLOCLANCDATAFIN'},{av:'AV10cParmLocLancEmpCConta',fld:'vCPARMLOCLANCEMPCCONTA'},{av:'AV11cParmLocLancCContaIni',fld:'vCPARMLOCLANCCCONTAINI'},{av:'AV12cParmLocLancCContaFin',fld:'vCPARMLOCLANCCCONTAFIN'}],[]]; this.EvtParms["GRID1_PREVPAGE"] = [[{av:'GRID1_nFirstRecordOnPage'},{av:'GRID1_nEOF'},{av:'subGrid1_Rows'},{av:'AV6cParmLocLancEmpresa',fld:'vCPARMLOCLANCEMPRESA'},{av:'AV7cParmLocLancUsuario',fld:'vCPARMLOCLANCUSUARIO'},{av:'AV8cParmLocLancDataIni',fld:'vCPARMLOCLANCDATAINI'},{av:'AV9cParmLocLancDataFin',fld:'vCPARMLOCLANCDATAFIN'},{av:'AV10cParmLocLancEmpCConta',fld:'vCPARMLOCLANCEMPCCONTA'},{av:'AV11cParmLocLancCContaIni',fld:'vCPARMLOCLANCCCONTAINI'},{av:'AV12cParmLocLancCContaFin',fld:'vCPARMLOCLANCCCONTAFIN'}],[]]; this.EvtParms["GRID1_NEXTPAGE"] = [[{av:'GRID1_nFirstRecordOnPage'},{av:'GRID1_nEOF'},{av:'subGrid1_Rows'},{av:'AV6cParmLocLancEmpresa',fld:'vCPARMLOCLANCEMPRESA'},{av:'AV7cParmLocLancUsuario',fld:'vCPARMLOCLANCUSUARIO'},{av:'AV8cParmLocLancDataIni',fld:'vCPARMLOCLANCDATAINI'},{av:'AV9cParmLocLancDataFin',fld:'vCPARMLOCLANCDATAFIN'},{av:'AV10cParmLocLancEmpCConta',fld:'vCPARMLOCLANCEMPCCONTA'},{av:'AV11cParmLocLancCContaIni',fld:'vCPARMLOCLANCCCONTAINI'},{av:'AV12cParmLocLancCContaFin',fld:'vCPARMLOCLANCCCONTAFIN'}],[]]; this.EvtParms["GRID1_LASTPAGE"] = [[{av:'GRID1_nFirstRecordOnPage'},{av:'GRID1_nEOF'},{av:'subGrid1_Rows'},{av:'AV6cParmLocLancEmpresa',fld:'vCPARMLOCLANCEMPRESA'},{av:'AV7cParmLocLancUsuario',fld:'vCPARMLOCLANCUSUARIO'},{av:'AV8cParmLocLancDataIni',fld:'vCPARMLOCLANCDATAINI'},{av:'AV9cParmLocLancDataFin',fld:'vCPARMLOCLANCDATAFIN'},{av:'AV10cParmLocLancEmpCConta',fld:'vCPARMLOCLANCEMPCCONTA'},{av:'AV11cParmLocLancCContaIni',fld:'vCPARMLOCLANCCCONTAINI'},{av:'AV12cParmLocLancCContaFin',fld:'vCPARMLOCLANCCCONTAFIN'}],[]]; this.setVCMap("AV13pParmLocLancEmpresa", "vPPARMLOCLANCEMPRESA", 0, "char"); this.setVCMap("AV14pParmLocLancUsuario", "vPPARMLOCLANCUSUARIO", 0, "char"); Grid1Container.addRefreshingVar(this.GXValidFnc[14]); Grid1Container.addRefreshingVar(this.GXValidFnc[19]); Grid1Container.addRefreshingVar(this.GXValidFnc[24]); Grid1Container.addRefreshingVar(this.GXValidFnc[29]); Grid1Container.addRefreshingVar(this.GXValidFnc[34]); Grid1Container.addRefreshingVar(this.GXValidFnc[39]); Grid1Container.addRefreshingVar(this.GXValidFnc[44]); this.InitStandaloneVars( ); }); gx.setParentObj(new gx09k0());
142.014599
943
0.763877
2282c87c749ca81068d560b5667880cae97d88b7
795
js
JavaScript
src/app.js
MichaelXu1983/portal-childapp-vue
8f651a380e4cde666564a4a033603d240f588905
[ "MIT" ]
1
2020-03-14T07:49:47.000Z
2020-03-14T07:49:47.000Z
src/app.js
MichaelXu1983/portal-childapp-vue
8f651a380e4cde666564a4a033603d240f588905
[ "MIT" ]
5
2020-07-19T07:32:21.000Z
2022-02-26T22:25:59.000Z
src/app.js
MichaelXu1983/portal-childapp-vue
8f651a380e4cde666564a4a033603d240f588905
[ "MIT" ]
null
null
null
import Vue from 'vue' import VueRouter from 'vue-router' import '@/router/routes.js' import routes from '@/router/index.js' import store from '@/store/index.js' // import ELEMENT from 'element-ui' // import { Button, Message } from 'element-ui' // 按需引入 Element // import '../theme/index.css' import App from '@/views/app.vue' // import Vuex from 'vuex' import MixinELEMENT from './mixins/index.js' // import $ from 'jquery' Vue.use(VueRouter) // Vue.use(ELEMENT) // 完整引用 Element // Vue.use(Button, Message) // 按需引用 Element // Vue.use(Vuex) // Vue.prototype.$message = Message // 绑定到 Vue 全局,可以使用这种方式调用:this.$message Vue.use(MixinELEMENT) const router = new VueRouter({ mode: 'hash', routes }) let vm = new Vue({ router, store, el: `#root`, render: h => h(App) }) Vue.use({ vm })
22.714286
74
0.675472
2283998649ec159c6ba0e1dc6817e5afc47db52c
2,326
js
JavaScript
packages/web-spindle/projectors/mapping/_mappingHandlerOps.js
valaatech/kernel
8e24e9e731bb67d0da82fbd56b6a8e32f22c178f
[ "MIT" ]
5
2019-12-30T08:24:57.000Z
2021-12-12T13:38:37.000Z
packages/web-spindle/projectors/mapping/_mappingHandlerOps.js
Valaa-Technologies/valaa-vault
8e24e9e731bb67d0da82fbd56b6a8e32f22c178f
[ "MIT" ]
2
2018-08-15T12:38:16.000Z
2018-09-21T07:17:55.000Z
packages/web-spindle/projectors/mapping/_mappingHandlerOps.js
Valaa-Technologies/valaa-vault
8e24e9e731bb67d0da82fbd56b6a8e32f22c178f
[ "MIT" ]
1
2018-04-06T12:26:59.000Z
2018-04-06T12:26:59.000Z
// @flow import type { PrefixRouter, Route } from "~/web-spindle/MapperService"; import { _verifyResourceAuthorization } from "../_commonProjectorOps"; import { _presolveResourceRouteRequest } from "../resource/_resourceHandlerOps"; import { dumpObject } from "~/tools"; export function _createToMapping (router: PrefixRouter, route: Route, runtime) { const toMappingSource = runtime.toMappingSource = ["§->"]; const toMapping = runtime.toMapping = ["§->"]; try { router.appendSchemaSteps( runtime, route.config.resource.schema, { targetTrack: toMappingSource }); const relationSchema = router.derefSchema(route.config.relation.schema); router.appendVPathSteps(runtime, relationSchema.valospace.reflection, toMappingSource); const relationsIndex = toMappingSource.findIndex(e => (e === "relations")); toMapping.push(...toMappingSource.splice(relationsIndex)); const filter = toMapping.find(e => e && (e[0] === "§filter")); if (!filter) throw new Error("mapping is missing filter clause"); filter[1] = ["§&&", filter[1], ["§==", ["§.", "target"], ["§$", "target"]]]; if (toMapping[toMappingSource.length - 1][0] === "§map") toMapping.splice(-2, 2); toMapping.push(0); } catch (error) { throw router.wrapErrorEvent(error, 1, new Error(`During _createToMapping(${router._routeName(route)}`), "\n\ttoMappingSource:", ...dumpObject(toMappingSource), "\n\ttoMapping:", ...dumpObject(toMapping), ); } } export function _presolveMappingRouteRequest ( router: PrefixRouter, runtime, valkOptions) { if (!_presolveResourceRouteRequest(router, runtime, valkOptions)) { return false; } const scope = valkOptions.scope; if (scope.mappingName === undefined) throw new Error("mappingName missing from scope"); if (scope.target && !_verifyResourceAuthorization(router, { method: "GET", category: "mapping", url: runtime.route.url }, scope, scope.target, "route target resource")) { return false; } scope.source = scope.resource.step(runtime.toMappingSource, Object.create(valkOptions)); if (!scope.source) throw new Error("Could not resolve mapping source from resource"); if (runtime.toMapping) { scope.mapping = scope.source.step(runtime.toMapping, Object.create(valkOptions)); } return true; }
43.074074
91
0.693465
2283a16851c9dae6b2875acbfc8076c8bdea86e7
18,553
js
JavaScript
exchange/node_modules/coinfalcon/dist/libs/https.js
nugness123/gekko
58d7398ed34cf2cf296fc7e92492036df4e5b386
[ "MIT" ]
3
2020-07-11T06:09:00.000Z
2020-10-07T00:11:07.000Z
exchange/node_modules/coinfalcon/dist/libs/https.js
nugness123/gekko
58d7398ed34cf2cf296fc7e92492036df4e5b386
[ "MIT" ]
9
2020-07-18T11:22:51.000Z
2022-02-12T22:19:39.000Z
exchange/node_modules/coinfalcon/dist/libs/https.js
adradr/gekko_with_gekkoga
b959c83c698d4c40aa5ac8b0454e1c06d7fb01bc
[ "MIT" ]
2
2021-02-12T17:37:43.000Z
2021-03-07T20:34:28.000Z
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _stringify = require('babel-runtime/core-js/json/stringify'); var _stringify2 = _interopRequireDefault(_stringify); var _promise = require('babel-runtime/core-js/promise'); var _promise2 = _interopRequireDefault(_promise); var _assign = require('babel-runtime/core-js/object/assign'); var _assign2 = _interopRequireDefault(_assign); var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _createClass2 = require('babel-runtime/helpers/createClass'); var _createClass3 = _interopRequireDefault(_createClass2); var cov_2gzrx27i4v = function () { var path = '/Users/Chase/Sites/Charity/coinfalcon-node/src/libs/https.js', hash = '2fe3e9d7cafd2bc8900da74998bf36bdad64c051', global = new Function('return this')(), gcv = '__coverage__', coverageData = { path: '/Users/Chase/Sites/Charity/coinfalcon-node/src/libs/https.js', statementMap: { '0': { start: { line: 5, column: 26 }, end: { line: 5, column: 52 } }, '1': { start: { line: 6, column: 4 }, end: { line: 58, column: 7 } }, '2': { start: { line: 7, column: 6 }, end: { line: 13, column: 7 } }, '3': { start: { line: 8, column: 8 }, end: { line: 8, column: 64 } }, '4': { start: { line: 9, column: 8 }, end: { line: 12, column: 34 } }, '5': { start: { line: 15, column: 22 }, end: { line: 48, column: 8 } }, '6': { start: { line: 16, column: 26 }, end: { line: 16, column: 28 } }, '7': { start: { line: 18, column: 8 }, end: { line: 18, column: 37 } }, '8': { start: { line: 19, column: 8 }, end: { line: 21, column: 11 } }, '9': { start: { line: 20, column: 10 }, end: { line: 20, column: 34 } }, '10': { start: { line: 22, column: 8 }, end: { line: 47, column: 11 } }, '11': { start: { line: 23, column: 10 }, end: { line: 27, column: 11 } }, '12': { start: { line: 24, column: 12 }, end: { line: 24, column: 59 } }, '13': { start: { line: 26, column: 12 }, end: { line: 26, column: 29 } }, '14': { start: { line: 29, column: 10 }, end: { line: 44, column: 11 } }, '15': { start: { line: 30, column: 12 }, end: { line: 40, column: 13 } }, '16': { start: { line: 31, column: 14 }, end: { line: 36, column: 15 } }, '17': { start: { line: 32, column: 36 }, end: { line: 32, column: 61 } }, '18': { start: { line: 33, column: 16 }, end: { line: 33, column: 55 } }, '19': { start: { line: 34, column: 16 }, end: { line: 34, column: 36 } }, '20': { start: { line: 35, column: 16 }, end: { line: 35, column: 23 } }, '21': { start: { line: 38, column: 14 }, end: { line: 38, column: 51 } }, '22': { start: { line: 39, column: 14 }, end: { line: 39, column: 21 } }, '23': { start: { line: 42, column: 12 }, end: { line: 42, column: 51 } }, '24': { start: { line: 43, column: 12 }, end: { line: 43, column: 19 } }, '25': { start: { line: 46, column: 10 }, end: { line: 46, column: 31 } }, '26': { start: { line: 50, column: 6 }, end: { line: 52, column: 9 } }, '27': { start: { line: 51, column: 8 }, end: { line: 51, column: 22 } }, '28': { start: { line: 54, column: 6 }, end: { line: 56, column: 7 } }, '29': { start: { line: 55, column: 8 }, end: { line: 55, column: 42 } }, '30': { start: { line: 57, column: 6 }, end: { line: 57, column: 20 } } }, fnMap: { '0': { name: '(anonymous_0)', decl: { start: { line: 4, column: 2 }, end: { line: 4, column: 3 } }, loc: { start: { line: 4, column: 27 }, end: { line: 59, column: 3 } }, line: 4 }, '1': { name: '(anonymous_1)', decl: { start: { line: 6, column: 23 }, end: { line: 6, column: 24 } }, loc: { start: { line: 6, column: 44 }, end: { line: 58, column: 5 } }, line: 6 }, '2': { name: '(anonymous_2)', decl: { start: { line: 15, column: 51 }, end: { line: 15, column: 52 } }, loc: { start: { line: 15, column: 65 }, end: { line: 48, column: 7 } }, line: 15 }, '3': { name: '(anonymous_3)', decl: { start: { line: 19, column: 28 }, end: { line: 19, column: 29 } }, loc: { start: { line: 19, column: 39 }, end: { line: 21, column: 9 } }, line: 19 }, '4': { name: '(anonymous_4)', decl: { start: { line: 22, column: 27 }, end: { line: 22, column: 28 } }, loc: { start: { line: 22, column: 33 }, end: { line: 47, column: 9 } }, line: 22 }, '5': { name: '(anonymous_5)', decl: { start: { line: 50, column: 26 }, end: { line: 50, column: 27 } }, loc: { start: { line: 50, column: 37 }, end: { line: 52, column: 7 } }, line: 50 } }, branchMap: { '0': { loc: { start: { line: 7, column: 6 }, end: { line: 13, column: 7 } }, type: 'if', locations: [{ start: { line: 7, column: 6 }, end: { line: 13, column: 7 } }, { start: { line: 7, column: 6 }, end: { line: 13, column: 7 } }], line: 7 }, '1': { loc: { start: { line: 7, column: 10 }, end: { line: 7, column: 75 } }, type: 'binary-expr', locations: [{ start: { line: 7, column: 10 }, end: { line: 7, column: 44 } }, { start: { line: 7, column: 48 }, end: { line: 7, column: 75 } }], line: 7 }, '2': { loc: { start: { line: 29, column: 10 }, end: { line: 44, column: 11 } }, type: 'if', locations: [{ start: { line: 29, column: 10 }, end: { line: 44, column: 11 } }, { start: { line: 29, column: 10 }, end: { line: 44, column: 11 } }], line: 29 }, '3': { loc: { start: { line: 30, column: 12 }, end: { line: 40, column: 13 } }, type: 'if', locations: [{ start: { line: 30, column: 12 }, end: { line: 40, column: 13 } }, { start: { line: 30, column: 12 }, end: { line: 40, column: 13 } }], line: 30 }, '4': { loc: { start: { line: 30, column: 16 }, end: { line: 30, column: 64 } }, type: 'binary-expr', locations: [{ start: { line: 30, column: 16 }, end: { line: 30, column: 27 } }, { start: { line: 30, column: 31 }, end: { line: 30, column: 64 } }], line: 30 }, '5': { loc: { start: { line: 31, column: 14 }, end: { line: 36, column: 15 } }, type: 'if', locations: [{ start: { line: 31, column: 14 }, end: { line: 36, column: 15 } }, { start: { line: 31, column: 14 }, end: { line: 36, column: 15 } }], line: 31 }, '6': { loc: { start: { line: 54, column: 6 }, end: { line: 56, column: 7 } }, type: 'if', locations: [{ start: { line: 54, column: 6 }, end: { line: 56, column: 7 } }, { start: { line: 54, column: 6 }, end: { line: 56, column: 7 } }], line: 54 }, '7': { loc: { start: { line: 54, column: 10 }, end: { line: 54, column: 75 } }, type: 'binary-expr', locations: [{ start: { line: 54, column: 10 }, end: { line: 54, column: 44 } }, { start: { line: 54, column: 48 }, end: { line: 54, column: 75 } }], line: 54 } }, s: { '0': 0, '1': 0, '2': 0, '3': 0, '4': 0, '5': 0, '6': 0, '7': 0, '8': 0, '9': 0, '10': 0, '11': 0, '12': 0, '13': 0, '14': 0, '15': 0, '16': 0, '17': 0, '18': 0, '19': 0, '20': 0, '21': 0, '22': 0, '23': 0, '24': 0, '25': 0, '26': 0, '27': 0, '28': 0, '29': 0, '30': 0 }, f: { '0': 0, '1': 0, '2': 0, '3': 0, '4': 0, '5': 0 }, b: { '0': [0, 0], '1': [0, 0], '2': [0, 0], '3': [0, 0], '4': [0, 0], '5': [0, 0], '6': [0, 0], '7': [0, 0] }, _coverageSchema: '332fd63041d2c1bcb487cc26dd0d5f7d97098a6c' }, coverage = global[gcv] || (global[gcv] = {}); if (coverage[path] && coverage[path].hash === hash) { return coverage[path]; } coverageData.hash = hash; return coverage[path] = coverageData; }(); var _https = require('https'); var _https2 = _interopRequireDefault(_https); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var customHttps = function () { function customHttps() { (0, _classCallCheck3.default)(this, customHttps); } (0, _createClass3.default)(customHttps, null, [{ key: 'request', value: function request(options) { cov_2gzrx27i4v.f[0]++; var requestParams = (cov_2gzrx27i4v.s[0]++, (0, _assign2.default)({}, options)); cov_2gzrx27i4v.s[1]++; return new _promise2.default(function (resolve, reject) { cov_2gzrx27i4v.f[1]++; cov_2gzrx27i4v.s[2]++; if ((cov_2gzrx27i4v.b[1][0]++, 'body' in requestParams === true) && (cov_2gzrx27i4v.b[1][1]++, requestParams.body !== null)) { cov_2gzrx27i4v.b[0][0]++; cov_2gzrx27i4v.s[3]++; requestParams.body = (0, _stringify2.default)(requestParams.body); cov_2gzrx27i4v.s[4]++; requestParams.headers = (0, _assign2.default)({ 'Content-Type': 'application/json', 'Content-Length': Buffer.byteLength(requestParams.body) }, requestParams.headers); } else { cov_2gzrx27i4v.b[0][1]++; } var request = (cov_2gzrx27i4v.s[5]++, _https2.default.request(requestParams, function (response) { cov_2gzrx27i4v.f[2]++; var currentBody = (cov_2gzrx27i4v.s[6]++, []); cov_2gzrx27i4v.s[7]++; response.setEncoding('utf8'); cov_2gzrx27i4v.s[8]++; response.on('data', function (chunk) { cov_2gzrx27i4v.f[3]++; cov_2gzrx27i4v.s[9]++; currentBody.push(chunk); }); cov_2gzrx27i4v.s[10]++; response.on('end', function () { cov_2gzrx27i4v.f[4]++; cov_2gzrx27i4v.s[11]++; try { cov_2gzrx27i4v.s[12]++; currentBody = JSON.parse(currentBody.join('')); } catch (e) { cov_2gzrx27i4v.s[13]++; currentBody = ''; } cov_2gzrx27i4v.s[14]++; if ([200, 201, 204].includes(response.statusCode) === false) { cov_2gzrx27i4v.b[2][0]++; cov_2gzrx27i4v.s[15]++; if ((cov_2gzrx27i4v.b[4][0]++, currentBody) && (cov_2gzrx27i4v.b[4][1]++, 'error' in currentBody === true)) { cov_2gzrx27i4v.b[3][0]++; cov_2gzrx27i4v.s[16]++; if (Object.prototype.toString.call(currentBody.error) === '[object Object]') { cov_2gzrx27i4v.b[5][0]++; var fieldsError = (cov_2gzrx27i4v.s[17]++, new Error('invalid body')); cov_2gzrx27i4v.s[18]++; fieldsError.fields = currentBody.error; cov_2gzrx27i4v.s[19]++; reject(fieldsError); cov_2gzrx27i4v.s[20]++; return; } else { cov_2gzrx27i4v.b[5][1]++; } cov_2gzrx27i4v.s[21]++; reject(new Error(currentBody.error)); cov_2gzrx27i4v.s[22]++; return; } else { cov_2gzrx27i4v.b[3][1]++; } cov_2gzrx27i4v.s[23]++; reject(new Error(response.statusCode)); cov_2gzrx27i4v.s[24]++; return; } else { cov_2gzrx27i4v.b[2][1]++; } cov_2gzrx27i4v.s[25]++; resolve(currentBody); }); })); cov_2gzrx27i4v.s[26]++; request.on('error', function (error) { cov_2gzrx27i4v.f[5]++; cov_2gzrx27i4v.s[27]++; reject(error); }); cov_2gzrx27i4v.s[28]++; if ((cov_2gzrx27i4v.b[7][0]++, 'body' in requestParams === true) && (cov_2gzrx27i4v.b[7][1]++, requestParams.body !== null)) { cov_2gzrx27i4v.b[6][0]++; cov_2gzrx27i4v.s[29]++; request.write(requestParams.body); } else { cov_2gzrx27i4v.b[6][1]++; } cov_2gzrx27i4v.s[30]++; request.end(); }); } }]); return customHttps; }(); exports.default = customHttps; //# sourceMappingURL=https.js.map
19.406904
134
0.330459
228439576f97043ff60484f99c2d86a47421ddfa
274
js
JavaScript
gaze_project/gazeBehavior/ver_5/templates/src/components/Footer.js
kidrabit/Data-Visualization-Lab-RND
baa19ee4e9f3422a052794e50791495632290b36
[ "Apache-2.0" ]
1
2022-01-18T01:53:34.000Z
2022-01-18T01:53:34.000Z
gaze_project/gazeBehavior/ver_5/templates/src/components/Footer.js
kidrabit/Data-Visualization-Lab-RND
baa19ee4e9f3422a052794e50791495632290b36
[ "Apache-2.0" ]
null
null
null
gaze_project/gazeBehavior/ver_5/templates/src/components/Footer.js
kidrabit/Data-Visualization-Lab-RND
baa19ee4e9f3422a052794e50791495632290b36
[ "Apache-2.0" ]
null
null
null
import React from 'react'; class Footer extends React.Component { render() { return ( <> <hr /> <div>ⓒData Visualization Lab, <a href="http://sejong.ac.kr">Sejong University</a></div> </> ); } } export default Footer;
18.266667
96
0.536496
2284522a55376051afdd8fce4d0482eb960c327e
674
js
JavaScript
rallyboard-v2/client/src/LoadingStatus.js
tylerjw/rallyscores
fd624b74a923f360431e8d34640862d280176c12
[ "MIT" ]
1
2020-10-11T18:02:02.000Z
2020-10-11T18:02:02.000Z
rallyboard-v2/client/src/LoadingStatus.js
tylerjw/rallyscores
fd624b74a923f360431e8d34640862d280176c12
[ "MIT" ]
null
null
null
rallyboard-v2/client/src/LoadingStatus.js
tylerjw/rallyscores
fd624b74a923f360431e8d34640862d280176c12
[ "MIT" ]
null
null
null
import React, { Component } from 'react'; import { Progress, Segment, Header } from 'semantic-ui-react'; class LoadingStatus extends Component { render() { const { status } = this.props; let percent = 0; if (status === 'started') { percent = 25; } else if (status === 'pending') { percent = 50; } else if (status === 'running') { percent = 75; } else if (status === 'finished') { percent = 100; } return ( <Segment> <Header>Updating results</Header> <Progress percent={percent} indicating > Job status: {status} </Progress> </Segment> ); } } export default LoadingStatus;
20.424242
81
0.569733
22853b4234167cb9023874ecbbfb7e6f55e3438c
786
js
JavaScript
controllers/authController.js
nasiratt92/WDI-project-three-sinatrafans
7e634e8ae6ede50d6bed0d2ce66fd5516678e45e
[ "MIT" ]
1
2018-11-06T15:15:27.000Z
2018-11-06T15:15:27.000Z
controllers/authController.js
nasiratt92/WDI-project-three-sinatrafans
7e634e8ae6ede50d6bed0d2ce66fd5516678e45e
[ "MIT" ]
null
null
null
controllers/authController.js
nasiratt92/WDI-project-three-sinatrafans
7e634e8ae6ede50d6bed0d2ce66fd5516678e45e
[ "MIT" ]
null
null
null
const User = require('../models/user'); const jwt = require('jsonwebtoken'); const { secret } = require('../config/environment'); function register(req, res, next){ User .create(req.body) .then(() => res.json({message: 'registration successful'})) .catch(next); } function login(req, res, next){ User .findOne({email: req.body.email }) .then(user => { if(!user || !user.validatePassword(req.body.password)){ return res.status(401).json({message: 'Unauthorised'}); } const token = jwt.sign({sub: user.id, admin: false}, secret, {expiresIn: '2hr'}); console.log('token created', token); return res.json({message: `Welcome back ${user.userName}`, token}); }) .catch(next); } module.exports = { register, login };
27.103448
87
0.617048
2288024a89634fabb73ddc6f8ab95e568c25fee6
385
js
JavaScript
src/client/reducers/confirmation-email.js
lexarflash8g/sba-gov-katana
d9f67bdd7ad194d37377693cecdfed3a91f4ffa2
[ "Apache-2.0" ]
2
2020-05-05T16:58:21.000Z
2021-03-08T21:40:18.000Z
src/client/reducers/confirmation-email.js
lexarflash8g/sba-gov-katana
d9f67bdd7ad194d37377693cecdfed3a91f4ffa2
[ "Apache-2.0" ]
14
2019-07-25T23:53:32.000Z
2021-07-16T18:31:30.000Z
src/client/reducers/confirmation-email.js
lexarflash8g/sba-gov-katana
d9f67bdd7ad194d37377693cecdfed3a91f4ffa2
[ "Apache-2.0" ]
5
2020-04-07T13:29:08.000Z
2021-03-16T22:10:22.000Z
const confirmationEmailReducer = (state = {}, action) => { if (action.type === 'RESEND_CONFIRMATION_EMAIL_SUCCESS') { return Object.assign({}, state, { resent: 'success' }) } else if (action.type === 'RESEND_CONFIRMATION_EMAIL_ERROR') { return Object.assign({}, state, { resent: 'error' }) } return state } export default confirmationEmailReducer
24.0625
65
0.649351