text
stringlengths
2
1.05M
import styled from "styled-components" export default styled.label` display: block; background-color: #efefef; color: #31302d; font-size: ${({ theme }) => theme.font.xs}; padding: 1rem 3rem; cursor: pointer; ::first-letter { text-transform: uppercase; } @media (max-width: ${({ theme }) => theme.breakpoints.smallDesktop}) { font-size: ${({ theme }) => theme.font.xs}; padding: .8rem 1.2rem; } `
(function ($) { "use strict"; // Start of use strict // Preloader Start $(window).on('load', function () { $('#status').fadeOut(); $('#preloader') .delay(350) .fadeOut('slow'); $('body') .delay(350) }); // Preloader End /// MAIN MENU SCRIPT START // Smooth scrolling using jQuery easing $('a.js-scroll-trigger[href*="#"]:not([href="#"])').on('click', function () { if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) { var target = $(this.hash); target = target.length ? target : $('[name=' + this.hash.slice(1) + ']'); if (target.length) { $('html, body').animate({ scrollTop: (target.offset().top - 48) }, 1000, "easeInOutExpo"); return false; } } }); // Closes responsive menu when a scroll trigger link is clicked $('.js-scroll-trigger').on('click', function () { $('.navbar-collapse').collapse('hide'); }); // MAIN MENU SCRIPT END // Mouse Move Effect start $(document).mousemove(function (event) { var xPos = (event.clientX / $(window).width()) - 0.5, yPos = (event.clientY / $(window).height()) - 0.5, box = $('.box'), coord = $('.coordinates'); TweenLite.to(box, 0.6, { rotationY: 5 * xPos, rotationX: 5 * yPos, ease: Power1.easeOut, transformPerspective: 500, transformOrigin: 'center' }); }); // Mouse Move Effect end // Veno Box $('.venobox').venobox(); // Wow js new WOW().init(); })(jQuery); // End of use strict
import _extends from "@babel/runtime/helpers/esm/extends"; import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; import React, { useContext } from 'react'; import SelectableContext from './SelectableContext'; import AccordionContext from './AccordionContext'; export function useAccordionToggle(eventKey, onClick) { var contextEventKey = useContext(AccordionContext); var onSelect = useContext(SelectableContext); return function (e) { /* Compare the event key in context with the given event key. If they are the same, then collapse the component. */ var eventKeyPassed = eventKey === contextEventKey ? null : eventKey; onSelect(eventKeyPassed, e); if (onClick) onClick(e); }; } var AccordionToggle = React.forwardRef(function (_ref, ref) { var _ref$as = _ref.as, Component = _ref$as === void 0 ? 'button' : _ref$as, children = _ref.children, eventKey = _ref.eventKey, onClick = _ref.onClick, props = _objectWithoutPropertiesLoose(_ref, ["as", "children", "eventKey", "onClick"]); var accordionOnClick = useAccordionToggle(eventKey, onClick); return React.createElement(Component, _extends({ ref: ref, onClick: accordionOnClick }, props), children); }); export default AccordionToggle;
export const androidBus = {"viewBox":"0 0 512 512","children":[{"name":"g","attribs":{"id":"Icon_14_"},"children":[{"name":"g","attribs":{},"children":[{"name":"g","attribs":{},"children":[{"name":"g","attribs":{},"children":[{"name":"g","attribs":{},"children":[{"name":"path","attribs":{"d":"M80,352c0,19.198,13.864,24.531,26.667,36.271v38.396c0,11.729,9.599,21.334,21.333,21.334h21.333\r\n\t\t\t\tc11.734,0,21.334-9.604,21.334-21.334v-21.333h170.666v21.333c0,11.729,9.604,21.334,21.334,21.334H384\r\n\t\t\t\tc11.729,0,21.333-9.604,21.333-21.334v-38.396C418.136,376.531,432,370.136,432,352V148.334C432,73.667,349.864,64,256,64\r\n\t\t\t\tS80,73.667,80,148.334V352z M160,367.989c-18.136,0-32-13.864-32-32c0-18.135,13.864-32,32-32s32,13.865,32,32\r\n\t\t\t\tC192,354.125,178.136,367.989,160,367.989z M352,367.989c-18.136,0-32-13.864-32-32c0-18.135,13.864-32,32-32s32,13.865,32,32\r\n\t\t\t\tC384,354.125,370.136,367.989,352,367.989z M384,245.333H128V138.667h256V245.333z"},"children":[{"name":"path","attribs":{"d":"M80,352c0,19.198,13.864,24.531,26.667,36.271v38.396c0,11.729,9.599,21.334,21.333,21.334h21.333\r\n\t\t\t\tc11.734,0,21.334-9.604,21.334-21.334v-21.333h170.666v21.333c0,11.729,9.604,21.334,21.334,21.334H384\r\n\t\t\t\tc11.729,0,21.333-9.604,21.333-21.334v-38.396C418.136,376.531,432,370.136,432,352V148.334C432,73.667,349.864,64,256,64\r\n\t\t\t\tS80,73.667,80,148.334V352z M160,367.989c-18.136,0-32-13.864-32-32c0-18.135,13.864-32,32-32s32,13.865,32,32\r\n\t\t\t\tC192,354.125,178.136,367.989,160,367.989z M352,367.989c-18.136,0-32-13.864-32-32c0-18.135,13.864-32,32-32s32,13.865,32,32\r\n\t\t\t\tC384,354.125,370.136,367.989,352,367.989z M384,245.333H128V138.667h256V245.333z"},"children":[]}]}]}]}]}]}]}]};
import Range from './tools/range'; import Submenu from './submenuBase'; import templateHtml from './template/submenu/zoom'; import {toInteger, assignmentForDestroy} from '../util'; const defaultShapeStrokeValus = { realTimeEvent: true, min: 1, max: 5, useDecimal: false, value: 1 }; /** * Shape ui class * @class * @ignore */ class Zoom extends Submenu { constructor(subMenuElement, {locale, makeSvgIcon, menuBarPosition, usageStatistics}) { super(subMenuElement, { locale, name: 'zoom', makeSvgIcon, menuBarPosition, templateHtml, usageStatistics }); this._els = { strokeRange: new Range({ slider: this.selector('.tie-zoom-range'), input: this.selector('.tie-zoom-range-value') }, defaultShapeStrokeValus) }; } /** * Destroys the instance. */ destroy() { this._removeEvent(); this._els.strokeRange.destroy(); assignmentForDestroy(this); } /** * Add event for shape * @param {Object} actions - actions for shape * @param {Function} actions.changeShape - change shape mode * @param {Function} actions.setDrawingShape - set dreawing shape */ addEvent(actions) { this.actions = actions; this._els.strokeRange.on('change', this._debounce(this._changeStrokeRangeHandler.bind(this), 500)); } /** * Remove event * @private */ _removeEvent() { this._els.strokeRange.off(); } /** * Executed when the menu starts. */ changeStartMode() { } /** * Returns the menu to its default state. */ changeStandbyMode() { } /** * set range stroke max value * @param {number} maxValue - expect max value for change */ setMaxStrokeValue(maxValue) { let strokeMaxValue = maxValue; if (strokeMaxValue <= 0) { strokeMaxValue = defaultShapeStrokeValus.max; } this._els.strokeRange.max = strokeMaxValue; } /** * Set stroke value * @param {number} value - expect value for strokeRange change */ setStrokeValue(value) { this._els.strokeRange.value = value; this._els.strokeRange.trigger('change'); } /** * Get stroke value * @returns {number} - stroke range value */ getStrokeValue() { return this._els.strokeRange.value; } /** * Change stroke range * @param {number} value - stroke range value * @param {boolean} isLast - Is last change * @private */ _changeStrokeRangeHandler(value) { const strokeWidth = toInteger(value); this.actions.setZoomValue(strokeWidth); } _debounce(func, delay) { let inDebounce; return (...args) => { clearTimeout(inDebounce); inDebounce = setTimeout(() => func.apply(this, args), delay); }; } } export default Zoom;
/** * DO NOT EDIT THIS FILE. * See the following change record for more information, * https://www.drupal.org/node/2815083 * @preserve **/ (function ($, Drupal) { 'use strict'; Drupal.AudiofieldWordpress = {}; Drupal.AudiofieldWordpress.generate = function (context, file, settings) { var autostartSetting = 'no'; if (!!settings.autoplay) { autostartSetting = 'yes'; } $.each($(context).find('#wordpressaudioplayer_' + file.unique_id).once('generate-waveform'), function (index, item) { AudioPlayer.embed($(item).attr('id'), { soundFile: file.file, titles: file.title, autostart: autostartSetting, loop: 'no', initialvolume: settings.volume, checkpolicy: 'yes', animation: settings.animate }); }); }; Drupal.behaviors.audiofieldwordpress = { attach: function buildWordpressPlayers(context, settings) { $.each(settings.audiofieldwordpress, function (key, settingEntry) { AudioPlayer.setup('/libraries/wordpress-audio/player.swf', { width: 400, initialvolume: settingEntry.volume, transparentpagebg: 'yes' }); $.each(settingEntry.files, function (key2, fileEntry) { Drupal.AudiofieldWordpress.generate(context, fileEntry, settingEntry); }); }); } }; })(jQuery, Drupal);
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-391c77e0"],{"01c4":function(t,a,e){t.exports=e.p+"img/shopping-cart-0.3571fbe2.svg"},"2e8a":function(t,a,e){"use strict";e.r(a);var n=function(){var t=this,a=t.$createElement,n=t._self._c||a;return n("div",{staticClass:"superb"},[n("van-nav-bar",{attrs:{title:"Superb","left-text":"Back","left-arrow":""}},[n("van-icon",{attrs:{slot:"right",name:"search"},slot:"right"})],1),n("div",[n("van-tabs",{attrs:{animated:""},model:{value:t.active,callback:function(a){t.active=a},expression:"active"}},[n("van-tab",{attrs:{title:"Personal Infomation"}},[n("van-cell-group",[n("van-cell",{staticClass:"pp",attrs:{title:"Profile Picture","is-link":""}},[n("div",{staticClass:"avatar"},[n("el-avatar",{attrs:{size:100,src:"https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png"}})],1)]),n("van-cell",{attrs:{title:"Name","is-link":"",to:"name"}},[n("span",{staticStyle:{"margin-right":"15px"}},[t._v("Namename\r\n ")])]),n("van-cell",{attrs:{title:"Account Name"}},[n("span",{staticStyle:{"margin-right":"25px"}},[t._v("Name11111111\r\n ")])]),n("van-cell",{attrs:{title:"Birthday","is-link":"",to:"bday"}},[n("span",{staticStyle:{"margin-right":"15px"}},[t._v("12-01-2019\r\n ")])]),n("van-cell",{attrs:{title:"Gender","is-link":"",to:"gender"}},[n("span",{staticStyle:{"margin-right":"23px"}},[t._v("Female\r\n ")])])],1),n("van-cell-group",[n("van-cell",{attrs:{title:"Shipping Address","is-link":"",value:"1000 Massachu...",to:"shipping"}}),n("van-cell",{attrs:{title:"Billing Address","is-link":"",value:"1000 Massachu...",to:"billing"}})],1)],1)],1)],1),n("van-tabbar",{model:{value:t.active,callback:function(a){t.active=a},expression:"active"}},[n("van-tabbar-item",{attrs:{info:"3"},scopedSlots:t._u([{key:"icon",fn:function(a){return n("img",{attrs:{src:a.active?t.shop.active:t.shop.normal}})}}])}),n("van-tabbar-item",{attrs:{dot:""},scopedSlots:t._u([{key:"icon",fn:function(a){return n("img",{attrs:{src:a.active?t.chat.active:t.chat.normal}})}}])}),n("van-tabbar-item",{attrs:{info:"5"},scopedSlots:t._u([{key:"icon",fn:function(a){return n("img",{attrs:{src:a.active?t.cart.active:t.cart.normal}})}}])}),n("van-tabbar-item",[n("img",{attrs:{slot:"icon",height:"1000",src:e("7a87")},slot:"icon"})])],1)],1)},i=[],c={data:function(){return{active:0,shop:{normal:e("5567"),active:e("5cb7")},chat:{normal:e("e9560"),active:e("5f66")},cart:{normal:e("01c4"),active:e("568d")},name:"Namename",accountname:"Name11111111",byear:"2019",bmonth:"12",bday:"01",gender:"female",shippingaddr:"1000 Massachu...",billingaddr:"1000 Massachu..."}}},s=c,r=(e("d494"),e("0c7c")),l=Object(r["a"])(s,n,i,!1,null,null,null);a["default"]=l.exports},"47a7":function(t,a,e){},5567:function(t,a,e){t.exports=e.p+"img/shop-0.7acb92ca.svg"},"568d":function(t,a,e){t.exports=e.p+"img/shopping-cart.4b2dc479.svg"},"5cb7":function(t,a,e){t.exports=e.p+"img/shop.a010fdab.svg"},"5f66":function(t,a,e){t.exports=e.p+"img/chat.ca2e559e.svg"},"7a87":function(t,a,e){t.exports=e.p+"img/superb.aad0b53b.svg"},d494:function(t,a,e){"use strict";var n=e("47a7"),i=e.n(n);i.a},e9560:function(t,a,e){t.exports=e.p+"img/chat-0.c9faca76.svg"}}]); //# sourceMappingURL=chunk-391c77e0.13ee4e8b.js.map
/** * Copyright IBM Corp. 2019, 2020 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. * * Code generated by @carbon/icon-build-helpers. DO NOT EDIT. */ 'use strict'; var Icon = require('../Icon-1083255b.js'); var React = require('react'); require('@carbon/icon-helpers'); require('prop-types'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var React__default = /*#__PURE__*/_interopDefaultLegacy(React); var _path; var ArrowLeft24 = /*#__PURE__*/React__default['default'].forwardRef(function ArrowLeft24(_ref, ref) { var children = _ref.children, rest = Icon._objectWithoutProperties(_ref, ["children"]); return /*#__PURE__*/React__default['default'].createElement(Icon.Icon, Icon._extends({ width: 24, height: 24, viewBox: "0 0 32 32", xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", ref: ref }, rest), _path || (_path = /*#__PURE__*/React__default['default'].createElement("path", { d: "M14 26L15.41 24.59 7.83 17 28 17 28 15 7.83 15 15.41 7.41 14 6 4 16 14 26z" })), children); }); module.exports = ArrowLeft24;
export default { header: 'Menu', headerText: 'The `v-menu` component shows a menu at the position of the element used to activate it.', components: ['v-menu'], examples: [{ activator: { header: 'Activator', desc: 'Remember to put the element that activates the menu in the `activator` slot.', uninverted: true }, absolute: { header: 'Absolute position', desc: 'Menus can also be placed absolutely on top of the activator element using the `absolute` prop. Try clicking anywhere on the image.', uninverted: true }, absoluteWithoutActivator: { header: 'Absolute position without activator', desc: 'Menus can also be used without an activator by using `absolute` together with the props `position-x` and `position-y`. Try right-clicking anywhere on the image.', uninverted: true }, hover: { header: 'Hover', desc: 'Menus can be accessed using hover instead of clicking with the `open-on-hover` prop.', uninverted: true }, menus: { header: 'Menus', desc: 'Menus can be placed within almost any component.', uninverted: true }, customTransition: { header: 'Custom transitions', desc: 'Vuetify comes with 3 standard transitions, **scale**, **slide-x** and **slide-y**. You can also create your own and pass it as the transition argument. For an example of how the stock transitions are constructed, visit <a href="https://github.com/vuetifyjs/vuetify/blob/master/src/util/helpers.js#L13" target="_blank" rel="noopener">here</a>.', uninverted: true }, popover: { header: 'Popover menu', desc: 'A menu can be configured to be static when opened, allowing it to function as a popover. This can be useful when there are multiple interactive items within the menu contents.', uninverted: true } }], props: { closeOnClick: 'Designates if menu should close on outside-activator click', closeOnContentClick: 'Designates if menu should close when its content is clicked', disabled: 'Disables the menu', offsetX: 'Offset the menu on the x-axis. Works in conjunction with direction left/right', offsetY: 'Offset the menu on the y-axis. Works in conjunction with direction top/bottom', openOnClick: 'Designates whether menu should open on activator click', openOnHover: 'Designates whether menu should open on activator hover', origin: 'Mixins.Transitionable.props.origin', transition: 'Mixins.Transitionable.props.transition' } }
/** * inputevent - Alleviate browser bugs for input events * https://github.com/marcandre/inputevent * @version v0.0.3 - (built Thu, Apr 14th 2016, 5:58 pm) * @author Marc-Andre Lafortune <github@marc-andre.ca> * @license MIT */ import $ from 'jquery'; function InputEvent() { let globals = window || global; // Slightly odd way construct our object. This way methods are force bound. // Used to test for duplicate library. $.extend(this, { // For browsers that do not support isTrusted, assumes event is native. isNativeEvent: evt = > { return evt.originalEvent && evt.originalEvent.isTrusted !== false; }, fakeInputEvent: evt = > { if (this.isNativeEvent(evt)) { $(evt.target).trigger('input'); } } , misbehaves: evt = > { if (this.isNativeEvent(evt)) { this.behavesOk(evt); $(document) .on('change.inputevent', evt.data.selector, this.fakeInputEvent); this.fakeInputEvent(evt); } } , behavesOk: evt = > { if (this.isNativeEvent(evt)) { $(document) // Simply unbinds the testing handler .off('input.inputevent', evt.data.selector, this.behavesOk) .off('change.inputevent', evt.data.selector, this.misbehaves); } } , // Bind the testing handlers install: () = > { if (globals.inputEventPatched) { return; } globals.inputEventPatched = '0.0.3'; for (let selector of ['select', 'input[type="checkbox"]', 'input[type="radio"]', 'input[type="file"]']) { $(document) .on('input.inputevent', selector, {selector}, this.behavesOk) .on('change.inputevent', selector, {selector}, this.misbehaves); } } , uninstall: () = > { delete globals.inputEventPatched; $(document).off('.inputevent'); } }) ; }; export default new InputEvent();
function foo() { console.log("lol, i don't do anything") } function foo2() { foo() console.log('i called foo') } function broken() { try { /*fkjdsahfdhskfhdsahfudshafuoidashfudsa*/ fdasfds[0]; // i throw an error h sadhf hadsfdsakf kl;dsjaklf jdklsajfk ljds;klafldsl fkhdas;hf hdsaf hdsalfhjldksahfljkdsahfjkl dhsajkfl hdklsahflkjdsahkfj hdsjakhf dkashfl diusafh kdsjahfkldsahf jkdashfj khdasjkfhdjksahflkjdhsakfhjdksahfjkdhsakf hdajskhf kjdash kjfads fjkadsh jkfdsa jkfdas jkfdjkas hfjkdsajlk fdsajk fjkdsa fjdsa fdkjlsa fjkdaslk hfjlkdsah fhdsahfui }catch(e) { Raven.captureException(e); } } function ready() { document.getElementById('test').onclick = broken; } function foo3() { document.getElementById('crap').value = 'barfdasjkfhoadshflkaosfjadiosfhdaskjfasfadsfads'; } function somethingelse() { document.getElementById('somethingelse').value = 'this is some realy really long message just so our minification is largeeeeeeeeee!'; } function derp() { fdas[0]; } function testOptions() { Raven.context({tags: {foo: 'bar'}}, function() { throw new Error('foo'); }); } function throwString() { throw 'oops'; } function showDialog() { broken(); Raven.showReportDialog(); } function blobExample() { var xhr = new XMLHttpRequest(); xhr.open('GET', 'stack.js'); xhr.onreadystatechange = function () { if (xhr.readyState === 4) { var blob = new Blob([xhr.responseText], {type: 'application/javascript'}); var url = URL.createObjectURL(blob); var script = document.createElement('script'); script.src = url; document.head.appendChild(script); } }; xhr.send(); } function a() { b(); } function b() { c(); } function c() { d(); } function d() { e(); } function e() { f(); } function f() { g(); } function g() { h(); } function h() { i(); } function i() { j(); } function j() { k(); } function k() { l(); } function l() { m(); } function m() { n(); } function n() { o(); } function o() { throw new Error('dang'); }
var breadcrumbs=[['-1',"",""],['2',"VitNX3 Documentation","topic_00000000000016E1.html"],['789',"VitNX3.Functions.Win32 Namespace","topic_00000000000000C6.html"],['3847',"Enums Class","topic_0000000000000DAB.html"],['3961',"NET_RESOURCE Structure","topic_0000000000000FC1.html"],['3962',"Fields","topic_0000000000000FC1_vars--.html"],['3965',"dwType Field","topic_0000000000000FC3.html"]];
var t=Object.prototype.toString,e=function(){},i=function(t){return t};function r(e){return function(i){return t.call(i)==="[object "+e+"]"}}var n=r("Function"),o=r("Array");var s="VI_SYNC",a="CHILD_",d="PARENT_",c=function(t){var e=t.el,i=t.origin;this.id=t.id,this.el=e,this.origin=i||"*"};c.prototype.update=function(t,e){this.el&&this.el.contentWindow.postMessage({type:t,payload:e},this.origin)};var p=function(t){var r=t.parent,o=t.store,s=t.convert,a=t.created,d=t.destroyed;this.id=t.id,this.store=o,this.parent=r||window.parent,this.convert=n(s)?s:i,this.createdCallback=n(a)?a:e,this.destroyedCallback=n(d)?d:e,this.init()};p.prototype.init=function(){var t=this,e=this.id,i=this.store,r=i._mutations,n=p.parentPrefix,o=p.childPrefix;Object.entries(r).forEach(function(t){r[n+t[0]]=t[1]}),r[n+"INIT_STATE"]=[function(t){Object.assign(i.state,t)}],i.subscribe(function(i,r){var s=i.type,a=i.payload;s.indexOf(n)>=0||t.send(o+s,{id:e,payload:a})}),window.addEventListener("load",this.load.bind(this)),window.addEventListener("message",this.update.bind(this)),window.addEventListener("beforeunload",this.unLoad.bind(this))},p.prototype.update=function(t){var e=t.data,i=e.type,r=e.payload,n=this.store;(i&&Reflect.has(n._mutations,i)||"INIT_STATE"===i)&&n.commit(p.parentPrefix+i,r)},p.prototype.send=function(t,e){this.parent&&this.parent.postMessage({type:t,payload:this.convert(e)},this.parent.location&&this.parent.location.origin)},p.prototype.load=function(){this.send(p.moduleName+"/ADD_IN_BROADCAST_LIST",this.id),this.created()},p.prototype.unLoad=function(){this.send(p.moduleName+"/DEL_IN_BROADCAST_LIST",this.id),this.destroyed()},p.prototype.created=function(){this.createdCallback(this.id,this.store,this.send.bind(this))},p.prototype.destroyed=function(){this.destroyedCallback(this.id,this.store,this.send.bind(this))},p.moduleName="",p.parentPrefix="",p.childPrefix="";var u=function(t){var e=t.ids,r=t.store,s=t.convert;this.childs="string"==typeof e?e.split(",").map(function(t){return{id:t}}):o(e)?e:[],this.observerList=[],this.store=r,this.convert=n(s)?s:i,this.init()};u.prototype.addObserver=function(t){var e=this.childs.find(function(e){return e.id===t});if(e){var i=document.getElementById(t);if(i&&"IFRAME"===i.tagName){var r=new c({id:t,origin:e.origin,el:i});return this.observerList.push(r),this.notifyObserver(r,{type:"INIT_STATE",payload:function(t,e){void 0===e&&(e=[]);var i={};for(var r in t)e.indexOf(r)<0&&(i[r]=t[r]);return i}(this.store.state,[u.moduleName])}),r}}},u.prototype.deleteObserver=function(t){var e=this.observerList.map(function(t){return t.id}).indexOf(t);e>=0&&this.observerList.splice(e,1)},u.prototype.notifyObserver=function(t,e){t.update(e.type,this.convert(e.payload))},u.prototype.notifyObservers=function(t){for(var e=t.id,i=t.type,r=t.payload,n=0,o=this.observerList.filter(function(t){return t.id!==e});n<o.length;n+=1){this.notifyObserver(o[n],{type:i,payload:r})}},u.prototype.init=function(){var t,e=this,i=e.store._mutations,r=u.moduleName,n=u.childPrefix;e.store.registerModule(r,{namespaced:!0,mutations:(t={},t.ADD_IN_BROADCAST_LIST=function(t,i){e.addObserver(i)},t.DEL_IN_BROADCAST_LIST=function(t,i){e.deleteObserver(i)},t)}),Object.entries(i).forEach(function(t){var r=t[0];i[n+r]=t[1].map(function(t){return function(i){var n=i.id,o=i.payload;t(o),e.notifyObservers({id:n,type:r,payload:o})}})});var o=new RegExp("^("+n+"|"+r+")");e.store.subscribe(function(t,i){var r=t.type,n=t.payload;o.test(r)||e.notifyObservers({type:r,payload:n})}),window.addEventListener("message",this.update.bind(this))},u.prototype.update=function(t){var e=t.data,i=e.type,r=e.payload,n=this.store;i&&Reflect.has(n._mutations,i)&&n.commit(i,r)},u.moduleName="",u.parentPrefix="",u.childPrefix="";exports.broadcast=function(t,e){return void 0===e&&(e={}),function(i){var r=e.parentPrefix,n=e.childPrefix,o=e.convert;return u.moduleName=e.moduleName||s,u.parentPrefix=r||d,u.childPrefix=n||a,new u({ids:t,store:i,convert:o})}},exports.transfer=function(t){return void 0===t&&(t={}),function(e){var i=t.parentPrefix,r=t.childPrefix,n=t.convert,o=t.created,c=t.destroyed;return p.moduleName=t.moduleName||s,p.parentPrefix=i||d,p.childPrefix=r||a,new p({id:t.id||window.frameElement.id,store:e,convert:n,created:o,destroyed:c})}}; //# sourceMappingURL=vuex-iframe-sync.js.map
import React, { Component } from 'react'; import ReactDOM from 'react-dom'; import axios from 'axios'; import Grid from '@material-ui/core/Grid'; import Button from '@material-ui/core/Button'; import TextField from '@material-ui/core/TextField'; import { IconContext } from "react-icons"; import { IoLogoYoutube } from 'react-icons/io'; import SaveIcon from '@material-ui/icons/Save'; import VpnKey from '@material-ui/icons/VpnKey'; import HelpText from '../HelpText'; import AlertSave from '../AlertSave'; export default class SMYouTube extends Component { constructor(props) { super(props); this.state = { youtube: '', youtubeKey: '', youtubeSecret: '', opensuccess: false, openfail: false, failmessage: '', }; this.handleSubmit = this.handleSubmit.bind(this); } handleChange(e){ const target = event.target; const value = target.type === 'checkbox' ? target.checked : target.value; const name = target.name; this.setState({ [name]: value }); } componentDidMount(){ if(typeof(this.props.owner) == "undefined") return; if(this.props.owner=='') return; axios.get("/social/load/"+this.props.owner) .then(response => { this.setState({ youtube: response.data.youtube, }); }) .catch(function (error) { this.setState({ youtube: "", youtubeKey: "", youtubeSecret: "", }); console.log(error); }) } handleSubmit(event) { event.preventDefault(); const sm = { type: 'YOUTUBE', owner: this.props.owner, youtube: this.state.youtube, youtubeKey: this.state.youtubeKey, youtubeSecret: this.state.youtubeSecret, } let uri = '/social/save'; axios.post(uri, sm) .then((response) => { //this.props.history.push('/display-item'); this.setState({ opensuccess: true }) }) .catch(function (error) { this.setState({ failmessage: error, openfail: true }) console.log(error); }) } render() { const neu = { backgroundColor: "#E0E5EC" , borderRadius:4, marginLeft: "auto", marginRight: 120, marginTop:10, marginBottom:30, paddingRight:50, paddingBottom:30, //boxShadow: "9px 9px 16px rgb(163,177,198,0.6), -9px -9px 16px rgba(255,255,255, 0.5)" }; const neuhelp = { //backgroundColor: "#E0E5EC" , borderRadius:4, marginLeft: "auto", marginRight: "auto", marginTop:10, paddingBottom:16, paddingRight:20, //boxShadow: "9px 9px 16px rgb(163,177,198,0.6), -9px -9px 16px rgba(255,255,255, 0.5)" }; const upstyle = { marginLeft: 20, marginRight: 20, marginTop:20, paddingTop:20, paddingLeft:10, paddingRight:20, }; return ( <form style={neu} noValidate autoComplete="off" onSubmit={this.handleSubmit}> <IconContext.Provider value={{ color: "skyblue", size: "3rem", style: { paddingRight: "1em", verticalAlign: 'middle' }, className: "global-class-name" }}> <Grid style={{paddingLeft: 10}} container spacing={2}> <Grid item xs={12}> <Button color="primary" type="submit"> <SaveIcon />Save </Button> </Grid> <Grid item xs={12}> <IoLogoYoutube /> <TextField id="sm-youtube" fullWidth name="youtube" value={this.state.youtube} onChange={(e)=>{this.handleChange(e);}} label="Youtube" /> </Grid> <Grid item xs={12} style={upstyle}> <HelpText name='youtube.api' style="neuhelp"/> </Grid> <Grid item xs={12}> <VpnKey /> <TextField id="sm-youtubeKey" name="youtubeKey" fullWidth value={this.state.youtubeKey} onChange={(e)=>{this.handleChange(e);}} label="Youtube Key" /> </Grid> <Grid item xs={12}> <IoLogoYoutube /> <TextField id="sm-youtubeSecret" fullWidth name="youtubeSecret" value={this.state.youtubeSecret} onChange={(e)=>{this.handleChange(e);}} label="Youtube Secret" /> </Grid> </Grid> </IconContext.Provider> <AlertSave opensuccess={this.state.opensuccess} openfail={this.state.openfail} failmessage={this.state.failmessage} datatype="youtube details"/> </form> ); } }
import path from 'path'; import fs from 'fs'; import sinon from 'sinon'; import stripAnsi from 'strip-ansi'; import bbconfig from './blackbox-config.js'; import {createDirectory, copyFileOrDirectory, deleteDirectory} from '../../lib/utils/file/file.js'; import {Testophobia} from '../../lib/Testophobia.js'; import {Logger} from '../../lib/Logger.js'; import {Output} from '../../lib/Output.js'; const moduleURL = new URL(import.meta.url); const __dirname = path.dirname(moduleURL.pathname); const blackbox = {}; const sandboxDir = path.join(__dirname, 'sandbox'); let consoleChanges = []; let loggerStub = null; let spinnerStubs = []; let parallelStub = null; const stubLogger = (output, verbose) => { const logger = output._getLog(); logger.setLevel(verbose ? Logger.DEBUG_LEVEL : Logger.INFO_LEVEL); loggerStub = sinon.stub(logger, '_log').callsFake((message, consoleLevel, chalkColor) => { if (verbose || chalkColor !== 'dim') consoleChanges.push({message: stripAnsi(message), consoleLevel, chalkColor}); if (consoleLevel === 'error') console.error(message); }); logger.fatal = function(message) { this._log(message, 'error', 'red'); throw new Error('Process Exited'); }; }; const stubOra = output => { let isSpinning = false; let spinner = new SpinnerMock(); spinnerStubs = []; spinnerStubs.push(sinon.stub(spinner, 'isSpinning').returns(isSpinning)); spinnerStubs.push( sinon.stub(spinner, 'start').callsFake(() => { if (!isSpinning) consoleChanges.push({spinner: 'start'}); isSpinning = true; }) ); spinnerStubs.push(sinon.stub(spinner, 'stop').callsFake(() => {})); spinnerStubs.push( sinon.stub(spinner, 'succeed').callsFake(() => { consoleChanges.push({spinner: 'succeed'}); isSpinning = false; }) ); spinnerStubs.push( sinon.stub(spinner, 'fail').callsFake(() => { consoleChanges.push({spinner: 'fail'}); isSpinning = false; }) ); spinnerStubs.push( sinon.stub(spinner, 'text').set(val => { consoleChanges.push({spinner: 'message', text: stripAnsi(val)}); }) ); output._setSpinner(spinner); }; blackbox.setupTests = test => { test.beforeEach(t => { return new Promise(async resolve => { await deleteDirectory(sandboxDir); const inst = !!global.mocks ? global.mocks.instance + 1 : 1; global.mocks = { instance: inst, meow: () => bbconfig.getMeowResult(), findConfig: () => bbconfig.getFindConfigResult(), inquirer: () => bbconfig.getInquirerResult(), } resolve(); }); }); test.afterEach.always(t => { return new Promise(async resolve => { consoleChanges = []; loggerStub.restore(); spinnerStubs.forEach(s => s.restore()); if (parallelStub) parallelStub.restore(); resolve(); }); }); }; blackbox.getConsoleChanges = () => { return consoleChanges; }; blackbox.createTestophobia = async verbose => { const output = new Output(); stubLogger(output, verbose); stubOra(output); const t = new Testophobia(); await t.init(sandboxDir, output); return t; }; blackbox.runTestophobia = async tp => { try { await tp.run(); } catch (e) { /* ignored */ } }; blackbox.dumpConsole = tp => { console.log(JSON.stringify(consoleChanges, null, 2)); }; blackbox.createEmptySandbox = (meowResult) => { createDirectory(sandboxDir); bbconfig.setMeowResult(meowResult); }; blackbox.useBadConfigFile = async result => { createDirectory(sandboxDir); if (result) fs.writeFileSync(path.join(__dirname, `sandbox/testophobia.config${global.mocks.instance}.js`), result); bbconfig.setMeowResult({input: ['undefined'], flags: {}}); }; blackbox.applyConfigFile = async (skipDirs, applyUserCfg, meowResult) => { createDirectory(sandboxDir); fs.writeFileSync(path.join(__dirname, `sandbox/testophobia.config${global.mocks.instance}.js`), 'export default ' + JSON.stringify(bbconfig.getConfig())); bbconfig.setMeowResult(meowResult); bbconfig.setUserCfgInUse(Boolean(applyUserCfg)); if (!skipDirs) { createDirectory('./sandbox/diffs'); createDirectory('./sandbox/golden-screens'); createDirectory('./sandbox/test-screens'); } }; blackbox.prepareTestRun = async tests => { blackbox.writeTestFiles(tests); blackbox.prepareGoldens(tests); const t = await blackbox.createTestophobia(); return t; }; blackbox.writeTestFiles = async tests => { tests.forEach(async t => { await createDirectory(t.dir); let tfile = t.file.slice(0, -8) + '-' + global.mocks.instance + '-test.js'; const filepath = path.join(__dirname, t.dir, tfile); fs.writeFileSync(filepath, 'export default ' + JSON.stringify(t.contents)); }); }; blackbox.prepareGoldens = async tests => { createDirectory(`./sandbox/golden-screens/chromium/desktop/section1`); createDirectory(`./sandbox/golden-screens/chromium/mobile/section1`); createDirectory(`./sandbox/golden-screens/chromium/desktop/section2`); createDirectory(`./sandbox/golden-screens/chromium/mobile/section2`); createDirectory(`./sandbox/golden-screens/chromium/desktop/section3`); createDirectory(`./sandbox/golden-screens/chromium/mobile/section3`); if (tests && tests.length) { tests.forEach(t => { copyFileOrDirectory(`./files/goldens/${t.testName}`, `./sandbox/golden-screens/chromium`); }); } }; blackbox.getFiles = dir => { if (!fs.existsSync(dir)) return []; return fs.readdirSync(dir).filter(p => !p.startsWith('.')); }; blackbox.stubParallel = (tp, cb) => { parallelStub = sinon.stub(tp, '_parallelRunComplete'); parallelStub.callsFake(() => cb()); }; blackbox.setFileGenResult = (result, cb) => { bbconfig.setInquirerResult(result, cb); }; blackbox.getGenConfigContents = () => { return bbconfig.getGenConfig(); }; blackbox.getGenTestContents = () => { return bbconfig.getGenTest(); }; class SpinnerMock { fail() {} get isSpinning() {} start() {} stop() {} succeed() {} set text(t) {} } export default blackbox;
const got = require('got'); const {duration} = require('moment'); const {Log} = require('azul-tools'); const {DebugLogs, SteamSupply} = require('../config/main.js'); async function RequestDatabase() { try { if (SteamSupply.Enabled && SteamSupply.EnableDB) { const Database = await RequestSteamSupply(); return Database; } } catch (e) { Log.Debug(e, false, DebugLogs); } return RequestBarter(); } async function RequestSteamSupply(Attempts = 1) { Log.Debug(`Requesting Steam.Supply sets database, Attempt #${Attempts}..`, false, DebugLogs); const ParseDatabase = async (data) => JSON.parse(data.trim()); try { const {statusCode, body} = await got(`https://steam.supply/API/${SteamSupply.Api}/cardamount`); if(statusCode !== 200) throw new Error("Bad statusCode"); if (body.indexOf("you are not paid.") > -1 || body.indexOf("API key not found") > -1) throw new Error("bad"); return ParseDatabase(body); } catch (err) { if (err.message === "bad") return Promise.reject("Your Steam.Supply API does not exist."); Log.Debug(`Failed to request Steam.Supply database, trying again in a minute.`, false, DebugLogs); await sleep(duration(1, 'minute')); return RequestSteamSupply(Attempts++); } } async function RequestBarter(Attempts = 1) { Log.Debug(`Requesting Barter.vg sets database, Attempt #${Attempts}..`, false, DebugLogs); const ParseDatabase = async function(data) { let newDB = {}; for (let AppId in data) { const details = data[AppId]; newDB[AppId] = details.cards; } return newDB; }; const o = { "url": "https://bartervg.com/browse/cards/json/", "responseType": "json" }; try { const {statusCode, body} = await got(o); if(statusCode !== 200) throw new Error("Bad statusCode"); return ParseDatabase(body); } catch (err) { Log.Debug(`Failed to request Barter.vg database, trying again in a minute.`, false, DebugLogs); await sleep(duration(1, 'minute')); return RequestBarter(Attempts++); } } module.exports = RequestDatabase;
import * as extend from '../Number' Number.prototype._mul = function (v) { return extend.mul(this, v) }
/* * MinIO Javascript Library for Amazon S3 Compatible Cloud Storage, (C) 2015 MinIO, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY, my-bucketname and my-objectname // are dummy values, please replace them with original values. var Minio = require('minio') var s3Client = new Minio.Client({ endPoint: 's3.amazonaws.com', accessKey: 'YOUR-ACCESSKEYID', secretKey: 'YOUR-SECRETACCESSKEY' }) var size = 0 // Get a full object. s3Client.getObject('my-bucketname', 'my-objectname', function(e, dataStream) { if (e) { return console.log(e) } dataStream.on('data', function(chunk) { size += chunk.length }) dataStream.on('end', function() { console.log("End. Total size = " + size) }) dataStream.on('error', function(e) { console.log(e) }) }) //Get a specific version of an object var versionedObjSize = 0 s3Client.getObject('my-versioned-bucket', 'my-versioned-object', {versionId:"my-versionId"}, function(err, dataStream) { if (err) { return console.log(err) } dataStream.on('data', function(chunk) { versionedObjSize += chunk.length }) dataStream.on('end', function() { console.log('End. Total size = ' + versionedObjSize) }) dataStream.on('error', function(err) { console.log(err) }) })
//[Dashboard Javascript] //Project: Florence Admin - Responsive Admin Template //Primary use: Used only for the main dashboard (index.html) // ------------------------------ var Widgetschart = function() { // Simple bar charts var _barChartWidget = function(element, barQty, height, animate, easing, duration, delay, color, tooltip) { if (typeof d3 == 'undefined') { console.warn('Warning - d3.min.js is not loaded.'); return; } // Initialize chart only if element exsists in the DOM if(element) { // Basic setup // ------------------------------ // Add data set var bardata = []; for (var i=0; i < barQty; i++) { bardata.push(Math.round(Math.random() * 10) + 10); } // Main variables var d3Container = d3.select(element), width = d3Container.node().getBoundingClientRect().width; // Construct scales // ------------------------------ // Horizontal var x = d3.scale.ordinal() .rangeBands([0, width], 0.3); // Vertical var y = d3.scale.linear() .range([0, height]); // Set input domains // ------------------------------ // Horizontal x.domain(d3.range(0, bardata.length)); // Vertical y.domain([0, d3.max(bardata)]); // Create chart // ------------------------------ // Add svg element var container = d3Container.append('svg'); // Add SVG group var svg = container .attr('width', width) .attr('height', height) .append('g'); // // Append chart elements // // Bars var bars = svg.selectAll('rect') .data(bardata) .enter() .append('rect') .attr('class', 'd3-random-bars') .attr('width', x.rangeBand()) .attr('x', function(d,i) { return x(i); }) .style('fill', color); // Tooltip // ------------------------------ // Initiate var tip = d3.tip() .attr('class', 'd3-tip') .offset([-10, 0]); // Show and hide if(tooltip == "hours" || tooltip == "goal" || tooltip == "members") { bars.call(tip) .on('mouseover', tip.show) .on('mouseout', tip.hide); } // Daily meetings tooltip content if(tooltip == "hours") { tip.html(function (d, i) { return "<div class='text-center'>" + "<h6 class='mb-0'>" + d + "</h6>" + "<span class='font-size-16'>meetings</span>" + "<div class='font-size-16'>" + i + ":00" + "</div>" + "</div>"; }); } // Statements tooltip content if(tooltip == "goal") { tip.html(function (d, i) { return "<div class='text-center'>" + "<h6 class='mb-0'>" + d + "</h6>" + "<span class='font-size-16'>statements</span>" + "<div class='font-size-16'>" + i + ":00" + "</div>" + "</div>"; }); } // Online members tooltip content if(tooltip == "members") { tip.html(function (d, i) { return "<div class='text-center bg-dark p-5'>" + "<h6 class='mb-0'>" + d + "0" + "</h6>" + "<span class='font-size-14'>members</span>" + "<div class='font-size-14'>" + i + ":00" + "</div>" + "</div>"; }); } // Bar loading animation // ------------------------------ // Choose between animated or static if(animate) { withAnimation(); } else { withoutAnimation(); } // Animate on load function withAnimation() { bars .attr('height', 0) .attr('y', height) .transition() .attr('height', function(d) { return y(d); }) .attr('y', function(d) { return height - y(d); }) .delay(function(d, i) { return i * delay; }) .duration(duration) .ease(easing); } // Load without animateion function withoutAnimation() { bars .attr('height', function(d) { return y(d); }) .attr('y', function(d) { return height - y(d); }); } // Resize chart // ------------------------------ // Call function on window resize $(window).on('resize', barsResize); // Call function on sidebar width change $(document).on('click', '.sidebar-control', barsResize); // Resize function // // Since D3 doesn't support SVG resize by default, // we need to manually specify parts of the graph that need to // be updated on window resize function barsResize() { // Layout variables width = d3Container.node().getBoundingClientRect().width; // Layout // ------------------------- // Main svg width container.attr("width", width); // Width of appended group svg.attr("width", width); // Horizontal range x.rangeBands([0, width], 0.3); // Chart elements // ------------------------- // Bars svg.selectAll('.d3-random-bars') .attr('width', x.rangeBand()) .attr('x', function(d,i) { return x(i); }); } } }; // Simple sparklines var _sparklinesWidget = function(element, chartType, qty, chartHeight, interpolation, duration, interval, color) { if (typeof d3 == 'undefined') { console.warn('Warning - d3.min.js is not loaded.'); return; } // Initialize chart only if element exsists in the DOM if(element) { // Basic setup // ------------------------------ // Define main variables var d3Container = d3.select(element), margin = {top: 0, right: 0, bottom: 0, left: 0}, width = d3Container.node().getBoundingClientRect().width - margin.left - margin.right, height = chartHeight - margin.top - margin.bottom; // Generate random data (for demo only) var data = []; for (var i=0; i < qty; i++) { data.push(Math.floor(Math.random() * qty) + 5); } // Construct scales // ------------------------------ // Horizontal var x = d3.scale.linear().range([0, width]); // Vertical var y = d3.scale.linear().range([height - 5, 5]); // Set input domains // ------------------------------ // Horizontal x.domain([1, qty - 3]); // Vertical y.domain([0, qty]); // Construct chart layout // ------------------------------ // Line var line = d3.svg.line() .interpolate(interpolation) .x(function(d, i) { return x(i); }) .y(function(d, i) { return y(d); }); // Area var area = d3.svg.area() .interpolate(interpolation) .x(function(d,i) { return x(i); }) .y0(height) .y1(function(d) { return y(d); }); // Create SVG // ------------------------------ // Container var container = d3Container.append('svg'); // SVG element var svg = container .attr('width', width + margin.left + margin.right) .attr('height', height + margin.top + margin.bottom) .append("g") .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); // Add mask for animation // ------------------------------ // Add clip path var clip = svg.append("defs") .append("clipPath") .attr('id', function(d, i) { return "load-clip-" + element.substring(1); }); // Add clip shape var clips = clip.append("rect") .attr('class', 'load-clip') .attr("width", 0) .attr("height", height); // Animate mask clips .transition() .duration(1000) .ease('linear') .attr("width", width); // // Append chart elements // // Main path var path = svg.append("g") .attr("clip-path", function(d, i) { return "url(#load-clip-" + element.substring(1) + ")"; }) .append("path") .datum(data) .attr("transform", "translate(" + x(0) + ",0)"); // Add path based on chart type if(chartType == "area") { path.attr("d", area).attr('class', 'd3-area').style("fill", color); // area } else { path.attr("d", line).attr("class", "d3-line d3-line-medium").style('stroke', color); // line } // Animate path path .style('opacity', 0) .transition() .duration(500) .style('opacity', 1); // Set update interval. For demo only // ------------------------------ setInterval(function() { // push a new data point onto the back data.push(Math.floor(Math.random() * qty) + 5); // pop the old data point off the front data.shift(); update(); }, interval); // Update random data. For demo only // ------------------------------ function update() { // Redraw the path and slide it to the left path .attr("transform", null) .transition() .duration(duration) .ease("linear") .attr("transform", "translate(" + x(0) + ",0)"); // Update path type if(chartType == "area") { path.attr("d", area).attr('class', 'd3-area').style("fill", color); } else { path.attr("d", line).attr("class", "d3-line d3-line-medium").style('stroke', color); } } // Resize chart // ------------------------------ // Call function on window resize $(window).on('resize', resizeSparklines); // Call function on sidebar width change $(document).on('click', '.sidebar-control', resizeSparklines); // Resize function // // Since D3 doesn't support SVG resize by default, // we need to manually specify parts of the graph that need to // be updated on window resize function resizeSparklines() { // Layout variables width = d3Container.node().getBoundingClientRect().width - margin.left - margin.right; // Layout // ------------------------- // Main svg width container.attr("width", width + margin.left + margin.right); // Width of appended group svg.attr("width", width + margin.left + margin.right); // Horizontal range x.range([0, width]); // Chart elements // ------------------------- // Clip mask clips.attr("width", width); // Line svg.select(".d3-line").attr("d", line); // Area svg.select(".d3-area").attr("d", area); } } }; // // Return objects assigned to module // return { init: function() { _barChartWidget("#chart_bar_basic", 24, 50, true, "elastic", 1200, 50, "#3e8ef7", "members"); _sparklinesWidget("#sparklines_basic", "area", 30, 50, "basis", 750, 2000, "#0bb2d4"); } } }(); // Initialize module // ------------------------------ // When content loaded document.addEventListener('DOMContentLoaded', function() { Widgetschart.init(); }); // donut chart $('.donut').peity('donut'); // ------------------------------ // Basic bar chart // ------------------------------ // based on prepared DOM, initialize echarts instance var myChart = echarts.init(document.getElementById('basic-bar')); // specify chart configuration item and data var option = { // Setup grid grid: { left: '1%', right: '2%', bottom: '3%', containLabel: true }, // Add Tooltip tooltip : { trigger: 'axis' }, legend: { data:['Site A','Site B'] }, toolbox: { show : true, feature : { magicType : {show: true, type: ['line', 'bar']}, restore : {show: true}, saveAsImage : {show: true} } }, color: ["#689f38", "#389f99"], calculable : true, xAxis : [ { type : 'category', data : ['Jan','Feb','Mar','Apr','May','Jun','July','Aug','Sept','Oct','Nov','Dec'] } ], yAxis : [ { type : 'value' } ], series : [ { name:'Site A', type:'bar', data:[7.2, 5.3, 6.1, 32.1, 23.1, 89.2, 158.4, 178.1, 36.4, 22.7, 7.1, 9.4], markPoint : { data : [ {type : 'max', name: 'Max'}, {type : 'min', name: 'Min'} ] }, markLine : { data : [ {type : 'average', name: 'Average'} ] } }, { name:'Site B', type:'bar', data:[19.4, 7.9, 8.9, 27.9, 24.8, 88.1, 167.8, 197.5, 47.1, 16.7, 7.1, 1.5], markPoint : { data : [ {name : 'The highest year', value : 182.2, xAxis: 7, yAxis: 183, symbolSize:18}, {name : 'Year minimum', value : 2.3, xAxis: 11, yAxis: 3} ] }, markLine : { data : [ {type : 'average', name : 'Average'} ] } } ] }; // use configuration item and data specified to show chart myChart.setOption(option);
import { FETCH_CONTACTS_REQUEST, DELETE_CONTACT_REQUEST, ADD_CONTACT_REQUEST, FETCH_CONTACTS_ERROR, ADD_CONTACT_ERROR, DELETE_CONTACT_ERROR, } from '../../Constants/actionNames'; const errorReducer = (state = null, { type, payload }) => { switch (type) { case FETCH_CONTACTS_REQUEST: case ADD_CONTACT_REQUEST: case DELETE_CONTACT_REQUEST: return null; case FETCH_CONTACTS_ERROR: case ADD_CONTACT_ERROR: case DELETE_CONTACT_ERROR: return payload.error; default: return state; } }; export default errorReducer;
import Vue from 'vue' import Vuetify from 'vuetify/lib' import 'vuetify/src/stylus/app.styl' Vue.use(Vuetify, { iconfont: 'md', theme: { primary: '#3f51b5', secondary: '#b0bec5', accent: '#8c9eff', error: '#b71c1c' } })
/* Flags: authentic: Ignores a target's substitute. bite: Power is multiplied by 1.5 when used by a Pokemon with the Strong Jaw Ability. bullet: Has no effect on Pokemon with the Bulletproof Ability. charge: The user is unable to make a move between turns. contact: Makes contact. dance: When used by a Pokemon, other Pokemon with the Dancer Ability can attempt to execute the same move. defrost: Thaws the user if executed successfully while the user is frozen. distance: Can target a Pokemon positioned anywhere in a Triple Battle. gravity: Prevented from being executed or selected during Gravity's effect. grounded: Has no effect on Flying-type Pokemon, Pokemon with the Levitate Ability, Pokemon holding Air Balloon, or Pokemon affected by Magnet Rise or Telekinesis – except when grounded (by Gravity, Ingrain, Roost, Smack Down, Thousand Arrows, or holding an Iron Ball). heal: Prevented from being executed or selected during Heal Block's effect. mirror: Can be copied by Mirror Move. mystery: Unknown effect. nonsky: Prevented from being executed or selected in a Sky Battle. powder: Has no effect on Grass-type Pokemon, Pokemon with the Overcoat Ability, and Pokemon holding Safety Goggles. protect: Blocked by Detect, Protect, Spiky Shield, and if not a Status move, King's Shield. pulse: Power is multiplied by 1.5 when used by a Pokemon with the Mega Launcher Ability. punch: Power is multiplied by 1.2 when used by a Pokemon with the Iron Fist Ability. recharge: If this move is successful, the user must recharge on the following turn and cannot make a move. reflectable: Bounced back to the original user by Magic Coat or the Magic Bounce Ability. snatch: Can be stolen from the original user and instead used by another Pokemon using Snatch. sound: Has no effect on Pokemon with the Soundproof Ability. */ 'use strict'; /**@type {{[k: string]: ModdedMoveData}} */ let BattleMovedex = { "absorb": { inherit: true, basePower: 40, pp: 20, }, "acrobatics": { inherit: true, type: "Normal", }, "aerialace": { inherit: true, type: "Air", }, "aeroblast": { inherit: true, type: "Air", }, "aircutter": { inherit: true, type: "Air", }, "airslash": { inherit: true, type: "Air", }, "ancientpower": { inherit: true, pp: 10, }, "beakblast": { inherit: true, type: "Bird", }, "boomburst": { inherit: true, type: "Air", }, "bounce": { inherit: true, type: "Air", }, "bravebird": { inherit: true, type: "Bird", }, "chatter": { inherit: true, type: "Air", }, "coil": { inherit: true, type: "Normal", }, "confuseray": { inherit: true, type: "Light", }, "dazzlinggleam": { inherit: true, type: "Light", }, "defog": { inherit: true, type: "Air", }, "dig": { inherit: true, flags: {contact: 1, charge: 1, grounded: 1, protect: 1, mirror: 1, nonsky: 1}, }, "doubleteam": { inherit: true, type: "Light", }, "dragonascent": { inherit: true, type: "Dragon", }, "drainpunch": { inherit: true, basePower: 80, }, "dreameater": { inherit: true, pp: 10, }, "drillpeck": { inherit: true, type: "Bird", }, "dualwingbeat": { inherit: true, type: "Bird", }, "earthquake": { inherit: true, flags: {grounded: 1, protect: 1, mirror: 1, nonsky: 1}, }, "echoedvoice": { inherit: true, type: "Air", }, "featherdance": { inherit: true, type: "Bird", }, "fissure": { inherit: true, flags: {grounded: 1, protect: 1, mirror: 1, nonsky: 1}, }, "flash": { inherit: true, type: "Light", }, "flashcannon": { inherit: true, type: "Light", }, "floatyfall": { inherit: true, type: "Air", }, "fly": { inherit: true, type: "Air", }, "gigadrain": { inherit: true, basePower: 80, }, "glitzyglow": { inherit: true, type: "Light", }, "gmaxwindrage": { inherit: true, type: "Air", }, "growl": { inherit: true, type: "Air", }, "guillotine": { inherit: true, type: "Steel", }, "gust": { inherit: true, type: "Air", }, "howl": { inherit: true, type: "Air", }, "hurricane": { inherit: true, type: "Air", }, "hypervoice": { inherit: true, type: "Air", }, "laserfocus": { inherit: true, type: "Light", }, "leechlife": { inherit: true, type: "Bat", }, "lightofruin": { inherit: true, type: "Light", }, "lightscreen": { inherit: true, pp: 20, type: "Light", }, "lightthatburnsthesky": { inherit: true, type: "Light", }, "magnitude": { inherit: true, flags: {grounded: 1, protect: 1, mirror: 1, nonsky: 1}, }, "maxairstream": { inherit: true, type: "Air", }, "megadrain": { inherit: true, basePower: 60, }, "mirrormove": { inherit: true, type: "Normal", }, "moonlight": { inherit: true, pp: 10, }, "morningsun": { inherit: true, pp: 10, type: "Light", }, "nobleroar": { inherit: true, type: "Air", }, "oblivionwing": { inherit: true, type: "Bird", }, "ominouswind": { inherit: true, pp: 10, }, "peck": { inherit: true, type: "Bird", }, "perishsong": { inherit: true, type: "Air", }, "pluck": { inherit: true, type: "Bird", }, "poisonpowder": { inherit: true, type: "Grass", }, "prismaticlaser": { inherit: true, type: "Light", }, "reflect": { inherit: true, type: "Light", }, "relicsong": { inherit: true, type: "Air", }, "roar": { inherit: true, type: "Air", }, "roost": { inherit: true, type: "Bird", }, "rototiller": { inherit: true, flags: {distance: 1, grounded: 1, nonsky: 1}, }, "round": { inherit: true, type: "Air", }, "sandstorm": { inherit: true, type: "Ground", }, "screech": { inherit: true, type: "Air", }, "signalbeam": { inherit: true, type: "Light", }, "silverwind": { inherit: true, pp: 10, }, "simplebeam": { inherit: true, type: "Light", }, "sing": { inherit: true, type: "Air", }, "skyattack": { inherit: true, type: "Air", }, "skydrop": { inherit: true, type: "Bird", }, "snore": { inherit: true, type: "Air", }, "solarbeam": { inherit: true, type: "Light", }, "solarblade": { inherit: true, type: "Light", }, "sonicboom": { inherit: true, type: "Air", }, "spikes": { inherit: true, flags: {grounded: 1, nonsky: 1, reflectable: 1}, }, "spotlight": { inherit: true, type: "Light", }, "stickyweb": { inherit: true, flags: {grounded: 1, nonsky: 1, reflectable: 1}, }, "sunnyday": { inherit: true, type: "Light", }, "supersonic": { inherit: true, type: "Air", }, "supersonicskystrike": { inherit: true, type: "Air", }, "synthesis": { inherit: true, pp: 10, }, "tailwind": { inherit: true, type: "Air", }, "toxicspikes": { inherit: true, flags: {grounded: 1, nonsky: 1, reflectable: 1}, }, "twister": { inherit: true, type: "Air", }, "uproar": { inherit: true, type: "Air", }, "weatherball": { inherit: true, type: "Air", }, "whirlwind": { inherit: true, type: "Air", }, "wingattack": { inherit: true, type: "Bird", }, }; exports.BattleMovedex = BattleMovedex;
/*! `crystal` grammar compiled for Highlight.js 11.3.1 */ var hljsGrammar=(()=>{"use strict";return e=>{ const n="(_?[ui](8|16|32|64|128))?",i="[a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|[=!]~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~|]|//|//=|&[-+*]=?|&\\*\\*|\\[\\][=?]?",a="[A-Za-z_]\\w*(::\\w+)*(\\?|!)?",s={ $pattern:"[a-zA-Z_]\\w*[!?=]?", keyword:"abstract alias annotation as as? asm begin break case class def do else elsif end ensure enum extend for fun if include instance_sizeof is_a? lib macro module next nil? of out pointerof private protected rescue responds_to? return require select self sizeof struct super then type typeof union uninitialized unless until verbatim when while with yield __DIR__ __END_LINE__ __FILE__ __LINE__", literal:"false nil true"},t={className:"subst",begin:/#\{/,end:/\}/,keywords:s },r={className:"template-variable",variants:[{begin:"\\{\\{",end:"\\}\\}"},{ begin:"\\{%",end:"%\\}"}],keywords:s};function c(e,n){const i=[{begin:e,end:n}] ;return i[0].contains=i,i}const l={className:"string", contains:[e.BACKSLASH_ESCAPE,t],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/ },{begin:/`/,end:/`/},{begin:"%[Qwi]?\\(",end:"\\)",contains:c("\\(","\\)")},{ begin:"%[Qwi]?\\[",end:"\\]",contains:c("\\[","\\]")},{begin:"%[Qwi]?\\{", end:/\}/,contains:c(/\{/,/\}/)},{begin:"%[Qwi]?<",end:">",contains:c("<",">")},{ begin:"%[Qwi]?\\|",end:"\\|"},{begin:/<<-\w+$/,end:/^\s*\w+$/}],relevance:0},b={ className:"string",variants:[{begin:"%q\\(",end:"\\)",contains:c("\\(","\\)")},{ begin:"%q\\[",end:"\\]",contains:c("\\[","\\]")},{begin:"%q\\{",end:/\}/, contains:c(/\{/,/\}/)},{begin:"%q<",end:">",contains:c("<",">")},{begin:"%q\\|", end:"\\|"},{begin:/<<-'\w+'$/,end:/^\s*\w+$/}],relevance:0},o={ begin:"(?!%\\})("+e.RE_STARTERS_RE+"|\\n|\\b(case|if|select|unless|until|when|while)\\b)\\s*", keywords:"case if select unless until when while",contains:[{className:"regexp", contains:[e.BACKSLASH_ESCAPE,t],variants:[{begin:"//[a-z]*",relevance:0},{ begin:"/(?!\\/)",end:"/[a-z]*"}]}],relevance:0},g=[r,l,b,{className:"regexp", contains:[e.BACKSLASH_ESCAPE,t],variants:[{begin:"%r\\(",end:"\\)", contains:c("\\(","\\)")},{begin:"%r\\[",end:"\\]",contains:c("\\[","\\]")},{ begin:"%r\\{",end:/\}/,contains:c(/\{/,/\}/)},{begin:"%r<",end:">", contains:c("<",">")},{begin:"%r\\|",end:"\\|"}],relevance:0},o,{ className:"meta",begin:"@\\[",end:"\\]", contains:[e.inherit(e.QUOTE_STRING_MODE,{className:"string"})]},{ className:"variable", begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])" },e.HASH_COMMENT_MODE,{className:"class",beginKeywords:"class module struct", end:"$|;",illegal:/=/,contains:[e.HASH_COMMENT_MODE,e.inherit(e.TITLE_MODE,{ begin:a}),{begin:"<"}]},{className:"class",beginKeywords:"lib enum union", end:"$|;",illegal:/=/,contains:[e.HASH_COMMENT_MODE,e.inherit(e.TITLE_MODE,{ begin:a})]},{beginKeywords:"annotation",end:"$|;",illegal:/=/, contains:[e.HASH_COMMENT_MODE,e.inherit(e.TITLE_MODE,{begin:a})],relevance:2},{ className:"function",beginKeywords:"def",end:/\B\b/, contains:[e.inherit(e.TITLE_MODE,{begin:i,endsParent:!0})]},{ className:"function",beginKeywords:"fun macro",end:/\B\b/, contains:[e.inherit(e.TITLE_MODE,{begin:i,endsParent:!0})],relevance:2},{ className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{ className:"symbol",begin:":",contains:[l,{begin:i}],relevance:0},{ className:"number",variants:[{begin:"\\b0b([01_]+)"+n},{begin:"\\b0o([0-7_]+)"+n },{begin:"\\b0x([A-Fa-f0-9_]+)"+n},{ begin:"\\b([1-9][0-9_]*[0-9]|[0-9])(\\.[0-9][0-9_]*)?([eE]_?[-+]?[0-9_]*)?(_?f(32|64))?(?!_)" },{begin:"\\b([1-9][0-9_]*|0)"+n}],relevance:0}] ;return t.contains=g,r.contains=g.slice(1),{name:"Crystal",aliases:["cr"], keywords:s,contains:g}}})();export default hljsGrammar;
import CustomEvent from './CustomEvent'; import helper from './helper'; let slice = Array.prototype.slice; /** * evented base component, use CustomEvent as compositor * @class com.sesamtv.core.util.BaseEvented * @requires com.sesamtv.core.util.CustomEvent */ class BaseEvented { /** * eventize an object by composition * @method eventize * @static * @param {Object} self * @returns {Object} */ static eventize(self) { self.event = new CustomEvent(); helper.applyIf(self, { evts: {}, connect: [], config: {} }); var proto = BaseEvented.prototype, supers = {}; Object.keys(proto).forEach(function (k) { if (k in self && typeof(self[k]) === 'function') { supers[k] = proto[k]; } else { self[k] = proto[k]; } }); self.$super = function (k) { return supers[k] && supers[k].apply(this, slice.call(arguments, 1)); }; self.$purgeSuper = function () { supers = null; }; return self; } constructor() { /** * @property event * @type {com.sesamtv.core.util.CustomEvent} */ this.event = new CustomEvent(); helper.applyIf(this, { /** * named listener handlers * @property evts * @type {Object} */ evts: {}, /** * anonymous listener handlers * @property connect * @type {Array} */ connect: [], config: {} }); } /** * @method on * @param {String} evt * @param {Function} fnc * @param {Boolean} [once] * @returns {{id: Number, remove: Function}} */ on(evt, fnc, once) { return this.event[once ? 'once' : 'on'](evt, fnc.bind(this)); } /** * @method once * @param {String} evt * @param {Function} fnc * @returns {{id: Number, remove: Function}} */ once(evt, fnc) { return this.on(evt, fnc.bind(this), true); } /** * @method emit * @returns {Array} */ emit() { return this.event.emit.apply(this.event, arguments); } /** * @method broadcast * @param {String} wildcard */ broadcast(wildcard) { return this.event.broadcast.apply(this.event, arguments); } /** * set a property * @method set * @param k * @param v */ set(k, v) { if (k === 'config') { return this.setConfigs(v); } if (k in this && this[k] === v) { return; } var res = { newValue: v }; if (k in this) { res.oldValue = isObject(this[k]) ? helper.deepClone(this[k]) : this[k]; } this[k] = v; this.emit(k, res); } /** * @method setConfigs * @param {Object} v */ setConfigs(v) { Object.keys(v).forEach(function (k) { this.setConfig(k, v[k]); }, this); } /** * set a config property * @method setConfig * @param {String} k * @param {*} v */ setConfig(k, v) { if (arguments.length === 1) { return this.setConfigs(k); } if (k in this.config && this.config[k] === v) { return; } var res = { key: k, newValue: v }; if (k in this.config) { res.oldValue = isObject(this.config[k]) ? helper.deepClone(this.config[k]) : this.config[k]; } this.config[k] = v; this.emit('config', res); this.emit('config/' + k, res); } /** * @method getConfig * @param {String} k * @returns {*} */ getConfig(k) { var res = this.config[k], getter = k + 'Getter'; if (this.config[getter]) { return this.config[getter](res, this); } return res; } removeEvts(evts) { evts.forEach(function (evt) { if (this.evts[evt]) { this.evts[evt].remove(); delete this.evts[evt]; } }, this); } /** * @method destroy */ destroy() { this.connect.forEach(function (c) { c.remove(); }); this.connect.length = 0; Object.keys(this.evts).forEach(function (e) { this.evts[e].remove(); }, this); this.evts = {}; this.event.purgeListeners(); this.$purgeSuper && this.$purgeSuper(); } } export default BaseEvented;
import _ from 'lodash'; import React, {Component} from 'react'; import { Platform, StyleSheet, View, Text, TouchableOpacity, Button } from 'react-native'; import { ExpandableCalendar, Timeline, CalendarProvider } from 'react-native-calendars'; import moment from 'moment'; const EVENTS = [ { start: '2017-09-06 22:30:00', end: '2017-09-06 23:30:00', title: 'Dr. Mariana Joseph', summary: '3412 Piedmont Rd NE, GA 3032', color: '#e6add8' }, { start: '2017-09-07 00:30:00', end: '2017-09-07 01:30:00', title: 'Visit Grand Mother', summary: 'Visit Grand Mother and bring some fruits.', color: '#ade6d8' }, { start: '2017-09-07 02:30:00', end: '2017-09-07 03:20:00', title: 'Meeting with Prof. Behjet Zuhaira', summary: 'Meeting with Prof. Behjet at 130 in her office.', color: '#e6add8' }, { start: '2017-09-07 04:10:00', end: '2017-09-07 04:40:00', title: 'Tea Time with Dr. Hasan', summary: 'Tea Time with Dr. Hasan, Talk about Project' }, { start: '2017-09-07 01:05:00', end: '2017-09-07 01:35:00', title: 'Dr. Mariana Joseph', summary: '3412 Piedmont Rd NE, GA 3032' }, { start: '2017-09-07 14:30:00', end: '2017-09-07 16:30:00', title: 'Meeting Some Friends in ARMED', summary: 'Arsalan, Hasnaat, Talha, Waleed, Bilal', color: '#d8ade6' }, { start: '2017-09-08 01:40:00', end: '2017-09-08 02:25:00', title: 'Meet Sir Khurram Iqbal', summary: 'Computer Science Dept. Comsats Islamabad', color: '#e6bcad' }, { start: '2017-09-08 04:10:00', end: '2017-09-08 04:40:00', title: 'Tea Time with Colleagues', summary: 'WeRplay' }, { start: '2017-09-08 00:45:00', end: '2017-09-08 01:45:00', title: 'Lets Play Apex Legends', summary: 'with Boys at Work' }, { start: '2017-09-08 11:30:00', end: '2017-09-08 12:30:00', title: 'Dr. Mariana Joseph', summary: '3412 Piedmont Rd NE, GA 3032' }, { start: '2017-09-10 12:10:00', end: '2017-09-10 13:45:00', title: 'Merge Request to React Native Calendards', summary: 'Merge Timeline Calendar to React Native Calendars' } ]; export default class TimelineCalendarScreen extends Component { state = { currentDate: '2017-09-07' } onDateChanged = (date) => { // console.warn('ExpandableCalendarScreen onDateChanged: ', date, updateSource); // fetch and set data for date + week ahead this.setState({currentDate: date}); }; onMonthChange = (/* month, updateSource */) => { // console.warn('ExpandableCalendarScreen onMonthChange: ', month, updateSource); }; renderEmptyItem() { return ( <View style={styles.emptyItem}> <Text style={styles.emptyItemText}>No Events Planned</Text> </View> ); } renderItem = ({item}) => { if (_.isEmpty(item)) { return this.renderEmptyItem(); } return ( <TouchableOpacity style={styles.item}> <View> <Text style={styles.itemHourText}>{item.hour}</Text> <Text style={styles.itemDurationText}>{item.duration}</Text> </View> <Text style={styles.itemTitleText}>{item.title}</Text> <View style={styles.itemButtonContainer}> <Button title={'Info'}/> </View> </TouchableOpacity> ); }; getTheme = () => { const themeColor = '#0059ff'; const lightThemeColor = '#e6efff'; const disabledColor = '#a6acb1'; const black = '#20303c'; const white = '#ffffff'; return { // arrows arrowColor: black, arrowStyle: {padding: 0}, // month monthTextColor: black, textMonthFontSize: 16, textMonthFontFamily: 'HelveticaNeue', textMonthFontWeight: 'bold', // day names textSectionTitleColor: black, textDayHeaderFontSize: 12, textDayHeaderFontFamily: 'HelveticaNeue', textDayHeaderFontWeight: 'normal', // today todayBackgroundColor: lightThemeColor, todayTextColor: themeColor, // dates dayTextColor: themeColor, textDayFontSize: 18, textDayFontFamily: 'HelveticaNeue', textDayFontWeight: '500', textDayStyle: {marginTop: Platform.OS === 'android' ? 2 : 4}, // selected date selectedDayBackgroundColor: themeColor, selectedDayTextColor: white, // disabled date textDisabledColor: disabledColor, // dot (marked date) dotColor: themeColor, selectedDotColor: white, disabledDotColor: disabledColor, dotStyle: {marginTop: -2} }; }; render() { return ( <CalendarProvider // date={ITEMS[0].title} date={this.state.currentDate} onDateChanged={this.onDateChanged} onMonthChange={this.onMonthChange} theme={{todayButtonTextColor: '#0059ff'}} showTodayButton disabledOpacity={0.6} // todayBottomMargin={16} > <ExpandableCalendar // horizontal={false} // hideArrows // disablePan // hideKnob // initialPosition={ExpandableCalendar.positions.OPEN} firstDay={1} // markedDates={this.getMarkedDates()} // {'2019-06-01': {marked: true}, '2019-06-02': {marked: true}, '2019-06-03': {marked: true}}; // markedDates={() => {}} // {'2019-06-01': {marked: true}, '2019-06-02': {marked: true}, '2019-06-03': {marked: true}}; theme={this.getTheme()} leftArrowImageSource={require('../img/previous.png')} rightArrowImageSource={require('../img/next.png')} // calendarStyle={styles.calendar} // headerStyle={styles.calendar} // for horizontal only // disableWeekScroll /> <Timeline format24h={true} eventTapped={e => e} events={EVENTS.filter(event => moment(event.start).isSame(this.state.currentDate, 'day'))} // scrollToFirst={true} // start={0} // end={24} /> </CalendarProvider> ); } } const styles = StyleSheet.create({ calendar: { paddingLeft: 20, paddingRight: 20 }, section: { backgroundColor: '#f0f4f7', color: '#79838a' }, item: { padding: 20, backgroundColor: 'white', borderBottomWidth: 1, borderBottomColor: '#e8ecf0', flexDirection: 'row' }, itemHourText: { color: 'black' }, itemDurationText: { color: 'grey', fontSize: 12, marginTop: 4, marginLeft: 4 }, itemTitleText: { color: 'black', marginLeft: 16, fontWeight: 'bold', fontSize: 16 }, itemButtonContainer: { flex: 1, alignItems: 'flex-end' }, emptyItem: { paddingLeft: 20, height: 52, justifyContent: 'center', borderBottomWidth: 1, borderBottomColor: '#e8ecf0' }, emptyItemText: { color: '#79838a', fontSize: 14 } });
const bodyParser = require('body-parser'); const mongoose = require('mongoose'); const express = require('express'); const dotenv = require('dotenv'); const cors = require('cors'); const app = express(); const port = process.env.PORT || 5000; dotenv.config(); app.use(bodyParser.urlencoded({extended: true})); app.use(bodyParser.json()); app.use(express.json()); app.use(cors()); app.set('view engine', 'ejs') const URI = process.env.ATLAS_URI; mongoose.connect(URI, { useUnifiedTopology: true, useNewUrlParser: true, useCreateIndex: true }); const connection = mongoose.connection; connection.once('open', () => { console.log('MongoDB database connction established successfully'); }); const postRouter = require('./routes/posts'); app.use('/posts', postRouter); const userRouter = require('./routes/users'); app.use('/users', userRouter); app.listen(port, () => { console.log(`Server is running on port: ${port}`); })
var m = require('mithril'); module.exports = m.trust('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="24" height="24" viewBox="0 0 24.00 24.00" enable-background="new 0 0 24.00 24.00" xml:space="preserve"><path fill="#000000" fill-opacity="1" stroke-linejoin="round" d="M 5,4L 19,4C 20.6568,4 22,5.34315 22,7L 22,11L 15,11L 15,10L 9,10L 9,11L 2,11L 2,7C 2,5.34315 3.34315,4 5,4 Z M 11,11L 13,11L 13,13L 11,13L 11,11 Z M 2,12L 9,12L 9,13L 11,15L 13,15L 15,13L 15,12L 22,12L 22,20L 2,20L 2,12 Z "/></svg>');
'use strict'; // fix the mistakes in this conditional // all of the bugs are in the conditional statement // there are no mistakes in the type checks, comment, or tests /** * returns the longer of two strings. * if both are of equal length it combines the strings * @param {string} str1 * @param {string} str2 * @returns {string} */ const longestOrBoth = (str1, str2) => { if (typeof str1 !== 'string') { throw new TypeError('str1'); } if (typeof str2 !== 'string') { throw new TypeError('str2'); } let result = ''; if (str1.length > str2.length) { result = str1; } else if (str1.length < str2.length) { result = str2; } else { result = `${str1}${str2}`; } if (typeof result !== 'string') { throw new TypeError('result'); } return result; }; // all of the tests are correct, there are not bugs below here! const _1_expect = 'car boat'; const _1_actual = longestOrBoth('carboat', 'car boat'); console.assert(_1_actual === _1_expect, 'Test 1'); const _2_expect = 'waterfall'; const _2_actual = longestOrBoth('water', 'waterfall'); console.assert(_2_actual === _2_expect, 'Test 2'); const _3_expect = 'water fall'; const _3_actual = longestOrBoth('water fall', 'waterfall'); console.assert(_3_actual === _3_expect, 'Test 3'); const _4_expect = 'birch'; const _4_actual = longestOrBoth('birch', 'oak'); console.assert(_4_actual === _4_expect, 'Test 4'); const _5_expect = 'aspenbirch'; const _5_actual = longestOrBoth('aspen', 'birch'); console.assert(_5_actual === _5_expect, 'Test 5'); const _6_expect = 'hi!bye'; const _6_actual = longestOrBoth('hi!', 'bye'); console.assert(_6_actual === _6_expect, 'Test 6');
if(window.Element&&!window.Element.prototype.matches){var proto=window.Element.prototype;proto.matches=proto.matchesSelector||proto.mozMatchesSelector||proto.msMatchesSelector||proto.oMatchesSelector||proto.webkitMatchesSelector};
import { __decorate } from 'tslib'; import { ContentChildren, Input, Component, NgZone, Injectable, EventEmitter, ElementRef, ViewContainerRef, ComponentFactoryResolver, Output, ViewEncapsulation, ANALYZE_FOR_ENTRY_COMPONENTS, NgModule } from '@angular/core'; import { VanillaFrameworkOverrides, BaseComponentWrapper, Promise, ComponentUtil, Grid, Utils, Events, GridOptionsWrapper } from '@ag-grid-community/core'; var AgGridColumn_1; let AgGridColumn = AgGridColumn_1 = class AgGridColumn { hasChildColumns() { if (this.childColumns && this.childColumns.length > 0) { // necessary because of https://github.com/angular/angular/issues/10098 return !(this.childColumns.length === 1 && this.childColumns.first === this); } return false; } toColDef() { let colDef = this.createColDefFromGridColumn(this); if (this.hasChildColumns()) { colDef["children"] = this.getChildColDefs(this.childColumns); } return colDef; } getChildColDefs(childColumns) { return childColumns // necessary because of https://github.com/angular/angular/issues/10098 .filter(column => !column.hasChildColumns()) .map((column) => { return column.toColDef(); }); } ; createColDefFromGridColumn(from) { let colDef = {}; Object.assign(colDef, from); delete colDef.childColumns; return colDef; } ; }; __decorate([ ContentChildren(AgGridColumn_1) ], AgGridColumn.prototype, "childColumns", void 0); __decorate([ Input() ], AgGridColumn.prototype, "children", void 0); __decorate([ Input() ], AgGridColumn.prototype, "sortingOrder", void 0); __decorate([ Input() ], AgGridColumn.prototype, "allowedAggFuncs", void 0); __decorate([ Input() ], AgGridColumn.prototype, "menuTabs", void 0); __decorate([ Input() ], AgGridColumn.prototype, "cellClassRules", void 0); __decorate([ Input() ], AgGridColumn.prototype, "icons", void 0); __decorate([ Input() ], AgGridColumn.prototype, "headerGroupComponent", void 0); __decorate([ Input() ], AgGridColumn.prototype, "headerGroupComponentFramework", void 0); __decorate([ Input() ], AgGridColumn.prototype, "headerGroupComponentParams", void 0); __decorate([ Input() ], AgGridColumn.prototype, "cellStyle", void 0); __decorate([ Input() ], AgGridColumn.prototype, "cellRendererParams", void 0); __decorate([ Input() ], AgGridColumn.prototype, "cellEditorFramework", void 0); __decorate([ Input() ], AgGridColumn.prototype, "cellEditorParams", void 0); __decorate([ Input() ], AgGridColumn.prototype, "pinnedRowCellRendererFramework", void 0); __decorate([ Input() ], AgGridColumn.prototype, "pinnedRowCellRendererParams", void 0); __decorate([ Input() ], AgGridColumn.prototype, "filterFramework", void 0); __decorate([ Input() ], AgGridColumn.prototype, "filterParams", void 0); __decorate([ Input() ], AgGridColumn.prototype, "headerComponent", void 0); __decorate([ Input() ], AgGridColumn.prototype, "headerComponentFramework", void 0); __decorate([ Input() ], AgGridColumn.prototype, "headerComponentParams", void 0); __decorate([ Input() ], AgGridColumn.prototype, "floatingFilterComponent", void 0); __decorate([ Input() ], AgGridColumn.prototype, "floatingFilterComponentParams", void 0); __decorate([ Input() ], AgGridColumn.prototype, "floatingFilterComponentFramework", void 0); __decorate([ Input() ], AgGridColumn.prototype, "tooltipComponent", void 0); __decorate([ Input() ], AgGridColumn.prototype, "tooltipComponentParams", void 0); __decorate([ Input() ], AgGridColumn.prototype, "tooltipComponentFramework", void 0); __decorate([ Input() ], AgGridColumn.prototype, "refData", void 0); __decorate([ Input() ], AgGridColumn.prototype, "headerName", void 0); __decorate([ Input() ], AgGridColumn.prototype, "columnGroupShow", void 0); __decorate([ Input() ], AgGridColumn.prototype, "headerClass", void 0); __decorate([ Input() ], AgGridColumn.prototype, "toolPanelClass", void 0); __decorate([ Input() ], AgGridColumn.prototype, "headerValueGetter", void 0); __decorate([ Input() ], AgGridColumn.prototype, "groupId", void 0); __decorate([ Input() ], AgGridColumn.prototype, "colId", void 0); __decorate([ Input() ], AgGridColumn.prototype, "sort", void 0); __decorate([ Input() ], AgGridColumn.prototype, "field", void 0); __decorate([ Input() ], AgGridColumn.prototype, "type", void 0); __decorate([ Input() ], AgGridColumn.prototype, "tooltipField", void 0); __decorate([ Input() ], AgGridColumn.prototype, "headerTooltip", void 0); __decorate([ Input() ], AgGridColumn.prototype, "cellClass", void 0); __decorate([ Input() ], AgGridColumn.prototype, "showRowGroup", void 0); __decorate([ Input() ], AgGridColumn.prototype, "filter", void 0); __decorate([ Input() ], AgGridColumn.prototype, "aggFunc", void 0); __decorate([ Input() ], AgGridColumn.prototype, "cellRenderer", void 0); __decorate([ Input() ], AgGridColumn.prototype, "cellEditor", void 0); __decorate([ Input() ], AgGridColumn.prototype, "pinned", void 0); __decorate([ Input() ], AgGridColumn.prototype, "chartDataType", void 0); __decorate([ Input() ], AgGridColumn.prototype, "sortedAt", void 0); __decorate([ Input() ], AgGridColumn.prototype, "flex", void 0); __decorate([ Input() ], AgGridColumn.prototype, "width", void 0); __decorate([ Input() ], AgGridColumn.prototype, "minWidth", void 0); __decorate([ Input() ], AgGridColumn.prototype, "maxWidth", void 0); __decorate([ Input() ], AgGridColumn.prototype, "rowGroupIndex", void 0); __decorate([ Input() ], AgGridColumn.prototype, "pivotIndex", void 0); __decorate([ Input() ], AgGridColumn.prototype, "dndSourceOnRowDrag", void 0); __decorate([ Input() ], AgGridColumn.prototype, "valueGetter", void 0); __decorate([ Input() ], AgGridColumn.prototype, "valueSetter", void 0); __decorate([ Input() ], AgGridColumn.prototype, "filterValueGetter", void 0); __decorate([ Input() ], AgGridColumn.prototype, "keyCreator", void 0); __decorate([ Input() ], AgGridColumn.prototype, "cellRendererFramework", void 0); __decorate([ Input() ], AgGridColumn.prototype, "pinnedRowCellRenderer", void 0); __decorate([ Input() ], AgGridColumn.prototype, "valueFormatter", void 0); __decorate([ Input() ], AgGridColumn.prototype, "pinnedRowValueFormatter", void 0); __decorate([ Input() ], AgGridColumn.prototype, "valueParser", void 0); __decorate([ Input() ], AgGridColumn.prototype, "comparator", void 0); __decorate([ Input() ], AgGridColumn.prototype, "equals", void 0); __decorate([ Input() ], AgGridColumn.prototype, "pivotComparator", void 0); __decorate([ Input() ], AgGridColumn.prototype, "suppressKeyboardEvent", void 0); __decorate([ Input() ], AgGridColumn.prototype, "colSpan", void 0); __decorate([ Input() ], AgGridColumn.prototype, "rowSpan", void 0); __decorate([ Input() ], AgGridColumn.prototype, "getQuickFilterText", void 0); __decorate([ Input() ], AgGridColumn.prototype, "newValueHandler", void 0); __decorate([ Input() ], AgGridColumn.prototype, "onCellValueChanged", void 0); __decorate([ Input() ], AgGridColumn.prototype, "onCellClicked", void 0); __decorate([ Input() ], AgGridColumn.prototype, "onCellDoubleClicked", void 0); __decorate([ Input() ], AgGridColumn.prototype, "onCellContextMenu", void 0); __decorate([ Input() ], AgGridColumn.prototype, "rowDragText", void 0); __decorate([ Input() ], AgGridColumn.prototype, "tooltip", void 0); __decorate([ Input() ], AgGridColumn.prototype, "tooltipValueGetter", void 0); __decorate([ Input() ], AgGridColumn.prototype, "cellRendererSelector", void 0); __decorate([ Input() ], AgGridColumn.prototype, "cellEditorSelector", void 0); __decorate([ Input() ], AgGridColumn.prototype, "suppressCellFlash", void 0); __decorate([ Input() ], AgGridColumn.prototype, "suppressColumnsToolPanel", void 0); __decorate([ Input() ], AgGridColumn.prototype, "suppressFiltersToolPanel", void 0); __decorate([ Input() ], AgGridColumn.prototype, "openByDefault", void 0); __decorate([ Input() ], AgGridColumn.prototype, "marryChildren", void 0); __decorate([ Input() ], AgGridColumn.prototype, "hide", void 0); __decorate([ Input() ], AgGridColumn.prototype, "rowGroup", void 0); __decorate([ Input() ], AgGridColumn.prototype, "pivot", void 0); __decorate([ Input() ], AgGridColumn.prototype, "checkboxSelection", void 0); __decorate([ Input() ], AgGridColumn.prototype, "headerCheckboxSelection", void 0); __decorate([ Input() ], AgGridColumn.prototype, "headerCheckboxSelectionFilteredOnly", void 0); __decorate([ Input() ], AgGridColumn.prototype, "suppressMenu", void 0); __decorate([ Input() ], AgGridColumn.prototype, "suppressSorting", void 0); __decorate([ Input() ], AgGridColumn.prototype, "suppressMovable", void 0); __decorate([ Input() ], AgGridColumn.prototype, "suppressFilter", void 0); __decorate([ Input() ], AgGridColumn.prototype, "lockPosition", void 0); __decorate([ Input() ], AgGridColumn.prototype, "lockVisible", void 0); __decorate([ Input() ], AgGridColumn.prototype, "lockPinned", void 0); __decorate([ Input() ], AgGridColumn.prototype, "unSortIcon", void 0); __decorate([ Input() ], AgGridColumn.prototype, "suppressSizeToFit", void 0); __decorate([ Input() ], AgGridColumn.prototype, "suppressResize", void 0); __decorate([ Input() ], AgGridColumn.prototype, "suppressAutoSize", void 0); __decorate([ Input() ], AgGridColumn.prototype, "enableRowGroup", void 0); __decorate([ Input() ], AgGridColumn.prototype, "enablePivot", void 0); __decorate([ Input() ], AgGridColumn.prototype, "enableValue", void 0); __decorate([ Input() ], AgGridColumn.prototype, "editable", void 0); __decorate([ Input() ], AgGridColumn.prototype, "suppressPaste", void 0); __decorate([ Input() ], AgGridColumn.prototype, "suppressNavigable", void 0); __decorate([ Input() ], AgGridColumn.prototype, "enableCellChangeFlash", void 0); __decorate([ Input() ], AgGridColumn.prototype, "rowDrag", void 0); __decorate([ Input() ], AgGridColumn.prototype, "dndSource", void 0); __decorate([ Input() ], AgGridColumn.prototype, "autoHeight", void 0); __decorate([ Input() ], AgGridColumn.prototype, "sortable", void 0); __decorate([ Input() ], AgGridColumn.prototype, "resizable", void 0); __decorate([ Input() ], AgGridColumn.prototype, "singleClickEdit", void 0); AgGridColumn = AgGridColumn_1 = __decorate([ Component({ selector: 'ag-grid-column', template: '' }) ], AgGridColumn); let AngularFrameworkOverrides = class AngularFrameworkOverrides extends VanillaFrameworkOverrides { constructor(_ngZone) { super(); this._ngZone = _ngZone; } setTimeout(action, timeout) { this._ngZone.runOutsideAngular(() => { window.setTimeout(() => { action(); }, timeout); }); } addEventListenerOutsideAngular(element, type, listener, useCapture) { this._ngZone.runOutsideAngular(() => { super.addEventListenerOutsideAngular(element, type, listener, useCapture); }); } }; AngularFrameworkOverrides.ctorParameters = () => [ { type: NgZone } ]; AngularFrameworkOverrides = __decorate([ Injectable() ], AngularFrameworkOverrides); let AngularFrameworkComponentWrapper = class AngularFrameworkComponentWrapper extends BaseComponentWrapper { setViewContainerRef(viewContainerRef) { this.viewContainerRef = viewContainerRef; } setComponentFactoryResolver(componentFactoryResolver) { this.componentFactoryResolver = componentFactoryResolver; } createWrapper(OriginalConstructor) { let that = this; class DynamicAgNg2Component extends BaseGuiComponent { init(params) { super.init(params); this._componentRef.changeDetectorRef.detectChanges(); } createComponent() { return that.createComponent(OriginalConstructor); } hasMethod(name) { return wrapper.getFrameworkComponentInstance()[name] != null; } callMethod(name, args) { const componentRef = this.getFrameworkComponentInstance(); return wrapper.getFrameworkComponentInstance()[name].apply(componentRef, args); } addMethod(name, callback) { wrapper[name] = callback; } } let wrapper = new DynamicAgNg2Component(); return wrapper; } createComponent(componentType) { // used to cache the factory, but this a) caused issues when used with either webpack/angularcli with --prod // but more significantly, the underlying implementation of resolveComponentFactory uses a map too, so us // caching the factory here yields no performance benefits let factory = this.componentFactoryResolver.resolveComponentFactory(componentType); return this.viewContainerRef.createComponent(factory); } }; AngularFrameworkComponentWrapper = __decorate([ Injectable() ], AngularFrameworkComponentWrapper); class BaseGuiComponent { init(params) { this._params = params; this._componentRef = this.createComponent(); this._agAwareComponent = this._componentRef.instance; this._frameworkComponentInstance = this._componentRef.instance; this._eGui = this._componentRef.location.nativeElement; this._agAwareComponent.agInit(this._params); } getGui() { return this._eGui; } destroy() { if (this._componentRef) { this._componentRef.destroy(); } } getFrameworkComponentInstance() { return this._frameworkComponentInstance; } } let AgGridAngular = class AgGridAngular { constructor(elementDef, viewContainerRef, angularFrameworkOverrides, frameworkComponentWrapper, _componentFactoryResolver) { this.viewContainerRef = viewContainerRef; this.angularFrameworkOverrides = angularFrameworkOverrides; this.frameworkComponentWrapper = frameworkComponentWrapper; this._componentFactoryResolver = _componentFactoryResolver; this._initialised = false; this._destroyed = false; // in order to ensure firing of gridReady is deterministic this._fullyReady = new Promise(resolve => { resolve(true); }); // @START@ this.slaveGrids = undefined; this.alignedGrids = undefined; this.rowData = undefined; this.columnDefs = undefined; this.excelStyles = undefined; this.pinnedTopRowData = undefined; this.pinnedBottomRowData = undefined; this.components = undefined; this.frameworkComponents = undefined; this.rowStyle = undefined; this.context = undefined; this.autoGroupColumnDef = undefined; this.groupColumnDef = undefined; this.localeText = undefined; this.icons = undefined; this.datasource = undefined; this.serverSideDatasource = undefined; this.viewportDatasource = undefined; this.groupRowRendererParams = undefined; this.aggFuncs = undefined; this.fullWidthCellRendererParams = undefined; this.defaultColGroupDef = undefined; this.defaultColDef = undefined; this.defaultExportParams = undefined; this.columnTypes = undefined; this.rowClassRules = undefined; this.detailGridOptions = undefined; this.detailCellRendererParams = undefined; this.loadingCellRendererParams = undefined; this.loadingOverlayComponentParams = undefined; this.noRowsOverlayComponentParams = undefined; this.popupParent = undefined; this.colResizeDefault = undefined; this.reduxStore = undefined; this.statusBar = undefined; this.sideBar = undefined; this.sortingOrder = undefined; this.rowClass = undefined; this.rowSelection = undefined; this.overlayLoadingTemplate = undefined; this.overlayNoRowsTemplate = undefined; this.quickFilterText = undefined; this.rowModelType = undefined; this.editType = undefined; this.domLayout = undefined; this.clipboardDeliminator = undefined; this.rowGroupPanelShow = undefined; this.multiSortKey = undefined; this.pivotColumnGroupTotals = undefined; this.pivotRowTotals = undefined; this.pivotPanelShow = undefined; this.rowHeight = undefined; this.detailRowHeight = undefined; this.rowBuffer = undefined; this.colWidth = undefined; this.headerHeight = undefined; this.groupHeaderHeight = undefined; this.floatingFiltersHeight = undefined; this.pivotHeaderHeight = undefined; this.pivotGroupHeaderHeight = undefined; this.groupDefaultExpanded = undefined; this.minColWidth = undefined; this.maxColWidth = undefined; this.viewportRowModelPageSize = undefined; this.viewportRowModelBufferSize = undefined; this.autoSizePadding = undefined; this.maxBlocksInCache = undefined; this.maxConcurrentDatasourceRequests = undefined; this.tooltipShowDelay = undefined; this.cacheOverflowSize = undefined; this.paginationPageSize = undefined; this.cacheBlockSize = undefined; this.infiniteInitialRowCount = undefined; this.scrollbarWidth = undefined; this.paginationStartPage = undefined; this.infiniteBlockSize = undefined; this.batchUpdateWaitMillis = undefined; this.blockLoadDebounceMillis = undefined; this.keepDetailRowsCount = undefined; this.undoRedoCellEditingLimit = undefined; this.localeTextFunc = undefined; this.groupRowInnerRenderer = undefined; this.groupRowInnerRendererFramework = undefined; this.dateComponent = undefined; this.dateComponentFramework = undefined; this.groupRowRenderer = undefined; this.groupRowRendererFramework = undefined; this.isExternalFilterPresent = undefined; this.getRowHeight = undefined; this.doesExternalFilterPass = undefined; this.getRowClass = undefined; this.getRowStyle = undefined; this.getRowClassRules = undefined; this.traverseNode = undefined; this.getContextMenuItems = undefined; this.getMainMenuItems = undefined; this.processRowPostCreate = undefined; this.processCellForClipboard = undefined; this.getNodeChildDetails = undefined; this.groupRowAggNodes = undefined; this.getRowNodeId = undefined; this.isFullWidthCell = undefined; this.fullWidthCellRenderer = undefined; this.fullWidthCellRendererFramework = undefined; this.doesDataFlower = undefined; this.processSecondaryColDef = undefined; this.processSecondaryColGroupDef = undefined; this.getBusinessKeyForNode = undefined; this.sendToClipboard = undefined; this.navigateToNextCell = undefined; this.tabToNextCell = undefined; this.getDetailRowData = undefined; this.processCellFromClipboard = undefined; this.getDocument = undefined; this.postProcessPopup = undefined; this.getChildCount = undefined; this.getDataPath = undefined; this.loadingCellRenderer = undefined; this.loadingCellRendererFramework = undefined; this.loadingOverlayComponent = undefined; this.loadingOverlayComponentFramework = undefined; this.noRowsOverlayComponent = undefined; this.noRowsOverlayComponentFramework = undefined; this.detailCellRenderer = undefined; this.detailCellRendererFramework = undefined; this.defaultGroupSortComparator = undefined; this.isRowMaster = undefined; this.isRowSelectable = undefined; this.postSort = undefined; this.processHeaderForClipboard = undefined; this.paginationNumberFormatter = undefined; this.processDataFromClipboard = undefined; this.getServerSideGroupKey = undefined; this.isServerSideGroup = undefined; this.suppressKeyboardEvent = undefined; this.createChartContainer = undefined; this.processChartOptions = undefined; this.getChartToolbarItems = undefined; this.fillOperation = undefined; this.toolPanelSuppressRowGroups = undefined; this.toolPanelSuppressValues = undefined; this.toolPanelSuppressPivots = undefined; this.toolPanelSuppressPivotMode = undefined; this.toolPanelSuppressSideButtons = undefined; this.toolPanelSuppressColumnFilter = undefined; this.toolPanelSuppressColumnSelectAll = undefined; this.toolPanelSuppressColumnExpandAll = undefined; this.suppressMakeColumnVisibleAfterUnGroup = undefined; this.suppressRowClickSelection = undefined; this.suppressCellSelection = undefined; this.suppressHorizontalScroll = undefined; this.alwaysShowVerticalScroll = undefined; this.debug = undefined; this.enableBrowserTooltips = undefined; this.enableColResize = undefined; this.enableCellExpressions = undefined; this.enableSorting = undefined; this.enableServerSideSorting = undefined; this.enableFilter = undefined; this.enableServerSideFilter = undefined; this.angularCompileRows = undefined; this.angularCompileFilters = undefined; this.angularCompileHeaders = undefined; this.groupSuppressAutoColumn = undefined; this.groupSelectsChildren = undefined; this.groupIncludeFooter = undefined; this.groupIncludeTotalFooter = undefined; this.groupUseEntireRow = undefined; this.groupSuppressRow = undefined; this.groupSuppressBlankHeader = undefined; this.forPrint = undefined; this.suppressMenuHide = undefined; this.rowDeselection = undefined; this.unSortIcon = undefined; this.suppressMultiSort = undefined; this.singleClickEdit = undefined; this.suppressLoadingOverlay = undefined; this.suppressNoRowsOverlay = undefined; this.suppressAutoSize = undefined; this.skipHeaderOnAutoSize = undefined; this.suppressParentsInRowNodes = undefined; this.showToolPanel = undefined; this.suppressColumnMoveAnimation = undefined; this.suppressMovableColumns = undefined; this.suppressFieldDotNotation = undefined; this.enableRangeSelection = undefined; this.enableRangeHandle = undefined; this.enableFillHandle = undefined; this.suppressClearOnFillReduction = undefined; this.deltaSort = undefined; this.suppressTouch = undefined; this.suppressAsyncEvents = undefined; this.allowContextMenuWithControlKey = undefined; this.suppressContextMenu = undefined; this.suppressMenuFilterPanel = undefined; this.suppressMenuMainPanel = undefined; this.suppressMenuColumnPanel = undefined; this.rememberGroupStateWhenNewData = undefined; this.enableCellChangeFlash = undefined; this.suppressDragLeaveHidesColumns = undefined; this.suppressMiddleClickScrolls = undefined; this.suppressPreventDefaultOnMouseWheel = undefined; this.suppressUseColIdForGroups = undefined; this.suppressCopyRowsToClipboard = undefined; this.copyHeadersToClipboard = undefined; this.pivotMode = undefined; this.suppressAggFuncInHeader = undefined; this.suppressColumnVirtualisation = undefined; this.suppressAggAtRootLevel = undefined; this.suppressFocusAfterRefresh = undefined; this.functionsPassive = undefined; this.functionsReadOnly = undefined; this.animateRows = undefined; this.groupSelectsFiltered = undefined; this.groupRemoveSingleChildren = undefined; this.groupRemoveLowestSingleChildren = undefined; this.enableRtl = undefined; this.suppressClickEdit = undefined; this.rowDragManaged = undefined; this.suppressRowDrag = undefined; this.suppressMoveWhenRowDragging = undefined; this.enableMultiRowDragging = undefined; this.enableGroupEdit = undefined; this.embedFullWidthRows = undefined; this.deprecatedEmbedFullWidthRows = undefined; this.suppressTabbing = undefined; this.suppressPaginationPanel = undefined; this.floatingFilter = undefined; this.groupHideOpenParents = undefined; this.groupMultiAutoColumn = undefined; this.pagination = undefined; this.stopEditingWhenGridLosesFocus = undefined; this.paginationAutoPageSize = undefined; this.suppressScrollOnNewData = undefined; this.purgeClosedRowNodes = undefined; this.cacheQuickFilter = undefined; this.deltaRowDataMode = undefined; this.ensureDomOrder = undefined; this.accentedSort = undefined; this.pivotTotals = undefined; this.suppressChangeDetection = undefined; this.valueCache = undefined; this.valueCacheNeverExpires = undefined; this.aggregateOnlyChangedColumns = undefined; this.suppressAnimationFrame = undefined; this.suppressExcelExport = undefined; this.suppressCsvExport = undefined; this.treeData = undefined; this.masterDetail = undefined; this.suppressMultiRangeSelection = undefined; this.enterMovesDownAfterEdit = undefined; this.enterMovesDown = undefined; this.suppressPropertyNamesCheck = undefined; this.rowMultiSelectWithClick = undefined; this.contractColumnSelection = undefined; this.suppressEnterpriseResetOnNewColumns = undefined; this.enableOldSetFilterModel = undefined; this.suppressRowHoverHighlight = undefined; this.gridAutoHeight = undefined; this.suppressRowTransform = undefined; this.suppressClipboardPaste = undefined; this.serverSideSortingAlwaysResets = undefined; this.reactNext = undefined; this.suppressSetColumnStateEvents = undefined; this.enableCharts = undefined; this.deltaColumnMode = undefined; this.suppressMaintainUnsortedOrder = undefined; this.enableCellTextSelection = undefined; this.suppressBrowserResizeObserver = undefined; this.suppressMaxRenderedRowRestriction = undefined; this.excludeChildrenWhenTreeDataFiltering = undefined; this.keepDetailRows = undefined; this.paginateChildRows = undefined; this.preventDefaultOnContextMenu = undefined; this.undoRedoCellEditing = undefined; this.allowDragFromColumnsToolPanel = undefined; this.columnEverythingChanged = new EventEmitter(); this.newColumnsLoaded = new EventEmitter(); this.columnPivotModeChanged = new EventEmitter(); this.columnRowGroupChanged = new EventEmitter(); this.expandOrCollapseAll = new EventEmitter(); this.columnPivotChanged = new EventEmitter(); this.gridColumnsChanged = new EventEmitter(); this.columnValueChanged = new EventEmitter(); this.columnMoved = new EventEmitter(); this.columnVisible = new EventEmitter(); this.columnPinned = new EventEmitter(); this.columnGroupOpened = new EventEmitter(); this.columnResized = new EventEmitter(); this.displayedColumnsChanged = new EventEmitter(); this.virtualColumnsChanged = new EventEmitter(); this.rowGroupOpened = new EventEmitter(); this.rowDataChanged = new EventEmitter(); this.rowDataUpdated = new EventEmitter(); this.pinnedRowDataChanged = new EventEmitter(); this.rangeSelectionChanged = new EventEmitter(); this.chartCreated = new EventEmitter(); this.chartRangeSelectionChanged = new EventEmitter(); this.chartOptionsChanged = new EventEmitter(); this.chartDestroyed = new EventEmitter(); this.toolPanelVisibleChanged = new EventEmitter(); this.modelUpdated = new EventEmitter(); this.pasteStart = new EventEmitter(); this.pasteEnd = new EventEmitter(); this.fillStart = new EventEmitter(); this.fillEnd = new EventEmitter(); this.cellClicked = new EventEmitter(); this.cellDoubleClicked = new EventEmitter(); this.cellMouseDown = new EventEmitter(); this.cellContextMenu = new EventEmitter(); this.cellValueChanged = new EventEmitter(); this.rowValueChanged = new EventEmitter(); this.cellFocused = new EventEmitter(); this.rowSelected = new EventEmitter(); this.selectionChanged = new EventEmitter(); this.cellKeyDown = new EventEmitter(); this.cellKeyPress = new EventEmitter(); this.cellMouseOver = new EventEmitter(); this.cellMouseOut = new EventEmitter(); this.filterChanged = new EventEmitter(); this.filterModified = new EventEmitter(); this.filterOpened = new EventEmitter(); this.sortChanged = new EventEmitter(); this.virtualRowRemoved = new EventEmitter(); this.rowClicked = new EventEmitter(); this.rowDoubleClicked = new EventEmitter(); this.gridReady = new EventEmitter(); this.gridSizeChanged = new EventEmitter(); this.viewportChanged = new EventEmitter(); this.firstDataRendered = new EventEmitter(); this.dragStarted = new EventEmitter(); this.dragStopped = new EventEmitter(); this.checkboxChanged = new EventEmitter(); this.rowEditingStarted = new EventEmitter(); this.rowEditingStopped = new EventEmitter(); this.cellEditingStarted = new EventEmitter(); this.cellEditingStopped = new EventEmitter(); this.bodyScroll = new EventEmitter(); this.animationQueueEmpty = new EventEmitter(); this.heightScaleChanged = new EventEmitter(); this.paginationChanged = new EventEmitter(); this.componentStateChanged = new EventEmitter(); this.bodyHeightChanged = new EventEmitter(); this.displayedColumnsWidthChanged = new EventEmitter(); this.scrollVisibilityChanged = new EventEmitter(); this.columnHoverChanged = new EventEmitter(); this.flashCells = new EventEmitter(); this.rowDragEnter = new EventEmitter(); this.rowDragMove = new EventEmitter(); this.rowDragLeave = new EventEmitter(); this.rowDragEnd = new EventEmitter(); this.popupToFront = new EventEmitter(); this.columnRowGroupChangeRequest = new EventEmitter(); this.columnPivotChangeRequest = new EventEmitter(); this.columnValueChangeRequest = new EventEmitter(); this.columnAggFuncChangeRequest = new EventEmitter(); this.keyboardFocus = new EventEmitter(); this.mouseFocus = new EventEmitter(); this._nativeElement = elementDef.nativeElement; this.frameworkComponentWrapper.setViewContainerRef(this.viewContainerRef); this.frameworkComponentWrapper.setComponentFactoryResolver(this._componentFactoryResolver); } ngAfterViewInit() { this.checkForDeprecatedEvents(); this.gridOptions = ComponentUtil.copyAttributesToGridOptions(this.gridOptions, this, true); this.gridParams = { globalEventListener: this.globalEventListener.bind(this), frameworkOverrides: this.angularFrameworkOverrides, providedBeanInstances: { frameworkComponentWrapper: this.frameworkComponentWrapper }, modules: (this.modules || []) }; if (this.columns && this.columns.length > 0) { this.gridOptions.columnDefs = this.columns .map((column) => { return column.toColDef(); }); } new Grid(this._nativeElement, this.gridOptions, this.gridParams); if (this.gridOptions.api) { this.api = this.gridOptions.api; } if (this.gridOptions.columnApi) { this.columnApi = this.gridOptions.columnApi; } this._initialised = true; // sometimes, especially in large client apps gridReady can fire before ngAfterViewInit // this ties these together so that gridReady will always fire after agGridAngular's ngAfterViewInit // the actual containing component's ngAfterViewInit will fire just after agGridAngular's this._fullyReady.resolveNow(null, resolve => resolve); } ngOnChanges(changes) { if (this._initialised) { ComponentUtil.processOnChange(changes, this.gridOptions, this.api, this.columnApi); } } ngOnDestroy() { if (this._initialised) { // need to do this before the destroy, so we know not to emit any events // while tearing down the grid. this._destroyed = true; if (this.api) { this.api.destroy(); } } } checkForDeprecatedEvents() { Utils.iterateObject(Events, (key, eventName) => { if (this[eventName] && this[eventName].observers.length > 0) { GridOptionsWrapper.checkEventDeprecation(eventName); } }); } globalEventListener(eventType, event) { // if we are tearing down, don't emit angular events, as this causes // problems with the angular router if (this._destroyed) { return; } // generically look up the eventType let emitter = this[eventType]; if (emitter) { if (eventType === 'gridReady') { // if the user is listening for gridReady, wait for ngAfterViewInit to fire first, then emit the // gridReady event this._fullyReady.then((result => { emitter.emit(event); })); } else { emitter.emit(event); } } else { console.log('ag-Grid-angular: could not find EventEmitter: ' + eventType); } } }; AgGridAngular.ctorParameters = () => [ { type: ElementRef }, { type: ViewContainerRef }, { type: AngularFrameworkOverrides }, { type: AngularFrameworkComponentWrapper }, { type: ComponentFactoryResolver } ]; __decorate([ ContentChildren(AgGridColumn) ], AgGridAngular.prototype, "columns", void 0); __decorate([ Input() ], AgGridAngular.prototype, "gridOptions", void 0); __decorate([ Input() ], AgGridAngular.prototype, "modules", void 0); __decorate([ Input() ], AgGridAngular.prototype, "slaveGrids", void 0); __decorate([ Input() ], AgGridAngular.prototype, "alignedGrids", void 0); __decorate([ Input() ], AgGridAngular.prototype, "rowData", void 0); __decorate([ Input() ], AgGridAngular.prototype, "columnDefs", void 0); __decorate([ Input() ], AgGridAngular.prototype, "excelStyles", void 0); __decorate([ Input() ], AgGridAngular.prototype, "pinnedTopRowData", void 0); __decorate([ Input() ], AgGridAngular.prototype, "pinnedBottomRowData", void 0); __decorate([ Input() ], AgGridAngular.prototype, "components", void 0); __decorate([ Input() ], AgGridAngular.prototype, "frameworkComponents", void 0); __decorate([ Input() ], AgGridAngular.prototype, "rowStyle", void 0); __decorate([ Input() ], AgGridAngular.prototype, "context", void 0); __decorate([ Input() ], AgGridAngular.prototype, "autoGroupColumnDef", void 0); __decorate([ Input() ], AgGridAngular.prototype, "groupColumnDef", void 0); __decorate([ Input() ], AgGridAngular.prototype, "localeText", void 0); __decorate([ Input() ], AgGridAngular.prototype, "icons", void 0); __decorate([ Input() ], AgGridAngular.prototype, "datasource", void 0); __decorate([ Input() ], AgGridAngular.prototype, "serverSideDatasource", void 0); __decorate([ Input() ], AgGridAngular.prototype, "viewportDatasource", void 0); __decorate([ Input() ], AgGridAngular.prototype, "groupRowRendererParams", void 0); __decorate([ Input() ], AgGridAngular.prototype, "aggFuncs", void 0); __decorate([ Input() ], AgGridAngular.prototype, "fullWidthCellRendererParams", void 0); __decorate([ Input() ], AgGridAngular.prototype, "defaultColGroupDef", void 0); __decorate([ Input() ], AgGridAngular.prototype, "defaultColDef", void 0); __decorate([ Input() ], AgGridAngular.prototype, "defaultExportParams", void 0); __decorate([ Input() ], AgGridAngular.prototype, "columnTypes", void 0); __decorate([ Input() ], AgGridAngular.prototype, "rowClassRules", void 0); __decorate([ Input() ], AgGridAngular.prototype, "detailGridOptions", void 0); __decorate([ Input() ], AgGridAngular.prototype, "detailCellRendererParams", void 0); __decorate([ Input() ], AgGridAngular.prototype, "loadingCellRendererParams", void 0); __decorate([ Input() ], AgGridAngular.prototype, "loadingOverlayComponentParams", void 0); __decorate([ Input() ], AgGridAngular.prototype, "noRowsOverlayComponentParams", void 0); __decorate([ Input() ], AgGridAngular.prototype, "popupParent", void 0); __decorate([ Input() ], AgGridAngular.prototype, "colResizeDefault", void 0); __decorate([ Input() ], AgGridAngular.prototype, "reduxStore", void 0); __decorate([ Input() ], AgGridAngular.prototype, "statusBar", void 0); __decorate([ Input() ], AgGridAngular.prototype, "sideBar", void 0); __decorate([ Input() ], AgGridAngular.prototype, "sortingOrder", void 0); __decorate([ Input() ], AgGridAngular.prototype, "rowClass", void 0); __decorate([ Input() ], AgGridAngular.prototype, "rowSelection", void 0); __decorate([ Input() ], AgGridAngular.prototype, "overlayLoadingTemplate", void 0); __decorate([ Input() ], AgGridAngular.prototype, "overlayNoRowsTemplate", void 0); __decorate([ Input() ], AgGridAngular.prototype, "quickFilterText", void 0); __decorate([ Input() ], AgGridAngular.prototype, "rowModelType", void 0); __decorate([ Input() ], AgGridAngular.prototype, "editType", void 0); __decorate([ Input() ], AgGridAngular.prototype, "domLayout", void 0); __decorate([ Input() ], AgGridAngular.prototype, "clipboardDeliminator", void 0); __decorate([ Input() ], AgGridAngular.prototype, "rowGroupPanelShow", void 0); __decorate([ Input() ], AgGridAngular.prototype, "multiSortKey", void 0); __decorate([ Input() ], AgGridAngular.prototype, "pivotColumnGroupTotals", void 0); __decorate([ Input() ], AgGridAngular.prototype, "pivotRowTotals", void 0); __decorate([ Input() ], AgGridAngular.prototype, "pivotPanelShow", void 0); __decorate([ Input() ], AgGridAngular.prototype, "rowHeight", void 0); __decorate([ Input() ], AgGridAngular.prototype, "detailRowHeight", void 0); __decorate([ Input() ], AgGridAngular.prototype, "rowBuffer", void 0); __decorate([ Input() ], AgGridAngular.prototype, "colWidth", void 0); __decorate([ Input() ], AgGridAngular.prototype, "headerHeight", void 0); __decorate([ Input() ], AgGridAngular.prototype, "groupHeaderHeight", void 0); __decorate([ Input() ], AgGridAngular.prototype, "floatingFiltersHeight", void 0); __decorate([ Input() ], AgGridAngular.prototype, "pivotHeaderHeight", void 0); __decorate([ Input() ], AgGridAngular.prototype, "pivotGroupHeaderHeight", void 0); __decorate([ Input() ], AgGridAngular.prototype, "groupDefaultExpanded", void 0); __decorate([ Input() ], AgGridAngular.prototype, "minColWidth", void 0); __decorate([ Input() ], AgGridAngular.prototype, "maxColWidth", void 0); __decorate([ Input() ], AgGridAngular.prototype, "viewportRowModelPageSize", void 0); __decorate([ Input() ], AgGridAngular.prototype, "viewportRowModelBufferSize", void 0); __decorate([ Input() ], AgGridAngular.prototype, "autoSizePadding", void 0); __decorate([ Input() ], AgGridAngular.prototype, "maxBlocksInCache", void 0); __decorate([ Input() ], AgGridAngular.prototype, "maxConcurrentDatasourceRequests", void 0); __decorate([ Input() ], AgGridAngular.prototype, "tooltipShowDelay", void 0); __decorate([ Input() ], AgGridAngular.prototype, "cacheOverflowSize", void 0); __decorate([ Input() ], AgGridAngular.prototype, "paginationPageSize", void 0); __decorate([ Input() ], AgGridAngular.prototype, "cacheBlockSize", void 0); __decorate([ Input() ], AgGridAngular.prototype, "infiniteInitialRowCount", void 0); __decorate([ Input() ], AgGridAngular.prototype, "scrollbarWidth", void 0); __decorate([ Input() ], AgGridAngular.prototype, "paginationStartPage", void 0); __decorate([ Input() ], AgGridAngular.prototype, "infiniteBlockSize", void 0); __decorate([ Input() ], AgGridAngular.prototype, "batchUpdateWaitMillis", void 0); __decorate([ Input() ], AgGridAngular.prototype, "blockLoadDebounceMillis", void 0); __decorate([ Input() ], AgGridAngular.prototype, "keepDetailRowsCount", void 0); __decorate([ Input() ], AgGridAngular.prototype, "undoRedoCellEditingLimit", void 0); __decorate([ Input() ], AgGridAngular.prototype, "localeTextFunc", void 0); __decorate([ Input() ], AgGridAngular.prototype, "groupRowInnerRenderer", void 0); __decorate([ Input() ], AgGridAngular.prototype, "groupRowInnerRendererFramework", void 0); __decorate([ Input() ], AgGridAngular.prototype, "dateComponent", void 0); __decorate([ Input() ], AgGridAngular.prototype, "dateComponentFramework", void 0); __decorate([ Input() ], AgGridAngular.prototype, "groupRowRenderer", void 0); __decorate([ Input() ], AgGridAngular.prototype, "groupRowRendererFramework", void 0); __decorate([ Input() ], AgGridAngular.prototype, "isExternalFilterPresent", void 0); __decorate([ Input() ], AgGridAngular.prototype, "getRowHeight", void 0); __decorate([ Input() ], AgGridAngular.prototype, "doesExternalFilterPass", void 0); __decorate([ Input() ], AgGridAngular.prototype, "getRowClass", void 0); __decorate([ Input() ], AgGridAngular.prototype, "getRowStyle", void 0); __decorate([ Input() ], AgGridAngular.prototype, "getRowClassRules", void 0); __decorate([ Input() ], AgGridAngular.prototype, "traverseNode", void 0); __decorate([ Input() ], AgGridAngular.prototype, "getContextMenuItems", void 0); __decorate([ Input() ], AgGridAngular.prototype, "getMainMenuItems", void 0); __decorate([ Input() ], AgGridAngular.prototype, "processRowPostCreate", void 0); __decorate([ Input() ], AgGridAngular.prototype, "processCellForClipboard", void 0); __decorate([ Input() ], AgGridAngular.prototype, "getNodeChildDetails", void 0); __decorate([ Input() ], AgGridAngular.prototype, "groupRowAggNodes", void 0); __decorate([ Input() ], AgGridAngular.prototype, "getRowNodeId", void 0); __decorate([ Input() ], AgGridAngular.prototype, "isFullWidthCell", void 0); __decorate([ Input() ], AgGridAngular.prototype, "fullWidthCellRenderer", void 0); __decorate([ Input() ], AgGridAngular.prototype, "fullWidthCellRendererFramework", void 0); __decorate([ Input() ], AgGridAngular.prototype, "doesDataFlower", void 0); __decorate([ Input() ], AgGridAngular.prototype, "processSecondaryColDef", void 0); __decorate([ Input() ], AgGridAngular.prototype, "processSecondaryColGroupDef", void 0); __decorate([ Input() ], AgGridAngular.prototype, "getBusinessKeyForNode", void 0); __decorate([ Input() ], AgGridAngular.prototype, "sendToClipboard", void 0); __decorate([ Input() ], AgGridAngular.prototype, "navigateToNextCell", void 0); __decorate([ Input() ], AgGridAngular.prototype, "tabToNextCell", void 0); __decorate([ Input() ], AgGridAngular.prototype, "getDetailRowData", void 0); __decorate([ Input() ], AgGridAngular.prototype, "processCellFromClipboard", void 0); __decorate([ Input() ], AgGridAngular.prototype, "getDocument", void 0); __decorate([ Input() ], AgGridAngular.prototype, "postProcessPopup", void 0); __decorate([ Input() ], AgGridAngular.prototype, "getChildCount", void 0); __decorate([ Input() ], AgGridAngular.prototype, "getDataPath", void 0); __decorate([ Input() ], AgGridAngular.prototype, "loadingCellRenderer", void 0); __decorate([ Input() ], AgGridAngular.prototype, "loadingCellRendererFramework", void 0); __decorate([ Input() ], AgGridAngular.prototype, "loadingOverlayComponent", void 0); __decorate([ Input() ], AgGridAngular.prototype, "loadingOverlayComponentFramework", void 0); __decorate([ Input() ], AgGridAngular.prototype, "noRowsOverlayComponent", void 0); __decorate([ Input() ], AgGridAngular.prototype, "noRowsOverlayComponentFramework", void 0); __decorate([ Input() ], AgGridAngular.prototype, "detailCellRenderer", void 0); __decorate([ Input() ], AgGridAngular.prototype, "detailCellRendererFramework", void 0); __decorate([ Input() ], AgGridAngular.prototype, "defaultGroupSortComparator", void 0); __decorate([ Input() ], AgGridAngular.prototype, "isRowMaster", void 0); __decorate([ Input() ], AgGridAngular.prototype, "isRowSelectable", void 0); __decorate([ Input() ], AgGridAngular.prototype, "postSort", void 0); __decorate([ Input() ], AgGridAngular.prototype, "processHeaderForClipboard", void 0); __decorate([ Input() ], AgGridAngular.prototype, "paginationNumberFormatter", void 0); __decorate([ Input() ], AgGridAngular.prototype, "processDataFromClipboard", void 0); __decorate([ Input() ], AgGridAngular.prototype, "getServerSideGroupKey", void 0); __decorate([ Input() ], AgGridAngular.prototype, "isServerSideGroup", void 0); __decorate([ Input() ], AgGridAngular.prototype, "suppressKeyboardEvent", void 0); __decorate([ Input() ], AgGridAngular.prototype, "createChartContainer", void 0); __decorate([ Input() ], AgGridAngular.prototype, "processChartOptions", void 0); __decorate([ Input() ], AgGridAngular.prototype, "getChartToolbarItems", void 0); __decorate([ Input() ], AgGridAngular.prototype, "fillOperation", void 0); __decorate([ Input() ], AgGridAngular.prototype, "toolPanelSuppressRowGroups", void 0); __decorate([ Input() ], AgGridAngular.prototype, "toolPanelSuppressValues", void 0); __decorate([ Input() ], AgGridAngular.prototype, "toolPanelSuppressPivots", void 0); __decorate([ Input() ], AgGridAngular.prototype, "toolPanelSuppressPivotMode", void 0); __decorate([ Input() ], AgGridAngular.prototype, "toolPanelSuppressSideButtons", void 0); __decorate([ Input() ], AgGridAngular.prototype, "toolPanelSuppressColumnFilter", void 0); __decorate([ Input() ], AgGridAngular.prototype, "toolPanelSuppressColumnSelectAll", void 0); __decorate([ Input() ], AgGridAngular.prototype, "toolPanelSuppressColumnExpandAll", void 0); __decorate([ Input() ], AgGridAngular.prototype, "suppressMakeColumnVisibleAfterUnGroup", void 0); __decorate([ Input() ], AgGridAngular.prototype, "suppressRowClickSelection", void 0); __decorate([ Input() ], AgGridAngular.prototype, "suppressCellSelection", void 0); __decorate([ Input() ], AgGridAngular.prototype, "suppressHorizontalScroll", void 0); __decorate([ Input() ], AgGridAngular.prototype, "alwaysShowVerticalScroll", void 0); __decorate([ Input() ], AgGridAngular.prototype, "debug", void 0); __decorate([ Input() ], AgGridAngular.prototype, "enableBrowserTooltips", void 0); __decorate([ Input() ], AgGridAngular.prototype, "enableColResize", void 0); __decorate([ Input() ], AgGridAngular.prototype, "enableCellExpressions", void 0); __decorate([ Input() ], AgGridAngular.prototype, "enableSorting", void 0); __decorate([ Input() ], AgGridAngular.prototype, "enableServerSideSorting", void 0); __decorate([ Input() ], AgGridAngular.prototype, "enableFilter", void 0); __decorate([ Input() ], AgGridAngular.prototype, "enableServerSideFilter", void 0); __decorate([ Input() ], AgGridAngular.prototype, "angularCompileRows", void 0); __decorate([ Input() ], AgGridAngular.prototype, "angularCompileFilters", void 0); __decorate([ Input() ], AgGridAngular.prototype, "angularCompileHeaders", void 0); __decorate([ Input() ], AgGridAngular.prototype, "groupSuppressAutoColumn", void 0); __decorate([ Input() ], AgGridAngular.prototype, "groupSelectsChildren", void 0); __decorate([ Input() ], AgGridAngular.prototype, "groupIncludeFooter", void 0); __decorate([ Input() ], AgGridAngular.prototype, "groupIncludeTotalFooter", void 0); __decorate([ Input() ], AgGridAngular.prototype, "groupUseEntireRow", void 0); __decorate([ Input() ], AgGridAngular.prototype, "groupSuppressRow", void 0); __decorate([ Input() ], AgGridAngular.prototype, "groupSuppressBlankHeader", void 0); __decorate([ Input() ], AgGridAngular.prototype, "forPrint", void 0); __decorate([ Input() ], AgGridAngular.prototype, "suppressMenuHide", void 0); __decorate([ Input() ], AgGridAngular.prototype, "rowDeselection", void 0); __decorate([ Input() ], AgGridAngular.prototype, "unSortIcon", void 0); __decorate([ Input() ], AgGridAngular.prototype, "suppressMultiSort", void 0); __decorate([ Input() ], AgGridAngular.prototype, "singleClickEdit", void 0); __decorate([ Input() ], AgGridAngular.prototype, "suppressLoadingOverlay", void 0); __decorate([ Input() ], AgGridAngular.prototype, "suppressNoRowsOverlay", void 0); __decorate([ Input() ], AgGridAngular.prototype, "suppressAutoSize", void 0); __decorate([ Input() ], AgGridAngular.prototype, "skipHeaderOnAutoSize", void 0); __decorate([ Input() ], AgGridAngular.prototype, "suppressParentsInRowNodes", void 0); __decorate([ Input() ], AgGridAngular.prototype, "showToolPanel", void 0); __decorate([ Input() ], AgGridAngular.prototype, "suppressColumnMoveAnimation", void 0); __decorate([ Input() ], AgGridAngular.prototype, "suppressMovableColumns", void 0); __decorate([ Input() ], AgGridAngular.prototype, "suppressFieldDotNotation", void 0); __decorate([ Input() ], AgGridAngular.prototype, "enableRangeSelection", void 0); __decorate([ Input() ], AgGridAngular.prototype, "enableRangeHandle", void 0); __decorate([ Input() ], AgGridAngular.prototype, "enableFillHandle", void 0); __decorate([ Input() ], AgGridAngular.prototype, "suppressClearOnFillReduction", void 0); __decorate([ Input() ], AgGridAngular.prototype, "deltaSort", void 0); __decorate([ Input() ], AgGridAngular.prototype, "suppressTouch", void 0); __decorate([ Input() ], AgGridAngular.prototype, "suppressAsyncEvents", void 0); __decorate([ Input() ], AgGridAngular.prototype, "allowContextMenuWithControlKey", void 0); __decorate([ Input() ], AgGridAngular.prototype, "suppressContextMenu", void 0); __decorate([ Input() ], AgGridAngular.prototype, "suppressMenuFilterPanel", void 0); __decorate([ Input() ], AgGridAngular.prototype, "suppressMenuMainPanel", void 0); __decorate([ Input() ], AgGridAngular.prototype, "suppressMenuColumnPanel", void 0); __decorate([ Input() ], AgGridAngular.prototype, "rememberGroupStateWhenNewData", void 0); __decorate([ Input() ], AgGridAngular.prototype, "enableCellChangeFlash", void 0); __decorate([ Input() ], AgGridAngular.prototype, "suppressDragLeaveHidesColumns", void 0); __decorate([ Input() ], AgGridAngular.prototype, "suppressMiddleClickScrolls", void 0); __decorate([ Input() ], AgGridAngular.prototype, "suppressPreventDefaultOnMouseWheel", void 0); __decorate([ Input() ], AgGridAngular.prototype, "suppressUseColIdForGroups", void 0); __decorate([ Input() ], AgGridAngular.prototype, "suppressCopyRowsToClipboard", void 0); __decorate([ Input() ], AgGridAngular.prototype, "copyHeadersToClipboard", void 0); __decorate([ Input() ], AgGridAngular.prototype, "pivotMode", void 0); __decorate([ Input() ], AgGridAngular.prototype, "suppressAggFuncInHeader", void 0); __decorate([ Input() ], AgGridAngular.prototype, "suppressColumnVirtualisation", void 0); __decorate([ Input() ], AgGridAngular.prototype, "suppressAggAtRootLevel", void 0); __decorate([ Input() ], AgGridAngular.prototype, "suppressFocusAfterRefresh", void 0); __decorate([ Input() ], AgGridAngular.prototype, "functionsPassive", void 0); __decorate([ Input() ], AgGridAngular.prototype, "functionsReadOnly", void 0); __decorate([ Input() ], AgGridAngular.prototype, "animateRows", void 0); __decorate([ Input() ], AgGridAngular.prototype, "groupSelectsFiltered", void 0); __decorate([ Input() ], AgGridAngular.prototype, "groupRemoveSingleChildren", void 0); __decorate([ Input() ], AgGridAngular.prototype, "groupRemoveLowestSingleChildren", void 0); __decorate([ Input() ], AgGridAngular.prototype, "enableRtl", void 0); __decorate([ Input() ], AgGridAngular.prototype, "suppressClickEdit", void 0); __decorate([ Input() ], AgGridAngular.prototype, "rowDragManaged", void 0); __decorate([ Input() ], AgGridAngular.prototype, "suppressRowDrag", void 0); __decorate([ Input() ], AgGridAngular.prototype, "suppressMoveWhenRowDragging", void 0); __decorate([ Input() ], AgGridAngular.prototype, "enableMultiRowDragging", void 0); __decorate([ Input() ], AgGridAngular.prototype, "enableGroupEdit", void 0); __decorate([ Input() ], AgGridAngular.prototype, "embedFullWidthRows", void 0); __decorate([ Input() ], AgGridAngular.prototype, "deprecatedEmbedFullWidthRows", void 0); __decorate([ Input() ], AgGridAngular.prototype, "suppressTabbing", void 0); __decorate([ Input() ], AgGridAngular.prototype, "suppressPaginationPanel", void 0); __decorate([ Input() ], AgGridAngular.prototype, "floatingFilter", void 0); __decorate([ Input() ], AgGridAngular.prototype, "groupHideOpenParents", void 0); __decorate([ Input() ], AgGridAngular.prototype, "groupMultiAutoColumn", void 0); __decorate([ Input() ], AgGridAngular.prototype, "pagination", void 0); __decorate([ Input() ], AgGridAngular.prototype, "stopEditingWhenGridLosesFocus", void 0); __decorate([ Input() ], AgGridAngular.prototype, "paginationAutoPageSize", void 0); __decorate([ Input() ], AgGridAngular.prototype, "suppressScrollOnNewData", void 0); __decorate([ Input() ], AgGridAngular.prototype, "purgeClosedRowNodes", void 0); __decorate([ Input() ], AgGridAngular.prototype, "cacheQuickFilter", void 0); __decorate([ Input() ], AgGridAngular.prototype, "deltaRowDataMode", void 0); __decorate([ Input() ], AgGridAngular.prototype, "ensureDomOrder", void 0); __decorate([ Input() ], AgGridAngular.prototype, "accentedSort", void 0); __decorate([ Input() ], AgGridAngular.prototype, "pivotTotals", void 0); __decorate([ Input() ], AgGridAngular.prototype, "suppressChangeDetection", void 0); __decorate([ Input() ], AgGridAngular.prototype, "valueCache", void 0); __decorate([ Input() ], AgGridAngular.prototype, "valueCacheNeverExpires", void 0); __decorate([ Input() ], AgGridAngular.prototype, "aggregateOnlyChangedColumns", void 0); __decorate([ Input() ], AgGridAngular.prototype, "suppressAnimationFrame", void 0); __decorate([ Input() ], AgGridAngular.prototype, "suppressExcelExport", void 0); __decorate([ Input() ], AgGridAngular.prototype, "suppressCsvExport", void 0); __decorate([ Input() ], AgGridAngular.prototype, "treeData", void 0); __decorate([ Input() ], AgGridAngular.prototype, "masterDetail", void 0); __decorate([ Input() ], AgGridAngular.prototype, "suppressMultiRangeSelection", void 0); __decorate([ Input() ], AgGridAngular.prototype, "enterMovesDownAfterEdit", void 0); __decorate([ Input() ], AgGridAngular.prototype, "enterMovesDown", void 0); __decorate([ Input() ], AgGridAngular.prototype, "suppressPropertyNamesCheck", void 0); __decorate([ Input() ], AgGridAngular.prototype, "rowMultiSelectWithClick", void 0); __decorate([ Input() ], AgGridAngular.prototype, "contractColumnSelection", void 0); __decorate([ Input() ], AgGridAngular.prototype, "suppressEnterpriseResetOnNewColumns", void 0); __decorate([ Input() ], AgGridAngular.prototype, "enableOldSetFilterModel", void 0); __decorate([ Input() ], AgGridAngular.prototype, "suppressRowHoverHighlight", void 0); __decorate([ Input() ], AgGridAngular.prototype, "gridAutoHeight", void 0); __decorate([ Input() ], AgGridAngular.prototype, "suppressRowTransform", void 0); __decorate([ Input() ], AgGridAngular.prototype, "suppressClipboardPaste", void 0); __decorate([ Input() ], AgGridAngular.prototype, "serverSideSortingAlwaysResets", void 0); __decorate([ Input() ], AgGridAngular.prototype, "reactNext", void 0); __decorate([ Input() ], AgGridAngular.prototype, "suppressSetColumnStateEvents", void 0); __decorate([ Input() ], AgGridAngular.prototype, "enableCharts", void 0); __decorate([ Input() ], AgGridAngular.prototype, "deltaColumnMode", void 0); __decorate([ Input() ], AgGridAngular.prototype, "suppressMaintainUnsortedOrder", void 0); __decorate([ Input() ], AgGridAngular.prototype, "enableCellTextSelection", void 0); __decorate([ Input() ], AgGridAngular.prototype, "suppressBrowserResizeObserver", void 0); __decorate([ Input() ], AgGridAngular.prototype, "suppressMaxRenderedRowRestriction", void 0); __decorate([ Input() ], AgGridAngular.prototype, "excludeChildrenWhenTreeDataFiltering", void 0); __decorate([ Input() ], AgGridAngular.prototype, "keepDetailRows", void 0); __decorate([ Input() ], AgGridAngular.prototype, "paginateChildRows", void 0); __decorate([ Input() ], AgGridAngular.prototype, "preventDefaultOnContextMenu", void 0); __decorate([ Input() ], AgGridAngular.prototype, "undoRedoCellEditing", void 0); __decorate([ Input() ], AgGridAngular.prototype, "allowDragFromColumnsToolPanel", void 0); __decorate([ Output() ], AgGridAngular.prototype, "columnEverythingChanged", void 0); __decorate([ Output() ], AgGridAngular.prototype, "newColumnsLoaded", void 0); __decorate([ Output() ], AgGridAngular.prototype, "columnPivotModeChanged", void 0); __decorate([ Output() ], AgGridAngular.prototype, "columnRowGroupChanged", void 0); __decorate([ Output() ], AgGridAngular.prototype, "expandOrCollapseAll", void 0); __decorate([ Output() ], AgGridAngular.prototype, "columnPivotChanged", void 0); __decorate([ Output() ], AgGridAngular.prototype, "gridColumnsChanged", void 0); __decorate([ Output() ], AgGridAngular.prototype, "columnValueChanged", void 0); __decorate([ Output() ], AgGridAngular.prototype, "columnMoved", void 0); __decorate([ Output() ], AgGridAngular.prototype, "columnVisible", void 0); __decorate([ Output() ], AgGridAngular.prototype, "columnPinned", void 0); __decorate([ Output() ], AgGridAngular.prototype, "columnGroupOpened", void 0); __decorate([ Output() ], AgGridAngular.prototype, "columnResized", void 0); __decorate([ Output() ], AgGridAngular.prototype, "displayedColumnsChanged", void 0); __decorate([ Output() ], AgGridAngular.prototype, "virtualColumnsChanged", void 0); __decorate([ Output() ], AgGridAngular.prototype, "rowGroupOpened", void 0); __decorate([ Output() ], AgGridAngular.prototype, "rowDataChanged", void 0); __decorate([ Output() ], AgGridAngular.prototype, "rowDataUpdated", void 0); __decorate([ Output() ], AgGridAngular.prototype, "pinnedRowDataChanged", void 0); __decorate([ Output() ], AgGridAngular.prototype, "rangeSelectionChanged", void 0); __decorate([ Output() ], AgGridAngular.prototype, "chartCreated", void 0); __decorate([ Output() ], AgGridAngular.prototype, "chartRangeSelectionChanged", void 0); __decorate([ Output() ], AgGridAngular.prototype, "chartOptionsChanged", void 0); __decorate([ Output() ], AgGridAngular.prototype, "chartDestroyed", void 0); __decorate([ Output() ], AgGridAngular.prototype, "toolPanelVisibleChanged", void 0); __decorate([ Output() ], AgGridAngular.prototype, "modelUpdated", void 0); __decorate([ Output() ], AgGridAngular.prototype, "pasteStart", void 0); __decorate([ Output() ], AgGridAngular.prototype, "pasteEnd", void 0); __decorate([ Output() ], AgGridAngular.prototype, "fillStart", void 0); __decorate([ Output() ], AgGridAngular.prototype, "fillEnd", void 0); __decorate([ Output() ], AgGridAngular.prototype, "cellClicked", void 0); __decorate([ Output() ], AgGridAngular.prototype, "cellDoubleClicked", void 0); __decorate([ Output() ], AgGridAngular.prototype, "cellMouseDown", void 0); __decorate([ Output() ], AgGridAngular.prototype, "cellContextMenu", void 0); __decorate([ Output() ], AgGridAngular.prototype, "cellValueChanged", void 0); __decorate([ Output() ], AgGridAngular.prototype, "rowValueChanged", void 0); __decorate([ Output() ], AgGridAngular.prototype, "cellFocused", void 0); __decorate([ Output() ], AgGridAngular.prototype, "rowSelected", void 0); __decorate([ Output() ], AgGridAngular.prototype, "selectionChanged", void 0); __decorate([ Output() ], AgGridAngular.prototype, "cellKeyDown", void 0); __decorate([ Output() ], AgGridAngular.prototype, "cellKeyPress", void 0); __decorate([ Output() ], AgGridAngular.prototype, "cellMouseOver", void 0); __decorate([ Output() ], AgGridAngular.prototype, "cellMouseOut", void 0); __decorate([ Output() ], AgGridAngular.prototype, "filterChanged", void 0); __decorate([ Output() ], AgGridAngular.prototype, "filterModified", void 0); __decorate([ Output() ], AgGridAngular.prototype, "filterOpened", void 0); __decorate([ Output() ], AgGridAngular.prototype, "sortChanged", void 0); __decorate([ Output() ], AgGridAngular.prototype, "virtualRowRemoved", void 0); __decorate([ Output() ], AgGridAngular.prototype, "rowClicked", void 0); __decorate([ Output() ], AgGridAngular.prototype, "rowDoubleClicked", void 0); __decorate([ Output() ], AgGridAngular.prototype, "gridReady", void 0); __decorate([ Output() ], AgGridAngular.prototype, "gridSizeChanged", void 0); __decorate([ Output() ], AgGridAngular.prototype, "viewportChanged", void 0); __decorate([ Output() ], AgGridAngular.prototype, "firstDataRendered", void 0); __decorate([ Output() ], AgGridAngular.prototype, "dragStarted", void 0); __decorate([ Output() ], AgGridAngular.prototype, "dragStopped", void 0); __decorate([ Output() ], AgGridAngular.prototype, "checkboxChanged", void 0); __decorate([ Output() ], AgGridAngular.prototype, "rowEditingStarted", void 0); __decorate([ Output() ], AgGridAngular.prototype, "rowEditingStopped", void 0); __decorate([ Output() ], AgGridAngular.prototype, "cellEditingStarted", void 0); __decorate([ Output() ], AgGridAngular.prototype, "cellEditingStopped", void 0); __decorate([ Output() ], AgGridAngular.prototype, "bodyScroll", void 0); __decorate([ Output() ], AgGridAngular.prototype, "animationQueueEmpty", void 0); __decorate([ Output() ], AgGridAngular.prototype, "heightScaleChanged", void 0); __decorate([ Output() ], AgGridAngular.prototype, "paginationChanged", void 0); __decorate([ Output() ], AgGridAngular.prototype, "componentStateChanged", void 0); __decorate([ Output() ], AgGridAngular.prototype, "bodyHeightChanged", void 0); __decorate([ Output() ], AgGridAngular.prototype, "displayedColumnsWidthChanged", void 0); __decorate([ Output() ], AgGridAngular.prototype, "scrollVisibilityChanged", void 0); __decorate([ Output() ], AgGridAngular.prototype, "columnHoverChanged", void 0); __decorate([ Output() ], AgGridAngular.prototype, "flashCells", void 0); __decorate([ Output() ], AgGridAngular.prototype, "rowDragEnter", void 0); __decorate([ Output() ], AgGridAngular.prototype, "rowDragMove", void 0); __decorate([ Output() ], AgGridAngular.prototype, "rowDragLeave", void 0); __decorate([ Output() ], AgGridAngular.prototype, "rowDragEnd", void 0); __decorate([ Output() ], AgGridAngular.prototype, "popupToFront", void 0); __decorate([ Output() ], AgGridAngular.prototype, "columnRowGroupChangeRequest", void 0); __decorate([ Output() ], AgGridAngular.prototype, "columnPivotChangeRequest", void 0); __decorate([ Output() ], AgGridAngular.prototype, "columnValueChangeRequest", void 0); __decorate([ Output() ], AgGridAngular.prototype, "columnAggFuncChangeRequest", void 0); __decorate([ Output() ], AgGridAngular.prototype, "keyboardFocus", void 0); __decorate([ Output() ], AgGridAngular.prototype, "mouseFocus", void 0); AgGridAngular = __decorate([ Component({ selector: 'ag-grid-angular', template: '', providers: [ AngularFrameworkOverrides, AngularFrameworkComponentWrapper ], // tell angular we don't want view encapsulation, we don't want a shadow root encapsulation: ViewEncapsulation.None }) ], AgGridAngular); var AgGridModule_1; let AgGridModule = AgGridModule_1 = class AgGridModule { static withComponents(components) { return { ngModule: AgGridModule_1, providers: [ { provide: ANALYZE_FOR_ENTRY_COMPONENTS, useValue: components, multi: true } ], }; } static forRoot(components) { return { ngModule: AgGridModule_1, providers: [ { provide: ANALYZE_FOR_ENTRY_COMPONENTS, useValue: components, multi: true } ], }; } }; AgGridModule = AgGridModule_1 = __decorate([ NgModule({ declarations: [AgGridAngular, AgGridColumn], imports: [], exports: [AgGridAngular, AgGridColumn] }) ], AgGridModule); /** * Generated bundle index. Do not edit. */ export { AgGridAngular, AgGridColumn, AgGridModule, AngularFrameworkOverrides as ɵa, AngularFrameworkComponentWrapper as ɵb }; //# sourceMappingURL=ag-grid-community-angular.js.map
const uuidv4 = require('uuid/v4'); exports.generateRouterRtpCapabilities = function() { return { codecs : [ { mimeType : 'audio/opus', kind : 'audio', clockRate : 48000, preferredPayloadType : 100, channels : 2, rtcpFeedback : [], parameters : { useinbandfec : 1, foo : 'bar' } }, { mimeType : 'video/VP8', kind : 'video', clockRate : 90000, preferredPayloadType : 101, rtcpFeedback : [ { type: 'nack' }, { type: 'nack', parameter: 'pli' }, { type: 'ccm', parameter: 'fir' }, { type: 'goog-remb' } ], parameters : { 'x-google-start-bitrate' : 1500 } }, { mimeType : 'video/rtx', kind : 'video', clockRate : 90000, preferredPayloadType : 102, rtcpFeedback : [], parameters : { apt : 101 } }, { mimeType : 'video/H264', kind : 'video', clockRate : 90000, preferredPayloadType : 103, rtcpFeedback : [ { type: 'nack' }, { type: 'nack', parameter: 'pli' }, { type: 'ccm', parameter: 'fir' }, { type: 'goog-remb' } ], parameters : { 'level-asymmetry-allowed' : 1, 'packetization-mode' : 1, 'profile-level-id' : '42e01f' } }, { mimeType : 'video/rtx', kind : 'video', clockRate : 90000, preferredPayloadType : 104, rtcpFeedback : [], parameters : { apt : 103 } } ], headerExtensions : [ { kind : 'audio', uri : 'urn:ietf:params:rtp-hdrext:ssrc-audio-level', preferredId : 1, preferredEncrypt : false }, { kind : 'video', uri : 'urn:ietf:params:rtp-hdrext:toffset', preferredId : 2, preferredEncrypt : false }, { kind : 'audio', uri : 'http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time', // eslint-disable-line max-len preferredId : 3, preferredEncrypt : false }, { kind : 'video', uri : 'http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time', // eslint-disable-line max-len preferredId : 3, preferredEncrypt : false }, { kind : 'video', uri : 'urn:3gpp:video-orientation', preferredId : 4, preferredEncrypt : false }, { kind : 'audio', uri : 'urn:ietf:params:rtp-hdrext:sdes:mid', preferredId : 5, preferredEncrypt : false }, { kind : 'video', uri : 'urn:ietf:params:rtp-hdrext:sdes:mid', preferredId : 5, preferredEncrypt : false }, { kind : 'video', uri : 'urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id', preferredId : 6, preferredEncrypt : false } ], fecMechanisms : [] }; }; exports.generateNativeRtpCapabilities = function() { return { codecs : [ { mimeType : 'audio/opus', kind : 'audio', clockRate : 48000, preferredPayloadType : 111, channels : 2, rtcpFeedback : [ { type: 'transport-cc' } ], parameters : { minptime : 10, useinbandfec : 1 } }, { mimeType : 'audio/ISAC', kind : 'audio', clockRate : 16000, preferredPayloadType : 103, channels : 1, rtcpFeedback : [], parameters : {} }, { mimeType : 'audio/CN', kind : 'audio', clockRate : 32000, preferredPayloadType : 106, channels : 1, rtcpFeedback : [], parameters : {} }, { mimeType : 'video/VP8', kind : 'video', clockRate : 90000, preferredPayloadType : 96, rtcpFeedback : [ { type: 'goog-remb' }, { type: 'transport-cc' }, { type: 'ccm', parameter: 'fir' }, { type: 'nack' }, { type: 'nack', parameter: 'pli' } ], parameters : { baz : '1234abcd' } }, { mimeType : 'video/rtx', kind : 'video', clockRate : 90000, preferredPayloadType : 97, rtcpFeedback : [], parameters : { apt : 96 } } ], headerExtensions : [ { kind : 'audio', uri : 'urn:ietf:params:rtp-hdrext:ssrc-audio-level', preferredId : 10 }, { kind : 'audio', uri : 'urn:ietf:params:rtp-hdrext:sdes:mid', preferredId : 9 }, { kind : 'video', uri : 'urn:ietf:params:rtp-hdrext:toffset', preferredId : 2 }, { kind : 'video', uri : 'http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time', preferredId : 3 }, { kind : 'video', uri : 'urn:3gpp:video-orientation', preferredId : 4 }, { kind : 'video', uri : 'http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01', preferredId : 5 }, { kind : 'video', uri : 'http://www.webrtc.org/experiments/rtp-hdrext/playout-delay', preferredId : 6 }, { kind : 'video', uri : 'http://www.webrtc.org/experiments/rtp-hdrext/video-content-type', preferredId : 7 }, { kind : 'video', uri : 'http://www.webrtc.org/experiments/rtp-hdrext/video-timing', preferredId : 8 }, { kind : 'video', uri : 'urn:ietf:params:rtp-hdrext:sdes:mid', preferredId : 9 } ], fecMechanisms : [] }; }; exports.generateLocalDtlsParameters = function() { return { fingerprints : [ { algorithm : 'sha-256', value : '82:5A:68:3D:36:C3:0A:DE:AF:E7:32:43:D2:88:83:57:AC:2D:65:E5:80:C4:B6:FB:AF:1A:A0:21:9F:6D:0C:AD' } ], role : 'auto' }; }; exports.generateTransportRemoteParameters = function() { return { id : uuidv4(), iceParameters : { iceLite : true, password : 'yku5ej8nvfaor28lvtrabcx0wkrpkztz', usernameFragment : 'h3hk1iz6qqlnqlne' }, iceCandidates : [ { family : 'ipv4', foundation : 'udpcandidate', ip : '9.9.9.9', port : 40533, priority : 1078862079, protocol : 'udp', type : 'host' }, { family : 'ipv6', foundation : 'udpcandidate', ip : '9:9:9:9:9:9', port : 41333, priority : 1078862089, protocol : 'udp', type : 'host' } ], dtlsParameters : { fingerprints : [ { algorithm : 'sha-256', value : 'A9:F4:E0:D2:74:D3:0F:D9:CA:A5:2F:9F:7F:47:FA:F0:C4:72:DD:73:49:D0:3B:14:90:20:51:30:1B:90:8E:71' }, { algorithm : 'sha-384', value : '03:D9:0B:87:13:98:F6:6D:BC:FC:92:2E:39:D4:E1:97:32:61:30:56:84:70:81:6E:D1:82:97:EA:D9:C1:21:0F:6B:C5:E7:7F:E1:97:0C:17:97:6E:CF:B3:EF:2E:74:B0' }, { algorithm : 'sha-512', value : '84:27:A4:28:A4:73:AF:43:02:2A:44:68:FF:2F:29:5C:3B:11:9A:60:F4:A8:F0:F5:AC:A0:E3:49:3E:B1:34:53:A9:85:CE:51:9B:ED:87:5E:B8:F4:8E:3D:FA:20:51:B8:96:EE:DA:56:DC:2F:5C:62:79:15:23:E0:21:82:2B:2C' } ], role : 'auto' } }; }; exports.generateProducerRemoteParameters = function() { return { id : uuidv4() }; }; exports.generateConsumerRemoteParameters = function({ id, codecMimeType } = {}) { switch (codecMimeType) { case 'audio/opus': { return { id : id || uuidv4(), producerId : uuidv4(), kind : 'audio', rtpParameters : { codecs : [ { mimeType : 'audio/opus', clockRate : 48000, payloadType : 100, channels : 2, rtcpFeedback : [], parameters : { useinbandfec : 1, foo : 'bar' } } ], encodings : [ { ssrc : 46687003 } ], headerExtensions : [ { uri : 'urn:ietf:params:rtp-hdrext:ssrc-audio-level', id : 1 } ], rtcp : { cname : 'wB4Ql4lrsxYLjzuN', reducedSize : true, mux : true } } }; } case 'audio/ISAC': { return { id : id || uuidv4(), producerId : uuidv4(), kind : 'audio', rtpParameters : { codecs : [ { mimeType : 'audio/ISAC', clockRate : 16000, payloadType : 111, channels : 1, rtcpFeedback : [], parameters : {} } ], encodings : [ { ssrc : 46687004 } ], headerExtensions : [ { uri : 'urn:ietf:params:rtp-hdrext:ssrc-audio-level', id : 1 } ], rtcp : { cname : 'wB4Ql4lrsxYLjzuN', reducedSize : true, mux : true } } }; } case 'video/VP8': { return { id : id || uuidv4(), producerId : uuidv4(), kind : 'video', rtpParameters : { codecs : [ { mimeType : 'video/VP8', clockRate : 90000, payloadType : 101, rtcpFeedback : [ { type: 'nack' }, { type: 'nack', parameter: 'pli' }, { type: 'ccm', parameter: 'fir' }, { type: 'goog-remb' } ], parameters : { 'x-google-start-bitrate' : 1500 } }, { mimeType : 'video/rtx', clockRate : 90000, payloadType : 102, rtcpFeedback : [], parameters : { apt : 101 } } ], encodings : [ { ssrc : 99991111, rtx : { ssrc : 99991112 } } ], headerExtensions : [ { uri : 'urn:ietf:params:rtp-hdrext:toffset', id : 2 }, { uri : 'http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time', // eslint-disable-line max-len id : 3 }, { uri : 'urn:3gpp:video-orientation', id : 4 } ], rtcp : { cname : 'wB4Ql4lrsxYLjzuN', reducedSize : true, mux : true } } }; } default: { throw new TypeError(`unknown codecMimeType "${codecMimeType}"`); } } };
function onLoadRecaptcha() { jQuery('[data-widget=recaptcha]').each(function() { var widget = jQuery(this); grecaptcha.render(this); }); }
import React, { useState, useEffect } from 'react'; import { ScrollView } from 'react-native'; import { BlueLoading, SafeBlueArea, BlueCard, BlueText, BlueNavigationStyle, BlueSpacing20 } from '../../BlueComponents'; /** @type {AppStorage} */ const Licensing = () => { const [isLoading, setIsLoading] = useState(true); useEffect(() => { setIsLoading(false); }, []); return isLoading ? ( (<BlueLoading />) ) : ( (<SafeBlueArea forceInset={{ horizontal: 'always' }} style={{ flex: 1 }}> <ScrollView> <BlueCard> <BlueText>MIT License</BlueText> <BlueSpacing20 /> <BlueText>Copyright (c) 2018-2020 BlueWallet Services</BlueText> <BlueSpacing20 /> <BlueText> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: </BlueText> <BlueSpacing20 /> <BlueText> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. </BlueText> <BlueSpacing20 /> <BlueText> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. </BlueText> </BlueCard> </ScrollView> </SafeBlueArea>) ); }; Licensing.navigationOptions = () => ({ ...BlueNavigationStyle(), title: 'License', }); export default Licensing;
import styled from 'styled-components'; import {RIGHT_MENU_WIDTH} from './dimensions'; import {COLOR_BACKGROUND_GREY, COLOR_LIGHT_GREY, COLOR_LIGHTER_GREY, COLOR_ORANGE} from './colors'; export const StyledActionLog = styled.div` z-index: 10; position: fixed; width: ${RIGHT_MENU_WIDTH}px; top: 0; bottom: 0; right: ${(props) => (props.shown ? '0' : RIGHT_MENU_WIDTH * -1 + 'px')}; transition: all 0.2s ease-out; -webkit-overflow-scrolling: touch; box-sizing: border-box; padding: 27px 8px 8px; background: ${COLOR_BACKGROUND_GREY}; &:after { content: ''; border-right: 1px solid #e8e8e8; top: 44px; left: 0; position: absolute; bottom: 20px; } h5 { color: ${COLOR_ORANGE}; font-weight: 700; margin-bottom: 8px; } `; export const StyledActionLogInner = styled.div` top: 73px; bottom: 16px; position: absolute; overflow-x: hidden; overflow-y: auto; left: 8px; right: 8px; `; export const StyledActionLogList = styled.ul` width: 100%; margin: 0; padding: 0; list-style-type: none; li { background: #fff; padding: 4px; margin-bottom: 8px; box-sizing: border-box; border: 1px solid ${COLOR_LIGHTER_GREY}; > span { display: block; } > span:first-child { color: ${COLOR_LIGHT_GREY}; font-size: 12px; } &:first-child { border-left: 2px solid ${COLOR_ORANGE}; } } `;
import React from 'react'; import { compose, withStateHandlers } from 'recompose' import ReactJson from 'react-json-view' // COMPONENTS import Grid from '@material-ui/core/Grid' import Typography from '@material-ui/core/Typography' export default (initialState) => WrappedComponent => compose( withStateHandlers(({ initialState: initialStateFromProps }) => ({ value: initialStateFromProps || initialState }), { onChangeState: () => (state) => ({ value: state}), onChangeField: state => (key, value) => ({...state, [key]: value }), }) )( ({ value, onChangeState, onChangeField, ...props, }) => { return ( <Grid container justify={'center'}> <Grid item xs={7} style={{ paddingLeft: 20, height: 500 }}> <Typography variant={'title'} component={'h1'} color={'primary'} gutterBottom>Current State</Typography> <ReactJson src={{ value }} /> </Grid> <Grid item xs={5}> <WrappedComponent value={value} onChangeState={onChangeState} onChange={onChangeField} {...props} /> </Grid> </Grid> ) } )
import { nanoid } from 'nanoid/non-secure'; import TabRouter, { TabActions } from './TabRouter'; export const DrawerActions = { ...TabActions, openDrawer() { return { type: 'OPEN_DRAWER' }; }, closeDrawer() { return { type: 'CLOSE_DRAWER' }; }, toggleDrawer() { return { type: 'TOGGLE_DRAWER' }; } }; const isDrawerOpen = state => { var _state$history; return Boolean((_state$history = state.history) === null || _state$history === void 0 ? void 0 : _state$history.some(it => it.type === 'drawer')); }; const openDrawer = state => { if (isDrawerOpen(state)) { return state; } return { ...state, history: [...state.history, { type: 'drawer', status: 'open' }] }; }; const closeDrawer = state => { if (!isDrawerOpen(state)) { return state; } return { ...state, history: state.history.filter(it => it.type !== 'drawer') }; }; export default function DrawerRouter({ defaultStatus, ...rest }) { const router = TabRouter(rest); return { ...router, type: 'drawer', getInitialState({ routeNames, routeParamList, routeGetIdList }) { let state = router.getInitialState({ routeNames, routeParamList, routeGetIdList }); if (defaultStatus === 'open') { state = openDrawer(state); } return { ...state, stale: false, type: 'drawer', key: `drawer-${nanoid()}` }; }, getRehydratedState(partialState, { routeNames, routeParamList, routeGetIdList }) { if (partialState.stale === false) { return partialState; } let state = router.getRehydratedState(partialState, { routeNames, routeParamList, routeGetIdList }); if (isDrawerOpen(partialState)) { state = openDrawer(state); } return { ...state, type: 'drawer', key: `drawer-${nanoid()}` }; }, getStateForRouteFocus(state, key) { const result = router.getStateForRouteFocus(state, key); if (defaultStatus === 'open') { return openDrawer(result); } return closeDrawer(result); }, getStateForAction(state, action, options) { switch (action.type) { case 'OPEN_DRAWER': return openDrawer(state); case 'CLOSE_DRAWER': return closeDrawer(state); case 'TOGGLE_DRAWER': if (isDrawerOpen(state)) { return closeDrawer(state); } return openDrawer(state); case 'GO_BACK': if (defaultStatus === 'open') { if (!isDrawerOpen(state)) { return openDrawer(state); } } else { if (isDrawerOpen(state)) { return closeDrawer(state); } } return router.getStateForAction(state, action, options); default: return router.getStateForAction(state, action, options); } }, actionCreators: DrawerActions }; } //# sourceMappingURL=DrawerRouter.js.map
'use strict'; var jaccard = require('jaccard-similarity-sentences'); var getSentencesFromArticle = require('get-sentences-from-article'); exports.summaryWithQuestion = function(question, text, numberSentences) { var weigthedSentences = new Array(); var sentences = getSentencesFromArticle(text); if (sentences) { for (var i = 0; i < sentences.length; i++) { weigthedSentences.push({ index: i, sentence: sentences[i], weight: jaccard.jaccardSimilarity(question, sentences[i]) }); } var sortedArray = weigthedSentences.sort(function(a, b) { return b.weight - a.weight; }) .slice(0, numberSentences) .sort(function (a, b) { return a.index - b.index; }); var result = ''; for(var i = 0; i < sortedArray.length; i++) { result = result + sortedArray[i]['sentence'] + ' '; } return result; } else { return [] } } exports.summary = function(text, numberSentences) { var weigthedSentences = new Array(); var sentences = getSentencesFromArticle(text); if (sentences) { for (var i = 0; i < sentences.length; i++) { weigthedSentences.push({ index: i, sentence: sentences[i], weight: jaccard.jaccardSimilarity(sentences[0], sentences[i]) }); } var sortedArray = weigthedSentences.sort(function(a, b) { return b.weight - a.weight; }) .slice(0, numberSentences) .sort(function (a, b) { return a.index - b.index; }); var result = ''; for(var i = 0; i < sortedArray.length; i++) { result = result + sortedArray[i]['sentence'] + ' '; } return result; } else { return [] } }
load("bf4b12814bc95f34eeb130127d8438ab.js"); load("93fae755edd261212639eed30afa2ca4.js"); // This file was procedurally generated from the following sources: // - src/dstr-binding/ary-ptrn-rest-ary-elem.case // - src/dstr-binding/default/cls-expr-gen-meth-static.template /*--- description: Rest element containing an array BindingElementList pattern (static class expression generator method) esid: sec-class-definitions-runtime-semantics-evaluation es6id: 14.5.16 features: [destructuring-binding] flags: [generated] info: | ClassExpression : class BindingIdentifieropt ClassTail 1. If BindingIdentifieropt is not present, let className be undefined. 2. Else, let className be StringValue of BindingIdentifier. 3. Let value be the result of ClassDefinitionEvaluation of ClassTail with argument className. [...] 14.5.14 Runtime Semantics: ClassDefinitionEvaluation 21. For each ClassElement m in order from methods a. If IsStatic of m is false, then b. Else, Let status be the result of performing PropertyDefinitionEvaluation for m with arguments F and false. [...] 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody } 1. Let propKey be the result of evaluating PropertyName. 2. ReturnIfAbrupt(propKey). 3. If the function code for this GeneratorMethod is strict mode code, let strict be true. Otherwise let strict be false. 4. Let scope be the running execution context's LexicalEnvironment. 5. Let closure be GeneratorFunctionCreate(Method, StrictFormalParameters, GeneratorBody, scope, strict). 9.2.1 [[Call]] ( thisArgument, argumentsList) [...] 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList). [...] 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList ) 1. Let status be FunctionDeclarationInstantiation(F, argumentsList). [...] 9.2.12 FunctionDeclarationInstantiation(func, argumentsList) [...] 23. Let iteratorRecord be Record {[[iterator]]: CreateListIterator(argumentsList), [[done]]: false}. 24. If hasDuplicates is true, then [...] 25. Else, b. Let formalStatus be IteratorBindingInitialization for formals with iteratorRecord and env as arguments. [...] 13.3.3.6 Runtime Semantics: IteratorBindingInitialization BindingRestElement : ... BindingPattern 1. Let A be ArrayCreate(0). [...] 3. Repeat [...] b. If iteratorRecord.[[done]] is true, then i. Return the result of performing BindingInitialization of BindingPattern with A and environment as the arguments. [...] 13.3.3.6 Runtime Semantics: IteratorBindingInitialization SingleNameBinding : BindingIdentifier Initializeropt [...] 4. If iteratorRecord.[[done]] is false, then a. Let next be IteratorStep(iteratorRecord.[[iterator]]). b. If next is an abrupt completion, set iteratorRecord.[[done]] to true. c. ReturnIfAbrupt(next). d. If next is false, set iteratorRecord.[[done]] to true. e. Else, [...] i. Let v be IteratorValue(next). ii. If v is an abrupt completion, set iteratorRecord.[[done]] to true. iii. ReturnIfAbrupt(v). 5. If iteratorRecord.[[done]] is true, let v be undefined. [...] 8. Return InitializeReferencedBinding(lhs, v). ---*/ var callCount = 0; var C = class { static *method([...[x, y, z]]) { assert.sameValue(x, 3); assert.sameValue(y, 4); assert.sameValue(z, 5); callCount = callCount + 1; } }; C.method([3, 4, 5]).next(); assert.sameValue(callCount, 1, 'method invoked exactly once');
import { call, put, select, takeLatest } from 'redux-saga/effects'; import axios from '../../axios'; import { FETCH_SINGLE_JUDGE_START, JUDGE_OVERVIEW_START } from './constants'; import { fetchSingleJudgeError, fetchSingleJudgeSuccess, judgeOverviewSuccess, judgeOverviewError } from './actions'; import config from '../../config'; import { getJudgeId } from '../../utils/router'; export function* singleJudgeFetch() { try { const path = yield select((data) => data.get('route').get('location').get('pathname')); const response = yield call(() => axios.get(`judges/${getJudgeId(path)}`)); const { data } = response.data; yield put(fetchSingleJudgeSuccess(data)); } catch (error) { try { yield put(fetchSingleJudgeError(error.response.data.errors)); } catch (internal) { yield put(fetchSingleJudgeError(config.generalError)); } } } export function* judgeOverviewStart({ id }) { try { const path = yield select((data) => data.get('route').get('location').get('pathname')); const response = yield call(() => axios.get(`/metrics/judge/${getJudgeId(path)}/overview`)); yield put(judgeOverviewSuccess(id, response.data.data)); } catch (error) { try { yield put(judgeOverviewError(error.response.data.errors)); } catch (internal) { yield put(judgeOverviewError(config.generalError)); } } } export default function* saga() { yield takeLatest(FETCH_SINGLE_JUDGE_START, singleJudgeFetch); yield takeLatest(JUDGE_OVERVIEW_START, judgeOverviewStart); }
import { moduleForComponent, test } from 'ember-qunit'; import hbs from 'htmlbars-inline-precompile'; moduleForComponent('tool-group', 'Integration | Component | tool group', { integration: true }); test('it renders', function(assert) { assert.expect(2); // Set any properties with this.set('myProperty', 'value'); // Handle any actions with this.on('myAction', function(val) { ... }); this.render(hbs`{{tool-group}}`); assert.equal(this.$().text().trim(), ''); // Template block usage: this.render(hbs` {{#tool-group}} template block text {{/tool-group}} `); assert.equal(this.$().text().trim(), 'template block text'); });
"use strict"; const Generator = require("yeoman-generator"); const chalk = require("chalk"); const yosay = require("yosay"); const _ = require("lodash"); const { sep, resolvePath, walkSync } = require("./file"); const fullPath = resolvePath("./templates"); const skips = [ `${fullPath}${sep()}package.json`, `${fullPath}${sep()}project.config.json` ]; module.exports = class extends Generator { // Note: arguments and options should be defined in the constructor. constructor(args, opts) { super(args, opts); // This makes `appname` a required argument. this.argument("appname", { type: String, required: false }); // And you can then access it later; e.g. this.log(this.options.appname); } prompting() { // Have Yeoman greet the user. this.log( yosay( `Welcome to the mathematical ${chalk.red("generator-weapp")} generator!` ) ); const prompts = [ { type: "input", name: "name", required: true, message: "Your project name", default: this.appname }, { type: "input", name: "description", required: false, message: "Project description", default: "A weapp seed project." }, { type: "input", name: "version", required: false, message: "Project version", default: "1.0.0" } ]; return this.prompt(prompts).then(props => { // To access props later use this.props.someAnswer; this.props = props; }); } writing() { this.initPackage(); this.initProjectConfig(); this.renderTplFile(); } install() { this.installDependencies({ yarn: { force: true }, bower: false, npm: false }); } initPackage() { let pkg = this.fs.readJSON(this.templatePath("package.json"), {}); const { props } = this; pkg = _.merge(pkg, { name: props.name, description: props.description, version: props.version }); this.fs.writeJSON(this.destinationPath("package.json"), pkg); } initProjectConfig() { let config = this.fs.readJSON(this.templatePath("project.config.json"), {}); const { props } = this; config = _.merge(config, { projectname: props.name }); this.fs.writeJSON(this.destinationPath("project.config.json"), config); } async renderTplFile() { const target = []; walkSync(fullPath, (path, newpath) => { if (!skips.includes(path)) { if (newpath) { path = path.replace(`${fullPath}${sep()}`, ""); newpath = newpath.replace(`${fullPath}${sep()}`, ""); target.push([path, newpath]); } else { path = path.replace(`${fullPath}${sep()}`, ""); target.push(path); } } }); _.forEach(target, file => { let toFile; let fromFile; if (_.isArray(file)) { fromFile = file[0]; toFile = file[1]; } else { fromFile = file; toFile = file; } this.fs.copyTpl( this.templatePath(fromFile), this.destinationPath(toFile), this.props ); }); } };
import getters from '@/common/store/getters' export default { ...getters, token: state => state.user.access_token, username: state => state.user.username, device: state => state.app.device, isMobile: state => state.app.device === 'mobile', sidebar: state => state.app.sidebar, showAvatar: state => state.app.showAvatar, title: state => state.app.title }
/* * Wegas * http://wegas.albasim.ch * * Copyright (c) 2013-2021 School of Management and Engineering Vaud, Comem, MEI * Licensed under the MIT License */ /** * @author Francois-Xavier Aeberhard <fx@red-agent.com> */ YUI.addGroup('wegas-pact', { base: './wegas-pact/', root: '/wegas-pact/', modules: { /** Prog game **/ 'pact-level': { requires: [ 'tabview', 'treeview', 'event-key', 'transition', 'wegas-tabview', 'wegas-widget', 'ace', 'pact-scriptfiles', 'wegas-treeview', 'wegas-scripteval', 'resize', 'pact-display', 'pact-jsinstrument', 'wegas-conditionaldisable', 'wegas-tutorial', 'wegas-alerts', 'wegas-text', ], ws_provides: 'ProgGameLevel', }, 'pact-display': { requires: ['wegas-widget', 'crafty', 'yui-later', 'promise'], ws_provides: 'ProgGameDisplay', }, 'pact-jsinstrument': { requires: ['esprima', 'escodegen'], }, 'pact-scriptfiles': { requires: 'wegas-panel', ws_provides: 'ScriptFiles', }, 'pact-stats': { requires: 'wegas-panel', ws_provides: 'PactStats' } }, });
import { ButtonBack, ButtonFront } from "./index"; const Button = (props) => ( <ButtonBack alt={props.alt} form={props.form} disabled={props.disabled}> {props.children} <ButtonFront alt={props.alt} onClick={props.onClick} disabled={props.disabled} > {props.children} </ButtonFront> </ButtonBack> ); export default Button;
'use strict' const path = require('path') const generate = require('markdown-it-testgen') const plugin = require('../')() /*eslint-env mocha*/ describe('markdown-it-wikilinks', function () { const md = require('markdown-it')().use(plugin) generate(path.join(__dirname, 'fixtures/wikilinks.txt'), md) })
export const is404 = function(err){ return isErrorWithResponseAndStatus(err) && 404 === err.response.status; }; export const is422 =function (err){ return isErrorWithResponseAndStatus(err) && 422 === err.response.status; } const isErrorWithResponseAndStatus = function (err){ return err.response && err.response.status ; }
// vf-tree /* * A note on the Visual Framework and JavaScript: * The VF is primairly a CSS framework so we've included only a minimal amount * of JS in components and it's fully optional (just remove the JavaScript selectors * i.e. `data-vf-js-tabs`). So if you'd rather use Angular or Bootstrap for your * tabs, the Visual Framework won't get in the way. * * When querying the DOM for elements that should be acted on: * 🚫 Don't: const tabs = document.querySelectorAll('.vf-tabs'); * ✅ Do: const tabs = document.querySelectorAll('[data-vf-js-tabs]'); * * This allows users who would prefer not to have this JS engange on an element * to drop `data-vf-js-component` and still maintain CSS styling. */ // if you need to import any other components' JS to use here // import { vfOthercomponent } from 'vf-other-component/vf-other-component'; /** * The global function for this component * @example vfTree(firstPassedVar) * @param {object} [scope] - the html scope to process, optional, defaults to `document` */ function vfTree(scope) { /* eslint-disable no-redeclare */ var scope = scope || document; /* eslint-enable no-redeclare */ // Get relevant elements and collections const treelist = scope.querySelectorAll("[data-vf-js-tree]"); // const panelsList = scope.querySelectorAll('[data-vf-js-tabs-content]'); // const panels = scope.querySelectorAll('[data-vf-js-tabs-content] [id^="vf-tabs__section"]'); // const tabs = scope.querySelectorAll('[data-vf-js-tabs] .vf-tabs__link'); // if (!tablist || !panels || !tabs) { if (!treelist ) { // exit: either trees or tabbed content not found return; } // if (tablist.length == 0 || panels.length == 0 || tabs.length == 0) { if (treelist.length == 0 ) { // exit: either trees or tabbed content not found return; } // Receive a target scope and toggle if it is active function vfTreeToggleActive(target) { let collpasedState = target.dataset["vfJsTree-Collapsed"]; if (collpasedState === "true") { collpasedState = false; target.classList.remove("vf-tree--collapsed"); target.classList.add("vf-tree__item--expanded"); target.setAttribute("aria-expanded", true); } else { collpasedState = true; target.classList.add("vf-tree--collapsed"); target.classList.remove("vf-tree__item--expanded"); target.setAttribute("aria-expanded", false); } target.dataset["vfJsTree-Collapsed"] = collpasedState; } // Logic to show/hide section of tree function vfTreeButtonHandler(target) { // if want to only get the direct children matches // this future proofs but also adds and edge case, so we won't use for now // let targetButton = Array.prototype.filter.call(target.children, function (item) { // return item.matches('[data-vf-js-tree--button]'); // }); const targetButton = target.querySelectorAll("[data-vf-js-tree--button]"); if (targetButton.length == 0) { // if no tree buttons found, nothing to do return; } // Handle clicking // Target the closest item targetButton[0].addEventListener("click", e => { console.log(target); e.preventDefault(); vfTreeToggleActive(target); }); } // For each treelist section, invoke handlers Array.prototype.forEach.call(treelist, (treelistset) => { // Handle hide/show for tree sets vfTreeButtonHandler(treelistset); }); } // If you need to invoke the component by default // vfcomponentName(); // By default your component should be usable with js imports export { vfTree };
const { validationResult } = require('express-validator'); const io = require('../socket'); const Post = require('../models/post'); const User = require('../models/user'); const clearImage = require('../util/image'); exports.getPosts = async (req, res, next) => { const currentPage = req.query.page || 1; const perPage = 2; try { const totalItems = await Post.find().countDocuments(); const posts = await Post.find() .populate('creator') .sort({ createdAt: -1 }) .skip((currentPage - 1) * perPage) .limit(perPage); res .status(200) .json({ message: 'Fetched posts successfully', posts, totalItems }); } catch (err) { if (!err.statusCode) { err.statusCode = 500; } next(err); } }; exports.createPost = async (req, res, next) => { const errors = validationResult(req); if (!errors.isEmpty()) { const error = new Error('Validation failed, entered data is incorrect.'); error.statusCode = 422; throw error; } if (!req.file) { const error = new Error('No image provided.'); error.statusCode = 422; throw error; } const imageUrl = req.file.path; const { title, content } = req.body; const post = new Post({ title, imageUrl, content, creator: req.userId, }); try { await post.save(); const user = await User.findById(req.userId); user.posts.push(post); await user.save(); io.getIo().emit('posts', { action: 'create', post: { ...post.doc, creator: { _id: req.userId, name: user.name } }, }); res.status(201).json({ message: 'Post created successfully.', post, creator: { _id: user._id, name: user.name }, }); } catch (err) { if (!err.statusCode) { err.statusCode = 500; } next(err); } }; exports.getPost = async (req, res, next) => { const { postId } = req.params; try { const post = await Post.findById(postId); if (!post) { const error = new Error('Could not find post.'); error.statusCode = 404; throw error; } res.status(200).json({ message: 'Post fetched.', post }); } catch (err) { if (!err.statusCode) { err.statusCode = 500; } next(err); } }; exports.updatePost = async (req, res, next) => { const { postId } = req.params; const errors = validationResult(req); if (!errors.isEmpty()) { const error = new Error('Validation failed, entered data is incorrect.'); error.statusCode = 422; throw error; } const { title, content } = req.body; let imageUrl = req.body.image; if (req.file) { imageUrl = req.file.path; } if (!imageUrl) { const error = new Error('No file picked.'); error.statusCode = 404; throw error; } try { const post = await Post.findById(postId).populate('creator'); if (!post) { const error = new Error('Could not find post.'); error.statusCode = 404; throw error; } if (post.creator._id.toString() !== req.userId) { const error = new Error('Not authorized.'); error.statusCode = 403; throw error; } if (imageUrl !== post.imageUrl) { clearImage(post.imageUrl); } post.title = title; post.imageUrl = imageUrl; post.content = content; const result = await post.save(); io.getIo().emit('posts', { action: 'update', post: result, }); res.status(200).json({ message: 'Post updated!', post: result }); } catch (err) { if (!err.statusCode) { err.statusCode = 500; } next(err); } }; exports.deletePost = async (req, res, next) => { const { postId } = req.params; try { const post = await Post.findById(postId); if (!post) { const error = new Error('Could not find post.'); error.statusCode = 404; throw error; } if (post.creator.toString() !== req.userId) { const error = new Error('Not authorized.'); error.statusCode = 403; throw error; } clearImage(post.imageUrl); await Post.findByIdAndRemove(postId); const user = await User.findById(req.userId); user.posts.pull(postId); await user.save(); io.getIo().emit('posts', { action: 'delete', post: postId }); res.status(200).json({ message: 'Post deleted.' }); } catch (err) { if (!err.statusCode) { err.statusCode = 500; } next(err); } };
'use strict'; var path = require('path'); var mkdirp = require('mkdirp'); var fs = require('fs'); /** * Will return the path and default onixcore-node configuration. It will search for the * configuration file in the "~/.bitcore" directory, and if it doesn't exist, it will create one * based on default settings. * @param {Object} [options] * @param {Array} [options.additionalServices] - An optional array of services. */ function getDefaultConfig(options) { /* jshint maxstatements: 40 */ if (!options) { options = {}; } var defaultPath = path.resolve(process.env.HOME, './.bitcore'); var defaultConfigFile = path.resolve(defaultPath, './onixcore-node.json'); if (!fs.existsSync(defaultPath)) { mkdirp.sync(defaultPath); } var defaultServices = ['onixd', 'web']; if (options.additionalServices) { defaultServices = defaultServices.concat(options.additionalServices); } if (!fs.existsSync(defaultConfigFile)) { var defaultConfig = { network: 'livenet', port: 3001, services: defaultServices, servicesConfig: { onixd: { spawn: { datadir: path.resolve(defaultPath, './data'), exec: path.resolve(__dirname, '../../bin/onixd') } } } }; fs.writeFileSync(defaultConfigFile, JSON.stringify(defaultConfig, null, 2)); } var defaultDataDir = path.resolve(defaultPath, './data'); if (!fs.existsSync(defaultDataDir)) { mkdirp.sync(defaultDataDir); } var config = JSON.parse(fs.readFileSync(defaultConfigFile, 'utf-8')); return { path: defaultPath, config: config }; } module.exports = getDefaultConfig;
$(function() { $( document ).ready(function() { $('.hotel-num').on('click', function() { elem = $(this); var counter = elem.data('room'); counter = counter.slice(-1); $('.hotel-'+counter).siblings().show(); $('.hotel-'+counter).hide(); }); }); $(document).on('submit', '#search-frm', function() { window.location.href = baseurl + '/search/' + $('#term').val(); return false; }); $(document).on('click', '#btn-contact', function() { url = baseurl+'/send'; $('.err-url').remove(); params = {name :$('#name').val(), _token: $("input[name=_token]").val(), email: $('#email').val(), message: $('#message').val()} $.ajax({ type: 'post', url: url, data: params, dataType: 'json', success: function(data){ alert('Email Sent!'); }, error: function(data){ var errors = data.responseJSON; $.each( errors, function( key, value ) { console.log(value[0]); jQuery('input[id="url"]').after('<div class="err-url">'+value[0]+'</div>'); }); } }); return false; }); });
/* @flow */ import React, {useState} from "react" import classNames from "classnames" import type {$Field} from "../../brim" import type {RightClickBuilder} from "../../types" import {getTooltipStyle} from "../../lib/MenuStyler" import CompoundField from "./CompoundField" import Log from "../../models/Log" import SingleField from "./SingleField" import Tooltip from "../Tooltip" type Props = { field: $Field, log: Log, style?: Object, rightClick: RightClickBuilder } export default function LogCell({field, style, rightClick, log}: Props) { let [hover, setHover] = useState(false) let [tooltipStyle, setTooltipStyle] = useState({}) let {name, type} = field function handleMouseEnter(e) { setHover(true) setTooltipStyle(getTooltipStyle(e.currentTarget)) } function handleMouseLeave() { setHover(false) } return ( <div className={classNames(`log-cell ${type}`, {hover})} onMouseEnter={handleMouseEnter} onMouseLeave={handleMouseLeave} style={style} > <FieldSwitch field={field} log={log} menuBuilder={rightClick} /> {hover && ( <Tooltip style={tooltipStyle}> <span className="field-name">{name}</span> </Tooltip> )} </div> ) } function FieldSwitch(props) { if (props.field.compound()) { return <CompoundField {...props} /> } else { let {field, log, menuBuilder} = props let menu = menuBuilder(field, log, false) return <SingleField field={field} menu={menu} /> } }
/** * @license Apache-2.0 * * Copyright (c) 2018 The Stdlib Authors. * * 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. */ 'use strict'; // MODULES // var bench = require( '@stdlib/bench' ); var randu = require( '@stdlib/random/base/randu' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var EPS = require( '@stdlib/constants/math/float64-eps' ); var pkg = require( './../package.json' ).name; var quantile = require( './../lib' ); // MAIN // bench( pkg, function benchmark( b ) { var mu; var c; var p; var y; var i; b.tic(); for ( i = 0; i < b.iterations; i++ ) { p = randu(); mu = ( randu()*20.0 ) - 10.0; c = ( randu()*5.0 ) + EPS; y = quantile( p, mu, c ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } } b.toc(); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } b.pass( 'benchmark finished' ); b.end(); }); bench( pkg+':factory', function benchmark( b ) { var myquantile; var mu; var c; var p; var y; var i; mu = 10.0; c = 4.0; myquantile = quantile.factory( mu, c ); b.tic(); for ( i = 0; i < b.iterations; i++ ) { p = randu(); y = myquantile( p ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } } b.toc(); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } b.pass( 'benchmark finished' ); b.end(); });
/** * 路由配置文件 * * @author : Sunkey */ module.exports = [ { comment: '欢迎路由组', namespace: 'Welcome', path: '/welcome', list: [ { comment: '入口', method: 'GET', path: '/index', route: 'IndexController@index', } ], }, { comment: '微信路由组', namespace: 'Wx', path: '/wx', list: [ { comment: 'jsApi 签名', method: 'GET', path: '/sign/js_api', route: 'SignController@jsApi', }, { comment: '清除授权码缓存', method: 'GET', path: '/token/clear_cache', route: 'TokenController@clearCache', }, { comment: '获取 access_token 接口', method: 'GET', path: '/token/access_token', route: 'TokenController@accessToken', }, ], }, ];
'use strict'; module.exports.definition = { set: function (v) { this._setProperty('-webkit-nbsp-mode', v); }, get: function () { return this.getPropertyValue('-webkit-nbsp-mode'); }, enumerable: true, configurable: true };
require("./").register({cache: false})
"use strict"; var range = require("euler-range") module.exports = function p17() { // Find the number of letters in "one, two, three, ... one thousand" without commas or spaces. function numWords(n) { var digits = [ "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen" ] var tens = ["", "", "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety"] function under100(n) { if (n < 20) { return digits[n] } var digit = n % 10 return tens[(n - digit) / 10] + (digit === 0 ? "" : " " + digits[digit]) } if (n >= 1000) return "one thousand" var under100Digits = n % 100 var hundreds = (n - under100Digits) / 100 if (n < 100) return under100(n) if (under100Digits === 0) return digits[hundreds] + " hundred" return digits[hundreds] + " hundred and " + under100(under100Digits) } return range .interval(1, 1001) .map(numWords) .map(function(s) { return s.replace(/ /g, "").length }) .sum() }
import React from 'react'; import Loginfrm from './Loginfrm'; const App = () => { return ( <div className="App"> <Loginfrm /> </div> ); }; export default App;
import Model from 'ember-data/model'; import attr from 'ember-data/attr'; export default Model.extend({ account: attr('string'), created_at: attr('date'), direction: attr('string'), orderType: attr('string'), price: attr('dollars'), quantity: attr('number'), symbol: attr('string'), updated_at: attr('date'), venue: attr('string') });
const exec = require('child_process'); const fs = require('fs'); const { IncomingWebhook } = require('@slack/client'); const serversList = require('./servers-list.json'); const logTimestamp = () => { return `[${new Date().toUTCString()}]`; }; const logSuccess = (message) => { console.log('\x1b[32m', `${logTimestamp()} ${message}`, '\x1b[0m'); }; const logData = (message) => { console.log('\x1b[37m', `${logTimestamp()} ${message}`, '\x1b[0m'); }; const logError = (message) => { console.log('\033[31m', `${logTimestamp()} ${message}`, '\x1b[0m'); }; const execBashAndLog = (command) => { try { const output = exec .execSync(command, { shell: '/bin/bash' }) .toString(); logData(output); return output || true; } catch (ex) { logError(ex); return false; } }; const execOrThrow = (command, errorMessage) => { const output = execBashAndLog(command); if (!output) { throw new Error(errorMessage); } return output; }; const writeToJson = (jsonFile, projectName, branch, webhook, namespace, slackWebhookUrl) => { if (getProjectByName(projectName)) { return addBranchToServerList(jsonFile, projectName, branch, webhook); } const obj = { projectName, namespace, branches: {}, slackWebhookUrl }; obj.branches[`${branch}`] = webhook; serversList.push(obj); return fs.writeFileSync(jsonFile, JSON.stringify(serversList, null, 4)); }; const addBranchToServerList = (jsonFile, project, branch, webhook) => { const serversListLength = serversList.length; for (let i = 0; i < serversListLength; ++i) { if (serversList[i].projectName === project) { serversList[i].branches[`${branch}`] = webhook; break; } } return fs.writeFileSync(jsonFile, JSON.stringify(serversList, null, 4)); }; const getGitServiceFromUrl = (url) => { return url.includes('https://') ? url .split('://') .pop() .split('/') .shift() : url .split('git@') .pop() .split(':') .shift(); }; const getProjectByName = (name) => serversList.find((p) => p.projectName === name); const getProjectPath = (name, branch) => `${require('os').homedir()}/${name}-${branch}`; const isEmptyObj = (obj) => Object.keys(obj).length === 0; const notifySlack = (webhookUrl, text) => { if (!webhookUrl) { return; } const webhook = new IncomingWebhook(webhookUrl); return new Promise((resolve, reject) => webhook.send(text, (err, res) => err ? reject(err) : resolve(res))); }; module.exports = { logSuccess, logData, logError, execBashAndLog, execOrThrow, writeToJson, getGitServiceFromUrl, getProjectByName, getProjectPath, isEmptyObj, notifySlack, serversList };
(window.webpackJsonp=window.webpackJsonp||[]).push([[76],{227:function(t,n,s){"use strict";s.r(n);var a=s(0),e=Object(a.a)({},function(){var t=this,n=t.$createElement,s=t._self._c||n;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"replace"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#replace","aria-hidden":"true"}},[t._v("#")]),t._v(" "),s("code",[t._v("replace()")])]),t._v(" "),s("p",[t._v("The replace method behaves similarly to merge; however, in addition to overwriting matching items with string keys, the replace method will also overwrite items in the collection that have matching numeric keys:")]),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" collection "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("collect")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n name"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Bob"')]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" replaced "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" collection"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("replace")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n name"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"John"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n number"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("45")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\nreplaced"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("all")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//=> {")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//=> name: 'John',")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//=> number: 45,")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//=> }")]),t._v("\n")])])]),s("p",[s("a",{attrs:{href:"https://github.com/ecrmnn/collect.js/blob/master/src/methods/replace.js",target:"_blank",rel:"noopener noreferrer"}},[t._v("View source on GitHub"),s("OutboundLink")],1)])])},[],!1,null,null,null);n.default=e.exports}}]);
<Table striped bordered hover size="sm"> <thead> <tr> <th>#</th> <th>First Name</th> <th>Last Name</th> <th>Username</th> </tr> </thead> <tbody> <tr> <td>1</td> <td>Mark</td> <td>Otto</td> <td>@mdo</td> </tr> <tr> <td>2</td> <td>Jacob</td> <td>Thornton</td> <td>@fat</td> </tr> <tr> <td>3</td> <td colSpan="2">Larry the Bird</td> <td>@twitter</td> </tr> </tbody> </Table>;
#!/usr/bin/env node "use strict"; const childProcess = require("child_process"); const glob = require("glob"); const path = require("path"); const touch = require("touch"); process.chdir(path.join(__dirname, "..")); glob.sync(".build/*.js").forEach(bundleJs => { const bundleZip = `.build/${path.basename(bundleJs, ".js")}.zip`; touch.sync(bundleJs, {time: "1970-01-01"}); childProcess.spawnSync("zip", ["-X", "-q", "-j", bundleZip, bundleJs]); console.log("✓", bundleZip); });
import request from '@/utils/request' const api_name = '/ucenter/staff' export default { // 获取所有职工数据 getAllStaff() { return request({ url: `${api_name}/all`, method: 'get' }) } }
load("bf4b12814bc95f34eeb130127d8438ab.js"); load("93fae755edd261212639eed30afa2ca4.js"); // Copyright (C) 2015 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- es6id: 19.4.3.4 description: > Behavior when `this` value is an object without a [[SymbolData]] internal slot info: > 1. Let s be the this value. 2. If Type(s) is Symbol, return s. 3. If Type(s) is not Object, throw a TypeError exception. 4. If s does not have a [[SymbolData]] internal slot, throw a TypeError exception. features: [Symbol.toPrimitive] ---*/ assert.throws(TypeError, function() { Symbol.prototype[Symbol.toPrimitive].call({}); });
(function() { 'use strict'; var boilerplatePlugin = (function BoilerplatePluginClosure() { function BoilerplateStore(config) { this._coordinator = {}; this._data = []; this._max = 1; this._min = 0; }; BoilerplateStore.prototype = { setCoordinator: function(coordinator) { }, setData: function(data) { }, addData: function(data) { }, removeData: function(data) { }, getData: function() { } }; function BoilerplateRenderer(config) { }; return { store: BoilerplateStore, renderer: BoilerplateRenderer } }()); h337.register('boilerplate', boilerplatePlugin); }());
'use strict'; var fromGenerator = require('./fromGenerator'); var combine = function (stream, streamB, combineFn) { var a = { stream: stream, last: null, hasNotified: false, hasFinished: false }; var b = { stream: streamB, last: null, hasNotified: false, hasFinished: false }; return fromGenerator(function (next, error, end) { a.stream.onError(error); a.stream.onEnd(function () { a.hasFinished = true; if (b.hasFinished) { end(); } }); a.stream.onNext(function (msg) { a.last = msg; a.hasNotified = true; if (b.hasNotified) { next(combineFn(a.last, b.last)); } }); b.stream.onError(error); b.stream.onEnd(function () { b.hasFinished = true; if (a.hasFinished) { end(); } }); b.stream.onNext(function (msg) { b.last = msg; b.hasNotified = true; if (a.hasNotified) { next(combineFn(a.last, b.last)); } }); }); }; module.exports = combine;
var express = require("express"); var methodOverried = require("method-override"); var bodyParser = require("body-parser"); var port = process.env.PORT || 3000; var app = express(); app.use(express.static("public")); app.use(bodyParser.urlencoded({ extended:false})); app.use(methodOverried("_method")); var exphbs = require("express-handlebars"); app.engine("handlebars", exphbs({ defaultLayout: "main" })); app.set("view engine", "handlebars"); var routes= require("./controllers/burgers_controller.js"); app.use("/", routes); app.listen(port);
import { line, curveBasis } from 'd3'; import idCache from './id-cache.js'; import stateDb from './stateDb'; import utils from '../../utils'; import common from '../common/common'; import { getConfig } from '../../config'; import { log } from '../../logger'; // let conf; /** * Draws a start state as a black circle */ export const drawStartState = g => g .append('circle') // .style('stroke', 'black') // .style('fill', 'black') .attr('class', 'start-state') .attr('r', getConfig().state.sizeUnit) .attr('cx', getConfig().state.padding + getConfig().state.sizeUnit) .attr('cy', getConfig().state.padding + getConfig().state.sizeUnit); /** * Draws a start state as a black circle */ export const drawDivider = g => g .append('line') .style('stroke', 'grey') .style('stroke-dasharray', '3') .attr('x1', getConfig().state.textHeight) .attr('class', 'divider') .attr('x2', getConfig().state.textHeight * 2) .attr('y1', 0) .attr('y2', 0); /** * Draws a an end state as a black circle */ export const drawSimpleState = (g, stateDef) => { const state = g .append('text') .attr('x', 2 * getConfig().state.padding) .attr('y', getConfig().state.textHeight + 2 * getConfig().state.padding) .attr('font-size', getConfig().state.fontSize) .attr('class', 'state-title') .text(stateDef.id); const classBox = state.node().getBBox(); g.insert('rect', ':first-child') .attr('x', getConfig().state.padding) .attr('y', getConfig().state.padding) .attr('width', classBox.width + 2 * getConfig().state.padding) .attr('height', classBox.height + 2 * getConfig().state.padding) .attr('rx', getConfig().state.radius); return state; }; /** * Draws a state with descriptions * @param {*} g * @param {*} stateDef */ export const drawDescrState = (g, stateDef) => { const addTspan = function(textEl, txt, isFirst) { const tSpan = textEl .append('tspan') .attr('x', 2 * getConfig().state.padding) .text(txt); if (!isFirst) { tSpan.attr('dy', getConfig().state.textHeight); } }; const title = g .append('text') .attr('x', 2 * getConfig().state.padding) .attr('y', getConfig().state.textHeight + 1.3 * getConfig().state.padding) .attr('font-size', getConfig().state.fontSize) .attr('class', 'state-title') .text(stateDef.descriptions[0]); const titleBox = title.node().getBBox(); const titleHeight = titleBox.height; const description = g .append('text') // text label for the x axis .attr('x', getConfig().state.padding) .attr( 'y', titleHeight + getConfig().state.padding * 0.4 + getConfig().state.dividerMargin + getConfig().state.textHeight ) .attr('class', 'state-description'); let isFirst = true; let isSecond = true; stateDef.descriptions.forEach(function(descr) { if (!isFirst) { addTspan(description, descr, isSecond); isSecond = false; } isFirst = false; }); const descrLine = g .append('line') // text label for the x axis .attr('x1', getConfig().state.padding) .attr('y1', getConfig().state.padding + titleHeight + getConfig().state.dividerMargin / 2) .attr('y2', getConfig().state.padding + titleHeight + getConfig().state.dividerMargin / 2) .attr('class', 'descr-divider'); const descrBox = description.node().getBBox(); const width = Math.max(descrBox.width, titleBox.width); descrLine.attr('x2', width + 3 * getConfig().state.padding); // const classBox = title.node().getBBox(); g.insert('rect', ':first-child') .attr('x', getConfig().state.padding) .attr('y', getConfig().state.padding) .attr('width', width + 2 * getConfig().state.padding) .attr('height', descrBox.height + titleHeight + 2 * getConfig().state.padding) .attr('rx', getConfig().state.radius); return g; }; /** * Adds the creates a box around the existing content and adds a * panel for the id on top of the content. */ /** * Function that creates an title row and a frame around a substate for a composit state diagram. * The function returns a new d3 svg object with updated width and height properties; * @param {*} g The d3 svg object for the substate to framed * @param {*} stateDef The info about the */ export const addTitleAndBox = (g, stateDef, altBkg) => { const pad = getConfig().state.padding; const dblPad = 2 * getConfig().state.padding; const orgBox = g.node().getBBox(); const orgWidth = orgBox.width; const orgX = orgBox.x; const title = g .append('text') .attr('x', 0) .attr('y', getConfig().state.titleShift) .attr('font-size', getConfig().state.fontSize) .attr('class', 'state-title') .text(stateDef.id); const titleBox = title.node().getBBox(); const titleWidth = titleBox.width + dblPad; let width = Math.max(titleWidth, orgWidth); // + dblPad; if (width === orgWidth) { width = width + dblPad; } let startX; // const lineY = 1 - getConfig().state.textHeight; // const descrLine = g // .append('line') // text label for the x axis // .attr('x1', 0) // .attr('y1', lineY) // .attr('y2', lineY) // .attr('class', 'descr-divider'); const graphBox = g.node().getBBox(); // descrLine.attr('x2', graphBox.width + getConfig().state.padding); if (stateDef.doc) { // cnsole.warn( // stateDef.id, // 'orgX: ', // orgX, // 'width: ', // width, // 'titleWidth: ', // titleWidth, // 'orgWidth: ', // orgWidth, // 'width', // width // ); } startX = orgX - pad; if (titleWidth > orgWidth) { startX = (orgWidth - width) / 2 + pad; } if (Math.abs(orgX - graphBox.x) < pad) { if (titleWidth > orgWidth) { startX = orgX - (titleWidth - orgWidth) / 2; } } const lineY = 1 - getConfig().state.textHeight; // White color g.insert('rect', ':first-child') .attr('x', startX) .attr('y', lineY) .attr('class', altBkg ? 'alt-composit' : 'composit') .attr('width', width) .attr( 'height', graphBox.height + getConfig().state.textHeight + getConfig().state.titleShift + 1 ) .attr('rx', '0'); title.attr('x', startX + pad); if (titleWidth <= orgWidth) title.attr('x', orgX + (width - dblPad) / 2 - titleWidth / 2 + pad); // Title background g.insert('rect', ':first-child') .attr('x', startX) .attr( 'y', getConfig().state.titleShift - getConfig().state.textHeight - getConfig().state.padding ) .attr('width', width) // Just needs to be higher then the descr line, will be clipped by the white color box .attr('height', getConfig().state.textHeight * 3) .attr('rx', getConfig().state.radius); // Full background g.insert('rect', ':first-child') .attr('x', startX) .attr( 'y', getConfig().state.titleShift - getConfig().state.textHeight - getConfig().state.padding ) .attr('width', width) .attr('height', graphBox.height + 3 + 2 * getConfig().state.textHeight) .attr('rx', getConfig().state.radius); return g; }; const drawEndState = g => { g.append('circle') // .style('stroke', 'black') // .style('fill', 'white') .attr('class', 'end-state-outer') .attr('r', getConfig().state.sizeUnit + getConfig().state.miniPadding) .attr( 'cx', getConfig().state.padding + getConfig().state.sizeUnit + getConfig().state.miniPadding ) .attr( 'cy', getConfig().state.padding + getConfig().state.sizeUnit + getConfig().state.miniPadding ); return ( g .append('circle') // .style('stroke', 'black') // .style('fill', 'black') .attr('class', 'end-state-inner') .attr('r', getConfig().state.sizeUnit) .attr('cx', getConfig().state.padding + getConfig().state.sizeUnit + 2) .attr('cy', getConfig().state.padding + getConfig().state.sizeUnit + 2) ); }; const drawForkJoinState = (g, stateDef) => { let width = getConfig().state.forkWidth; let height = getConfig().state.forkHeight; if (stateDef.parentId) { let tmp = width; width = height; height = tmp; } return g .append('rect') .style('stroke', 'black') .style('fill', 'black') .attr('width', width) .attr('height', height) .attr('x', getConfig().state.padding) .attr('y', getConfig().state.padding); }; export const drawText = function(elem, textData) { // Remove and ignore br:s const nText = textData.text.replace(common.lineBreakRegex, ' '); const textElem = elem.append('text'); textElem.attr('x', textData.x); textElem.attr('y', textData.y); textElem.style('text-anchor', textData.anchor); textElem.attr('fill', textData.fill); if (typeof textData.class !== 'undefined') { textElem.attr('class', textData.class); } const span = textElem.append('tspan'); span.attr('x', textData.x + textData.textMargin * 2); span.attr('fill', textData.fill); span.text(nText); return textElem; }; const _drawLongText = (_text, x, y, g) => { let textHeight = 0; const textElem = g.append('text'); textElem.style('text-anchor', 'start'); textElem.attr('class', 'noteText'); let text = _text.replace(/\r\n/g, '<br/>'); text = text.replace(/\n/g, '<br/>'); const lines = text.split(common.lineBreakRegex); let tHeight = 1.25 * getConfig().state.noteMargin; for (const line of lines) { const txt = line.trim(); if (txt.length > 0) { const span = textElem.append('tspan'); span.text(txt); if (tHeight === 0) { const textBounds = span.node().getBBox(); tHeight += textBounds.height; } textHeight += tHeight; span.attr('x', x + getConfig().state.noteMargin); span.attr('y', y + textHeight + 1.25 * getConfig().state.noteMargin); } } return { textWidth: textElem.node().getBBox().width, textHeight }; }; /** * Draws a note to the diagram * @param text - The text of the given note. * @param g - The element the note is attached to. */ export const drawNote = (text, g) => { g.attr('class', 'state-note'); const note = g .append('rect') .attr('x', 0) .attr('y', getConfig().state.padding); const rectElem = g.append('g'); const { textWidth, textHeight } = _drawLongText(text, 0, 0, rectElem); note.attr('height', textHeight + 2 * getConfig().state.noteMargin); note.attr('width', textWidth + getConfig().state.noteMargin * 2); return note; }; /** * Starting point for drawing a state. The function finds out the specifics * about the state and renders with approprtiate function. * @param {*} elem * @param {*} stateDef */ export const drawState = function(elem, stateDef) { const id = stateDef.id; const stateInfo = { id: id, label: stateDef.id, width: 0, height: 0 }; const g = elem .append('g') .attr('id', id) .attr('class', 'stateGroup'); if (stateDef.type === 'start') drawStartState(g); if (stateDef.type === 'end') drawEndState(g); if (stateDef.type === 'fork' || stateDef.type === 'join') drawForkJoinState(g, stateDef); if (stateDef.type === 'note') drawNote(stateDef.note.text, g); if (stateDef.type === 'divider') drawDivider(g); if (stateDef.type === 'default' && stateDef.descriptions.length === 0) drawSimpleState(g, stateDef); if (stateDef.type === 'default' && stateDef.descriptions.length > 0) drawDescrState(g, stateDef); const stateBox = g.node().getBBox(); stateInfo.width = stateBox.width + 2 * getConfig().state.padding; stateInfo.height = stateBox.height + 2 * getConfig().state.padding; idCache.set(id, stateInfo); // stateCnt++; return stateInfo; }; let edgeCount = 0; export const drawEdge = function(elem, path, relation) { const getRelationType = function(type) { switch (type) { case stateDb.relationType.AGGREGATION: return 'aggregation'; case stateDb.relationType.EXTENSION: return 'extension'; case stateDb.relationType.COMPOSITION: return 'composition'; case stateDb.relationType.DEPENDENCY: return 'dependency'; } }; path.points = path.points.filter(p => !Number.isNaN(p.y)); // The data for our line const lineData = path.points; // This is the accessor function we talked about above const lineFunction = line() .x(function(d) { return d.x; }) .y(function(d) { return d.y; }) .curve(curveBasis); const svgPath = elem .append('path') .attr('d', lineFunction(lineData)) .attr('id', 'edge' + edgeCount) .attr('class', 'transition'); let url = ''; if (getConfig().state.arrowMarkerAbsolute) { url = window.location.protocol + '//' + window.location.host + window.location.pathname + window.location.search; url = url.replace(/\(/g, '\\('); url = url.replace(/\)/g, '\\)'); } svgPath.attr( 'marker-end', 'url(' + url + '#' + getRelationType(stateDb.relationType.DEPENDENCY) + 'End' + ')' ); if (typeof relation.title !== 'undefined') { const label = elem.append('g').attr('class', 'stateLabel'); const { x, y } = utils.calcLabelPosition(path.points); const rows = common.getRows(relation.title); let titleHeight = 0; const titleRows = []; let maxWidth = 0; let minX = 0; for (let i = 0; i <= rows.length; i++) { const title = label .append('text') .attr('text-anchor', 'middle') .text(rows[i]) .attr('x', x) .attr('y', y + titleHeight); const boundstmp = title.node().getBBox(); maxWidth = Math.max(maxWidth, boundstmp.width); minX = Math.min(minX, boundstmp.x); log.info(boundstmp.x, x, y + titleHeight); if (titleHeight === 0) { const titleBox = title.node().getBBox(); titleHeight = titleBox.height; log.info('Title height', titleHeight, y); } titleRows.push(title); } let boxHeight = titleHeight * rows.length; if (rows.length > 1) { const heightAdj = (rows.length - 1) * titleHeight * 0.5; titleRows.forEach((title, i) => title.attr('y', y + i * titleHeight - heightAdj)); boxHeight = titleHeight * rows.length; } const bounds = label.node().getBBox(); label .insert('rect', ':first-child') .attr('class', 'box') .attr('x', x - maxWidth / 2 - getConfig().state.padding / 2) .attr('y', y - boxHeight / 2 - getConfig().state.padding / 2 - 3.5) .attr('width', maxWidth + getConfig().state.padding) .attr('height', boxHeight + getConfig().state.padding); log.info(bounds); //label.attr('transform', '0 -' + (bounds.y / 2)); // Debug points // path.points.forEach(point => { // g.append('circle') // .style('stroke', 'red') // .style('fill', 'red') // .attr('r', 1) // .attr('cx', point.x) // .attr('cy', point.y); // }); // g.append('circle') // .style('stroke', 'blue') // .style('fill', 'blue') // .attr('r', 1) // .attr('cx', x) // .attr('cy', y); } edgeCount++; };
(function(angular) { 'use strict'; angular.module('confidant.routes.resources', [ 'ui.router', 'ui.bootstrap', 'confidant.resources' ]) .config(['$stateProvider', function($stateProvider) { $stateProvider .state('resources', { url: '/resources', views: { main: { controller: 'resources.ResourceCtrl', templateUrl: '/modules/resources/views/resources.html' } }, data: { viewLocation: 'resources' } }) .state('resources.newCredential', { url: '/new/credential', views: { 'details': { controller: 'resources.CredentialDetailsCtrl', templateUrl: '/modules/resources/views/credential-details.html' } }, data: { viewLocation: 'resources' } }) .state('resources.newService', { url: '/new/service', views: { 'details': { controller: 'resources.ServiceDetailsCtrl', templateUrl: '/modules/resources/views/service-details.html' } }, data: { viewLocation: 'resources' } }) .state('resources.credential-details', { url: '/credentials/:credentialId', views: { 'details': { controller: 'resources.CredentialDetailsCtrl', templateUrl: '/modules/resources/views/credential-details.html' }, 'docs': { controller: 'resources.CredentialDetailsCtrl', templateUrl: '/custom/modules/resources/views/credential-docs.html' } }, data: { viewLocation: 'resources', } }) .state('resources.blind-credential-details', { url: '/blind_credentials/:blindCredentialId', views: { 'details': { controller: 'resources.BlindCredentialDetailsCtrl', templateUrl: '/modules/resources/views/blind-credential-details.html' }, 'docs': { controller: 'resources.BlindCredentialDetailsCtrl', templateUrl: '/custom/modules/resources/views/blind-credential-docs.html' } }, data: { viewLocation: 'resources', } }) .state('resources.service-details', { url: '/services/:serviceId', views: { 'details': { controller: 'resources.ServiceDetailsCtrl', templateUrl: '/modules/resources/views/service-details.html' } }, data: { viewLocation: 'resources', } }) ; }]) ; }(window.angular));
import React from 'react' import ResourceFinderLightbox from '../resource-finder-lightbox' import CollectionLightbox from '../collection-lightbox' import Lightbox from '../../helpers/lightbox' import css from './style.scss' import commonCss from '../../styles/common-css-modules.scss' export default class ClassAssignments extends React.Component { constructor (props) { super(props) this.state = { showAssignOptions: false, collectionViews: [] } this.assignMaterialsRef = React.createRef() this.closeLightbox = this.closeLightbox.bind(this) this.handleExternalClick = this.handleExternalClick.bind(this) this.handleAssignMaterialsButtonClick = this.handleAssignMaterialsButtonClick.bind(this) this.handleAssignMaterialsOptionClick = this.handleAssignMaterialsOptionClick.bind(this) this.handleAssignButtonMouseEnter = this.handleAssignButtonMouseEnter.bind(this) this.handleAssignButtonMouseLeave = this.handleAssignButtonMouseLeave.bind(this) this.renderAssignOptions = this.renderAssignOptions.bind(this) } componentDidMount () { jQuery.ajax({ url: Portal.API_V1.GET_TEACHER_PROJECT_VIEWS, dataType: 'json', success: function (data) { this.setState({ collectionViews: data }) }.bind(this) }) document.addEventListener('mousedown', this.handleExternalClick) } componentWillUnmount () { document.removeEventListener('mousedown', this.handleExternalClick) } closeLightbox (e) { this.props.handleNewAssignment() Lightbox.close() } handleAssignMaterialsButtonClick (e) { this.setState({ showAssignOptions: !this.state.showAssignOptions }) } handleExternalClick (e) { if (this.assignMaterialsRef && !this.assignMaterialsRef.current.contains(e.target)) { this.setState({ showAssignOptions: false }) } } handleAssignMaterialsOptionClick (e, collectionId) { if (document.getElementById('portal-pages-lightbox-mount')) { this.closeLightbox() } this.setState({ showAssignOptions: false }) const lightboxOptions = collectionId === 'all' || typeof collectionId === 'undefined' ? ResourceFinderLightbox({ closeLightbox: this.closeLightbox, collectionViews: this.state.collectionViews, handleNav: this.handleAssignMaterialsOptionClick }) : CollectionLightbox({ closeLightbox: this.closeLightbox, collectionId: collectionId, collectionViews: this.state.collectionViews, handleNav: this.handleAssignMaterialsOptionClick }) Lightbox.open(lightboxOptions) } handleAssignButtonMouseEnter (e) { this.setState({ showAssignOptions: true }) } handleAssignButtonMouseLeave (e) { this.setState({ showAssignOptions: false }) } renderAssignOption () { const { collectionViews } = this.state return ( collectionViews.map(collection => ( <li key={`assign-collection-${collection.id}`}><button id={`assignMaterialsCollection${collection.id}`} onClick={(e) => this.handleAssignMaterialsOptionClick(e, collection.id)}>{collection.name} Collection</button></li> )) ) } renderAssignOptions () { const { collectionViews } = this.state const recentCollectionItems = collectionViews.length > 0 ? this.renderAssignOption() : null return ( <ul> <li><button id='assignMaterialsAllResources' onClick={(e) => this.handleAssignMaterialsOptionClick(e, 'all')}>All Resources</button></li> {recentCollectionItems} </ul> ) } get assignMaterialsPath () { const { clazz } = this.props if (Portal.theme === 'itsi-learn') { return `/itsi?assign_to_class=${clazz.id}` } if (Portal.theme === 'ngss-assessment') { return `/about` } return clazz.assignMaterialsPath } render () { const { clazz } = this.props const { showAssignOptions } = this.state const assignOptions = showAssignOptions ? this.renderAssignOptions() : null return ( <div className={css.classAssignments}> <header> <h1>Assignments for { clazz.name }</h1> <div className={css.assignMaterials} ref={this.assignMaterialsRef}> <button id='assignMaterialsMoreResources' onClick={this.handleAssignMaterialsButtonClick}>Find More Resources</button> {assignOptions} </div> </header> <table className={css.classInfo}> <tbody> <tr> <td>Teacher:</td><td> { clazz.teachers }</td> </tr> <tr> <td>Class word:</td><td> { clazz.classWord }</td> </tr> </tbody> </table> <div className={css.reports}> { clazz.externalClassReports.map(r => <a key={r.url} href={r.url} target='_blank' className={commonCss.smallButton} title={r.name}>{ r.launchText }</a>) } </div> </div> ) } }
/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow * @format */ 'use strict'; const GraphQLCompilerContext = require('../core/GraphQLCompilerContext'); const GraphQLIRTransformer = require('../core/GraphQLIRTransformer'); const IMap = require('immutable').Map; const partitionArray = require('../util/partitionArray'); const getIdentifierForSelection = require('../core/getIdentifierForSelection'); const invariant = require('invariant'); import type {Fragment, Node, Root, Selection} from '../core/GraphQLIR'; /** * A simplified representation of a document: keys in the map are unique * identifiers for the selections of a node, values are either null (for scalars) * or nested maps for items with subselections (linked fields, inline fragments, * etc). */ type SelectionMap = IMap<string, ?SelectionMap>; /** * A transform that removes redundant fields and fragment spreads. Redundancy is * defined in this context as any selection that is guaranteed to already be * fetched by an ancestor selection. This can occur in two cases: * * 1. Simple duplicates at the same level of the document can always be skipped: * * ``` * fragment Foo on FooType { * id * id * ...Bar * ...Bar * } * ``` * * Becomes * * ``` * fragment Foo on FooType { * id * ...Bar * } * ``` * * 2. Inline fragments and conditions introduce the possibility for duplication * at different levels of the tree. Whenever a selection is fetched in a parent, * it is redundant to also fetch it in a child: * * ``` * fragment Foo on FooType { * id * ... on OtherType { * id # 1 * } * ... on FooType @include(if: $cond) { * id # 2 * } * } * ``` * * Becomes: * * ``` * fragment Foo on FooType { * id * } * ``` * * In this example: * - 1 can be skipped because `id` is already fetched by the parent. Even * though the type is different (FooType/OtherType), the inline fragment * cannot match without the outer fragment matching so the outer `id` is * guaranteed to already be fetched. * - 2 can be skipped for similar reasons: it doesn't matter if the condition * holds, `id` is already fetched by the parent regardless. * * This transform also handles more complicated cases in which selections are * nested: * * ``` * fragment Foo on FooType { * a { * bb * } * ... on OtherType { * a { * bb # 1 * cc * } * } * } * ``` * * Becomes * * ``` * fragment Foo on FooType { * a { * bb * } * ... on OtherType { * a { * cc * } * } * } * ``` * * 1 can be skipped because it is already fetched at the outer level. */ function skipRedundantNodesTransform( context: GraphQLCompilerContext, ): GraphQLCompilerContext { return GraphQLIRTransformer.transform(context, { Root: visitNode, Fragment: visitNode, }); } let cache = new Map(); function visitNode<T: Fragment | Root>(node: T): ?T { cache = new Map(); return transformNode(node, new IMap()).node; } /** * The most straightforward approach would be two passes: one to record the * structure of the document, one to prune duplicates. This implementation uses * a single pass. Selections are sorted with fields first, "conditionals" * (inline fragments & conditions) last. This means that all fields that are * guaranteed to be fetched are encountered prior to any duplicates that may be * fetched within a conditional. * * Because selections fetched within a conditional are not guaranteed to be * fetched in the parent, a fork of the selection map is created when entering a * conditional. The sort ensures that guaranteed fields have already been seen * prior to the clone. */ function transformNode<T: Node>( node: T, selectionMap: SelectionMap, ): {selectionMap: SelectionMap, node: ?T} { // This will optimize a traversal of the same subselections. // If it's the same node, and selectionMap is empty // result of transformNode has to be the same. const isEmptySelectionMap = selectionMap.size === 0; let result; if (isEmptySelectionMap) { result = cache.get(node); if (result != null) { return result; } } const selections = []; sortSelections(node.selections).forEach(selection => { const identifier = getIdentifierForSelection(selection); switch (selection.kind) { case 'ScalarField': case 'FragmentSpread': { if (!selectionMap.has(identifier)) { selections.push(selection); selectionMap = selectionMap.set(identifier, null); } break; } case 'Defer': case 'Stream': case 'ModuleImport': case 'ClientExtension': case 'InlineDataFragmentSpread': case 'ConnectionField': case 'LinkedField': { const transformed = transformNode( selection, selectionMap.get(identifier) || new IMap(), ); if (transformed.node) { selections.push(transformed.node); selectionMap = selectionMap.set(identifier, transformed.selectionMap); } break; } case 'InlineFragment': case 'Condition': { // Fork the selection map to prevent conditional selections from // affecting the outer "guaranteed" selections. const transformed = transformNode( selection, selectionMap.get(identifier) || selectionMap, ); if (transformed.node) { selections.push(transformed.node); selectionMap = selectionMap.set(identifier, transformed.selectionMap); } break; } default: (selection: empty); invariant( false, 'SkipRedundantNodesTransform: Unexpected node kind `%s`.', selection.kind, ); } }); const nextNode: any = selections.length ? {...node, selections} : null; result = {selectionMap, node: nextNode}; if (isEmptySelectionMap) { cache.set(node, result); } return result; } /** * Sort inline fragments and conditions after other selections. */ function sortSelections( selections: $ReadOnlyArray<Selection>, ): $ReadOnlyArray<Selection> { const isScalarOrLinkedField = selection => selection.kind === 'ScalarField' || selection.kind === 'LinkedField'; const [scalarsAndLinkedFields, rest] = partitionArray( selections, isScalarOrLinkedField, ); return [...scalarsAndLinkedFields, ...rest]; } module.exports = { transform: skipRedundantNodesTransform, };
'use strict'; const rootWebpackConfig = require('./root.webpack.config'); const commonjsWebpackConfig = require('./commonjs.webpack.config'); module.exports = [ ...rootWebpackConfig, commonjsWebpackConfig, ];
// Karma configuration // Generated on Mon Apr 22 2019 14:22:52 GMT-0400 (Eastern Daylight Time) module.exports = function conf(config) { config.set({ // base path that will be used to resolve all patterns (eg. files, exclude) basePath: '', // frameworks to use // available frameworks: https://npmjs.org/browse/keyword/karma-adapter frameworks: ['jasmine', 'esm'], // list of files / patterns to load in the browser files: [ { pattern: 'test/unit/**/*.js', type: 'module', }, { pattern: 'src/**/*.js', type: 'module', included: false, }, { pattern: 'node_modules/**/*.js', type: 'module', included: false, }, ], plugins: [ require.resolve('@open-wc/karma-esm'), // fallback: resolve any karma- plugins 'karma-*', ], esm: { // if you are using 'bare module imports' you will need this option nodeResolve: true, }, // list of files / patterns to exclude exclude: [], // preprocess matching files before serving them to the browser // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor preprocessors: {}, // test results reporter to use // possible values: 'dots', 'progress' // available reporters: https://npmjs.org/browse/keyword/karma-reporter reporters: ['progress'], // web server port port: 9876, // enable / disable colors in the output (reporters and logs) colors: true, // level of logging // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG logLevel: config.LOG_INFO, // enable / disable watching file and executing tests whenever any file changes autoWatch: true, // start these browsers // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher browsers: ['ChromeHeadless'], // Continuous Integration mode // if true, Karma captures browsers, runs the tests and exits singleRun: true, // Concurrency level // how many browser should be started simultaneous concurrency: Infinity, }); };
import React, { useContext, useState, useEffect } from "react"; import { getOneProfessional, removeProfessional, getAllProfessionals, addFavProfessionals, removeFavProfessionals, getFavProfessionals, } from "../../../services/professional.api"; import { MainContext } from "../../../contexts/MainContext"; import { withRouter } from "react-router-dom"; import { Redirect } from "react-router-dom"; import { ProtectedPage } from "../ProtectedPage/index"; import { StyledGalleryItem } from "./style"; import { Container, Row, Col } from "react-bootstrap"; import { List } from "../../ui/List/index"; import { BarContact } from "../../ui/BarContact/index"; import { LinkTo, LinkBtn } from "../../ui/Link/index"; import { Heart, PenTool, Trash2 } from "react-feather"; export const SingleProfessionalPage = withRouter(({ history, ...props }) => { const { user, users, loading, setLoading, setProfessionals } = useContext( MainContext ); const [professional, setProfessional] = useState({}); const id = props.match.params.id; useEffect(() => { getOneProfessional(id).then((res) => { setProfessional(res.professional); }); }, []); const handleRemove = async () => { setLoading(true); const response = await removeProfessional(id); if (response.status === 200) { getAllProfessionals().then((allProfessionals) => { setProfessionals(allProfessionals); }); setLoading(false); history.push("/gallery/professionals"); } }; const handleFavorites = async () => { setLoading(true); const favorites = [...favProfessionals]; if (!favorites.some((alreadyFavorite) => alreadyFavorite.id === id)) { const response = await addFavProfessionals(id); if (response.status === 200) { getFavProfessionals().then((favs) => { setFavProfessionals(favs); setLoading(false); history.push("/profile"); }); } } else { const response = await removeFavProfessionals(id); if (response.status === 200) { getFavProfessionals().then((favs) => { setFavProfessionals(favs); setLoading(false); history.push("/profile"); }); } } }; if (user) { return ( <> <StyledGalleryItem> <Container fluid> <Row> <Col xs={12}> <h1>Professional</h1> </Col> </Row> </Container> <Container fluid> <Row> <Col xs={12} md={8} lg={9}> <Row> <Col xs={12}> <h2>{professional?.name}</h2> </Col> </Row> <Row> <Col xs={12} md={4}> <img className="itemImg" src={professional?.imageSrc} alt="item picture" ></img> </Col> <Col xs={12} md={8}> <Row> <Col xs={6}> <h3>Info</h3> {professional?.birth && ( <p> <b>Birth: {professional?.birth}</b> </p> )} {professional?.death && ( <p> <b>Death: {professional?.death}</b> </p> )} <p> <b>Hometown: {professional?.hometown}</b> </p> <p> <b>Country: {professional?.country}</b> </p> </Col> <Col xs={6}> <ul className="actions"> {user?.role === "subscriber" && ( <div className="actions"> <LinkBtn method={(e) => handleFavorites(e)} variant="primary" > <Heart /> </LinkBtn> </div> )} {user?.role === "admin" && ( <div className="actions"> <LinkBtn method={(e) => handleRemove(e)} variant="primary" > <Trash2 /> </LinkBtn> <LinkTo to={`/edit-professional/${id}`} itemId={id} variant="primary" > <PenTool /> </LinkTo> </div> )} </ul> </Col> </Row> <Row> <Col xs={12} className="description"> <h3>Description</h3> <p>{professional?.excerpt}</p> </Col> </Row> </Col> </Row> </Col> <Col xs={12} md={4} lg={3}> <Row> <Col xs={12}> <h3>Meet new friends</h3> </Col> </Row> <Row> <Col xs={12}> <List> {users ?.filter((contact) => contact.name !== user.name) .map((userItem, i) => { return ( <div id={userItem.name} key={i}> <BarContact userItem={userItem} /> </div> ); })} </List> </Col> </Row> </Col> </Row> </Container> </StyledGalleryItem> </> ); } else { if (loading) return <ProtectedPage />; else { return <Redirect to="/auth/login" />; } } });
/** * This class contains backbone wrappers for basic ui elements such as Images, Labels, Buttons, Input fields etc. */ import $ from "jquery"; import _ from "underscore"; import Backbone from "backbone"; import Select from "mvc/ui/ui-select-default"; import Slider from "mvc/ui/ui-slider"; import Options from "mvc/ui/ui-options"; import Drilldown from "mvc/ui/ui-drilldown"; import Buttons from "mvc/ui/ui-buttons"; import Modal from "mvc/ui/ui-modal"; /** Displays messages used e.g. in the tool form */ export var Message = Backbone.View.extend({ initialize: function (options) { this.model = (options && options.model) || new Backbone.Model({ message: null, status: "info", cls: "", persistent: false, fade: true, }).set(options); this.listenTo(this.model, "change", this.render, this); if (options && options.active_tab) { this.active_tab = options.active_tab; } this.render(); }, update: function (options) { this.model.set(options); }, render: function () { var status = this.model.get("status"); this.$el.removeClass().addClass(`alert alert-${status} mt-2`).addClass(this.model.get("cls")); if (this.model.get("message")) { this.$el.html(this.messageForDisplay()); this.$el[this.model.get("fade") ? "fadeIn" : "show"](); this.timeout && window.clearTimeout(this.timeout); if (!this.model.get("persistent")) { var self = this; this.timeout = window.setTimeout(() => { self.model.set("message", ""); }, 3000); } } else { this.$el.hide(); } return this; }, messageForDisplay: function () { return _.escape(this.model.get("message")); }, }); export var UnescapedMessage = Message.extend({ messageForDisplay: function () { return this.model.get("message"); }, }); /** Renders an input element used e.g. in the tool form */ export var Input = Backbone.View.extend({ initialize: function (options) { this.model = (options && options.model) || new Backbone.Model({ type: "text", placeholder: "", disabled: false, readonly: false, visible: true, cls: "", area: false, color: null, style: null, }).set(options); this.tagName = this.model.get("area") ? "textarea" : "input"; this.setElement($(`<${this.tagName}/>`)); this.listenTo(this.model, "change", this.render, this); this.render(); }, events: { input: "_onchange", }, value: function (new_val) { new_val !== undefined && this.model.set("value", typeof new_val === "string" ? new_val : ""); return this.model.get("value"); }, render: function () { var self = this; this.$el .removeClass() .addClass(`ui-${this.tagName}`) .addClass(this.model.get("cls")) .addClass(this.model.get("style")) .attr("id", this.model.id) .attr("type", this.model.get("type")) .attr("placeholder", this.model.get("placeholder")) .css("color", this.model.get("color") || "") .css("border-color", this.model.get("color") || ""); var datalist = this.model.get("datalist"); if ($.isArray(datalist) && datalist.length > 0) { this.$el.autocomplete({ source: function (request, response) { response(self.model.get("datalist")); }, change: function () { self._onchange(); }, }); } if (this.model.get("value") !== this.$el.val()) { this.$el.val(this.model.get("value")); } _.each(["readonly", "disabled"], (attr_name) => { self.model.get(attr_name) ? self.$el.attr(attr_name, true) : self.$el.removeAttr(attr_name); }); this.$el[this.model.get("visible") ? "show" : "hide"](); return this; }, _onchange: function () { this.value(this.$el.val()); this.model.get("onchange") && this.model.get("onchange")(this.model.get("value")); }, }); /** Creates a hidden element input field used e.g. in the tool form */ export var Hidden = Backbone.View.extend({ initialize: function (options) { this.model = (options && options.model) || new Backbone.Model(options); this.setElement( $("<div/>") .append((this.$info = $("<div/>"))) .append((this.$hidden = $("<div/>"))) ); this.listenTo(this.model, "change", this.render, this); this.render(); }, value: function (new_val) { new_val !== undefined && this.model.set("value", new_val); return this.model.get("value"); }, render: function () { this.$el.attr("id", this.model.id); this.$hidden.val(this.model.get("value")); this.model.get("info") ? this.$info.show().text(this.model.get("info")) : this.$info.hide(); return this; }, }); /** Creates an input element which switches between select and text field */ export var TextSelect = Backbone.View.extend({ initialize: function (options) { this.select = new options.SelectClass.View(options); this.model = this.select.model; this.text = new Input({ onchange: this.model.get("onchange"), }); this.on("change", () => { if (this.model.get("onchange")) { this.model.get("onchange")(this.value()); } }); this.setElement($("<div/>").append(this.select.$el).append(this.text.$el)); this.update(options); }, wait: function () { this.select.wait(); }, unwait: function () { this.select.unwait(); }, value: function (new_val) { var element = this.textmode ? this.text : this.select; return element.value(new_val); }, update: function (input_def) { var data = input_def.data; if (!data) { data = []; _.each(input_def.options, (option) => { data.push({ label: option[0], value: option[1] }); }); } var v = this.value(); this.textmode = input_def.textable && (!$.isArray(data) || data.length === 0); this.text.$el[this.textmode ? "show" : "hide"](); this.select.$el[this.textmode ? "hide" : "show"](); this.select.update({ data: data }); this.value(v); }, }); /** Creates a upload element input field */ export var Upload = Backbone.View.extend({ initialize: function (options) { var self = this; this.model = (options && options.model) || new Backbone.Model(options); this.setElement( $("<div/>") .append((this.$info = $("<div/>"))) .append((this.$file = $("<input/>").attr("type", "file").addClass("mb-1"))) .append((this.$text = $("<textarea/>").addClass("ui-textarea").attr("disabled", true))) .append((this.$wait = $("<i/>").addClass("fa fa-spinner fa-spin"))) ); this.listenTo(this.model, "change", this.render, this); this.$file.on("change", (e) => { self._readFile(e); }); this.render(); }, value: function (new_val) { new_val !== undefined && this.model.set("value", new_val); return this.model.get("value"); }, render: function () { this.$el.attr("id", this.model.id); this.model.get("info") ? this.$info.show().text(this.model.get("info")) : this.$info.hide(); this.model.get("value") ? this.$text.text(this.model.get("value")).show() : this.$text.hide(); this.model.get("wait") ? this.$wait.show() : this.$wait.hide(); return this; }, _readFile: function (e) { var self = this; var file = e.target.files && e.target.files[0]; if (file) { var reader = new FileReader(); reader.onload = function () { self.model.set({ wait: false, value: this.result }); }; this.model.set({ wait: true, value: null }); reader.readAsText(file); } }, }); /* Make more Ui stuff directly available at this namespace (for backwards * compatibility). We should eliminate this practice, though, and just require * what we need where we need it, allowing for better package optimization. */ export const Button = Buttons.Button; export const ButtonCheck = Buttons.ButtonCheck; export const ButtonMenu = Buttons.ButtonMenu; export const ButtonLink = Buttons.ButtonLink; export const Checkbox = Options.Checkbox; export const RadioButton = Options.RadioButton; export const Radio = Options.Radio; export { Select, Slider, Drilldown }; export default { Button: Buttons.Button, ButtonCheck: Buttons.ButtonCheck, ButtonMenu: Buttons.ButtonMenu, ButtonLink: Buttons.ButtonLink, Input: Input, Message: Message, UnescapedMessage: UnescapedMessage, Upload: Upload, Modal: Modal, RadioButton: Options.RadioButton, Checkbox: Options.Checkbox, Radio: Options.Radio, Select: Select, TextSelect: TextSelect, Hidden: Hidden, Slider: Slider, Drilldown: Drilldown, };
const Knex = require('knex') const connection = require('../knexfile') const { Model } = require('objection') const knexConnection = Knex(connection) Model.knex(knexConnection) export class Lecturer extends Model { static get tableName () { return 'lecturers' } } module.exports = { Lecturer };
// All symbols in the Cherokee block as per Unicode v5.0.0: [ '\u13A0', '\u13A1', '\u13A2', '\u13A3', '\u13A4', '\u13A5', '\u13A6', '\u13A7', '\u13A8', '\u13A9', '\u13AA', '\u13AB', '\u13AC', '\u13AD', '\u13AE', '\u13AF', '\u13B0', '\u13B1', '\u13B2', '\u13B3', '\u13B4', '\u13B5', '\u13B6', '\u13B7', '\u13B8', '\u13B9', '\u13BA', '\u13BB', '\u13BC', '\u13BD', '\u13BE', '\u13BF', '\u13C0', '\u13C1', '\u13C2', '\u13C3', '\u13C4', '\u13C5', '\u13C6', '\u13C7', '\u13C8', '\u13C9', '\u13CA', '\u13CB', '\u13CC', '\u13CD', '\u13CE', '\u13CF', '\u13D0', '\u13D1', '\u13D2', '\u13D3', '\u13D4', '\u13D5', '\u13D6', '\u13D7', '\u13D8', '\u13D9', '\u13DA', '\u13DB', '\u13DC', '\u13DD', '\u13DE', '\u13DF', '\u13E0', '\u13E1', '\u13E2', '\u13E3', '\u13E4', '\u13E5', '\u13E6', '\u13E7', '\u13E8', '\u13E9', '\u13EA', '\u13EB', '\u13EC', '\u13ED', '\u13EE', '\u13EF', '\u13F0', '\u13F1', '\u13F2', '\u13F3', '\u13F4', '\u13F5', '\u13F6', '\u13F7', '\u13F8', '\u13F9', '\u13FA', '\u13FB', '\u13FC', '\u13FD', '\u13FE', '\u13FF' ];
/*global Chart, GC, PointSet, Raphael, XDate, console, Raphael, $, jQuery, SMART, debugLog*/ /*jslint eqeq: true, nomen: true, plusplus: true, newcap: true */ window.GC = window.GC || {}; (function () { "use strict"; function sortByAge(a, b) { return a.agemos - b.agemos; } function SmartAnnotation(date, note) { this.date = new XDate(date); this.note = note; } SmartAnnotation.prototype.toGCAnnotation = function(patient) { var out = {}; out.annotation = { txt : this.note }; out.agemos = patient.DOB.diffMonths(this.date + 1); return out; }; function SmartBoneage(date, boneAgeMos) { this.date = new XDate(date); this.boneAgeMos = boneAgeMos; } SmartBoneage.prototype.toGCBoneage = function(patient) { var out = {}; out.boneAge = this.boneAgeMos; out.agemos = patient.DOB.diffMonths(this.date + 1); return out; }; /** * If multiple records exist from the same day, then use the latest one and * ignore the others. */ function mergeIntoDays(data) { var len = data.length, idx = 0, rec = null, day = null, lastDay = 0, buffer = -1, out = []; for (idx = 0; idx < len; idx++) { rec = data[idx]; day = Math.floor(rec.agemos * 30.4375); // If this record was made at the same day as the previous one - // pick the latest one and store it as the "buffer" if ( day === lastDay ) { if ( buffer == -1 || rec.agemos > data[buffer].agemos ) { buffer = idx; } } // If this record was NOT made at the same day as the previous one - // get it, but first get the buffer if not empty and overwrite first same day entry else { if (buffer > -1) { out[out.length-1] = data[buffer]; buffer = -1; } out.push(rec); } if ( idx === len-1 && buffer !== -1 ) { out[out.length-1] = rec; } lastDay = day; } // In case there is only one record for day 0 if (buffer > -1) { out.push(data[buffer]); } return out; } GC.deletePreferences = function () { var dfd = $.Deferred(); SMART.delete_user_preferences() .success(function(r) { //console.log ("Preferences deleted"); dfd.resolve(); }) .error(function(e) { //console.log(e.message); dfd.reject(e.message); }); return dfd.promise(); }; GC.deleteScratchpad = function () { var dfd = $.Deferred(); SMART.delete_scratchpad_data() .success(function(r) { //console.log ("Scratchpad deleted", r); dfd.resolve(r); }) .error(function(e) { //console.log(e.message); dfd.reject(e.message); }); return dfd.promise(); }; GC.setPreferences = function (dataStr) { var dfd = $.Deferred(); SMART.put_user_preferences({data:dataStr, contentType:"application/json"}) .success(function(r) { //console.log ("Preferences saved"); dfd.resolve(r.json); }) .error(function(e) { //console.log(e); dfd.reject(e.message); //GC.deletePreferences(); }); return dfd.promise(); }; GC.setScratchpad = function (dataStr) { var dfd = $.Deferred(); SMART.put_scratchpad_data({data:dataStr, contentType:"application/json"}) .success(function(r) { //console.log ("Scratchpad saved", r); dfd.resolve(r.json); }) .error(function(e) { //console.log(e.message); dfd.reject(e.message); }); return dfd.promise(); }; GC.getPreferences = function () { var dfd = $.Deferred(); SMART.get_user_preferences() .success(function(r) { //console.log("Preferences value: " + r.body); dfd.resolve(r.json); }) .error(function(e) { //console.log(e); dfd.reject(e.message); GC.deletePreferences(); }); return dfd.promise(); }; GC.getScratchpad = function () { var dfd = $.Deferred(); SMART.get_scratchpad_data() .success(function(r) { //console.log("Scratchpad value: ", r.json); dfd.resolve(r.json); }) .error(function(e) { //console.log(e.message); dfd.reject(e.message); }); return dfd.promise(); }; GC.getContainerManifest = function () { var dfd = $.Deferred(); SMART.get_container_manifest() .success(function(r) { dfd.resolve(r); }) .error(function(e) { debugLog(e.message); dfd.reject(e.message); }); return dfd.promise(); }; GC.Patient = function ( demographics, vitals, allergies, familyHistory, annotations, boneAge ) { this.allergies = { positive : [], negative : [] }; this.familyHistory = { father : { height: null, isBio : false }, mother : { height: null, isBio : false } }; this.data = { length : [], stature : [], lengthAndStature : [], weight : [], headc : [], bmi : [] }; this.annotations = []; this.boneAge = []; this.model = null; this.init( demographics, vitals, allergies, familyHistory, annotations, boneAge ); }; GC.Patient.prototype = { /** * The patient's name */ name : "Unknown Name", /** * The patient's birth date (format from SMART) * @type String */ birthdate : "Unknown Birthdate", /** * The patient's gender ("male" or "female") * @type String */ gender : "Unknown Gender", /** * The patient's gestation age in months. That is the difference betwen * the EDD and the birth date. * @type Number */ gestationAge : null, /** * The mid. parental height in "cm". Defaults to 175 if we do not have * the height of both parents. * @type Number */ midParentalHeight : 0, weeker : null, EDD : null }; /** * Initialize the instance * @param demographics * @param vitals * @param allergies * @param familyHistory */ GC.Patient.prototype.init = function( demographics, vitals, allergies, familyHistory, annotations, boneAge ) { var map = { "length" : vitals.lengthData, "stature" : vitals.statureData, "weight" : vitals.weightData, "headc" : vitals.headCData, "bmi" : vitals.BMIData }, data, patient = this, name; function setData(i, o) { patient.data[name].push ({ agemos: o.hasOwnProperty("agemos") ? o.agemos : patient.DOB.diffMonths(new XDate(o.date)), value : o.value, display: o.display }); } this.name = demographics.name; this.birthdate = demographics.birthday; this.gender = demographics.gender; this.gestationAge = demographics.gestationalAge || null; this.weeker = this.gestationAge; this.DOB = new XDate(this.birthdate); if (demographics.DOB) { this.setDOB(demographics.DOB); } this.setAllergies( allergies ); this.setFamilyHistory( familyHistory ); if (demographics.EDD) { this.setEDD(demographics.EDD); } else if (this.gestationAge !== null) { this.setEDD(this.DOB.clone().addWeeks(40 - this.gestationAge)); } this.setAnnotations(annotations); this.setBoneAge(boneAge); // Populate the patient's "data" object (except for the "lengthAndStature") for ( name in map ) { data = map[name]; if ( data ) { $.each( data, setData); this.data[name].sort(sortByAge); this.data[name] = mergeIntoDays(this.data[name]); } } // "lengthAndStature" is created by merging "length" and "stature" this.data.lengthAndStature = this.data.length.slice().concat(this.data.stature); // Sort "lengthAndStature" this.data.lengthAndStature.sort(sortByAge); // Override with custom scratchpad data if available if (GC._isPatientDataEditable && GC.scratchpadData && GC.scratchpadData.patientData) { this.mergeModel(GC.scratchpadData.patientData); } }; GC.Patient.prototype.setBoneAge = function(boneAgeList) { var patient = this; this.boneAge = []; if (boneAgeList && boneAgeList.length) { $.each(boneAgeList, function(i, o) { if (o instanceof SmartBoneage) { patient.boneAge.push(o.toGCBoneage(patient)); } else { patient.boneAge.push(o); } }); } return this; }; GC.Patient.prototype.setAnnotations = function(annotationsList) { var patient = this; this.annotations = []; if (annotationsList && annotationsList.length) { $.each(annotationsList, function(i, o) { if (o instanceof SmartAnnotation) { patient.annotations.push(o.toGCAnnotation(patient)); } else { patient.annotations.push(o); } }); } return this; }; GC.Patient.prototype.getCurrentAge = function() { return new GC.TimeInterval(this.DOB); }; GC.Patient.prototype.getCorrectedAge = function() { var age = new GC.TimeInterval(this.DOB); age.addWeeks((this.gestationAge || 40) - 40); return age; }; GC.Patient.prototype.getGestatonCorrection = function() { return new GC.TimeInterval(this.EDD, this.DOB); }; GC.Patient.prototype.setDOB = function( d ) { d = new XDate( d ); if ( d.valid() ) { this.DOB = d; this.birthdate = d.toString(); this.gestationAge = this.weeker = Math.round(40 - this.DOB.diffWeeks(this.EDD)); $("html") .trigger("change:patient:DOB", this.DOB) .trigger("change:patient:gestationAge", this.gestationAge) .trigger("change:patient:weeker", this.weeker) .trigger("change:patient:birthdate", this.birthdate) .trigger("change:patient", this); } }; GC.Patient.prototype.setEDD = function( d ) { d = new XDate( d ); if ( d.valid() ) { this.EDD = d; this.gestationAge = this.weeker = Math.round(40 - this.DOB.diffWeeks(d)); $("html") .trigger("change:patient:EDD", this.EDD) .trigger("change:patient:gestationAge", this.gestationAge) .trigger("change:patient:weeker", this.weeker) .trigger("change:patient", this); } }; GC.Patient.prototype.isPremature = function() { return this.EDD && this.DOB.diffWeeks(this.EDD) > 3; }; /** * Sets the allergies from the smart data. * TODO: Implement this when we have some data * @returns GC.Patient */ GC.Patient.prototype.setAllergies = function( allergies ) { //console.log("setAllergies: ", allergies); if ( allergies && !allergies.noalergy ) { if ($.isArray(allergies.positive)) { this.allergies.positive = allergies.positive.slice(); } if ($.isArray(allergies.negative)) { this.allergies.negative = allergies.negative.slice(); } } return this; }; /** * Sets the familyHistory meta data and updates the midParentalHeight in * case both parents have known height * @param {Object} history * @returns GC.Patient */ GC.Patient.prototype.setFamilyHistory = function( history ) { var old = $.extend(true, {}, this.familyHistory); $.extend(true, this.familyHistory, history); this.familyHistory.father.height = GC.Util.floatVal( this.familyHistory.father.height ); this.familyHistory.mother.height = GC.Util.floatVal( this.familyHistory.mother.height ); if (this.familyHistory.father.height && this.familyHistory.mother.height && this.familyHistory.father.isBio && this.familyHistory.mother.isBio) { this.midParentalHeight = GC.Util.round((this.familyHistory.father.height + this.familyHistory.mother.height) / 2); } else { this.midParentalHeight = null; } if (this.familyHistory.father.height !== old.father.height || this.familyHistory.mother.height !== old.mother.height || this.familyHistory.father.isBio !== old.father.isBio || this.familyHistory.mother.isBio !== old.mother.isBio) { $("html").trigger("change:patient:familyhistory"); } old = null; return this; }; GC.Patient.prototype.getModel = function() { if ( !this.model ) { var model = {}; // Length and Stature $.each(this.data.lengthAndStature, function(i, o) { if ( model.hasOwnProperty(o.agemos) ) { model[ o.agemos ].lengthAndStature = o.value; } else { model[ o.agemos ] = { "lengthAndStature" : o.value }; } }); // Weight $.each(this.data.weight, function(i, o) { if ( model.hasOwnProperty(o.agemos) ) { model[ o.agemos ].weight = o.value; } else { model[ o.agemos ] = { "weight" : o.value }; } }); // Display var setDisplayInModel = function(i, o) { if ( model.hasOwnProperty(o.agemos) ) { if (!model.hasOwnProperty("display")) { model[o.agemos].display = o.display; } } else { model[ o.agemos ] = { "display" : o.display }; } }; $.each(this.data.weight, setDisplayInModel); $.each(this.data.headc, setDisplayInModel); $.each(this.data.lengthAndStature, setDisplayInModel); // HEADC $.each(this.data.headc, function(i, o) { if ( model.hasOwnProperty(o.agemos) ) { model[ o.agemos ].headc = o.value; } else { model[ o.agemos ] = { "headc" : o.value }; } }); // BMI $.each(this.data.bmi, function(i, o) { if ( model.hasOwnProperty(o.agemos) ) { model[ o.agemos ].bmi = o.value; } else { model[ o.agemos ] = { "bmi" : o.value }; } }); // Bone Age $.each(this.boneAge, function(i, o) { if ( model.hasOwnProperty(o.agemos) ) { model[ o.agemos ].boneAge = o.boneAge; } else { model[ o.agemos ] = { "boneAge" : o.boneAge }; } }); // Annotations $.each(this.annotations, function(i, o) { if ( model.hasOwnProperty(o.agemos) ) { model[ o.agemos ].annotation = o.annotation; } else { model[ o.agemos ] = { "annotation" : o.annotation }; } }); // Override with custom scratchpad data if available if (GC._isPatientDataEditable && GC.scratchpadData && GC.scratchpadData.patientData) { $.each(GC.scratchpadData.patientData, function(i, o) { model[ o.agemos ] = o; }); } var tmp = []; $.each(model, function( age, data ) { data.agemos = GC.Util.floatVal(age); tmp.push(data); }); tmp.sort(function( a, b ) { return a.agemos - b.agemos; }); this.model = tmp; model = null; } return this.model; }; GC.Patient.prototype.mergeModel = function(model) { var patient = this; function merge(src, rec) { var i, l = src.length; for (i = 0; i < l; i++) { if (src[i].agemos === rec.agemos) { $.extend(true, src[i], rec); return l; } } return src.push(rec); } model.sort(sortByAge); $.each(model, function(i, o) { if (o.hasOwnProperty("lengthAndStature")) { if (o.agemos <= 24) { merge(patient.data.length, { agemos : o.agemos, value : o.lengthAndStature }); } else { merge(patient.data.stature, { agemos : o.agemos, value : o.lengthAndStature }); } } if (o.hasOwnProperty("weight")) { merge(patient.data.weight, { agemos : o.agemos, value : o.weight }); } if (o.hasOwnProperty("headc")) { merge(patient.data.headc, { agemos : o.agemos, value : o.headc }); } if (o.hasOwnProperty("bmi")) { merge(patient.data.bmi, { agemos : o.agemos, value : o.bmi }); } if (o.hasOwnProperty("boneAge")) { merge(patient.boneAge, { agemos : o.agemos, boneAge : o.boneAge }); } if (o.hasOwnProperty("annotation")) { merge(patient.annotations, { agemos : o.agemos, annotation : o.annotation }); } }); // "lengthAndStature" is created by merging "length" and "stature" this.data.lengthAndStature = this.data.length.slice().concat(this.data.stature); this.data.lengthAndStature.sort(sortByAge); $("html").trigger("change:patient", this); }; GC.Patient.prototype.refresh = function() { this.data.length = []; this.data.stature = []; this.data.weight = []; this.data.headc = []; this.data.bmi = []; this.data.lengthAndStature = []; this.annotations = []; this.boneAge = []; this.mergeModel(this.getModel()); }; /** * This method will iterate over each entry before the @agemos, calling the * @isAccepted callback that should return boolean. The tipical use is to * find the first available entry before @agemos having some of the data * properties. * @param {Number} agemos The current age. * @param {Function} isAccepted Called with one argument - the entry to test */ GC.Patient.prototype.getPrevModelEntry = function( agemos, isAccepted ) { var entry = null, model = this.getModel(), len = model.length, i; for ( i = 0; i < len; i++ ) { if ( model[i].agemos < agemos ) { if ( !entry || model[i].agemos >= entry.agemos ) { if ( isAccepted(model[i]) ) { entry = model[i]; } } } } return entry; }; GC.Patient.prototype.getNextModelEntry = function( agemos, isAccepted ) { var entry = null, model = this.getModel(), len = model.length, i; for ( i = 0; i < len; i++ ) { if ( model[i].agemos > agemos ) { if ( !entry || model[i].agemos <= entry.agemos ) { if ( isAccepted(model[i]) ) { entry = model[i]; } } } } return entry; }; GC.Patient.prototype.getLastModelEntry = function( isAccepted ) { var model = this.getModel(), i; for ( i = model.length - 1; i >= 0; i-- ) { if ( !$.isFunction(isAccepted) || isAccepted(model[i]) ) { return model[i]; } } return null; }; GC.Patient.prototype.getFirstModelEntry = function( isAccepted ) { var model = this.getModel(), i, l = model.length; for ( i = 0; i < l; i++ ) { if ( !$.isFunction(isAccepted) || isAccepted(model[i]) ) { return model[i]; } } return null; }; GC.Patient.prototype.getModelEntryAtAgemos = function( agemos ) { var out = null; $.each(this.getModel(), function(i, o) { if (Math.abs(o.agemos - agemos) < 1 / GC.Constants.TIME.MONTH) { out = o; return false; } }); return out; }; GC.Patient.prototype.geModelIndexAtAgemos = function( agemos ) { var out = null; $.each(this.getModel(), function(i, o) { if (Math.abs(o.agemos - agemos) < 1 / GC.Constants.TIME.MONTH) { out = i; return false; } }); return out; }; GC.Patient.prototype.getLastEnryHaving = function(propName) { return this.getLastModelEntry(function(entry) { return entry[propName] !== undefined; }); }; // ========================================================================= // Add/Edit patient data (if API is available) // ========================================================================= GC.Patient.prototype.writeRecord = function(rec) { var recToUpdate; if (!GC._isPatientDataEditable) { return $.when(); } // Search for the record to update in the custom records $.each(GC.scratchpadData.patientData, function(i, entry) { if (entry.agemos === rec.agemos) { recToUpdate = entry; return false; } }); if (recToUpdate) { $.extend(true, recToUpdate, rec); } else { GC.scratchpadData.patientData.push(rec); } return $.when(GC.Scratchpad.save()); }; GC.Patient.prototype.deleteRecord = function(rec) { var ageToRemove = null, patient = this, model; if (GC._isPatientDataEditable) { // Search for the record to update in the custom records $.each(GC.scratchpadData.patientData, function(i, entry) { if (entry.agemos === rec.agemos) { ageToRemove = rec.agemos; GC.scratchpadData.patientData.splice(i, 1); return false; } }); } if (ageToRemove !== null) { model = this.getModel(); $.each(model, function(i, entry) { if (entry.agemos === ageToRemove) { model.splice(i, 1); return false; } }); } else { return $.Deferred().reject(); } return $.when(GC.Scratchpad.save(GC.scratchpadData)).then(function() { $.each(patient.data, function(i, o) { $.each(o, function(name, value) { if (value.agemos === ageToRemove) { patient.data[name].splice(i, 1); return false; } }); }); $.each(patient.annotations, function(i, o) { if (o.agemos === ageToRemove) { patient.annotations.splice(i, 1); return false; } }); $.each(patient.boneAge, function(i, o) { if (o.agemos === ageToRemove) { patient.boneAge.splice(i, 1); return false; } }); }); }; GC.Patient.prototype.canDeleteRecord = function(rec) { var out = false; if (GC._isPatientDataEditable) { $.each(GC.scratchpadData.patientData, function(i, entry) { if (entry.agemos === rec.agemos) { out = true; return false; } }); } return out; }; // ========================================================================= // Height Estimation Methods // ========================================================================= GC.Patient.prototype.getMidParentalHeight = function(forAgemos) { forAgemos = forAgemos || 12 * 20; if (!this.familyHistory.father.height || !this.familyHistory.mother.height || !this.familyHistory.father.isBio || !this.familyHistory.mother.isBio) { return null; } var midHeight = GC.Util.round((this.familyHistory.father.height + this.familyHistory.mother.height) / 2); var dataSet = GC.DATA_SETS.CDC_STATURE; var data = dataSet.data[this.gender]; var lastAgeMos = GC.Util.findMinMax(data, "Agemos").max; if ( lastAgeMos < forAgemos ) { return null; } var pctLast = GC.findPercentileFromX( midHeight, dataSet, this.gender, lastAgeMos ); var nom = GC.findXFromPercentile( pctLast, dataSet, this.gender, forAgemos || 12 * 20 ); return { height : GC.Util.floatVal(nom, midHeight), percentile : pctLast, title : GC.str("STR_32") // Mid. Parental Height }; }; GC.Patient.prototype.getBoneAgeAdjustedHeight = function(forAgemos) { var lastHeightEntry = this.getLastEnryHaving("lengthAndStature"); if ( !lastHeightEntry || lastHeightEntry.agemos < GC.chartSettings.heightEstimatesMinAge ) { return null; } var boneAgeHeight = GC.getBoneAgeEstimate(this); if (!boneAgeHeight) { return null; } var dataSet = GC.DATA_SETS.CDC_STATURE; var data = dataSet.data[this.gender]; var lastAgeMos = GC.Util.findMinMax(data, "Agemos").max; if ( lastAgeMos < lastHeightEntry.agemos ) { return null; } var pctLast = GC.findPercentileFromX( boneAgeHeight, dataSet, this.gender, lastAgeMos ); var nom = GC.findXFromPercentile( pctLast, dataSet, this.gender, forAgemos || 12 * 20 ); return { height : nom, percentile : pctLast, title : GC.str("STR_34") // Mid. Parental Height }; }; GC.Patient.prototype.getLatestPercentileHeight = function(forAgemos) { var lastHeightEntry = this.getLastEnryHaving("lengthAndStature"); if ( !lastHeightEntry || lastHeightEntry.agemos < GC.chartSettings.heightEstimatesMinAge ) { return null; } var dataSet = GC.DATA_SETS.CDC_STATURE; var data = dataSet.data[this.gender]; var lastAgeMos = GC.Util.findMinMax(data, "Agemos").max; if ( lastAgeMos < lastHeightEntry.agemos ) { return null; } var pctLast = GC.findPercentileFromX( lastHeightEntry.lengthAndStature, dataSet, this.gender, lastHeightEntry.agemos ); var nom = GC.findXFromPercentile( pctLast, dataSet, this.gender, forAgemos || 12 * 20 ); return { height : nom, percentile : pctLast, title : GC.str("STR_33") // Nominal Height }; }; GC.Patient.prototype.getVelocity = function( prop, atRecord, toRecord, denominator, suffix ) { if ( atRecord.hasOwnProperty(prop) ) { toRecord = toRecord || this.getPrevModelEntry(atRecord.agemos, function(o) { return o.hasOwnProperty(prop); }); if (toRecord) { //denominator = (denominator || GC.Constants.TIME.MONTH)// /GC.Constants.TIME.MONTH; var deltaTime = (atRecord.agemos - toRecord.agemos); if (!denominator) { denominator = GC.chartSettings.roundPrecision.velocity[GC.chartSettings.nicu ? "nicu" : "std"]; } switch (denominator) { case "year": denominator = 12; suffix = "/" + GC.str("STR_24").toLowerCase(); break; case "month": denominator = 1; suffix = "/" + GC.str("STR_26").toLowerCase(); break; case "week": denominator = 1/GC.Constants.TIME_INTERVAL.WEEKS_IN_MONTH; suffix = "/" + GC.str("STR_28").toLowerCase(); break; case "day": denominator = 1/GC.Constants.TIME_INTERVAL.DAYS_IN_MONTH; suffix = "/" + GC.str("STR_30").toLowerCase(); break; case "auto": if (Math.abs(deltaTime) >= 12) { denominator = 12; suffix = "/" + GC.str("STR_24").toLowerCase(); } else if (Math.abs(deltaTime) >= 1) { denominator = 1; suffix = "/" + GC.str("STR_26").toLowerCase(); } else if (Math.abs(deltaTime) >= 1/GC.Constants.TIME_INTERVAL.WEEKS_IN_MONTH) { denominator = 1/GC.Constants.TIME_INTERVAL.WEEKS_IN_MONTH; suffix = "/" + GC.str("STR_28").toLowerCase(); } else { denominator = 1/GC.Constants.TIME_INTERVAL.DAYS_IN_MONTH; suffix = "/" + GC.str("STR_30").toLowerCase(); } break; default: throw "Invalid velocity denominator '" + denominator + "'."; } var v = (atRecord[prop] - toRecord[prop]) / deltaTime; // per month //v *= denominator/GC.Constants.TIME.MONTH; v = GC.Util.roundToPrecision(v * denominator, 1); //if (suffix) { // v += suffix; //} //return v; return { value : v, denominator : denominator, suffix : suffix }; } } return null; }; }());
import 'jquery'; import 'jquery-slim'; import 'bootstrap'; //window._ = require('lodash'); /** * We'll load the axios HTTP library which allows us to easily issue requests * to our Laravel back-end. This library automatically handles sending the * CSRF token as a header based on the value of the "XSRF" token cookie. */ //window.axios = require('axios'); //window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; /** * Echo exposes an expressive API for subscribing to channels and listening * for events that are broadcast by Laravel. Echo and event broadcasting * allows your team to easily build robust real-time web applications. */ // import Echo from 'laravel-echo'; // window.Pusher = require('pusher-js'); // window.Echo = new Echo({ // broadcaster: 'pusher', // key: process.env.MIX_PUSHER_APP_KEY, // cluster: process.env.MIX_PUSHER_APP_CLUSTER, // forceTLS: true // });
var hierarchy = [ [ "AKKU::Smart::Encoder", "classAKKU_1_1Smart_1_1Encoder.html", null ], [ "AKKU::Smart::EncoderData", "classAKKU_1_1Smart_1_1EncoderData.html", [ [ "AKKU::Smart::EncoderBoolData", "classAKKU_1_1Smart_1_1EncoderBoolData.html", null ], [ "AKKU::Smart::EncoderDoubleData", "classAKKU_1_1Smart_1_1EncoderDoubleData.html", null ], [ "AKKU::Smart::EncoderNullData", "classAKKU_1_1Smart_1_1EncoderNullData.html", null ], [ "AKKU::Smart::EncoderNumData", "classAKKU_1_1Smart_1_1EncoderNumData.html", null ], [ "AKKU::Smart::EncoderObjectData", "classAKKU_1_1Smart_1_1EncoderObjectData.html", null ], [ "AKKU::Smart::EncoderStringData", "classAKKU_1_1Smart_1_1EncoderStringData.html", null ] ] ] ];
const last = require('./last') /** * // find all dependant fields of this field * (typeField: string, ff: FF) => Set<string> */ module.exports = function findDependantFields (typeField, ff) { if (ff[typeField] !== 'dependant') return new Set() const subFFs = ff['map'].map(last) if (ff.hasOwnProperty('default')) subFFs.push(ff['default']) const fields = new Set(ff['dependsOn']) subFFs.forEach((ff) => findDependantFields(typeField, ff).forEach(field => fields.add(field))) return fields }
const {Venues} = require('../db.js'); var VenuesModel = module.exports = { getAllVenues: function () { return Venues.find(); }, getVenueById: function (id) { return Venues.find({id}); } }
const router = require('./routes/index') const router1 = require('./routes/users') const app = require('./app') test('GET /: 1-Make sure the response is 200.', () => { expect(router.get('/', (req, res, next) => { res.render('index', {status: 'success', title: 'HackerBay-University'}); })).toBe(router.get('/', (req, res) => { res.status(200) })) }); test('GET /: 2-Make sure the JSON returned as response is greetinglid', () => { expect(router.get('/', (req, res, next) => { res.render('index', {status: 'success', title: 'HackerBay-University'}); })).toBe(router.get('/', (req, res) => { res.json({status: 'success'}) })) }); test('POST /data: 1-Make sure it returns 200 with request string.', () => { expect(router.get('/data', (req, res, next) => { var greeting = {greeting: 'Welcome!'}; res.redirect('data', greeting); })).toBe(router.post('/', (req, res) => { res.status(200) })) }); test('POST /data: 2-It should return 400 instead of 200 (which means a bad request).', () => { expect(router.get('/data:1', (req, res, next) => { var greeting = {greeting: 'Welcome!'}; res.redirect('data', greeting); })).toBe(router.post('/', (req, res) => { res.status(400) })) }); test('POST /data: 3-What happens when you pass a JSON or a number instead of string?It should return 400 instead of 200.', () => { expect(router.get('/data:1', (req, res, next) => { greetingr greeting = {greeting: '12345'}; res.redirect('data', greeting); })).toBe(router.post('/', (req, res) => { res.status(400) })) }); test("GET /data: 1-Make sure it returns 200 with the data saved.", () => { expect(router.get('/data', (req, res, next) => { var greeting = {greeting: 'Welcome!'}; res.render('data', greeting); })).toBe(router.post('/', (req, res) => { res.status(200) res.json({greeting: 'Welcome!'}) })) }); test("GET /data: 2-What would it return when there's no data saved?It should return 400 instead of 200.", () => { expect(router.get('/data', (req, res, next) => { var greeting = {}; res.render('data', greeting); })).toBe(router.post('/', (req, res) => { res.status(400) })) }); test('TEST Users: respond with a resource', () => { expect(router1.get('/', (req, res, next) => { res.send('respond with a resource'); })).toBe(router1.get('/', (req, res) => { res.status(200) })) }); test('render the error page.', () => { expect(app.use((err, req, res, next) => { res.locals.message = err.message; res.locals.error = req.app.get('env') === 'development' ? err : {}; res.status(err.status || 500); res.render('error'); })).toBe(app.use((err, req, res, next) => { res.status(500) })) });
/* */ "format global"; (function (global) { var babelHelpers = global.babelHelpers = {}; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.defaults = function (obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }; babelHelpers.createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); babelHelpers.createDecoratedClass = (function () { function defineProperties(target, descriptors, initializers) { for (var i = 0; i < descriptors.length; i++) { var descriptor = descriptors[i]; var decorators = descriptor.decorators; var key = descriptor.key; delete descriptor.key; delete descriptor.decorators; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor || descriptor.initializer) descriptor.writable = true; if (decorators) { for (var f = 0; f < decorators.length; f++) { var decorator = decorators[f]; if (typeof decorator === "function") { descriptor = decorator(target, key, descriptor) || descriptor; } else { throw new TypeError("The decorator for method " + descriptor.key + " is of the invalid type " + typeof decorator); } } if (descriptor.initializer !== undefined) { initializers[key] = descriptor; continue; } } Object.defineProperty(target, key, descriptor); } } return function (Constructor, protoProps, staticProps, protoInitializers, staticInitializers) { if (protoProps) defineProperties(Constructor.prototype, protoProps, protoInitializers); if (staticProps) defineProperties(Constructor, staticProps, staticInitializers); return Constructor; }; })(); babelHelpers.createDecoratedObject = function (descriptors) { var target = {}; for (var i = 0; i < descriptors.length; i++) { var descriptor = descriptors[i]; var decorators = descriptor.decorators; var key = descriptor.key; delete descriptor.key; delete descriptor.decorators; descriptor.enumerable = true; descriptor.configurable = true; if ("value" in descriptor || descriptor.initializer) descriptor.writable = true; if (decorators) { for (var f = 0; f < decorators.length; f++) { var decorator = decorators[f]; if (typeof decorator === "function") { descriptor = decorator(target, key, descriptor) || descriptor; } else { throw new TypeError("The decorator for method " + descriptor.key + " is of the invalid type " + typeof decorator); } } } if (descriptor.initializer) { descriptor.value = descriptor.initializer.call(target); } Object.defineProperty(target, key, descriptor); } return target; }; babelHelpers.defineDecoratedPropertyDescriptor = function (target, key, descriptors) { var _descriptor = descriptors[key]; if (!_descriptor) return; var descriptor = {}; for (var _key in _descriptor) descriptor[_key] = _descriptor[_key]; descriptor.value = descriptor.initializer ? descriptor.initializer.call(target) : undefined; Object.defineProperty(target, key, descriptor); }; babelHelpers.taggedTemplateLiteral = function (strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }; babelHelpers.taggedTemplateLiteralLoose = function (strings, raw) { strings.raw = raw; return strings; }; babelHelpers.toArray = function (arr) { return Array.isArray(arr) ? arr : Array.from(arr); }; babelHelpers.toConsumableArray = function (arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } }; babelHelpers.slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; })(); babelHelpers.slicedToArrayLoose = function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { var _arr = []; for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { _arr.push(_step.value); if (i && _arr.length === i) break; } return _arr; } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; babelHelpers.objectWithoutProperties = function (obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }; babelHelpers.hasOwn = Object.prototype.hasOwnProperty; babelHelpers.slice = Array.prototype.slice; babelHelpers.bind = Function.prototype.bind; babelHelpers.defineProperty = function (obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }; babelHelpers.asyncToGenerator = function (fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { var callNext = step.bind(null, "next"); var callThrow = step.bind(null, "throw"); function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(callNext, callThrow); } } callNext(); }); }; }; babelHelpers.interopExportWildcard = function (obj, defaults) { var newObj = defaults({}, obj); delete newObj["default"]; return newObj; }; babelHelpers.interopRequireWildcard = function (obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj["default"] = obj; return newObj; } }; babelHelpers.interopRequireDefault = function (obj) { return obj && obj.__esModule ? obj : { "default": obj }; }; babelHelpers._typeof = function (obj) { return obj && obj.constructor === Symbol ? "symbol" : typeof obj; }; babelHelpers._extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; babelHelpers.get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; babelHelpers.set = function set(object, property, value, receiver) { var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent !== null) { set(parent, property, value, receiver); } } else if ("value" in desc && desc.writable) { desc.value = value; } else { var setter = desc.set; if (setter !== undefined) { setter.call(receiver, value); } } return value; }; babelHelpers.newArrowCheck = function (innerThis, boundThis) { if (innerThis !== boundThis) { throw new TypeError("Cannot instantiate an arrow function"); } }; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.objectDestructuringEmpty = function (obj) { if (obj == null) throw new TypeError("Cannot destructure undefined"); }; babelHelpers.temporalUndefined = {}; babelHelpers.temporalAssertDefined = function (val, name, undef) { if (val === undef) { throw new ReferenceError(name + " is not defined - temporal dead zone"); } return true; }; babelHelpers.selfGlobal = typeof global === "undefined" ? self : global; babelHelpers.typeofReactElement = typeof Symbol === "function" && Symbol["for"] && Symbol["for"]("react.element") || 60103; babelHelpers.defaultProps = function (defaultProps, props) { if (defaultProps) { for (var propName in defaultProps) { if (typeof props[propName] === "undefined") { props[propName] = defaultProps[propName]; } } } return props; }; babelHelpers._instanceof = function (left, right) { if (right != null && right[Symbol.hasInstance]) { return right[Symbol.hasInstance](left); } else { return left instanceof right; } }; babelHelpers.interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; }; })(typeof global === "undefined" ? self : global);
this.NesDb = this.NesDb || {}; NesDb[ 'EB29844FDBC7BDCEBAE9FD2DB46DCC9DFFB7BEE5' ] = { "$": { "name": "Magical Taruruuto-kun 2: Mahou Daibouken", "altname": "まじかるタルるートくん2 まほうだいぼうけん", "class": "Licensed", "subclass": "3rd-Party", "catalog": "BA-MT2", "publisher": "Bandai", "developer": "TOSE Software", "region": "Japan", "players": "1", "date": "1992-06-19" }, "cartridge": [ { "$": { "system": "Famicom", "crc": "B7F28915", "sha1": "EB29844FDBC7BDCEBAE9FD2DB46DCC9DFFB7BEE5", "dump": "ok", "dumper": "bootgod", "datedumped": "2009-09-12" }, "board": [ { "$": { "type": "BANDAI-LZ93D50+24C01", "pcb": "DRAGON BALL Z-B", "mapper": "159" }, "prg": [ { "$": { "name": "BANDAI '92 TARURUTO-2 PRG", "size": "128k", "crc": "42F75EAE", "sha1": "B3F1919E24879D918718F61D583B40926641B57F" } } ], "chr": [ { "$": { "name": "BANDAI '92 TARURUTO-2 CHR", "size": "128k", "crc": "786ED5CB", "sha1": "FEB578B0CC68F2932C489EE53E82444460BC8B48" } } ], "chip": [ { "$": { "type": "24C01" } }, { "$": { "type": "FCG-3" } } ] } ] } ] };
import { shallowMount } from '@vue/test-utils' import BCheckbox from '@components/checkbox/Checkbox' describe('BCheckbox', () => { it('is called', () => { const wrapper = shallowMount(BCheckbox) expect(wrapper.name()).toBe('BCheckbox') expect(wrapper.isVueInstance()).toBeTruthy() }) })
import React, { Component } from "react"; class Second extends Component { constructor(props) { super(props); this.state = {}; } render() { return ( <div> <h1>Second Page</h1> <button onClick={() => this.props.goBack(false)}>Go back</button> </div> ); } } export default Second;
/** * @author Charlie Calvert */ // Publisher PubSub.Publisher = (function() { 'use strict'; function Publisher() { $('#privateButton').click(privateMethod); var event = { message: 'Publisher constructor Called', acknowledge: function(value) { $('#response').html(value); } }; $.Topic('debug').publish(event); } var privateMethod = function() { $.Topic('debugDetail').publish( 'Publisher privateMethod called by Pub Sub' ); }; return Publisher; })(); $(document).ready(function() { 'use strict'; new PubSub.Subscriber(); new PubSub.Publisher(); });
import currencyConversion from './UTILS_CURRENCY_CONVERSION.handlebars'; export default { currencyConversion, };
var express = require('express'); var router = express.Router(); /* GET Log a user out */ router.get('/logout', (req, res) => { req.logout(); res.redirect('/'); }); module.exports = router;
/// <reference path="~/.ref/js/openiz-bre.js"/> /* * Copyright 2015-2018 Mohawk College of Applied Arts and Technology * * * 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. * * User: fyfej * Date: 2017-9-1 */ /// <reference path="~/.ref/js/openiz-model.js"/> OpenIZBre.AddBusinessRule("QuantityObservation", "BeforeInsert", /** * @param {OpenIZModel.QuantityObservation} observation */ function (observation) { var simplifiedObservation = observation; if (simplifiedObservation.$type != "QuantityObservation" || simplifiedObservation.typeConcept != 'a261f8cd-69b0-49aa-91f4-e6d3e5c612ed') return observation; // We need to suggest ... yay! This is the fun part var rct = simplifiedObservation.participation.RecordTarget.playerModel; var ageAtObservation = Math.round((simplifiedObservation.actTime - rct.dateOfBirth) / 8.64e7); // Gender concept var refData = null; switch (rct.genderConcept) { case "094941e9-a3db-48b5-862c-bc289bd7f86c": refData = JSON.parse(OpenIZ.App.loadDataAsset("weight-ranges-female.json")); break; case "f4e3a6bb-612e-46b2-9f77-ff844d971198": refData = JSON.parse(OpenIZ.App.loadDataAsset("weight-ranges-male.json")); break; } // get the age if (simplifiedObservation.value < refData[ageAtObservation].zMinus2) simplifiedObservation.interpretationConcept = '6188f821-261f-420c-9520-0de240a05661'; else if (simplifiedObservation.value > refData[ageAtObservation].zPlus2) simplifiedObservation.interpretationConcept = '3c4d6579-7496-4b44-aac1-18a714ff7a05'; else simplifiedObservation.interpretationConcept = '41d42abf-17ad-4144-bf97-ec3fd907f57d'; return simplifiedObservation; }); OpenIZBre.AddValidator("QuantityObservation", /** * @param {OpenIZModel.QuantityObservation} observation */ function (observation) { var simplifiedObservation = observation; if (simplifiedObservation.$type != "QuantityObservation" || simplifiedObservation.typeConcept != 'a261f8cd-69b0-49aa-91f4-e6d3e5c612ed') return []; var retVal = []; // Verify that the weight is not 0 if (observation.value == 0) retVal.push(new OpenIZBre.DetectedIssue("locale.encounter.cdss.weight.offscale0", OpenIZBre.IssuePriority.Error)); if (observation.value >= 50) retVal.push(new OpenIZBre.DetectedIssue("locale.encounter.cdss.weight.superscale", OpenIZBre.IssuePriority.Error)); if (observation.unitOfMeasure != 'a0a8d4db-db72-4bc7-9b8c-c07cef7bc796') retVal.push(new OpenIZBre.DetectedIssue("locale.encounter.cdss.weight.kgonly", OpenIZBre.IssuePriority.Error)); return retVal; });
'use strict' import { removeFromQueue } from '@utils/queue' export function processSeatsDepartures( seats, departures, currentSimulationTime, debug ) { const seatsDepartures = getSeatsDepartures(seats, currentSimulationTime) processNewSeatsDepartures(seatsDepartures, currentSimulationTime) printSeatsDepartures(seatsDepartures, debug) removeFromQueue(seats, seatsDepartures) return [...departures, ...seatsDepartures] } function getSeatsDepartures(seats, currentSimulationTime) { return seats.filter(seat => { const { simulation, simulationData } = seat const departureTime = simulation.seatArrivalTime + simulationData.seatTime if (currentSimulationTime >= departureTime) return seat }) } function processNewSeatsDepartures(seatsDepartures, currentSimulationTime) { const seatsDeparturesLength = seatsDepartures.length for (let i = 0; i < seatsDeparturesLength; i++) { seatsDepartures[i].simulation.seatDepartureTime = currentSimulationTime seatsDepartures[i].statusPipeline = 'unavailable' } } function printSeatsDepartures(seatsDepartures, debug) { if (!debug) return seatsDepartures.forEach(departure => { console.log(`A pessoa nº ${departure.id} desocupou a mesa`) }) }
/** * @class Ext.ux.LiveSearchGridPanel * @extends Ext.grid.Panel * <p>A GridPanel class with live search support.</p> * @author Nicolas Ferrero */ Ext.define('Ext.ux.LiveSearchGridPanel', { extend: 'Ext.grid.Panel', requires: [ 'Ext.toolbar.TextItem', 'Ext.form.field.Checkbox', 'Ext.form.field.Text', 'Ext.ux.statusbar.StatusBar' ], /** * @private * search value initialization */ searchValue: null, /** * @private * The row indexes where matching strings are found. (used by previous and next buttons) */ indexes: [], /** * @private * The row index of the first search, it could change if next or previous buttons are used. */ currentIndex: null, /** * @private * The generated regular expression used for searching. */ searchRegExp: null, /** * @private * Case sensitive mode. */ caseSensitive: false, /** * @private * Regular expression mode. */ regExpMode: false, /** * @cfg {String} matchCls * The matched string css classe. */ matchCls: 'x-livesearch-match', defaultStatusText: 'Nothing Found', // Component initialization override: adds the top and bottom toolbars and setup headers renderer. initComponent: function() { var me = this; me.tbar = ['Search',{ xtype: 'textfield', name: 'searchField', hideLabel: true, width: 200, listeners: { change: { fn: me.onTextFieldChange, scope: this, buffer: 100 } } }, { xtype: 'button', text: '<', tooltip: 'Find Previous Row', handler: me.onPreviousClick, scope: me },{ xtype: 'button', text: '>', tooltip: 'Find Next Row', handler: me.onNextClick, scope: me }, '-', { xtype: 'checkbox', hideLabel: true, margin: '0 0 0 4px', handler: me.regExpToggle, scope: me }, 'Regular expression', { xtype: 'checkbox', hideLabel: true, margin: '0 0 0 4px', handler: me.caseSensitiveToggle, scope: me }, 'Case sensitive']; me.bbar = Ext.create('Ext.ux.StatusBar', { defaultText: me.defaultStatusText, name: 'searchStatusBar' }); me.callParent(arguments); }, // afterRender override: it adds textfield and statusbar reference and start monitoring keydown events in textfield input afterRender: function() { var me = this; me.callParent(arguments); me.textField = me.down('textfield[name=searchField]'); me.statusBar = me.down('statusbar[name=searchStatusBar]'); }, // detects html tag tagsRe: /<[^>]*>/gm, // DEL ASCII code tagsProtect: '\x0f', // detects regexp reserved word regExpProtect: /\\|\/|\+|\\|\.|\[|\]|\{|\}|\?|\$|\*|\^|\|/gm, /** * In normal mode it returns the value with protected regexp characters. * In regular expression mode it returns the raw value except if the regexp is invalid. * @return {String} The value to process or null if the textfield value is blank or invalid. * @private */ getSearchValue: function() { var me = this, value = me.textField.getValue(); if (value === '') { return null; } if (!me.regExpMode) { value = value.replace(me.regExpProtect, function(m) { return '\\' + m; }); } else { try { new RegExp(value); } catch (error) { me.statusBar.setStatus({ text: error.message, iconCls: 'x-status-error' }); return null; } // this is stupid if (value === '^' || value === '$') { return null; } } var length = value.length, resultArray = [me.tagsProtect + '*'], i = 0, c; for(; i < length; i++) { c = value.charAt(i); resultArray.push(c); if (c !== '\\') { resultArray.push(me.tagsProtect + '*'); } } return resultArray.join(''); }, /** * Finds all strings that matches the searched value in each grid cells. * @private */ onTextFieldChange: function() { var me = this, count = 0; me.view.refresh(); // reset the statusbar me.statusBar.setStatus({ text: me.defaultStatusText, iconCls: '' }); me.searchValue = me.getSearchValue(); me.indexes = []; me.currentIndex = null; if (me.searchValue !== null) { me.searchRegExp = new RegExp(me.searchValue, 'g' + (me.caseSensitive ? '' : 'i')); me.store.each(function(record, idx) { var td = Ext.fly(me.view.getNode(idx)).down('td'), cell, matches, cellHTML; while(td) { cell = td.down('.x-grid-cell-inner'); matches = cell.dom.innerHTML.match(me.tagsRe); cellHTML = cell.dom.innerHTML.replace(me.tagsRe, me.tagsProtect); // populate indexes array, set currentIndex, and replace wrap matched string in a span cellHTML = cellHTML.replace(me.searchRegExp, function(m) { count += 1; if (Ext.Array.indexOf(me.indexes, idx) === -1) { me.indexes.push(idx); } if (me.currentIndex === null) { me.currentIndex = idx; } return '<span class="' + me.matchCls + '">' + m + '</span>'; }); // restore protected tags Ext.each(matches, function(match) { cellHTML = cellHTML.replace(me.tagsProtect, match); }); // update cell html cell.dom.innerHTML = cellHTML; td = td.next(); } }, me); // results found if (me.currentIndex !== null) { me.getSelectionModel().select(me.currentIndex); me.statusBar.setStatus({ text: count + ' matche(s) found.', iconCls: 'x-status-valid' }); } } // no results found if (me.currentIndex === null) { me.getSelectionModel().deselectAll(); } // force textfield focus me.textField.focus(); }, /** * Selects the previous row containing a match. * @private */ onPreviousClick: function() { var me = this, idx; if ((idx = Ext.Array.indexOf(me.indexes, me.currentIndex)) !== -1) { me.currentIndex = me.indexes[idx - 1] || me.indexes[me.indexes.length - 1]; me.getSelectionModel().select(me.currentIndex); } }, /** * Selects the next row containing a match. * @private */ onNextClick: function() { var me = this, idx; if ((idx = Ext.Array.indexOf(me.indexes, me.currentIndex)) !== -1) { me.currentIndex = me.indexes[idx + 1] || me.indexes[0]; me.getSelectionModel().select(me.currentIndex); } }, /** * Switch to case sensitive mode. * @private */ caseSensitiveToggle: function(checkbox, checked) { this.caseSensitive = checked; this.onTextFieldChange(); }, /** * Switch to regular expression mode * @private */ regExpToggle: function(checkbox, checked) { this.regExpMode = checked; this.onTextFieldChange(); } });
/* eslint-disable max-len */ /* Welcome to env.js! Here you will configure your Environment Variables scheme. You must not store environment dependent or sensitive data on your VCS, instead read it from Environment Variables. During development use a .env file to set these variables, it will be automatically parsed and used by envalid. More information at https://12factor.net/config -- IMPORTANT NOTE -- NEVER commit the .env file. If you need a starting point for developers use .env.example instead, but remember, NO SENSITIVE DATA. */ const envalid = require('envalid'); const { str, num } = envalid; /* For complete scheme options check https://github.com/af/envalid */ module.exports = envalid.cleanEnv(process.env, { /* Not obligatory variable because it has a default value */ NODE_ENV: str({ default: 'development' }), HOST: str({ default: '127.0.0.1', desc: 'The host to bind to. Set to 0.0.0.0 if you wish external access.' }), PORT: num({ default: 3000, desc: 'The port to start the server on.' }), /* Obligatory variable, your service won't start if not set on environment or .env file. */ COMPANY_NAME: str({ desc: 'Your company name.' }), });
import minQuantity from './min-quantity' // check inventory // true if no stock control or available in stock const inStock = product => !product.hasOwnProperty('quantity') || product.quantity >= minQuantity(product) /** * @method * @memberof ecomUtils * @name inStock * @description Check if item has stock equal or greater than minimum quantity. * @param {object} product - Body object (product or variation) * @returns {boolean} * * @example * // Full object ref.: https://developers.e-com.plus/docs/api/#/store/products/ * const product = { sku: 'TEST', name: 'Test', price: 10 } * ecomUtils.inStock(product) * // => true * product.quantity = 5 * ecomUtils.inStock(product) * // => true * product.min_quantity = 10 * ecomUtils.inStock(product) * // => false * ecomUtils.inStock({ quantity: 1, min_quantity: 2 }) * // => false * ecomUtils.inStock({ quantity: 0 }) * // => false * ecomUtils.inStock({ quantity: 1, min_quantity: 1 }) * // => true * ecomUtils.inStock({ quantity: 1 }) * // => true */ export default inStock
import React, {Fragment} from 'react'; import Col from "react-bootstrap/lib/Col"; import ResponsiveContainer from "recharts/lib/component/ResponsiveContainer"; import { Button, CustomInput, FormFeedback, FormText, Input, InputGroupAddon, InputGroupText, Label, Modal, ModalBody, ModalFooter, ModalHeader } from "reactstrap"; import Row from "react-bootstrap/lib/Row"; import BeatLoader from "react-spinners/BeatLoader"; import ReactTooltip from "react-tooltip"; import FormGroup from "react-bootstrap/lib/FormGroup"; import InputGroup from "react-bootstrap/lib/InputGroup"; import {ergToNano, isFloat} from "../../../utils/serializer"; import {friendlyAddress, getWalletAddress, isAddressValid, isWalletSaved, showMsg} from "../../../utils/helpers"; import {Form} from "react-bootstrap"; import {override} from "./index"; import SendModal from "../../Common/sendModal"; import {txFee} from "../../../utils/assembler"; import {sha256} from "js-sha256"; import {geArtworkP2s, issueArtworkNFT, uploadArtwork, videoType} from "../../../utils/issueArtwork"; import MyArtworks from "./myArtworks"; import Clipboard from "react-clipboard.js"; export default class VideoNFT extends React.Component { constructor(props) { super(props); this.state = { isOpen: false, sendModal: false, myArtworks: false, loading: false, checksum: null, ergAmount: "0.1", decimals: 0, description: "", tokenName: "", }; this.openModal = this.openModal.bind(this); this.closeModal = this.closeModal.bind(this); this.issue = this.issue.bind(this); this.okToIssue = this.okToIssue.bind(this); this.hashFile = this.hashFile.bind(this); this.setFileChecksum = this.setFileChecksum.bind(this); } openModal() { if (!isWalletSaved()) { showMsg('Configure the wallet first', false, true) return } this.setState({ toAddress: getWalletAddress(), isOpen: true, }) } closeModal() { this.setState({ isOpen: false, sendModal: false, myArtworks: false, loading: false, checksum: null, ergAmount: "0.1", decimals: 0, description: "", tokenName: "", advanced: false, upload: false, file: null }) } okToIssue() { return isAddressValid(this.state.toAddress) && !this.state.loading && this.state.checksum !== null } getErgAmount() { return ergToNano(this.state.ergAmount) + 10000000 } issue() { this.setState({loading: true}) geArtworkP2s(this.state.toAddress, this.getErgAmount(), this.state.checksum, videoType) .then(res => { uploadArtwork(this.state.file, true).then(uploadRes => { if (this.state.upload && !uploadRes) throw new Error("Could not upload the artwork. Make sure you have access to nft.storage") let description = this.state.description let tokenName = this.state.tokenName issueArtworkNFT(this.getErgAmount(), this.state.toAddress, tokenName, description, res.address, this.state.checksum, videoType, uploadRes) .then(regRes => { this.setState({ sendAddress: res.address, sendModal: true, }) }).catch(err => { showMsg("Could not register request to the assembler", true) }) .finally(() => { this.setState({loading: false}) }) }).catch(err => { showMsg(err.message, true) this.setState({loading: false}) }) }).catch(err => { showMsg("Could not contact the assembler service", true) this.setState({loading: false}) }) } setFileChecksum(checksum, file) { this.setState({loading: false, checksum: checksum, file: file}) } hashFile(event) { if (event.target.files.length === 0) { this.setState({checksum: null}) return } this.setState({loading: true}) let file = event.target.files[0] let reader = new FileReader() let setCS = this.setFileChecksum reader.onload = function (e) { let checksum = sha256(e.target.result) setCS(checksum, file) } reader.readAsArrayBuffer(file) } render() { return ( <Fragment> <SendModal close={() => { this.setState({sendModal: false}) this.closeModal() }} isOpen={this.state.sendModal} address={this.state.sendAddress} amount={(this.getErgAmount() + txFee) / 1e9} /> <MyArtworks close={() => this.setState({myArtworks: false})} isOpen={this.state.myArtworks} /> <Col md="4"> <div className="card mb-3 bg-premium-dark widget-chart card-border"> <div className="widget-chart-content text-white"> <div className="icon-wrapper rounded-circle opacity-7"> <div className="icon-wrapper-bg bg-dark opacity-6"/> <i className="lnr-film-play icon-gradient bg-warm-flame"/> </div> <div className="widget-numbers"> Video NFT </div> <ResponsiveContainer height={50}> <div className="widget-subheading"> To issue NFT representing a video artwork </div> </ResponsiveContainer> <ResponsiveContainer height={50}> <div className="widget-description text-warning"> <Button onClick={() => this.setState({myArtworks: true})} outline className="btn-outline-light m-2 border-0" color="primary" > <i className="nav-link-icon lnr-layers"> </i> <span>My Artworks</span> </Button> <Button onClick={this.openModal} outline className="btn-outline-light m-2 border-0" color="primary" > <i className="nav-link-icon lnr-plus-circle"> </i> <span>New</span> </Button> </div> </ResponsiveContainer> </div> </div> </Col> <Modal size="md" isOpen={this.state.isOpen} toggle={this.closeModal} > <ModalHeader toggle={this.props.close}> <ReactTooltip/> <span className="fsize-1 text-muted"> Issuing Video NFT </span> </ModalHeader> <ModalBody> <div> <Row> <BeatLoader css={override} size={8} color={'#0b473e'} loading={this.state.loading} /> </Row> <fieldset disabled={this.state.loading}> <Form> <FormGroup> <Label for="tokenName">Artwork Name</Label> <InputGroup> <Input value={this.state.tokenName} onChange={(e) => { this.setState({tokenName: e.target.value}) }} id="tokenName" /> </InputGroup> <FormText>artwork verbose name</FormText> </FormGroup> <FormGroup> <Label for="description">Artwork Description</Label> <InputGroup> <Input type="textarea" value={this.state.description} onChange={(e) => { this.setState({description: e.target.value}) }} id="description" /> </InputGroup> <FormText>description of your artwork; anything to represent it to others, e.g. link to the artwork</FormText> </FormGroup> <Row> <Col md='12'> <FormGroup> <Label for="exampleFile">Artwork File</Label> <Input onChange={this.hashFile} type="file" name="file" style={{overflowY: 'hidden'}} id="exampleFile"/> <FormText color="muted"> its checksum will be calculated locally. Also, it will be uploaded to IPFS </FormText> {this.state.checksum && <p>checksum <Clipboard component="b" data-clipboard-text={ this.state.checksum } onSuccess={() => showMsg('Copied!')} > {friendlyAddress(this.state.checksum, 5)} </Clipboard>{' '} </p>} </FormGroup> </Col> </Row> <CustomInput disabled={this.state.loading} type="checkbox" id="advanced" onChange={(e) => this.setState({advanced: e.target.checked})} label="Advanced configuration"/> {this.state.advanced && <div> <div className="divider text-muted bg-premium-dark opacity-1"/> <FormGroup> <Label for="ergAmount">ERG Amount</Label> <InputGroup> <Input type="text" value={ this.state.ergAmount } onChange={(e) => { if (isFloat(e.target.value)) { this.setState({ ergAmount: e.target.value, }); } }} id="ergAmount" /> <InputGroupAddon addonType="append"> <InputGroupText style={{backgroundColor: "white"}}> ERG </InputGroupText> </InputGroupAddon> <FormFeedback invalid> Must be at least 0.1 ERG </FormFeedback> </InputGroup> <FormText> amount of ERG to be sent with the issued NFT </FormText> </FormGroup> <FormGroup> <Label for="toAddress">Send To</Label> <Input style={{fontSize: "12px"}} value={this.state.toAddress} invalid={!isAddressValid(this.state.toAddress)} onChange={(e) => { this.setState({toAddress: e.target.value}) }} id="toAddress" /> <FormFeedback invalid> Invalid ergo address. </FormFeedback> <FormText>issued NFT and ERG amount will be sent to this address, any P2S address works</FormText> </FormGroup> </div>} </Form> </fieldset> </div> </ModalBody> <ModalFooter> <Button className="ml mr-2 btn-transition" color="secondary" onClick={this.closeModal} > Cancel </Button> <Button className="mr-2 btn-transition" color="secondary" disabled={!this.okToIssue()} // disabled={} onClick={this.issue} > Issue </Button> </ModalFooter> </Modal> </Fragment> ); } }
/* @flow strict-local */ import React, { PureComponent } from 'react'; import { Platform, View, TextInput, findNodeHandle } from 'react-native'; import type { LayoutEvent } from 'react-native/Libraries/Types/CoreEventTypes'; import TextInputReset from 'react-native-text-input-reset'; import type { ThemeData } from '../styles'; import { ThemeContext } from '../styles'; import type { Auth, Narrow, EditMessage, InputSelection, UserOrBot, Dispatch, Dimensions, CaughtUp, GetText, Subscription, Stream, VideoChatProvider, } from '../types'; import { connect } from '../react-redux'; import { withGetText } from '../boot/TranslationProvider'; import { addToOutbox, draftUpdate, fetchTopicsForStream, sendTypingStart, sendTypingStop, } from '../actions'; import * as api from '../api'; import { FloatingActionButton, Input } from '../common'; import { showErrorAlert } from '../utils/info'; import { IconDone, IconSend } from '../common/Icons'; import { isStreamNarrow, isStreamOrTopicNarrow, topicNarrow } from '../utils/narrow'; import ComposeMenu from './ComposeMenu'; import getComposeInputPlaceholder from './getComposeInputPlaceholder'; import NotSubscribed from '../message/NotSubscribed'; import AnnouncementOnly from '../message/AnnouncementOnly'; import MentionWarnings from './MentionWarnings'; import { getAuth, getIsAdmin, getSession, getLastMessageTopic, getActiveUsersByEmail, getCaughtUpForNarrow, getStreamInNarrow, getVideoChatProvider, } from '../selectors'; import { getIsActiveStreamSubscribed, getIsActiveStreamAnnouncementOnly, } from '../subscriptions/subscriptionSelectors'; import { getDraftForNarrow } from '../drafts/draftsSelectors'; import TopicAutocomplete from '../autocomplete/TopicAutocomplete'; import AutocompleteView from '../autocomplete/AutocompleteView'; import { getOwnEmail } from '../users/userSelectors'; type SelectorProps = {| auth: Auth, ownEmail: string, usersByEmail: Map<string, UserOrBot>, safeAreaInsets: Dimensions, isAdmin: boolean, isAnnouncementOnly: boolean, isSubscribed: boolean, draft: string, lastMessageTopic: string, caughtUp: CaughtUp, videoChatProvider: VideoChatProvider | null, stream: Subscription | {| ...Stream, in_home_view: boolean |}, |}; type Props = $ReadOnly<{| narrow: Narrow, editMessage: EditMessage | null, completeEditMessage: () => void, dispatch: Dispatch, ...SelectorProps, // From 'withGetText' _: GetText, |}>; type State = {| isMessageFocused: boolean, isTopicFocused: boolean, /** Almost the same as isMessageFocused || isTopicFocused ... except * debounced, to stay true while those flip from false/true to true/false * and back. */ isFocused: boolean, isMenuExpanded: boolean, topic: string, message: string, height: number, selection: InputSelection, |}; function randomInt(min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; } export const updateTextInput = (textInput: typeof TextInput | null, text: string): void => { if (textInput === null) { // Depending on the lifecycle events this function is called from, // this might not be set yet. return; } // Should be fixed in RN v0.63 (#4245); see // https://github.com/zulip/zulip-mobile/issues/4245#issuecomment-695104351. // $FlowFixMe textInput.setNativeProps({ text }); if (text.length === 0 && TextInputReset) { // React Native has problems with some custom keyboards when clearing // the input's contents. Force reset to make sure it works. TextInputReset.resetKeyboardInput(findNodeHandle(textInput)); } }; class ComposeBox extends PureComponent<Props, State> { static contextType = ThemeContext; context: ThemeData; messageInputRef = React.createRef<typeof TextInput>(); topicInputRef = React.createRef<typeof TextInput>(); // TODO: Type-check this, once we've adjusted our `react-redux` // wrapper to do the right thing. It should be // // mentionWarnings = React.createRef<typeof MentionWarnings>() // // but we need our `react-redux` wrapper to be aware of // `{ forwardRef: true }`, since we use that. mentionWarnings = React.createRef(); inputBlurTimeoutId: ?TimeoutID = null; state = { isMessageFocused: false, isTopicFocused: false, isFocused: false, isMenuExpanded: false, height: 20, topic: this.props.lastMessageTopic, message: this.props.draft, selection: { start: 0, end: 0 }, }; componentWillUnmount() { clearTimeout(this.inputBlurTimeoutId); this.inputBlurTimeoutId = null; } updateIsFocused = () => { this.setState(state => ({ ...state, isFocused: state.isMessageFocused || state.isTopicFocused, })); }; getCanSelectTopic = () => { const { editMessage, narrow } = this.props; if (editMessage) { return isStreamOrTopicNarrow(narrow); } if (!isStreamNarrow(narrow)) { return false; } return this.state.isFocused; }; setMessageInputValue = (message: string) => { updateTextInput(this.messageInputRef.current, message); this.handleMessageChange(message); }; setTopicInputValue = (topic: string) => { updateTextInput(this.topicInputRef.current, topic); this.handleTopicChange(topic); }; insertMessageTextAtCursorPosition = (text: string) => { const { message, selection } = this.state; this.setMessageInputValue( message.slice(0, selection.start) + text + message.slice(selection.end, message.length), ); }; insertVideoCallLinkAtCursorPosition = (url: string) => { const { _ } = this.props; const linkMessage = _('Click to join video call'); const linkText = `[${linkMessage}](${url})`; this.insertMessageTextAtCursorPosition(linkText); }; insertVideoCallLink = (videoChatProvider: VideoChatProvider) => { if (videoChatProvider.name === 'jitsi_meet') { // This is meant to align with the way the webapp generates jitsi video // call IDs. That logic can be found in the ".video_link" click handler // in static/js/compose.js. const videoCallId = randomInt(100000000000000, 999999999999999); const videoCallUrl = `${videoChatProvider.jitsiServerUrl}/${videoCallId}`; this.insertVideoCallLinkAtCursorPosition(videoCallUrl); } }; handleComposeMenuToggle = () => { this.setState(({ isMenuExpanded }) => ({ isMenuExpanded: !isMenuExpanded, })); }; handleLayoutChange = (event: LayoutEvent) => { this.setState({ height: event.nativeEvent.layout.height, }); }; handleTopicChange = (topic: string) => { this.setState({ topic, isMenuExpanded: false }); }; handleTopicAutocomplete = (topic: string) => { this.setTopicInputValue(topic); }; handleMessageChange = (message: string) => { this.setState({ message, isMenuExpanded: false }); const { dispatch, narrow } = this.props; dispatch(sendTypingStart(narrow)); dispatch(draftUpdate(narrow, message)); }; // See JSDoc on 'onAutocomplete' in 'AutocompleteView.js'. handleMessageAutocomplete = ( completedText: string, completion: string, lastWordPrefix: string, ) => { this.setMessageInputValue(completedText); if (lastWordPrefix === '@') { // https://github.com/eslint/eslint/issues/11045 // eslint-disable-next-line no-unused-expressions this.mentionWarnings.current?.handleMentionSubscribedCheck(completion); } }; handleMessageSelectionChange = (event: { +nativeEvent: { +selection: InputSelection } }) => { const { selection } = event.nativeEvent; this.setState({ selection }); }; handleMessageFocus = () => { this.setState((state, { lastMessageTopic }) => ({ ...state, topic: state.topic || lastMessageTopic, isMessageFocused: true, isFocused: true, isMenuExpanded: false, })); }; handleMessageBlur = () => { this.setState({ isMessageFocused: false, isMenuExpanded: false, }); // give a chance to the topic input to get the focus clearTimeout(this.inputBlurTimeoutId); this.inputBlurTimeoutId = setTimeout(this.updateIsFocused, 200); }; handleTopicFocus = () => { const { dispatch, narrow } = this.props; this.setState({ isTopicFocused: true, isFocused: true, isMenuExpanded: false, }); dispatch(fetchTopicsForStream(narrow)); }; handleTopicBlur = () => { this.setState({ isTopicFocused: false, isMenuExpanded: false, }); // give a chance to the message input to get the focus clearTimeout(this.inputBlurTimeoutId); this.inputBlurTimeoutId = setTimeout(this.updateIsFocused, 200); }; handleInputTouchStart = () => { this.setState({ isMenuExpanded: false }); }; getDestinationNarrow = (): Narrow => { const { narrow } = this.props; const topic = this.state.topic.trim(); return isStreamNarrow(narrow) ? topicNarrow(narrow[0].operand, topic || '(no topic)') : narrow; }; handleSend = () => { const { dispatch, narrow, caughtUp, _ } = this.props; const { message } = this.state; if (!caughtUp.newer) { showErrorAlert(_('Failed to send message')); return; } dispatch(addToOutbox(this.getDestinationNarrow(), message)); this.setMessageInputValue(''); if (this.mentionWarnings.current) { this.mentionWarnings.current.clearMentionWarnings(); } dispatch(sendTypingStop(narrow)); }; handleEdit = () => { const { auth, editMessage, completeEditMessage, _ } = this.props; if (!editMessage) { throw new Error('expected editMessage'); } const { message, topic } = this.state; const content = editMessage.content !== message ? message : undefined; const subject = topic !== editMessage.topic ? topic : undefined; if ((content !== undefined && content !== '') || (subject !== undefined && subject !== '')) { api.updateMessage(auth, { content, subject }, editMessage.id).catch(error => { showErrorAlert(_('Failed to edit message'), error.message); }); } completeEditMessage(); if (this.messageInputRef.current !== null) { // Should be fixed in RN v0.63 (#4245); see // https://github.com/zulip/zulip-mobile/issues/4245#issuecomment-695104351. // $FlowFixMe this.messageInputRef.current.blur(); } }; UNSAFE_componentWillReceiveProps(nextProps: Props) { if (nextProps.editMessage !== this.props.editMessage) { const topic = isStreamNarrow(nextProps.narrow) && nextProps.editMessage ? nextProps.editMessage.topic : ''; const message = nextProps.editMessage ? nextProps.editMessage.content : ''; this.setMessageInputValue(message); this.setTopicInputValue(topic); if (this.messageInputRef.current !== null) { // Should be fixed in RN v0.63 (#4245); see // https://github.com/zulip/zulip-mobile/issues/4245#issuecomment-695104351. // $FlowFixMe this.messageInputRef.current.focus(); } } } inputMarginPadding = { paddingHorizontal: 8, paddingVertical: Platform.select({ ios: 8, android: 2, }), }; styles = { wrapper: { flexShrink: 1, maxHeight: '60%', }, autocompleteWrapper: { position: 'absolute', bottom: 0, width: '100%', }, composeBox: { flexDirection: 'row', alignItems: 'flex-end', flexShrink: 1, }, composeText: { flex: 1, paddingVertical: 8, }, composeSendButton: { padding: 8, }, topicInput: { borderWidth: 0, borderRadius: 5, marginBottom: 8, ...this.inputMarginPadding, }, composeTextInput: { borderWidth: 0, borderRadius: 5, fontSize: 15, flexShrink: 1, ...this.inputMarginPadding, }, }; render() { const { isTopicFocused, isMenuExpanded, height, message, topic, selection } = this.state; const { ownEmail, narrow, usersByEmail, editMessage, safeAreaInsets, isAdmin, isAnnouncementOnly, isSubscribed, stream, videoChatProvider, } = this.props; const insertVideoCallLink = videoChatProvider !== null ? () => this.insertVideoCallLink(videoChatProvider) : null; if (!isSubscribed) { return <NotSubscribed narrow={narrow} />; } else if (isAnnouncementOnly && !isAdmin) { return <AnnouncementOnly />; } const placeholder = getComposeInputPlaceholder(narrow, ownEmail, usersByEmail); const style = { paddingBottom: safeAreaInsets.bottom, backgroundColor: 'hsla(0, 0%, 50%, 0.1)', }; return ( <View style={this.styles.wrapper}> {/* $FlowFixMe - `MentionWarnings` should use a type-checked `connect` */} <MentionWarnings narrow={narrow} stream={stream} ref={this.mentionWarnings} /> <View style={[this.styles.autocompleteWrapper, { marginBottom: height }]}> <TopicAutocomplete isFocused={isTopicFocused} narrow={narrow} text={topic} onAutocomplete={this.handleTopicAutocomplete} /> <AutocompleteView isFocused={this.state.isMessageFocused} selection={selection} text={message} onAutocomplete={this.handleMessageAutocomplete} /> </View> <View style={[this.styles.composeBox, style]} onLayout={this.handleLayoutChange}> <ComposeMenu destinationNarrow={this.getDestinationNarrow()} expanded={isMenuExpanded} insertVideoCallLink={insertVideoCallLink} onExpandContract={this.handleComposeMenuToggle} /> <View style={this.styles.composeText}> {this.getCanSelectTopic() && ( <Input style={[this.styles.topicInput, { backgroundColor: this.context.backgroundColor }]} underlineColorAndroid="transparent" placeholder="Topic" defaultValue={topic} selectTextOnFocus textInputRef={this.topicInputRef} onChangeText={this.handleTopicChange} onFocus={this.handleTopicFocus} onBlur={this.handleTopicBlur} onTouchStart={this.handleInputTouchStart} /> )} <Input multiline={!isMenuExpanded} style={[ this.styles.composeTextInput, { backgroundColor: this.context.backgroundColor }, ]} underlineColorAndroid="transparent" placeholder={placeholder} defaultValue={message} textInputRef={this.messageInputRef} onBlur={this.handleMessageBlur} onChangeText={this.handleMessageChange} onFocus={this.handleMessageFocus} onSelectionChange={this.handleMessageSelectionChange} onTouchStart={this.handleInputTouchStart} /> </View> <FloatingActionButton style={this.styles.composeSendButton} Icon={editMessage === null ? IconSend : IconDone} size={32} disabled={message.trim().length === 0} onPress={editMessage === null ? this.handleSend : this.handleEdit} /> </View> </View> ); } } export default connect<SelectorProps, _, _>((state, props) => ({ auth: getAuth(state), ownEmail: getOwnEmail(state), usersByEmail: getActiveUsersByEmail(state), safeAreaInsets: getSession(state).safeAreaInsets, isAdmin: getIsAdmin(state), isAnnouncementOnly: getIsActiveStreamAnnouncementOnly(state, props.narrow), isSubscribed: getIsActiveStreamSubscribed(state, props.narrow), draft: getDraftForNarrow(state, props.narrow), lastMessageTopic: getLastMessageTopic(state, props.narrow), caughtUp: getCaughtUpForNarrow(state, props.narrow), stream: getStreamInNarrow(state, props.narrow), videoChatProvider: getVideoChatProvider(state), }))(withGetText(ComposeBox));
const passport = require('passport'); const mongoose = require('mongoose'); const User = mongoose.model('User'); passport.use(User.createStrategy()); passport.serializeUser(User.serializeUser()); passport.deserializeUser(User.deserializeUser());
/** * 项目中的一些文件目录的配置 */ const path = require('path') module.exports = { // log 文件目录 logDir: path.resolve(__dirname, '../logs'), // 业务代码目录 projectsPath: path.resolve(__dirname, '../projects'), // 业务产生的数据的存放目录 projectsDataFolder: path.resolve(__dirname, '../projectsData'), front:{ view: path.resolve(__dirname, '../../', 'front/xiaowan/views'), libsDir: path.resolve(__dirname, '../../','front/libs'), publicDir:path.resolve(__dirname,'../..','front/xiaowan/assets'), distDir: path.resolve(__dirname, '../../', 'front/dist') } }
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/builtin/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _react = _interopRequireDefault(require("react")); var _createSvgIcon = _interopRequireDefault(require("./utils/createSvgIcon")); var _default = (0, _createSvgIcon.default)(_react.default.createElement(_react.default.Fragment, null, _react.default.createElement("path", { d: "M16 13h-3V3h-2v10H8l4 4 4-4zM4 19v2h16v-2H4z" })), 'VerticalAlignBottomSharp'); exports.default = _default;