text
stringlengths 2
1.05M
|
|---|
import React from 'react'
import styled from "@emotion/styled"
import {css, jsx} from '@emotion/react'
import {StaticImage} from "gatsby-plugin-image"
const Wrapper = styled("div")`
width: 100%;
min-height: 100vh;
`
const FirstInnerWrapper = styled("div")`
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
margin-top: 10%;
margin-bottom: 5%;
`
const SecodInnerWrapper = styled("div")`
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
height: auto;
`
const FirstTextbox = styled("div")`
text-align: center;
width: 42%;
margin-bottom: 10%;
`
const SecondTextbox = styled("div")`
width: 28%;
margin-left: 12%;
`
export default function EducationSection({currentLanguage}) {
return (
<Wrapper>
<FirstInnerWrapper>
<FirstTextbox>
<h2 css={css `margin-bottom: 5%;`}>{currentLanguage.educationHeader}</h2>
<p className="p-big">{currentLanguage.educationTextOne}</p>
</FirstTextbox>
<StaticImage
src="../../images/CityImageOne.png"
alt="The facade of a Church"
layout="constrained"
width={950}
height={633}
css={css `width: 50%; align-self: flex-start; position: relative; left: 12%;`}/>
</FirstInnerWrapper>
<SecodInnerWrapper>
<SecondTextbox>
<p className="p-big">{currentLanguage.educationTextTwo}</p>
</SecondTextbox>
<StaticImage
src="../../images/CityImageTwo.png"
alt="Another facade of a Church"
layout="constrained"
width={950}
height={633}
css={css `width: 35%; position: relative; bottom: 25vh; right: 12%;`}/>
</SecodInnerWrapper>
</Wrapper>
)
}
|
/**
* Copyright (c) 2014-2018, FrontEndART Software Ltd.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by FrontEndART Software Ltd.
* 4. Neither the name of FrontEndART Software Ltd. nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY FrontEndART Software Ltd. ''AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL FrontEndART Software Ltd. BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
SM.MetricLoader = new (function() { // Singleton object
SM.Subscribable.call(this); // inherit from SM.Subscribable
var self = this;
var config = {
reversedMetrics: [ "CLOC", "DLOC", "TCLOC", "TPDA", "TPUA", "CD", "TCD", "AD", "TAD"]
};
this.metrics = {}; //of Metric
this.metricsToGet = {}; // of Metric
this.callbacks = {}; //of Function
this.countdown = undefined; // Timeout object holder
this.ready = false; // becomes true when UG-s are loaded
/**
* This function handles smart data filling of a Metric object.
* If this function is called frequently , subsequent calls will
* be batched together into one web api call to the back-end. If the Metric
* was requested previously, it is served up from an inner cache, it will not
* be updated from the databasse in this case.
*
* @param metric The metric object. it has to at least have title,
* lang, and level data filled in.
* @param callback this function is called, when data for the given metric is
* successfully retrieved, and reciewes one argument which is
* the completed Metric object. It is called twice: once when
* baselines are loaded, and a second time when the metricinfo
* has loaded.
*/
this.requestMetric = function(metric, callback) {
// sanitize inputs
if (!metric instanceof SM.Metric) {
console.log("bad Arguments in MetricLoader.requestMetric");
}
callback = (callback && callback instanceof Function)? callback : undefined;
// collapse frequent requests into a single one.
// This also substitutes a common lock for this function and getEm.
// thus getEm wil veryvery likely not fire during the execution of
// requestMetric. (JS doesnt support multithreading => no native locks)
var resetCountdown = false;
if (this.countdown !== undefined) {
clearTimeout(this.countdown);
this.countdown = undefined;
resetCountdown = true;
}
if (this.metrics[metric.getUniqueKey()]) { // requested earlyer, fetched already -> returning that one
// fill data into supplied metric object.
Object.keys(this.metrics[metric.getUniqueKey()]).forEach(function(attr) {
if (self.metrics[metric.getUniqueKey()].hasOwnProperty(attr)) {
metric[attr] = self.metrics[metric.getUniqueKey()][attr];
}
});
if (callback) {
callback(this.metrics[metric.getUniqueKey()]);
}
} else if (this.metricsToGet[metric.getUniqueKey()]) { // requested earlyer, NOT fetched yet
// add callback as normally.
if (callback) {
this.callbacks[metric.getUniqueKey()].push(callback);
}
// add callback that fills data into supplied metric object.
this.callbacks[metric.getUniqueKey()].push(function(met) {
Object.keys(met).forEach(function(attr) {
if (met.hasOwnProperty(attr)) {
metric[attr] = met[attr];
}
});
});
resetCountdown = true;
} else { // first time this metric was requested, adding it to the to-get list
this.metricsToGet[metric.getUniqueKey()] = metric;
this.callbacks[metric.getUniqueKey()] = this.callbacks[metric.getUniqueKey()] || [];
if (callback) {
this.callbacks[metric.getUniqueKey()].push(callback);
}
resetCountdown = true;
}
if (resetCountdown) {
this.countdown = setTimeout(this.getEm, 100);
}
};
this.getEm = function() {
/* private -> eg it is not supposed to be callable from outside,
* but JS has no privacy... */
if (Object.keys(this.metricsToGet).length === 0) return; // nothing to do
if (!this.ready) {
setTimeout(this.getEm, 100);
return false; // try again later
}
var queriedMetrics = this.metricsToGet;
this.metricsToGet = {}; // Do not mix two batches if another request arrives.
var helper = {};
var parsedHTML = {};
SM.languages.forEach(function(lang, i) {
parsedHTML[lang.id] = $(lang.helpPage);
});
var uniqueKeys = Object.keys(queriedMetrics);
var query = [];
for (var i = 0; i < uniqueKeys.length; i++) {
metric = queriedMetrics[uniqueKeys[i]];
smid = metric.langID.toLowerCase();
// fix id inconsistencies
if (smid === "csharp") {
smid = "cs";
} else if (smid === "python") {
smid = "py";
} else if (smid === "javascript") {
smid = "js";
}
key = "sm." + smid + "." + metric.scope.toLowerCase()
+ ".baseline." + metric.title;
query.push(key);
helper[key] = metric.getUniqueKey();
}
var queryString = query.join(",");
a = window.SonarRequest.getJSON(location.origin + '/api/settings/values', {
component: SM.options.component.key,
keys: queryString
}).then(function(response) {
uniqueKeys.forEach(function(key) {
var instance = queriedMetrics[key];
// correct the direction for some metrics
if (config.reversedMetrics.indexOf(instance.title) != -1) {
instance.direction = 1;
}
});
response.settings.forEach(function(res) {
var met = queriedMetrics[helper[res.key]];
met.baseline = (res.value) // if its undefined -> 0
? res.value * 1
: undefined;
self.metrics[met.getUniqueKey()] = met;
self.callbacks[met.getUniqueKey()].forEach(function(callback) {
callback(met);
});
});
// now, after the baseline loaded, parse the metric description
Object.keys(queriedMetrics).forEach(function(key) {
met = queriedMetrics[key];
if (typeof self.metrics[met.getUniqueKey()] === "undefined") {
self.metrics[met.getUniqueKey()] = met;
}
var query = parsedHTML[met.langID].filter('h4#' + met.title);
if (query.length > 0) {
met.helpText = query[0].outerHTML;
var longname = query[0].innerHTML.split(" ");
longname.splice(longname.length-1, longname.length-1);
met.longName += longname.join(" ");
query.nextUntil('h4, h3, h2', '*').each(
function(a,t) {
met.helpText += t.outerHTML;
}
);
} else {
met.helpText = 'Description not found.';
}
self.callbacks[met.getUniqueKey()].forEach(function(callback) {
callback(met);
});
});
self.emit("finishedAllRequests");
});
};
this.getEm = this.getEm.bind(this);
x = SM.waitForNDo(
function() {
var bool = true;
SM.languages.forEach(function(lang) {
bool = bool && (SM.languages.helpPageLoaded[lang.id] == true);
});
return bool;
},
function() {
self.ready = true;
},
100
);
SM.bindFunctions(this);
})();
|
import React from 'react';
import styled from '@emotion/styled';
import { GatsbyImage, getImage } from 'gatsby-plugin-image';
import Iconos from './iconos';
import Layout from './Layout';
import { graphql } from 'gatsby';
export const query = graphql`
query($id: String!) {
allStrapiPropiedades(filter: {id: { eq: $id }}) {
nodes {
nombre
descripcion
wc
habitaciones
precio
estacionamiento
agentes {
nombre
email
telefono
}
imagen {
sharp: childImageSharp {
fluid(maxWidth: 1200) {
...GatsbyImageSharpFluid_withWebp
}
}
}
}
}
}
`;
const Propiedades = ({data: {allStrapiPropiedades: { nodes }}}) => {
return (
<Layout>
<h1>Propiedades</h1>
</Layout>
);
}
export default Propiedades;
|
define([
"skylark-threejs",
"../threex"
], function (
THREE,
threex
) {
'use strict';
var DeviceOrientationControls = function (object) {
var scope = this;
this.object = object;
this.object.rotation.reorder('YXZ');
this.enabled = true;
this.deviceOrientation = {};
this.screenOrientation = 0;
this.alphaOffset = 0;
var onDeviceOrientationChangeEvent = function (event) {
scope.deviceOrientation = event;
};
var onScreenOrientationChangeEvent = function () {
scope.screenOrientation = window.orientation || 0;
};
var setObjectQuaternion = function () {
var zee = new THREE.Vector3(0, 0, 1);
var euler = new THREE.Euler();
var q0 = new THREE.Quaternion();
var q1 = new THREE.Quaternion(-Math.sqrt(0.5), 0, 0, Math.sqrt(0.5));
return function (quaternion, alpha, beta, gamma, orient) {
euler.set(beta, alpha, -gamma, 'YXZ');
quaternion.setFromEuler(euler);
quaternion.multiply(q1);
quaternion.multiply(q0.setFromAxisAngle(zee, -orient));
};
}();
this.connect = function () {
onScreenOrientationChangeEvent();
if (window.DeviceOrientationEvent !== undefined && typeof window.DeviceOrientationEvent.requestPermission === 'function') {
window.DeviceOrientationEvent.requestPermission().then(function (response) {
if (response == 'granted') {
window.addEventListener('orientationchange', onScreenOrientationChangeEvent, false);
window.addEventListener('deviceorientation', onDeviceOrientationChangeEvent, false);
}
}).catch(function (error) {
console.error('THREE.DeviceOrientationControls: Unable to use DeviceOrientation API:', error);
});
} else {
window.addEventListener('orientationchange', onScreenOrientationChangeEvent, false);
window.addEventListener('deviceorientation', onDeviceOrientationChangeEvent, false);
}
scope.enabled = true;
};
this.disconnect = function () {
window.removeEventListener('orientationchange', onScreenOrientationChangeEvent, false);
window.removeEventListener('deviceorientation', onDeviceOrientationChangeEvent, false);
scope.enabled = false;
};
this.update = function () {
if (scope.enabled === false)
return;
var device = scope.deviceOrientation;
if (device) {
var alpha = device.alpha ? THREE.MathUtils.degToRad(device.alpha) + scope.alphaOffset : 0;
var beta = device.beta ? THREE.MathUtils.degToRad(device.beta) : 0;
var gamma = device.gamma ? THREE.MathUtils.degToRad(device.gamma) : 0;
var orient = scope.screenOrientation ? THREE.MathUtils.degToRad(scope.screenOrientation) : 0;
setObjectQuaternion(scope.object.quaternion, alpha, beta, gamma, orient);
}
};
this.dispose = function () {
scope.disconnect();
};
this.connect();
};
return threex.controls.DeviceOrientationControls = DeviceOrientationControls;
});
|
function solve(input) {
let string = input.shift();
let command = input.shift();
let charsToSumUpper = '';
let charsToSumLower = '';
for (const char of string) {
let check = isUpper(char);
if (check) {
charsToSumUpper += char;
} else {
let lower = isLower(char);
if(lower){
charsToSumLower += char;
}
}
}
let result = 0;
if(command === 'UPPERCASE'){
for (const char of charsToSumUpper) {
let sumator = char.charCodeAt(0);
result += sumator;
}
}else if(command === 'LOWERCASE'){
for (const char of charsToSumLower) {
let sumator = char.charCodeAt(0);
result += sumator;
}
}
console.log(`The total sum is: ${result}`);
function isUpper(char) {
let result = char.charCodeAt(0);
return result >= 65 && result <= 90 ? true : false;
}
function isLower(char){
let result = char.charCodeAt(0);
return result >= 97 && result <= 122? true : false;
}
}
solve([ 'HelloFromMyAwes45212omePROGRAM', 'LOWERCASE', '' ]
);
|
module.exports = {
env: {
// server-wallet runs in Node.JS environments
node: true,
// We expect to be able to use Promise and Set
es6: true,
},
plugins: ['jest', 'import', 'unicorn'],
extends: [
'../../.eslintrc.js',
'plugin:jest/recommended',
'plugin:jest/style',
'plugin:import/errors',
'plugin:import/warnings',
],
rules: {
// It's annoying having to deal with these jest rules
'jest/no-disabled-tests': 'off',
'jest/expect-expect': 'off',
'no-process-env': 'error',
'unicorn/filename-case': [
'error',
// Enforce kebab casing for file names except for generated seed/migration files
{case: 'kebabCase', ignore: [/^\d_.*_seeds\.ts$/, /^\d{14}_.*\.ts$/]},
],
},
overrides: [
{
// process.env allowed in some files
files: ['src/config.ts', 'scripts/*', 'e2e-test/jest/*'],
rules: {'no-process-env': 'off'},
},
{
files: ['**/*.ts'],
extends: ['plugin:import/typescript'],
rules: {
// We use snake case for some PostgreSQL / Objection client library key names
'@typescript-eslint/camelcase': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-unused-vars': [1, {argsIgnorePattern: '^_'}],
},
},
],
};
|
import { login, logout, getInfo } from '@/api/user'
import { getToken, setToken, removeToken } from '@/utils/auth'
import router, { resetRouter } from '@/router'
const state = {
token: getToken(),
name: '',
avatar: '',
introduction: '',
roles: []
}
const mutations = {
SET_TOKEN: (state, token) => {
state.token = token
},
SET_INTRODUCTION: (state, introduction) => {
state.introduction = introduction
},
SET_NAME: (state, name) => {
state.name = name
},
SET_AVATAR: (state, avatar) => {
state.avatar = avatar
},
SET_ROLES: (state, roles) => {
state.roles = roles
}
}
const actions = {
// user login
login({ commit }, userInfo) {
const { username, password, code, verify } = userInfo
return new Promise((resolve, reject) => {
login({ username: username.trim(), password: password, code: code, verify: verify }).then(response => {
commit('SET_TOKEN', response.token)
setToken(response.token)
resolve()
}).catch(error => {
reject(error)
})
})
},
// get user info
getInfo({ commit, state }) {
return new Promise((resolve, reject) => {
getInfo(state.token).then(response => {
const { data } = response
if (!data) {
reject('Verification failed, please Login again.')
}
const { roles, name, avatar, introduction } = data
// roles must be a non-empty array
if (!roles || roles.length <= 0) {
reject('getInfo: roles must be a non-null array!')
}
commit('SET_ROLES', roles)
commit('SET_NAME', name)
commit('SET_AVATAR', avatar)
commit('SET_INTRODUCTION', introduction)
resolve(data)
}).catch(error => {
reject(error)
})
})
},
// user logout
logout({ commit, state, dispatch }) {
return new Promise((resolve, reject) => {
logout(state.token).then(() => {
commit('SET_TOKEN', '')
commit('SET_ROLES', [])
removeToken()
resetRouter()
dispatch('tagsView/delAllViews', null, { root: true })
resolve()
}).catch(error => {
reject(error)
})
})
},
// remove token
resetToken({ commit }) {
return new Promise(resolve => {
commit('SET_TOKEN', '')
commit('SET_ROLES', [])
removeToken()
resolve()
})
},
// dynamically modify permissions
async changeRoles({ commit, dispatch }, role) {
const token = role + '-token'
commit('SET_TOKEN', token)
setToken(token)
const { roles } = await dispatch('getInfo')
resetRouter()
// generate accessible routes map based on roles
const accessRoutes = await dispatch('permission/generateRoutes', roles, { root: true })
// dynamically add accessible routes
router.addRoutes(accessRoutes)
// reset visited views and cached views
dispatch('tagsView/delAllViews', null, { root: true })
}
}
export default {
namespaced: true,
state,
mutations,
actions
}
|
/**
* Represents an Ext JS application, which is typically a single page app using a
* {@link Ext.container.Viewport Viewport}.
*
* An application consists of one or more Views. The behavior of a View is managed by its
* corresponding {@link Ext.app.ViewController ViewController} and {@link Ext.app.ViewModel
* ViewModel}.
*
* Global activities are coordinated by {@link Ext.app.Controller Controllers} which are
* ultimately instantiated by an instance of this (or a derived) class.
*
* Ext.application({
* name: 'MyApp',
*
* // An instance of this view is created and set as the Viewport:
* autoCreateViewport: 'MyApp.view.Main'
* });
*
* This does several things. First it creates a global variable called 'MyApp' - all of
* your Application's classes (such as its Models, Views and Controllers) will reside under
* this single namespace, which drastically lowers the chances of colliding global variables.
*
* The MyApp global will also have a getApplication method to get a reference to the current
* application:
*
* var app = MyApp.getApplication();
*
* # Telling Application about the rest of the app
*
* Because an Ext.app.Application represents an entire app, we should tell it about the other
* parts of the app - namely the Models, Views and Controllers that are bundled with the application. Let's say we have a blog management app; we
* might have Models and Controllers for Posts and Comments, and Views for listing, adding and editing Posts and Comments.
* Here's how we'd tell our Application about all these things:
*
* Ext.application({
* name: 'Blog',
*
* models: ['Post', 'Comment'],
*
* controllers: ['Posts', 'Comments'],
*
* launch: function() {
* ...
* }
* });
*
* Note that we didn't actually list the Views directly in the Application itself. This is because Views are managed by
* Controllers, so it makes sense to keep those dependencies there. The Application will load each of the specified
* Controllers using the pathing conventions laid out in the [application architecture guide][mvc] - in this case
* expecting the controllers to reside in app/controller/Posts.js and app/controller/Comments.js. In turn, each
* Controller simply needs to list the Views it uses and they will be automatically loaded. Here's how our Posts
* controller like be defined:
*
* Ext.define('MyApp.controller.Posts', {
* extend: 'Ext.app.Controller',
* views: ['posts.List', 'posts.Edit'],
*
* //the rest of the Controller here
* });
*
* Because we told our Application about our Models and Controllers, and our Controllers about their Views, Ext JS will
* automatically load all of our app files for us. This means we don't have to manually add script tags into our html
* files whenever we add a new class, but more importantly it enables us to create a minimized build of our entire
* application using Sencha Cmd.
*
* # Deriving from Ext.app.Application
*
* Typically, applications do not derive directly from Ext.app.Application. Rather, the
* configuration passed to `Ext.application` mimics what you might do in a derived class.
* In some cases, however, it can be desirable to share logic by using a derived class
* from `Ext.app.Application`.
*
* Derivation works as you would expect, but using the derived class should still be the
* job of the `Ext.application` method.
*
* Ext.define('MyApp.app.Application', {
* extend: 'Ext.app.Application',
* name: 'MyApp',
* ...
* });
*
* Ext.application('MyApp.app.Application');
*
* For more information about writing Ext JS applications, please see the [application architecture guide][mvc].
*
* [mvc]: #/guide/application_architecture
*/
Ext.define('Ext.app.Application', {
extend: 'Ext.app.Controller',
requires : [
'Ext.tip.QuickTipManager',
'Ext.util.History',
'Ext.util.MixedCollection'
],
isApplication: true,
/**
* @cfg {String} extend A class name to use with the `Ext.application` call. The class must also extend {@link Ext.app.Application}.
*
* Ext.define('MyApp.Application', {
* extend : 'Ext.app.Application',
*
* launch : function() {
* Ext.direct.Manager.addProvider(Ext.app.REMOTING_API);
* }
* });
*
* Ext.application({
* extend : 'MyApp.Application'
* });
*/
/**
* @cfg {String/String[]} controllers
* Names of controllers that the app uses.
*/
/**
* @cfg {Object} scope
* The scope to execute the {@link #launch} function in. Defaults to the Application instance.
*/
scope: undefined,
/**
* @cfg {String/String[]} [namespaces]
*
* The list of namespace prefixes used in the application to resolve dependencies
* like Views and Stores:
*
* Ext.application({
* name: 'MyApp',
*
* namespaces: ['Common.code'],
*
* controllers: [ 'Common.code.controller.Foo', 'Bar' ]
* });
*
* Ext.define('Common.code.controller.Foo', {
* extend: 'Ext.app.Controller',
*
* models: ['Foo'], // Loads Common.code.model.Foo
* views: ['Bar'] // Loads Common.code.view.Bar
* });
*
* Ext.define('MyApp.controller.Bar', {
* extend: 'Ext.app.Controller',
*
* models: ['Foo'], // Loads MyApp.model.Foo
* views: ['Bar'] // Loads MyApp.view.Bar
* });
*
* You don't need to include main namespace (MyApp), it will be added to the list
* automatically.
*/
namespaces: [],
/**
* @cfg {Object} paths
* Additional load paths to add to Ext.Loader.
* See {@link Ext.Loader#paths} config for more details.
*/
paths: null,
/**
* @cfg {String} appFolder
* The path to the directory which contains all application's classes.
* This path will be registered via {@link Ext.Loader#setPath} for the namespace specified
* in the {@link #name name} config.
*/
appFolder: 'app',
// NOTE - this config has to be processed by Ext.application
config: {
/**
* @cfg {String} name
* The name of your application. This will also be the namespace for your views, controllers
* models and stores. Don't use spaces or special characters in the name. **Application name
* is mandatory**.
*/
name: '',
/**
* @cfg {Boolean} enableQuickTips
* True to automatically set up Ext.tip.QuickTip support.
*/
enableQuickTips: true,
/**
* @cfg {String} appProperty
* The name of a property to be assigned to the main namespace to gain a reference to
* this application. Can be set to an empty value to prevent the reference from
* being created
*
* Ext.application({
* name: 'MyApp',
* appProperty: 'myProp',
*
* launch: function() {
* console.log(MyApp.myProp === this);
* }
* });
*/
appProperty: 'app',
/**
* @cfg {Boolean/String} [autoCreateViewport=false]
* Set to `true` to automatically load and instantiate `AppName.view.Viewport`
* before firing the launch function. Otherwise this is the name of the view to
* create and apply the `viewport` plugin.
*
* @cmd-auto-dependency { directRef: "Ext.container.plugin.Viewport" }
*
*/
autoCreateViewport: false,
/**
* @cfg {String} [defaultToken=null] The default token to be used at application launch
* if one is not present. Often this is set to something like `'home'`.
*/
defaultToken : null
},
onClassExtended: function(cls, data, hooks) {
var Controller = Ext.app.Controller,
proto = cls.prototype,
requires = [],
viewportClass = data.autoCreateViewport,
onBeforeClassCreated, paths, namespace, ns, appFolder;
// Ordinary inheritance does not work here so we collect
// necessary data from current class data and its superclass
namespace = data.name || cls.superclass.name;
appFolder = data.appFolder || cls.superclass.appFolder;
if (namespace) {
data.$namespace = namespace;
Ext.app.addNamespaces(namespace);
}
if (data.namespaces) {
Ext.app.addNamespaces(data.namespaces);
}
if (!data['paths processed']) {
if (namespace && appFolder) {
Ext.Loader.setPath(namespace, appFolder);
}
paths = data.paths;
if (paths) {
for (ns in paths) {
if (paths.hasOwnProperty(ns)) {
Ext.Loader.setPath(ns, paths[ns]);
}
}
}
}
else {
delete data['paths processed'];
}
if (viewportClass) {
//<debug>
if (!namespace) {
Ext.Error.raise("[Ext.app.Application] Can't resolve namespace for " +
data.$className + ", did you forget to specify 'name' property?");
}
//</debug>
if (viewportClass === true) {
viewportClass = 'Viewport';
} else {
requires.push('Ext.container.plugin.Viewport');
}
Controller.processDependencies(proto, requires, namespace, 'view', viewportClass);
}
// Any "requires" also have to be processed before we fire up the App instance.
if (requires.length) {
onBeforeClassCreated = hooks.onBeforeCreated;
hooks.onBeforeCreated = function(cls, data) {
var args = Ext.Array.clone(arguments);
Ext.require(requires, function () {
return onBeforeClassCreated.apply(this, args);
});
};
}
},
/**
* Creates new Application.
* @param {Object} [config] Config object.
*/
constructor: function(config) {
var me = this;
Ext.app.route.Router.application = me;
me.callParent(arguments);
//<debug>
if (Ext.isEmpty(me.getName())) {
Ext.Error.raise("[Ext.app.Application] Name property is required");
}
//</debug>
me.doInit(me);
me.initNamespace();
me.initControllers();
me.onBeforeLaunch();
me.finishInitControllers();
},
initNamespace: function() {
var me = this,
appProperty = me.getAppProperty(),
ns;
ns = Ext.namespace(me.getName());
if (ns) {
ns.getApplication = function() {
return me;
};
if (appProperty) {
if (!ns[appProperty]) {
ns[appProperty] = me;
}
//<debug>
else if (ns[appProperty] !== me) {
Ext.log.warn('An existing reference is being overwritten for ' + name + '.' + appProperty +
'. See the appProperty config.'
);
}
//</debug>
}
}
},
initControllers: function() {
var me = this,
controllers = Ext.Array.from(me.controllers);
me.controllers = new Ext.util.MixedCollection();
for (var i = 0, ln = controllers.length; i < ln; i++) {
me.getController(controllers[i]);
}
},
finishInitControllers: function() {
var me = this,
controllers, i, l;
controllers = me.controllers.getRange();
for (i = 0, l = controllers.length; i < l; i++) {
controllers[i].finishInit(me);
}
},
/**
* @method
* @template
* Called automatically when the page has completely loaded. This is an empty function that should be
* overridden by each application that needs to take action on page load.
* @param {String} profile The detected application profile
* @return {Boolean} By default, the Application will dispatch to the configured startup controller and
* action immediately after running the launch function. Return false to prevent this behavior.
*/
launch: Ext.emptyFn,
/**
* @private
*/
onBeforeLaunch: function() {
var me = this,
History = Ext.util.History,
token = History.getToken(),
defaultToken = me.getDefaultToken(),
controllers, c, cLen, controller;
if (me.getEnableQuickTips()) {
me.initQuickTips();
}
if (me.getAutoCreateViewport()) {
me.initViewport();
}
me.launch.call(me.scope || me);
me.launched = true;
me.fireEvent('launch', me);
controllers = me.controllers.items;
cLen = controllers.length;
for (c = 0; c < cLen; c++) {
controller = controllers[c];
controller.onLaunch(me);
}
if (token) {
me.redirectTo(token, true);
} else if (defaultToken) {
History.add(defaultToken);
}
if (!History.ready) {
History.init();
}
},
getModuleClassName: function(name, kind) {
return Ext.app.Controller.getFullName(name, kind, this.getName()).absoluteName;
},
getViewportName: function () {
var name = null,
autoCreate = this.getAutoCreateViewport();
if (autoCreate) {
name = (autoCreate === true) ? 'Viewport' : autoCreate;
}
return name;
},
initQuickTips: function() {
Ext.tip.QuickTipManager.init();
},
initViewport: function() {
var viewport = this.getView(this.getViewportName()),
config;
if (viewport) {
if (!viewport.prototype.isViewport) {
config = {
plugins: 'viewport'
};
}
this.viewport = viewport.create(config);
}
},
/**
* Create an instance of a controller by name.
* @param {String} name The name of the controller. For a controller with the
* full class name `MyApp.controller.Foo`, the name parameter should be `Foo`.
* If the controller already exists, it will be returned.
*
* @return {Ext.app.Controller} controller
*/
createController: function(name) {
return this.getController(name);
},
/**
* Destroys a controller, any listeners are unbound.
* @param {String/Ext.app.Controller} controller The controller
*/
destroyController: function(controller) {
if (typeof controller === 'string') {
controller = this.getController(controller, true);
}
Ext.destroy(controller);
},
getController: function(name, /* private */ preventCreate) {
var me = this,
controllers = me.controllers,
className, controller, len, i, c, all;
controller = controllers.get(name);
// In a majority of cases, the controller id will be the same as the name.
// However, when a controller is manually given an id, it will be keyed
// in the collection that way. So if we don't find it, we attempt to loop
// over the existing controllers and find it by classname
if (!controller) {
all = controllers.items;
for (i = 0, len = all.length; i < len; ++i) {
c = all[i];
className = c.getModuleClassName();
if (className && className === name) {
controller = c;
break;
}
}
}
if (!controller && !preventCreate) {
className = me.getModuleClassName(name, 'controller');
controller = Ext.create(className, {
application: me,
moduleClassName: name
});
controllers.add(controller);
if (me._initialized) {
controller.doInit(me);
}
}
return controller;
},
/**
* Unregister a controller from the application.
* @private
* @param {Ext.app.Controller} controller The controller to unregister
*/
unregister: function(controller) {
this.controllers.remove(controller);
},
// Inherit docs
getApplication: function() {
return this;
},
// Inherit docs
destroy: function(destroyRefs){
var me = this,
controllers = me.controllers,
ns = Ext.namespace(me.getName()),
appProp = me.getAppProperty();
Ext.destroy(me.viewport);
if (controllers) {
controllers.each(function(controller){
controller.destroy(destroyRefs, true);
});
}
me.controllers = null;
me.callParent([destroyRefs, true]);
// Clean up any app reference
if (ns && ns[appProp] === me) {
delete ns[appProp];
}
}
});
|
import React, {
Component
}
from 'react';
import {Row, Col, ContainerFluid} from './Wrappers';
import AbilityScores from './AbilityScores';
import CharName from './CharName';
import SkillList from './SkillList';
import {
getInitialState
}
from './data';
import {
map,
get,
find,
matches,
}
from 'lodash/fp';
import {
abilityScores,
skills,
incAbility,
decAbility,
changeSkillsChosen,
savingThrows,
calcAC,
getModifier,
randomizeScores,
randomLetter,
randomDigit,
baseSkillLevel
}
from './calculations';
import './App.css';
class App extends Component {
constructor() {
super();
this.state = {
...getInitialState(),
skillsChosen: [],
name: 'Default Name',
playerName: ''
};
}
name = map(get('name'))
get abilityScores() {
return abilityScores(this.state.abilities);
}
get skills() {
return skills(this.state.skills, {}.skills);
}
handleAddAbilityScore = (name) => {
this.setState({
abilities: incAbility(name, this.state.abilities)
});
}
handleRemoveAbilityScore = (name) => {
this.setState({
abilities: decAbility(name, this.state.abilities)
});
}
handleRandomizeScores = () => {
this.setState({
abilities: randomizeScores(this.state.abilities)
});
}
handleAddSkill = (skillName) => {
const {skills, skillsChosen, classChosen} = this.state;
const newSkillsChosen = changeSkillsChosen(skillsChosen, skills, skillName);
this.setState({
skillsChosen: newSkillsChosen
});
}
handleRemoveSkill = (skillName) => {
const {skills, skillsChosen, classChosen} = this.state;
const newSkillsChosen = changeSkillsChosen(skillsChosen, skills, skillName);
this.setState({
skillsChosen: newSkillsChosen
});
}
handleSkillChecked = (skillName) => {
const {skills, skillsChosen, classChosen} = this.state;
const newSkillsChosen = changeSkillsChosen(skillsChosen, skills, skillName);
const newSkills = baseSkillLevel(skillsChosen, skills, skillName);
this.setState({
skillsChosen: newSkillsChosen
});
this.setState({
skills: newSkills
});
}
handleNewClassicName = () => {
var letterCount = 1
var digitCount = 4
this.genName(letterCount, digitCount)
}
handleNewName = () => {
var letterCount = 3
var digitCount = 5
this.genName(letterCount, digitCount)
}
genName = (letterCount, digitCount) => {
var name = "";
for (var i=0;i<letterCount;i++) {
name += randomLetter();
}
name += "-";
var number = "";
for (var i=0;i<digitCount;i++) {
number += randomDigit();
}
number = parseInt(number, 10);
name += number;
this.setState({
name: name
})
}
render() {
return (
<div className="App">
<header>
<h1>SWN Character Sheet</h1>
</header>
<ContainerFluid>
<Row>
<Col sm='4'>
<CharName
name={this.state.name}
onNewClassicName={this.handleNewClassicName}
onNewName={this.handleNewName}
/>
<AbilityScores
abilityScores={this.abilityScores}
onAddAbilityScore={this.handleAddAbilityScore}
onRemoveAbilityScore={this.handleRemoveAbilityScore}
onRandomizeScores={this.handleRandomizeScores}
/>
</Col>
<Col sm='4'>
<SkillList skills={this.skills}
skillsChosen={this.state.skillsChosen}
full={this.state.skillsFull}
onSkillChecked={this.handleSkillChecked}
/>
</Col>
</Row>
</ContainerFluid>
</div>
);
}
}
export default App;
|
module.exports = function (Schema) {
/*<define>*/
/**
* 创建联合类型
*
* @param {number} size 联合类型总大小
* @param {Object} schema 联合类型中出现的字段
* @return {Schema} 返回联合类型
'''<example>'''
* @example unionCreator():base
```js
var _ = jpacks;
var _schema = _.union({
length: _.byte,
content: _.shortString
}, 20);
console.log(_.stringify(_schema));
// > union({length:'uint8',content:string('uint8')},20)
var buffer = _.pack(_schema, {
content: '0123456789'
});
console.log(buffer.join(' '));
// > 10 48 49 50 51 52 53 54 55 56 57 0 0 0 0 0 0 0 0 0
console.log(JSON.stringify(_.unpack(_schema, buffer)));
// > {"length":10,"content":"0123456789"}
```
'''</example>'''
*/
function unionCreator(schemas, size) {
/*<safe>*/
if (typeof schemas !== 'object') {
throw new Error('Parameter "schemas" must be a object type.');
}
if (schemas instanceof Schema) {
throw new Error('Parameter "schemas" cannot be a Schema object.');
}
/*</safe>*/
var keys = Object.keys(schemas);
return new Schema({
unpack: function _unpack(buffer, options, offsets) {
var beginOffset = offsets[0];
var result = {};
keys.forEach(function (key) {
offsets[0] = beginOffset;
result[key] = Schema.unpack(schemas[key], buffer, options, offsets);
});
offsets[0] += size;
return result;
},
pack: function _pack(value, options, buffer) {
var arrayBuffer = new ArrayBuffer(size);
var uint8Array = new Uint8Array(arrayBuffer);
keys.forEach(function (key) {
if (typeof value[key] === 'undefined') {
return;
}
var temp = [];
Schema.pack(schemas[key], value[key], options, temp);
uint8Array.set(temp);
});
[].push.apply(buffer, uint8Array);
},
size: size,
args: arguments,
namespace: 'union'
});
}
var union = Schema.together(unionCreator, function (fn, args) {
fn.namespace = 'union';
fn.args = args;
});
Schema.register('union', union);
/*</define>*/
};
|
var express = require('express');
var app = express();
var axios = require("axios");
var cheerio = require("cheerio");
var cors = require('cors');
const config = require('./config.json');
const Redis = require('ioredis');
const csv = require('csvtojson')
let basePathHistory = "https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/";
app.use(cors());
// create redis instance :O
const redis = new Redis(config.redis.host, {
password: config.redis.password
})
const keys = config.keys
var getAll = async () => {
let response;
try {
response = await axios.get("https://www.worldometers.info/coronavirus/");
if (response.status !== 200) {
console.log("ERROR");
}
} catch (err) {
return null;
}
// to store parsed data
const result = {};
// get HTML and parse death rates
const html = cheerio.load(response.data);
html(".maincounter-number").filter((i, el) => {
let count = el.children[0].next.children[0].data || "0";
count = parseInt(count.replace(/,/g, "") || "0", 10);
// first one is
if (i === 0) {
result.cases = count;
} else if (i === 1) {
result.deaths = count;
} else {
result.recovered = count;
}
});
result.updated = Date.now()
const string = JSON.stringify(result);
redis.set(keys.all, string);
console.log("Updated The Cases");
}
var getCountries = async () => {
let response;
try {
response = await axios.get("https://www.worldometers.info/coronavirus/");
if (response.status !== 200) {
console.log("Error", response.status);
}
} catch (err) {
return null;
}
// to store parsed data
const result = [];
// get HTML and parse death rates
const html = cheerio.load(response.data);
const countriesTable = html("table#main_table_countries_today");
const countriesTableCells = countriesTable
.children("tbody")
.children("tr")
.children("td");
// NOTE: this will change when table format change in website
const totalColumns = 12;
const countryColIndex = 0;
const casesColIndex = 1;
const todayCasesColIndex = 2;
const deathsColIndex = 3;
const todayDeathsColIndex = 4;
const curedColIndex = 5;
const activeColIndex = 6;
const criticalColIndex = 7;
const casesPerOneMillionColIndex = 8;
const deathsPerOneMillionColIndex = 9;
// minus totalColumns to skip last row, which is total
for (let i = 0; i < countriesTableCells.length - totalColumns; i += 1) {
const cell = countriesTableCells[i];
// get country
if (i % totalColumns === countryColIndex) {
let country =
cell.children[0].data ||
cell.children[0].children[0].data ||
// country name with link has another level
cell.children[0].children[0].children[0].data ||
cell.children[0].children[0].children[0].children[0].data ||
"";
country = country.trim();
if (country.length === 0) {
// parse with hyperlink
country = cell.children[0].next.children[0].data || "";
}
result.push({
country
});
}
// get cases
if (i % totalColumns === casesColIndex) {
let cases = cell.children.length != 0 ? cell.children[0].data : "";
result[result.length - 1].cases = parseInt(
cases.trim().replace(/,/g, "") || "0",
10
);
}
// get today cases
if (i % totalColumns === todayCasesColIndex) {
let cases = cell.children.length != 0 ? cell.children[0].data : "";
result[result.length - 1].todayCases = parseInt(
cases.trim().replace(/,/g, "") || "0",
10
);
}
// get deaths
if (i % totalColumns === deathsColIndex) {
let deaths = cell.children.length != 0 ? cell.children[0].data : "";
result[result.length - 1].deaths = parseInt(
deaths.trim().replace(/,/g, "") || "0",
10
);
}
// get today deaths
if (i % totalColumns === todayDeathsColIndex) {
let deaths = cell.children.length != 0 ? cell.children[0].data : "";
result[result.length - 1].todayDeaths = parseInt(
deaths.trim().replace(/,/g, "") || "0",
10
);
}
// get cured
if (i % totalColumns === curedColIndex) {
let cured = cell.children.length != 0 ? cell.children[0].data : "";
result[result.length - 1].recovered = parseInt(
cured.trim().replace(/,/g, "") || 0,
10
);
}
// get active
if (i % totalColumns === activeColIndex) {
let cured = cell.children.length != 0 ? cell.children[0].data : "";
result[result.length - 1].active = parseInt(
cured.trim().replace(/,/g, "") || 0,
10
);
}
// get critical
if (i % totalColumns === criticalColIndex) {
let critical = cell.children.length != 0 ? cell.children[0].data : "";
result[result.length - 1].critical = parseInt(
critical.trim().replace(/,/g, "") || "0",
10
);
}
// get total cases per one million population
if (i % totalColumns === casesPerOneMillionColIndex) {
let casesPerOneMillion = cell.children.length != 0 ? cell.children[0].data : "";
result[result.length - 1].casesPerOneMillion = parseFloat(
casesPerOneMillion.trim().replace(/,/g, "") || "0"
);
}
// get total deaths per one million population
if (i % totalColumns === deathsPerOneMillionColIndex) {
let deathsPerOneMillion = cell.children.length != 0 ? cell.children[0].data : "";
result[result.length - 1].deathsPerOneMillion = parseFloat(
deathsPerOneMillion.trim().replace(/,/g, "") || "0"
);
}
}
const string = JSON.stringify(result.filter(x=>x.country!="World"));
redis.set(keys.countries, string);
console.log(`Updated countries: ${result.length} countries`);
};
var getHistory = async () => {
let history = await axios.get(`https://pomber.github.io/covid19/timeseries.json`).then(async response => {
const res = response.data;
const hKeys = Object.keys(res);
let newHistory = [];
for (key of hKeys) {
const newArr = res[key].map(({
confirmed: cases,
...rest
}) => ({
cases,
...rest
}));
newHistory.push({
country: key,
timeline: newArr
});
}
redis.set(keys.timeline, JSON.stringify(newHistory));
let globalTimeline = JSON.stringify(await calculateAllTimeline(newHistory));
redis.set(keys.timelineglobal, globalTimeline);
console.log(`Updated JHU CSSE Timeline`);
});
}
getCountries()
getAll()
getHistory()
setInterval(getCountries, config.interval);
setInterval(getAll, config.interval);
setInterval(getHistory, config.interval);
let calculateAllTimeline = async (timeline) => {
let data = {};
timeline.forEach(async element => {
element.timeline.forEach(async o => {
if (!data.hasOwnProperty(o.date)) {
data[o.date] = {};
data[o.date]["cases"] = 0;
data[o.date]["deaths"] = 0;
data[o.date]["recovered"] = 0;
}
data[o.date].cases += parseInt(o.cases);
data[o.date].deaths += parseInt(o.deaths);
data[o.date].recovered += parseInt(o.recovered);
});
});
return data;
}
app.get("/", async function (request, response) {
console.log("hello");
let a = JSON.parse(await redis.get(keys.all))
response.send(
`${a.cases} cases are reported of the COVID-19<br> ${a.deaths} have died from it <br>\n${a.recovered} have recovered from it. <br>
View the dashboard here : <a href="https://coronastatistics.live">coronastatistics.live</a>`
);
});
var listener = app.listen(process.env.PORT || 5001, function () {
console.log("Your app is listening on port " + listener.address().port);
});
app.get("/all/", async function (req, res) {
let all = JSON.parse(await redis.get(keys.all))
res.send(all);
});
app.get("/countries/", async function (req, res) {
let countries = JSON.parse(await redis.get(keys.countries))
if (req.query['sort']) {
try {
const sortProp = req.query['sort'];
countries.sort((a, b) => {
if (a[sortProp] < b[sortProp]) {
return -1;
} else if (a[sortProp] > b[sortProp]) {
return 1;
}
return 0;
})
} catch (e) {
console.error("ERROR while sorting", e);
res.status(422).send(e);
return;
}
}
res.send(countries.reverse());
});
app.get("/countries/:country", async function (req, res) {
let countries = JSON.parse(await redis.get(keys.countries))
let country = countries.find(
e => e.country.toLowerCase().includes(req.params.country.toLowerCase())
);
if (!country) {
res.send("false");
return;
}
res.send(country);
});
app.get("/timeline", async function (req, res) {
let data = JSON.parse(await redis.get(keys.timeline))
res.send(data);
});
app.get("/timeline/global", async function (req, res) {
let data = JSON.parse(await redis.get(keys.timelineglobal))
res.send(data);
});
app.get("/timeline/:country", async function (req, res) {
let data = JSON.parse(await redis.get(keys.timeline));
let country = data.find(
e => e.country.toLowerCase() === req.params.country.toLowerCase()
);
if (!country) {
res.send(false);
return;
}
country = data.filter(
e => e.country.toLowerCase() === req.params.country.toLowerCase()
);
if (country.length == 1) {
res.send({
multiple: false,
name: country[0].country,
data: country[0]
});
return;
}
res.send({
multiple: true,
name: country[0].country,
data: country
});
});
|
Highcharts.maps["countries/cn/430502"] = {"type":"FeatureCollection","features":[{"type":"Feature","properties":{"adcode":430502,"name":"双清区","center":[111.479756,27.240001],"centroid":[111.546436,27.241775],"childrenNum":0,"level":"district","acroutes":[100000,430000,430500],"parent":{"adcode":430500},"longitude":111.546436,"latitude":27.241775},"geometry":{"type":"MultiPolygon","coordinates":[[[[5845,3491],[5846,3490],[5846,3488],[5846,3488],[5846,3487],[5846,3487],[5846,3486],[5846,3486],[5846,3486],[5847,3486],[5847,3485],[5847,3485],[5847,3485],[5847,3485],[5848,3484],[5848,3484],[5848,3484],[5848,3484],[5848,3484],[5848,3484],[5847,3484],[5847,3484],[5847,3484],[5847,3484],[5847,3483],[5847,3483],[5847,3483],[5847,3483],[5847,3483],[5847,3483],[5847,3482],[5847,3482],[5847,3482],[5848,3482],[5848,3482],[5849,3483],[5849,3483],[5849,3483],[5850,3483],[5850,3483],[5850,3483],[5850,3483],[5851,3483],[5851,3482],[5851,3482],[5850,3482],[5850,3481],[5850,3480],[5850,3480],[5850,3480],[5849,3480],[5849,3480],[5849,3479],[5849,3479],[5850,3478],[5850,3478],[5849,3477],[5849,3477],[5849,3477],[5849,3477],[5849,3476],[5849,3475],[5849,3473],[5848,3473],[5848,3472],[5848,3472],[5848,3471],[5848,3471],[5848,3471],[5848,3471],[5847,3471],[5847,3470],[5847,3470],[5847,3470],[5847,3470],[5847,3470],[5846,3469],[5846,3469],[5846,3469],[5846,3469],[5846,3469],[5845,3469],[5845,3469],[5845,3470],[5845,3470],[5845,3470],[5845,3471],[5845,3471],[5845,3471],[5844,3471],[5844,3471],[5844,3471],[5843,3471],[5842,3471],[5842,3471],[5842,3471],[5841,3471],[5841,3471],[5840,3471],[5839,3471],[5838,3471],[5838,3471],[5837,3470],[5836,3470],[5836,3469],[5835,3469],[5835,3469],[5835,3470],[5834,3470],[5834,3471],[5834,3471],[5834,3472],[5834,3472],[5834,3472],[5833,3472],[5833,3471],[5833,3471],[5832,3471],[5832,3471],[5832,3472],[5832,3472],[5831,3472],[5831,3472],[5831,3471],[5830,3471],[5830,3470],[5829,3470],[5829,3470],[5829,3469],[5829,3469],[5829,3469],[5829,3470],[5829,3470],[5829,3471],[5829,3471],[5829,3471],[5829,3471],[5829,3471],[5828,3471],[5826,3472],[5826,3472],[5826,3472],[5826,3473],[5826,3473],[5826,3473],[5825,3473],[5825,3473],[5825,3472],[5825,3472],[5825,3472],[5824,3471],[5823,3471],[5823,3471],[5822,3471],[5822,3471],[5822,3471],[5822,3472],[5822,3472],[5821,3474],[5820,3474],[5820,3475],[5820,3475],[5820,3475],[5820,3475],[5820,3475],[5820,3476],[5820,3476],[5819,3476],[5819,3476],[5820,3476],[5820,3477],[5821,3477],[5821,3478],[5821,3478],[5821,3478],[5821,3478],[5820,3478],[5820,3478],[5820,3478],[5820,3478],[5820,3478],[5820,3479],[5820,3479],[5819,3480],[5819,3480],[5819,3481],[5819,3481],[5820,3482],[5820,3482],[5820,3482],[5820,3482],[5820,3483],[5819,3482],[5819,3482],[5819,3482],[5819,3482],[5819,3483],[5819,3483],[5818,3484],[5818,3484],[5818,3484],[5818,3486],[5818,3486],[5818,3486],[5818,3486],[5818,3486],[5818,3487],[5819,3487],[5819,3487],[5819,3487],[5819,3486],[5820,3486],[5820,3486],[5820,3485],[5821,3484],[5821,3484],[5821,3484],[5821,3483],[5822,3483],[5822,3483],[5822,3483],[5822,3483],[5823,3483],[5823,3484],[5824,3485],[5824,3485],[5824,3485],[5824,3486],[5824,3486],[5824,3486],[5824,3487],[5824,3487],[5824,3487],[5823,3487],[5823,3487],[5823,3488],[5823,3488],[5824,3489],[5824,3490],[5823,3490],[5823,3491],[5823,3491],[5822,3492],[5822,3492],[5822,3492],[5822,3492],[5823,3493],[5823,3493],[5823,3493],[5823,3493],[5823,3493],[5823,3493],[5823,3494],[5823,3494],[5823,3494],[5823,3494],[5823,3494],[5823,3494],[5823,3494],[5824,3495],[5824,3495],[5824,3495],[5824,3495],[5825,3495],[5825,3495],[5825,3495],[5825,3495],[5825,3494],[5825,3494],[5825,3494],[5825,3494],[5826,3494],[5826,3494],[5826,3494],[5826,3494],[5826,3494],[5827,3494],[5827,3494],[5827,3494],[5827,3494],[5828,3493],[5828,3493],[5830,3494],[5832,3494],[5832,3493],[5833,3493],[5832,3492],[5830,3490],[5830,3489],[5830,3489],[5832,3489],[5833,3489],[5834,3489],[5834,3491],[5834,3492],[5834,3493],[5835,3492],[5835,3491],[5835,3490],[5836,3489],[5837,3488],[5839,3488],[5840,3488],[5841,3488],[5842,3489],[5843,3490],[5843,3491],[5845,3491]]]]}}],"UTF8Encoding":true,"crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:EPSG:3415"}},"hc-transform":{"default":{"crs":"+proj=lcc +lat_1=18 +lat_2=24 +lat_0=21 +lon_0=114 +x_0=500000 +y_0=500000 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs","scale":0.000129831107685,"jsonres":15.5,"jsonmarginX":-999,"jsonmarginY":9851,"xoffset":-3139937.49309,"yoffset":4358972.7486}}}
|
const createRedditCommand = require("../utils/createRedditCommand");
module.exports = {
cromch: createRedditCommand("cromch"),
puppies: createRedditCommand("puppies"),
};
|
import Logger from './Logger';
const QueryString = {
make: function(params) {
if (!params) {
return '';
}
const esc = encodeURIComponent;
const query = Object.keys(params)
.filter(x => params[x] !== null)
.map(k => esc(k) + '=' + esc(params[k]))
.join('&');
return query;
},
append: function(path, params) {
const qs = QueryString.make(params);
return qs
? (path.includes('?')
? path + qs
: path + '?' + qs)
: path;
},
parse: function(qs) {
const params = {};
const pairs = (qs[0] === '?' ? qs.substr(1) : qs).split('&');
for (var i = 0; i < pairs.length; i++) {
const pair = pairs[i].split('=');
if (pair[0]) {
params[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1] || '');
}
}
return params;
}
};
export default QueryString;
Logger.log('silly', `QueryString loaded.`);
|
import React, { useState } from "react";
import "../style/patterns/contact.scss";
import enter from "../assets/icons/enter.svg";
import loading from "../assets/icons/loading.svg";
import circleUp from "../assets/icons/circleUp.svg";
import circleDown from "../assets/icons/circleDown.svg";
import Button from "../components/Button";
import ques1 from "../assets/icons/ques1.svg";
import ques2 from "../assets/icons/ques2.svg";
import ques3 from "../assets/icons/ques3.svg";
import ques4 from "../assets/icons/ques4.svg";
import arrowUWhite from "../assets/icons/arrowUpWhite.svg";
const contact = [
{
image: require("../assets/icons/blockchainW.svg").default,
about: "Blockchain solutions",
},
{
image: require("../assets/icons/exchangeW.svg").default,
about: "Crypto exchange development",
},
{
image: require("../assets/icons/altCoinW.svg").default,
about: "Tokens & Altcoins development",
},
{
image: require("../assets/icons/defiW.svg").default,
about: "Defi development",
},
{
image: require("../assets/icons/nftMarketW.svg").default,
about: "NFT marketplace",
},
{
image: require("../assets/icons/dAppW.svg").default,
about: "Dapp development",
},
];
const ContactUs = ({ image, about }) => {
return (
<div className="checkBox_div2">
<img src={image} alt="checkbox" className="mb-20" />
<p className="mb-20">{about}</p>
<label class="container">
<input type="checkbox" />
</label>
</div>
);
};
const FreeDemo = () => {
const [toggle, setToggle] = useState("0");
const Ques = () => {
return (
<>
<div>
<div className="contact_left">
<div>
<p className="mb-20 text_primary_14_W500 silverGrad">
GET A QUOTE
</p>
<p className="mb-20 text_primary_24 silverGrad">
Discover what DeWall Street can do for you
</p>
<p className="mb-30 text_secondaryLite_14">
Send us your details and requirements and our team will get back
to you shortly.
</p>
<div className="contact_link">
<Button
variant="secondary"
children="Show me"
type="submit"
></Button>
<p className="ml-20 mt-10">
<span className="text_secondaryLite_14">press Enter</span>
<img src={enter} alt="arrow" />
</p>
</div>
</div>
</div>
</div>
<div className="contact_social">
<div>
<img src={loading} alt="loading" />
<p className="text_secondaryLite_14">
0 out of 4 questions answered
</p>
</div>
<div className="contact_social_arrow">
<img src={circleUp} alt="up" />
<img src={circleDown} alt="down" onClick={() => setToggle("1")} />
</div>
</div>
</>
);
};
const Ques1 = () => {
return (
<>
<div>
<p className="mb-20 text_primary_24 silverGrad">
First up, what’s your name?
</p>
<input type="text" placeholder="Type your answer here" />
<div className="contact_link">
<Button variant="secondary" children="Okay" type="submit"></Button>
<p className="ml-20 mt-10">
<span className="text_secondaryLite_14">press Enter</span>
<img src={enter} alt="arrow" />
</p>
</div>
</div>
<div className="contact_social">
<div>
<img src={ques1} alt="loading" />
<p className="text_secondaryLite_14">
1 out of 4 questions answered
</p>
</div>
<div className="contact_social_arrow">
<img src={arrowUWhite} alt="up" onClick={() => setToggle("0")} />
<img src={circleDown} alt="down" onClick={() => setToggle("2")} />
</div>
</div>
</>
);
};
const Ques2 = () => {
return (
<>
<div>
<p className="mb-20 text_primary_24 silverGrad email">
What’s your email address?
</p>
<input type="text" placeholder="Type your answer here" />
</div>
<div>
<p className="mb-20 text_primary_24 silverGrad email">
And your phone number?
</p>
<input type="text" placeholder="Type your answer here" />
<div className="contact_link">
<Button variant="secondary" children="Okay" type="submit"></Button>
<p className="ml-20 mt-10">
<span className="text_secondaryLite_14">press Enter</span>
<img src={enter} alt="arrow" />
</p>
</div>
</div>
<div className="contact_social">
<div>
<img src={ques2} alt="loading" />
<p className="text_secondaryLite_14">
2 out of 4 questions answered
</p>
</div>
<div className="contact_social_arrow">
<img src={arrowUWhite} alt="up" onClick={() => setToggle("1")} />
<img src={circleDown} alt="down" onClick={() => setToggle("3")} />
</div>
</div>
</>
);
};
const Ques3 = () => {
return (
<>
<div>
<p className="mb-20 text_primary_24 silverGrad">
How can we help you?
</p>
<div className="checkBoxGrid">
{contact.map((data) => (
// console.log(data)
<ContactUs image={data.image} about={data.about} />
))}
</div>
<div className="contact_link">
<Button variant="secondary" children="Okay" type="submit"></Button>
<p className="ml-20 mt-10">
<span className="text_secondaryLite_14">press Enter</span>
<img src={enter} alt="arrow" />
</p>
</div>
</div>
<div className="contact_social">
<div>
<img src={ques3} alt="loading" />
<p className="text_secondaryLite_14">
3 out of 4 questions answered
</p>
</div>
<div className="contact_social_arrow">
<img src={arrowUWhite} alt="up" onClick={() => setToggle("2")} />
<img src={circleDown} alt="down" onClick={() => setToggle("4")} />
</div>
</div>
</>
);
};
const Ques4 = () => {
return (
<>
<div>
<p className="mb-20 text_primary_24 silverGrad">
Finally, tell us about your product in breif.
</p>
<input type="text" placeholder="Type your answer here" />
<div className="contact_link" style={{ marginTop: "30px" }}>
<Button
variant="secondary"
children="Submit"
type="submit"
></Button>
<p className="ml-20 mt-10">
<span className="text_secondaryLite_14">press Enter</span>
<img src={enter} alt="arrow" />
</p>
</div>
</div>
<div className="contact_social">
<div>
<img src={ques4} alt="loading" />
<p className="text_secondaryLite_14">
4 out of 4 questions answered
</p>
</div>
<div className="contact_social_arrow">
<img src={arrowUWhite} alt="up" onClick={() => setToggle("3")} />
<img src={circleDown} alt="down" onClick={() => setToggle("5")} />
</div>
</div>
</>
);
};
const Final = () => {
return (
<>
<div>
<div className="contact_left">
<div>
<p className="mb-20 text_primary_24 silverGrad">
All done, You are on top of our priority now.
</p>
<p className="text_secondaryLite_14">
Thank you for telling us your product idea. Currently, our team
is going through the details provided by you. We shall be
arranging a call with you between the next 2 business days.
</p>
<div
className="contact_link contact_final"
style={{ marginTop: "30px" }}
>
<Button
variant="secondary"
children="Tell us another product idea"
type="submit"
></Button>
<p className="ml-20 mt-10">
<span className="text_secondaryLite_14">Done for now</span>
<img src={enter} alt="arrow" />
</p>
</div>
</div>
</div>
</div>
<div className="contact_social"></div>
</>
);
};
return (
<div className="contact">
{toggle === "0" && <Ques />}
{toggle === "1" && <Ques1 />}
{toggle === "2" && <Ques2 />}
{toggle === "3" && <Ques3 />}
{toggle === "4" && <Ques4 />}
{toggle === "5" && <Final />}
</div>
);
};
export default FreeDemo;
|
const key = 'protected-screens-table';
const TITLE = `${key}.title`;
const EMPTY_PLACEHOLDER_MESSAGE = `${key}.empty-placeholder-message`;
const HEADER_NAME_TITLE = `${key}.header-name-title`;
export default {
TITLE,
EMPTY_PLACEHOLDER_MESSAGE,
HEADER_NAME_TITLE,
};
|
import React from "react"
import { PropTypes } from "prop-types"
import "normalize.css"
import layoutStyles from "./Layout.module.scss"
import "./../../styles/defaults.scss"
import Navbar from "../navbar/Navbar"
const Layout = ({ children }) => {
return (
<div className={layoutStyles.container}>
<Navbar />
<div className={layoutStyles.content}>{children}</div>
</div>
)
}
Layout.propTypes = {
children: PropTypes.any,
}
export default Layout
|
/**
* @fileoverview added by tsickle
* Generated from: base.module.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { TdChartComponent } from './chart.component';
import { TdChartXAxisComponent } from './axis/x-axis.component';
import { TdChartYAxisComponent } from './axis/y-axis.component';
import { TdDatasetComponent } from './dataset/dataset.component';
import { registerDefaultThemes } from './utils';
/** @type {?} */
export const BASE_MODULE_COMPONENTS = [
TdChartComponent,
TdChartXAxisComponent,
TdChartYAxisComponent,
TdDatasetComponent,
];
import 'zrender/lib/svg/svg';
registerDefaultThemes();
export class CovalentBaseEchartsModule {
}
CovalentBaseEchartsModule.decorators = [
{ type: NgModule, args: [{
imports: [CommonModule],
declarations: [BASE_MODULE_COMPONENTS],
exports: [BASE_MODULE_COMPONENTS],
},] }
];
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmFzZS5tb2R1bGUuanMiLCJzb3VyY2VSb290IjoiLi4vLi4vLi4vLi4vLi4vc3JjL3BsYXRmb3JtL2VjaGFydHMvYmFzZS8iLCJzb3VyY2VzIjpbImJhc2UubW9kdWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEsT0FBTyxFQUFFLFFBQVEsRUFBUSxNQUFNLGVBQWUsQ0FBQztBQUMvQyxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFFL0MsT0FBTyxFQUFFLGdCQUFnQixFQUFFLE1BQU0sbUJBQW1CLENBQUM7QUFDckQsT0FBTyxFQUFFLHFCQUFxQixFQUFFLE1BQU0seUJBQXlCLENBQUM7QUFDaEUsT0FBTyxFQUFFLHFCQUFxQixFQUFFLE1BQU0seUJBQXlCLENBQUM7QUFDaEUsT0FBTyxFQUFFLGtCQUFrQixFQUFFLE1BQU0sNkJBQTZCLENBQUM7QUFFakUsT0FBTyxFQUFFLHFCQUFxQixFQUFFLE1BQU0sU0FBUyxDQUFDOztBQUVoRCxNQUFNLE9BQU8sc0JBQXNCLEdBQWdCO0lBQ2pELGdCQUFnQjtJQUNoQixxQkFBcUI7SUFDckIscUJBQXFCO0lBQ3JCLGtCQUFrQjtDQUNuQjtBQUVELE9BQU8scUJBQXFCLENBQUM7QUFFN0IscUJBQXFCLEVBQUUsQ0FBQztBQU94QixNQUFNLE9BQU8seUJBQXlCOzs7WUFMckMsUUFBUSxTQUFDO2dCQUNSLE9BQU8sRUFBRSxDQUFDLFlBQVksQ0FBQztnQkFDdkIsWUFBWSxFQUFFLENBQUMsc0JBQXNCLENBQUM7Z0JBQ3RDLE9BQU8sRUFBRSxDQUFDLHNCQU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VFY2hhcnRzTW9kdWxlIHt9XG4iXX0=
|
// Interface for tracking the number and/or latency of episodes and steps.
class _EventTimer {
// Example event timer to measure step and observation times.
__enter__() { //eslint-disable-line
//pass
}
__exit__(unused_exception_type, unused_exc_value, unused_traceback) { //eslint-disable-line
//pass
}
}
class Metrics {
// Interface for tracking the number and/or latency of episodes and steps.
constructor(map_name) { //eslint-disable-line
//pass
}
increment_instance() { //eslint-disable-line
//pass
}
increment_episode() { //eslint-disable-line
//pass
}
measure_step_time(num_steps = 1) { //eslint-disable-line
// Return a context manager to measure the time to perform N game steps.
num_steps = null
return new _EventTimer()
}
measure_observation_time() { //eslint-disable-line
// Return a context manager to measure the time to get an observation.
return new _EventTimer()
}
close() { //eslint-disable-line
//pass
}
__del__() {
this.close()
}
}
module.exports = {
_EventTimer,
Metrics
}
|
// 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';
var helpers = require('../../helpers/integration');
var harness = helpers.harness(__filename);
var it = harness.it;
var db = harness.locals.db;
it('should be able to insert docs and design doc', function(assert) {
db.insert({
views: {
'by_id': {
map: 'function(doc) { emit(doc._id, doc); }'
}
}
}, '_design/alice', function(error, response) {
assert.equal(error, null, 'should create views');
assert.equal(response.ok, true, 'response ok');
assert.end();
});
});
it('should insert a bunch of items', helpers.insertThree);
it('get multiple docs with a composed key', function(assert) {
db.view('alice', 'by_id', {
keys: ['foobar', 'barfoo'],
'include_docs': true
}, function(err, view) {
assert.equal(err, null, 'should response');
assert.equal(view.rows.length, 2, 'has more or less than two rows');
assert.equal(view.rows[0].id, 'foobar', 'foo is not the first id');
assert.equal(view.rows[1].id, 'barfoo', 'bar is not the second id');
assert.end();
});
});
|
const expect = require('chai').expect;
const Accounts = require('../../src/accounts').Accounts;
const Account = require('../../src/accounts').Account;
describe('Accounts Manager', () => {
it('should exist', () => {
expect(Accounts).to.be.ok;
});
describe('Getting Accounts', () => {
const Manager = new Accounts();
it('should be able to add and get new accounts', () => {
const expected = { getUsername: () => 'lol' };
Manager.addAccount(expected);
expect(Manager.getAccount('lol')).to.eql(expected);
});
it('should be able to get all accounts', () => {
Manager.addAccount({ getUsername: () => 'hah' });
expect(Manager.getAccounts().length).to.equal(2);
})
});
});
describe('User Account', () => {
it('should exist', () => {
expect(Accounts).to.be.ok;
});
it('should be instantiated by new', () => {
const testAccount = new Account();
expect(testAccount instanceof Account).to.be.true;
});
describe('Usernames', () => {
const testAccount = new Account();
it('should be able to set and get username', () => {
const name = 'Hats';
testAccount.setUsername(name);
expect(testAccount.getUsername()).to.equal(name);
});
});
describe('Character Management', () => {
const testAccount = new Account();
it('should be able to add and get characters by name', () => {
const expected = 'Hooray';
testAccount.addCharacter('Hooray');
const actual = testAccount.getCharacter('Hooray');
expect(actual).to.eql(expected);
});
it('should be able to return array of all characters', () => {
testAccount.addCharacter('Potato');
const actual = testAccount.getCharacters().length;
const expected = 2;
expect(actual).to.equal(expected);
});
it('should return array of all living characters', () => {
testAccount.addDeceased('Potato');
const alive = testAccount.getCharacters();
expect(alive.length).to.equal(1);
});
it('should return array of all dead characters', () => {
const dead = testAccount.getDeceased();
expect(dead.length).to.equal(1);
});
});
describe('Karma', () => {
const testAccount = new Account();
it('should be able to add and get karma', () => {
const expected = 6;
testAccount.addKarma(expected);
expect(testAccount.getKarma()).to.equal(expected);
});
it('should be able to deduct and get karma', () => {
const expected = 3;
testAccount.deductKarma(expected);
expect(testAccount.getKarma()).to.equal(expected);
});
//FIXME: Skipped because I plan on modularizing the scoring stuff.
xdescribe('Scoring', () => {
const scoreMockA = {
'killed': [1, 2, 3],
'explored': [1, 2],
'level': 12
};
const scoreMockB = {
'killed': [2, 2],
'explored': [1],
'level': 5
};
it('should be able to get a cumulative total of all karma earned', () => {
const expected = 12;
testAccount.addKarma(6);
expect(testAccount.getScore('totalKarma')).to.equal(expected);
});
it('should be able to total scores', () => {
const expected = {
totalKarma: 12,
totalKills: 0,
totalExplored: 0,
totalLevels: 0,
grandTotal: 12,
totalKilled: 0
};
testAccount.updateScore();
expect(testAccount.getScore()).to.eql(expected);
});
it('should be able to update scores', () => {
const expected = {
totalKarma: 12,
totalKills: 0,
totalExplored: 3,
totalLevels: 17,
grandTotal: 15,
totalKilled: 5
};
testAccount.addCharacter(scoreMockA);
testAccount.addCharacter(scoreMockB);
testAccount.updateScore();
const actual = testAccount.getScore();
expect(actual).to.eql(expected)
});
})
});
});
|
// Copyright 2014 Google Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
(function(shared, scope, testing) {
scope.Animation = function(target, effectInput, timingInput) {
var animationNode = scope.AnimationNode(shared.normalizeTimingInput(timingInput));
var effect = scope.convertEffectInput(effectInput);
var timeFraction;
var animation = function() {
WEB_ANIMATIONS_TESTING && console.assert(typeof timeFraction !== 'undefined');
effect(target, timeFraction);
};
// Returns whether the animation is in effect or not after the timing update.
animation._update = function(localTime) {
timeFraction = animationNode(localTime);
return timeFraction !== null;
};
animation._clear = function() {
effect(target, null);
};
animation._hasSameTarget = function(otherTarget) {
return target === otherTarget;
};
animation._isCurrent = animationNode._isCurrent;
animation._totalDuration = animationNode._totalDuration;
return animation;
};
scope.NullAnimation = function(clear) {
var nullAnimation = function() {
if (clear) {
clear();
clear = null;
}
};
nullAnimation._update = function() {
return null;
};
nullAnimation._totalDuration = 0;
nullAnimation._isCurrent = function() {
return false;
};
nullAnimation._hasSameTarget = function() {
return false;
};
return nullAnimation;
};
if (WEB_ANIMATIONS_TESTING) {
testing.minifillAnimation = scope.Animation;
}
})(webAnimationsShared, webAnimationsMinifill, webAnimationsTesting);
|
// Código del cuadrado
console.group("Cuadrados");
// const ladoCuadrado = 5;
// console.log("Los lados del cuadrado miden: " + ladoCuadrado + "cm");
function perimetroCuadrado(lado) {
return lado * 4;
}
// console.log("El perímetro del cuadrado es: " + perimetroCuadrado + "cm");
function areaCuadrado(lado) {
return lado * lado;
}
// console.log("El área del cuadrado es: " + areaCuadrado + "cmˆ2");
console.groupEnd();
// Código del triángulo
console.group("Triángulos");
// const ladoTriangulo1 = 6;
// const ladoTriangulo2 = 6;
// const baseTriangulo = 4;
// console.log(
// "Los lados del triángulo miden: "
// + ladoTriangulo1
// + "cm, "
// + ladoTriangulo2
// + "cm, "
// + baseTriangulo
// + "cm"
// );
// const alturaTriangulo = 5.5;
// console.log("La altura del triángulo es de: " + alturaTriangulo + "cm");
function perimetroTriangulo(ladoA, ladoB, baseT) {
return ladoA + ladoB + baseT;
}
// console.log("El perímetro del triángulo es: " + perimetroTriangulo + "cm");
function areaTriangulo(base, altura) {
return (base * altura) / 2;
}
console.log("El área del triángulo es: " + areaTriangulo + "cmˆ2");
//triangulo isosceles-altura
function alturaTriangulo(a, b, base){
if(a == b){
return Math.sqrt(Math.pow(a,2) - Math.pow(base/2,2));
}
else{
console.error("los lados a y b no son iguales");
return "el triángulo no es isósceles";
}
}
console.groupEnd();
// Código del círculo
console.group("Círculos");
// Radio
// const radioCirculo = 4;
// console.log("El radio del círculo es: " + radioCirculo + "cm");
// Diámetro
function diametroCirculo(radio) {
return radio * 2;
}
// PI
const PI = Math.PI;
console.log("PI es: " + PI);
// Circunferencia
function perimetroCirculo(radio) {
const diametro = diametroCirculo(radio);
return diametro * PI;
}
// Área
function areaCirculo(radio) {
return (radio * radio) * PI;
}
console.groupEnd();
// Aquí interactuamos con el HTML
function calcularPerimetroCuadrado() {
const input = document.getElementById("InputCuadrado");
const value = input.value;
const perimetro = perimetroCuadrado(value);
alert(perimetro);
}
function calcularAreaCuadrado() {
const input = document.getElementById("InputCuadrado");
const value = input.value;
const area = areaCuadrado(value);
alert(area);
}
//triangulo perimetro,area y altura
function calcularPerimetroTriangulo(){
const input1 = document.getElementById("InputLado1");
const lado1 = input1.value;
const input2 = document.getElementById("InputLado2");
const lado2 = input2.value;
const input3 = document.getElementById("InputBase");
const base = input3.value;
const perimetro = perimetroTriangulo(lado1, lado2, base);
alert("El Perimetro del triangulo es:" + perimetro);
}
function calcularAreaTriangulo(){
const input4 =document.getElementById("InputAltura");
const altura = input4.value;
const input3 = document.getElementById("InputBase");
const base = input3.value;
const area = areaTriangulo(altura, base);
alert("El area del triangulo es: " + area);
}
function calcularAlturaTriangulo(){
const input1 = document.getElementById("InputLado1");
const lado1 = input1.value;
const input2 = document.getElementById("InputLado2");
const lado2 = input2.value;
const input3 = document.getElementById("InputBase");
const base = input3.value;
const altura = alturaTriangulo(lado1, lado2, base);
alert("La altura es de: " + altura);
}
|
import { __awaiter } from 'tslib';
import { ContentContainerComponentHarness, HarnessPredicate, ComponentHarness, parallel } from '@angular/cdk/testing';
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/** Harness for interacting with a standard Angular Material table cell. */
class MatCellHarness extends ContentContainerComponentHarness {
/**
* Gets a `HarnessPredicate` that can be used to search for a table cell with specific attributes.
* @param options Options for narrowing the search
* @return a `HarnessPredicate` configured with the given options.
*/
static with(options = {}) {
return MatCellHarness._getCellPredicate(MatCellHarness, options);
}
/** Gets the cell's text. */
getText() {
return __awaiter(this, void 0, void 0, function* () {
return (yield this.host()).text();
});
}
/** Gets the name of the column that the cell belongs to. */
getColumnName() {
return __awaiter(this, void 0, void 0, function* () {
const host = yield this.host();
const classAttribute = yield host.getAttribute('class');
if (classAttribute) {
const prefix = 'mat-column-';
const name = classAttribute.split(' ').map(c => c.trim()).find(c => c.startsWith(prefix));
if (name) {
return name.split(prefix)[1];
}
}
throw Error('Could not determine column name of cell.');
});
}
static _getCellPredicate(type, options) {
return new HarnessPredicate(type, options)
.addOption('text', options.text, (harness, text) => HarnessPredicate.stringMatches(harness.getText(), text))
.addOption('columnName', options.columnName, (harness, name) => HarnessPredicate.stringMatches(harness.getColumnName(), name));
}
}
/** The selector for the host element of a `MatCellHarness` instance. */
MatCellHarness.hostSelector = '.mat-cell';
/** Harness for interacting with a standard Angular Material table header cell. */
class MatHeaderCellHarness extends MatCellHarness {
/**
* Gets a `HarnessPredicate` that can be used to search for
* a table header cell with specific attributes.
* @param options Options for narrowing the search
* @return a `HarnessPredicate` configured with the given options.
*/
static with(options = {}) {
return MatHeaderCellHarness._getCellPredicate(MatHeaderCellHarness, options);
}
}
/** The selector for the host element of a `MatHeaderCellHarness` instance. */
MatHeaderCellHarness.hostSelector = '.mat-header-cell';
/** Harness for interacting with a standard Angular Material table footer cell. */
class MatFooterCellHarness extends MatCellHarness {
/**
* Gets a `HarnessPredicate` that can be used to search for
* a table footer cell with specific attributes.
* @param options Options for narrowing the search
* @return a `HarnessPredicate` configured with the given options.
*/
static with(options = {}) {
return MatFooterCellHarness._getCellPredicate(MatFooterCellHarness, options);
}
}
/** The selector for the host element of a `MatFooterCellHarness` instance. */
MatFooterCellHarness.hostSelector = '.mat-footer-cell';
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
class _MatRowHarnessBase extends ComponentHarness {
/** Gets a list of `MatCellHarness` for all cells in the row. */
getCells(filter = {}) {
return __awaiter(this, void 0, void 0, function* () {
return this.locatorForAll(this._cellHarness.with(filter))();
});
}
/** Gets the text of the cells in the row. */
getCellTextByIndex(filter = {}) {
return __awaiter(this, void 0, void 0, function* () {
const cells = yield this.getCells(filter);
return parallel(() => cells.map(cell => cell.getText()));
});
}
/** Gets the text inside the row organized by columns. */
getCellTextByColumnName() {
return __awaiter(this, void 0, void 0, function* () {
const output = {};
const cells = yield this.getCells();
const cellsData = yield parallel(() => cells.map(cell => {
return parallel(() => [cell.getColumnName(), cell.getText()]);
}));
cellsData.forEach(([columnName, text]) => output[columnName] = text);
return output;
});
}
}
/** Harness for interacting with a standard Angular Material table row. */
class MatRowHarness extends _MatRowHarnessBase {
constructor() {
super(...arguments);
this._cellHarness = MatCellHarness;
}
/**
* Gets a `HarnessPredicate` that can be used to search for a table row with specific attributes.
* @param options Options for narrowing the search
* @return a `HarnessPredicate` configured with the given options.
*/
static with(options = {}) {
return new HarnessPredicate(MatRowHarness, options);
}
}
/** The selector for the host element of a `MatRowHarness` instance. */
MatRowHarness.hostSelector = '.mat-row';
/** Harness for interacting with a standard Angular Material table header row. */
class MatHeaderRowHarness extends _MatRowHarnessBase {
constructor() {
super(...arguments);
this._cellHarness = MatHeaderCellHarness;
}
/**
* Gets a `HarnessPredicate` that can be used to search for
* a table header row with specific attributes.
* @param options Options for narrowing the search
* @return a `HarnessPredicate` configured with the given options.
*/
static with(options = {}) {
return new HarnessPredicate(MatHeaderRowHarness, options);
}
}
/** The selector for the host element of a `MatHeaderRowHarness` instance. */
MatHeaderRowHarness.hostSelector = '.mat-header-row';
/** Harness for interacting with a standard Angular Material table footer row. */
class MatFooterRowHarness extends _MatRowHarnessBase {
constructor() {
super(...arguments);
this._cellHarness = MatFooterCellHarness;
}
/**
* Gets a `HarnessPredicate` that can be used to search for
* a table footer row cell with specific attributes.
* @param options Options for narrowing the search
* @return a `HarnessPredicate` configured with the given options.
*/
static with(options = {}) {
return new HarnessPredicate(MatFooterRowHarness, options);
}
}
/** The selector for the host element of a `MatFooterRowHarness` instance. */
MatFooterRowHarness.hostSelector = '.mat-footer-row';
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
class _MatTableHarnessBase extends ContentContainerComponentHarness {
/** Gets all of the header rows in a table. */
getHeaderRows(filter = {}) {
return __awaiter(this, void 0, void 0, function* () {
return this.locatorForAll(this._headerRowHarness.with(filter))();
});
}
/** Gets all of the regular data rows in a table. */
getRows(filter = {}) {
return __awaiter(this, void 0, void 0, function* () {
return this.locatorForAll(this._rowHarness.with(filter))();
});
}
/** Gets all of the footer rows in a table. */
getFooterRows(filter = {}) {
return __awaiter(this, void 0, void 0, function* () {
return this.locatorForAll(this._footerRowHarness.with(filter))();
});
}
/** Gets the text inside the entire table organized by rows. */
getCellTextByIndex() {
return __awaiter(this, void 0, void 0, function* () {
const rows = yield this.getRows();
return parallel(() => rows.map(row => row.getCellTextByIndex()));
});
}
/** Gets the text inside the entire table organized by columns. */
getCellTextByColumnName() {
return __awaiter(this, void 0, void 0, function* () {
const [headerRows, footerRows, dataRows] = yield parallel(() => [
this.getHeaderRows(),
this.getFooterRows(),
this.getRows()
]);
const text = {};
const [headerData, footerData, rowsData] = yield parallel(() => [
parallel(() => headerRows.map(row => row.getCellTextByColumnName())),
parallel(() => footerRows.map(row => row.getCellTextByColumnName())),
parallel(() => dataRows.map(row => row.getCellTextByColumnName())),
]);
rowsData.forEach(data => {
Object.keys(data).forEach(columnName => {
const cellText = data[columnName];
if (!text[columnName]) {
text[columnName] = {
headerText: getCellTextsByColumn(headerData, columnName),
footerText: getCellTextsByColumn(footerData, columnName),
text: []
};
}
text[columnName].text.push(cellText);
});
});
return text;
});
}
}
/** Harness for interacting with a standard mat-table in tests. */
class MatTableHarness extends _MatTableHarnessBase {
constructor() {
super(...arguments);
this._headerRowHarness = MatHeaderRowHarness;
this._rowHarness = MatRowHarness;
this._footerRowHarness = MatFooterRowHarness;
}
/**
* Gets a `HarnessPredicate` that can be used to search for a table with specific attributes.
* @param options Options for narrowing the search
* @return a `HarnessPredicate` configured with the given options.
*/
static with(options = {}) {
return new HarnessPredicate(MatTableHarness, options);
}
}
/** The selector for the host element of a `MatTableHarness` instance. */
MatTableHarness.hostSelector = '.mat-table';
/** Extracts the text of cells only under a particular column. */
function getCellTextsByColumn(rowsData, column) {
const columnTexts = [];
rowsData.forEach(data => {
Object.keys(data).forEach(columnName => {
if (columnName === column) {
columnTexts.push(data[columnName]);
}
});
});
return columnTexts;
}
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
export { MatCellHarness, MatFooterCellHarness, MatFooterRowHarness, MatHeaderCellHarness, MatHeaderRowHarness, MatRowHarness, MatTableHarness, _MatRowHarnessBase, _MatTableHarnessBase };
//# sourceMappingURL=testing.js.map
|
"use strict";
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
require("symbol-observable");
// symbol polyfill must go first
const fs_1 = require("fs");
const path = __importStar(require("path"));
const semver_1 = require("semver");
const version_1 = require("../models/version");
const color_1 = require("../utilities/color");
const config_1 = require("../utilities/config");
(async () => {
var _a;
/**
* Disable Browserslist old data warning as otherwise with every release we'd need to update this dependency
* which is cumbersome considering we pin versions and the warning is not user actionable.
* `Browserslist: caniuse-lite is outdated. Please run next command `npm update`
* See: https://github.com/browserslist/browserslist/blob/819c4337456996d19db6ba953014579329e9c6e1/node.js#L324
*/
process.env.BROWSERSLIST_IGNORE_OLD_DATA = '1';
const disableVersionCheckEnv = process.env['NG_DISABLE_VERSION_CHECK'];
/**
* Disable CLI version mismatch checks and forces usage of the invoked CLI
* instead of invoking the local installed version.
*/
const disableVersionCheck = disableVersionCheckEnv !== undefined &&
disableVersionCheckEnv !== '0' &&
disableVersionCheckEnv.toLowerCase() !== 'false';
if (disableVersionCheck) {
return (await Promise.resolve().then(() => __importStar(require('./cli')))).default;
}
let cli;
try {
// No error implies a projectLocalCli, which will load whatever
// version of ng-cli you have installed in a local package.json
const projectLocalCli = require.resolve('@angular/cli', { paths: [process.cwd()] });
cli = await Promise.resolve().then(() => __importStar(require(projectLocalCli)));
const globalVersion = new semver_1.SemVer(version_1.VERSION.full);
// Older versions might not have the VERSION export
let localVersion = (_a = cli.VERSION) === null || _a === void 0 ? void 0 : _a.full;
if (!localVersion) {
try {
const localPackageJson = await fs_1.promises.readFile(path.join(path.dirname(projectLocalCli), '../../package.json'), 'utf-8');
localVersion = JSON.parse(localPackageJson).version;
}
catch (error) {
// eslint-disable-next-line no-console
console.error('Version mismatch check skipped. Unable to retrieve local version: ' + error);
}
}
let isGlobalGreater = false;
try {
isGlobalGreater = !!localVersion && globalVersion.compare(localVersion) > 0;
}
catch (error) {
// eslint-disable-next-line no-console
console.error('Version mismatch check skipped. Unable to compare local version: ' + error);
}
if (isGlobalGreater) {
// If using the update command and the global version is greater, use the newer update command
// This allows improvements in update to be used in older versions that do not have bootstrapping
if (process.argv[2] === 'update') {
cli = await Promise.resolve().then(() => __importStar(require('./cli')));
}
else if (await config_1.isWarningEnabled('versionMismatch')) {
// Otherwise, use local version and warn if global is newer than local
const warning = `Your global Angular CLI version (${globalVersion}) is greater than your local ` +
`version (${localVersion}). The local Angular CLI version is used.\n\n` +
'To disable this warning use "ng config -g cli.warnings.versionMismatch false".';
// eslint-disable-next-line no-console
console.error(color_1.colors.yellow(warning));
}
}
}
catch {
// If there is an error, resolve could not find the ng-cli
// library from a package.json. Instead, include it from a relative
// path to this script file (which is likely a globally installed
// npm package). Most common cause for hitting this is `ng new`
cli = await Promise.resolve().then(() => __importStar(require('./cli')));
}
if ('default' in cli) {
cli = cli['default'];
}
return cli;
})()
.then((cli) => {
return cli({
cliArgs: process.argv.slice(2),
inputStream: process.stdin,
outputStream: process.stdout,
});
})
.then((exitCode) => {
process.exit(exitCode);
})
.catch((err) => {
// eslint-disable-next-line no-console
console.error('Unknown error: ' + err.toString());
process.exit(127);
});
|
const { servers, yta, ytv } = require('../lib/y2mate')
let yts = require('yt-search')
let fetch = require('node-fetch')
let handler = async (m, { conn, command, text, usedPrefix }) => {
if (!text) throw `uhm.. what are you looking for?\n\nExample:\n${usedPrefix + command} Bad Boy`
let chat = global.db.data.chats[m.chat]
let results = await yts(text)
let vid = results.all.find(video => video.seconds < 3600)
if (!vid) throw 'Content Not found'
let isVideo = /2$/.test(command)
let yt = false
let yt2 = false
let usedServer = servers[0]
for (let i in servers) {
let server = servers[i]
try {
yt = await yta(vid.url, server)
yt2 = await ytv(vid.url, server)
usedServer = server
break
} catch (e) {
m.reply(`Server ${server} error!${servers.length >= i + 1 ? '' : '\ntry again...'}`)
}
}
let { dl_link, thumb, title, filesize, filesizeF } = yt
await conn.send3ButtonLoc(m.chat, await (await fetch(thumb)).buffer(), `
*Title:* ${title}
*Audio File Size:* ${filesizeF}
*Video File Size:* ${yt2.filesizeF}
*Play Doesnt Work ,In Disappearing mode( Private Chat)*
`.trim(), watermark,'ℹ️Source', `.yts${vid.url}`, '📻Audio', `.yta ${vid.url}`, '🎥Video', `.yt ${vid.url}`)
}
handler.help = ['song','play','?'].map(v => v + ' <query>')
handler.tags = ['downloader']
handler.command = /^(play|song)$/i
handler.exp = 0
module.exports = handler
|
/* ------------------------------------------------------------------------------
*
* # Advanced Velocity.js examples
*
* Specific JS code additions for extension_velocity_examples.html page
*
* Version: 1.0
* Latest update: Aug 1, 2015
*
* ---------------------------------------------------------------------------- */
$(function() {
// Animation options
// ------------------------------
// Properties animation
$('.velocity-properties').on('click', function (e) {
e.preventDefault();
$(this).parent().next().find('.panel').velocity({
marginLeft: 20,
marginRight: 20,
opacity: 0.5
}).velocity('reverse', {
delay: 1000,
complete: function() {
$(this).removeAttr('style');
}
})
});
// Chained animation
$('.velocity-chained').on('click', function (e) {
e.preventDefault();
$(this).parent().next().find('.panel').velocity({
marginLeft: 20
}).velocity('reverse', {
delay: 1000
}).velocity({
marginRight: 20
}).velocity('reverse', {
delay: 1000
}).velocity({
opacity: 0.5
}).velocity('reverse', {
delay: 1000,
complete: function() {
$(this).removeAttr('style');
}
})
});
// Stagger animation
$('.velocity-stagger').on('click', function (e) {
e.preventDefault();
$(this).parent().next().find('.panel').velocity('transition.slideUpIn', {
stagger: 500
});
});
// Drag animation
$('.velocity-drag').on('click', function (e) {
e.preventDefault();
$(this).parent().next().find('.panel').velocity('transition.slideUpBigIn', {
duration: 1000,
drag: true
});
});
// Backwards animation
$('.velocity-backwards').on('click', function (e) {
e.preventDefault();
$(this).parent().next().find('.panel').velocity('transition.slideDownOut', {
stagger: 400,
backwards: true
})
.velocity({ opacity: 1 }, {
duration: 500,
display: "block"
});
});
// Animation callbacks
// ------------------------------
// Begin callback
$('.velocity-begin').on('click', function (e) {
e.preventDefault();
$(this).parent().next('.row').velocity({
marginLeft: 20,
marginRight: 20,
opacity: 0.5
}, {
begin: function() {
alert('Begin callback example');
}
}).velocity('reverse', {
delay: 1000,
complete: function() {
$(this).removeAttr('style');
}
})
});
// Complete callback
$('.velocity-complete').on('click', function (e) {
e.preventDefault();
$(this).parent().next('.row').velocity({
marginLeft: 20,
marginRight: 20,
opacity: 0.5
}, {
complete: function() {
alert('Complete callback example');
}
}).velocity('reverse', {
delay: 1000,
complete: function() {
$(this).removeAttr('style');
}
})
});
// Progress callback animation
$('.velocity-progress').on('click', function (e) {
e.preventDefault();
var $percentComplete = $("#percentComplete"),
$timeRemaining = $("#timeRemaining");
$(this).parent().next('.row').velocity({
marginLeft: 20,
marginRight: 20,
opacity: 0.5
}, {
duration: 1000,
progress: function(elements, percentComplete, timeRemaining, timeStart) {
$percentComplete.html(Math.round(percentComplete * 100) + "% complete.");
$timeRemaining.html(timeRemaining + "ms remaining.");
}
}).velocity('reverse', {
delay: 1000,
complete: function() {
$(this).removeAttr('style');
}
})
});
// Animate layout on page load
// ------------------------------
// Hide elements first
$(".sidebar, .navbar, .navbar-brand, .navbar-text, .navbar-nav > li, .page-header, .page-title, .page-header .heading-elements, .breadcrumb, .breadcrumb-elements > li, .content-wrapper > .panel, .content-wrapper .row > [class*=col-], .footer")
.css('opacity', 0);
// Animate when Pace loading is done
Pace.on('done', function () {
// Layout parts
$(".navbar, .navbar-brand, .navbar-text, .navbar-nav > li, .page-header, .page-title, .page-header .heading-elements, .breadcrumb, .breadcrumb-elements > li, .content-wrapper > .panel, .content-wrapper .row > [class*=col-], .footer")
.css('opacity', 1)
.velocity("transition.slideDownIn", {
stagger: 200,
duration: 200,
complete: function(elements) {
$(this).removeAttr('style');
}
});
// Sidebar
$(".sidebar")
.css({opacity: 0, borderColor: 'transparent'})
.velocity("transition.slideUpIn", {
delay: 100,
duration: 500,
display: 'table-cell',
complete: function(elements) {
$(this).removeAttr('style');
}
});
// Navigation list on load
$(".navigation > li")
.css('opacity', 0)
.velocity("transition.slideLeftIn", {
delay: 500,
stagger: 75,
duration: 200,
complete: function(elements) {
$(this).removeAttr('style')
}
});
// Navigation list on click
$(".navigation .has-ul").on('click', function() {
if ($(this).parent('li').hasClass('active')) {
$(this).next('ul').children('li').css('opacity', 0).velocity("transition.fadeIn", {
delay: 150,
stagger: 30,
duration: 200,
complete: function(elements) {
$(this).removeAttr('style')
}
});
} else {
$(this).next('ul').children('li').css('opacity', 0).velocity("transition.slideLeftOut", {
duration: 200,
complete: function(elements) {
$(this).removeAttr('style')
}
});
}
});
});
});
|
const mouse = {
state: {
x: 0,
y: 0,
click: null
},
init: (canvas, callback) => {
canvas.addEventListener("contextmenu", event => event.preventDefault())
canvas.addEventListener("mousemove", event => {
mouse.state.x = event.layerX
mouse.state.y = event.layerY
callback(mouse.state)
})
canvas.addEventListener("mousedown", event => {
switch (event.button) {
case 0:
mouse.state.click = "left"
break
case 1:
mouse.state.click = "middle"
break
case 2:
mouse.state.click = "right"
break
default:
mouse.state.click = null
break
}
callback(mouse.state)
})
}
}
export {mouse as default}
|
(function($) {
$.fn.popup = function(options) {
var defaults = {
animation: 'fadeAndPop', //fade, fadeAndPop, none
animationspeed: 500, //how fast animtions are
closeonbackgroundclick: true, //if you click background will modal close?
dismissmodalclass: 'close-popup-modal' //the class of a button or element that will close an open modal
};
var options = $.extend({}, defaults, options);
return this.each(function() {
var modal = $(this),
topMeasure = parseInt(modal.css('top')),
topOffset = modal.height() + topMeasure,
locked = false,
modalBG = $('.popup-modal-bg');
if(modalBG.length == 0) {
modalBG = $('<div class="popup-modal-bg" />').insertAfter(modal);
}
modal.bind('popup:open', function () {
modalBG.unbind('click.modalEvent');
$('.' + options.dismissmodalclass).unbind('click.modalEvent');
if(!locked) {
lockModal();
if(options.animation == "fadeAndPop") {
modal.css({'top': $(document).scrollTop()-topOffset, 'opacity' : 0, 'visibility' : 'visible'});
modalBG.fadeIn(options.animationspeed/2);
modal.delay(options.animationspeed/2).animate({
"top": $(document).scrollTop()+topMeasure + 'px',
"opacity" : 1
}, options.animationspeed,unlockModal());
}
if(options.animation == "fade") {
modal.css({'opacity' : 0, 'visibility' : 'visible', 'top': $(document).scrollTop()+topMeasure});
modalBG.fadeIn(options.animationspeed/2);
modal.delay(options.animationspeed/2).animate({
"opacity" : 1
}, options.animationspeed,unlockModal());
}
if(options.animation == "none") {
modal.css({'visibility' : 'visible', 'top':$(document).scrollTop()+topMeasure});
modalBG.css({"display":"block"});
unlockModal()
}
}
modal.unbind('popup:open');
});
modal.bind('popup:close', function () {
if(!locked) {
lockModal();
if(options.animation == "fadeAndPop") {
modalBG.delay(options.animationspeed).fadeOut(options.animationspeed);
modal.animate({
"top": $(document).scrollTop()-topOffset + 'px',
"opacity" : 0
}, options.animationspeed/2, function() {
modal.css({'top':topMeasure, 'opacity' : 1, 'visibility' : 'hidden'});
unlockModal();
});
}
if(options.animation == "fade") {
modalBG.delay(options.animationspeed).fadeOut(options.animationspeed);
modal.animate({
"opacity" : 0
}, options.animationspeed, function() {
modal.css({'opacity' : 1, 'visibility' : 'hidden', 'top' : topMeasure});
unlockModal();
});
}
if(options.animation == "none") {
modal.css({'visibility' : 'hidden', 'top' : topMeasure});
modalBG.css({'display' : 'none'});
}
}
modal.unbind('popup:close');
});
modal.trigger('popup:open')
//Close Modal Listeners
// var closeButton = $('.' + options.dismissmodalclass).bind('click.modalEvent', function () {
// modal.trigger('popup:close')
// });
//
// if(options.closeonbackgroundclick) {
// modalBG.css({"cursor":"pointer"})
// modalBG.bind('click.modalEvent', function () {
// modal.trigger('popup:close')
// });
// }
// $('body').keyup(function(e) {
// if(e.which===27){ modal.trigger('popup:close'); } // 27 is the keycode for the Escape key
// });
var closeButton = $('.close').bind('click.modalEvent', function () {
modal.trigger('popup:close')
});
if(options.closeonbackgroundclick) {
modalBG.css({"cursor":"pointer"})
modalBG.bind('click.modalEvent', function () {
modal.trigger('popup:close')
});
}
$('.close').click(function () {
modalBG.css({"cursor":"pointer"})
modalBG.bind('click.modalEvent', function () {
modal.trigger('popup:close')
});
});
$('body').keyup(function(e) {
if(e.which===27){ modal.trigger('popup:close'); } // 27 is the keycode for the Escape key
})
function unlockModal() {
locked = false;
}
function lockModal() {
locked = true;
}
});//each call
}//orbit plugin call
})(jQuery);
|
'use strict';
/**
* Adds commas to a number
* @param {number} number
* @param {string} locale
* @return {string}
*/
module.exports = function(number, locale) {
console.log('%d == %s', number, number.toLocaleString(locale));
return number.toLocaleString(locale);
};
|
import React, { useState } from "react"
import PropTypes from "prop-types"
import { Button, Label, Row, UncontrolledAlert, Input } from "reactstrap"
function EmailPick({ nextPage }) {
const [email, setEmail] = useState(null)
const [isSend, setIsSend] = useState(false)
const regExp = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
const validateEmail = email => {
const res = regExp.test(String(email).toLowerCase())
return res
}
const sendEmail = () => {
setIsSend(true)
setTimeout(() => {
setIsSend(false)
nextPage("email", email)
}, 1000)
}
const isValidEmail = validateEmail(email)
return (
<>
<h4 className="my-4">Enter your Email</h4>
<Row className="justify-content-around">
{isSend && (
<UncontrolledAlert
color="success"
className="alert-dismissible fade show"
role="alert"
>
<i className="mdi mdi-check-all me-2" />
Email send Successfully
</UncontrolledAlert>
)}
{/* {error && (
<UncontrolledAlert
color="danger"
className="alert-dismissible fade show"
role="alert"
>
<i className="mdi mdi-block-helper me-2" />
Some Error text
</UncontrolledAlert>
)} */}
<Label className="card-radio-label mb-4">
<Input
name="email"
label="Email"
className="form-control"
placeholder="Enter email"
type="email"
validate={{ pattern: { value: regExp } }}
onChange={e => setEmail(e.target.value)}
required
/>
</Label>
<Button
type="submit"
className="col-11"
color="primary"
disabled={!isValidEmail}
onClick={sendEmail}
>
verify email
</Button>
</Row>
</>
)
}
EmailPick.propTypes = {
nextPage: PropTypes.func,
}
export default EmailPick
|
/*
Copyright (c) 2020-2021, Salih Selim Sekerci. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang("specialchar","bg",{euro:"Евро знак",lsquo:"Лява маркировка за цитат",rsquo:"Дясна маркировка за цитат",ldquo:"Лява двойна кавичка за цитат",rdquo:"Дясна двойна кавичка за цитат",ndash:"\\\\",mdash:"/",iexcl:"Обърната питанка",cent:"Знак за цент",pound:"Знак за паунд",curren:"Валутен знак",yen:"Знак за йена",brvbar:"Прекъсната линия",sect:"Знак за секция",uml:"Diaeresis",copy:"Знак за Copyright",ordf:"Feminine ordinal indicator",laquo:"Left-pointing double angle quotation mark",
not:"Not sign",reg:"Registered sign",macr:"Macron",deg:"Degree sign",sup2:"Superscript two",sup3:"Superscript three",acute:"Acute accent",micro:"Micro sign",para:"Pilcrow sign",middot:"Middle dot",cedil:"Cedilla",sup1:"Superscript one",ordm:"Masculine ordinal indicator",raquo:"Right-pointing double angle quotation mark",frac14:"Vulgar fraction one quarter",frac12:"Vulgar fraction one half",frac34:"Vulgar fraction three quarters",iquest:"Inverted question mark",Agrave:"Latin capital letter A with grave accent",
Aacute:"Latin capital letter A with acute accent",Acirc:"Latin capital letter A with circumflex",Atilde:"Latin capital letter A with tilde",Auml:"Latin capital letter A with diaeresis",Aring:"Latin capital letter A with ring above",AElig:"Latin Capital letter Æ",Ccedil:"Latin capital letter C with cedilla",Egrave:"Latin capital letter E with grave accent",Eacute:"Latin capital letter E with acute accent",Ecirc:"Latin capital letter E with circumflex",Euml:"Latin capital letter E with diaeresis",Igrave:"Latin capital letter I with grave accent",
Iacute:"Latin capital letter I with acute accent",Icirc:"Latin capital letter I with circumflex",Iuml:"Latin capital letter I with diaeresis",ETH:"Latin capital letter Eth",Ntilde:"Latin capital letter N with tilde",Ograve:"Latin capital letter O with grave accent",Oacute:"Latin capital letter O with acute accent",Ocirc:"Latin capital letter O with circumflex",Otilde:"Latin capital letter O with tilde",Ouml:"Latin capital letter O with diaeresis",times:"Multiplication sign",Oslash:"Latin capital letter O with stroke",
Ugrave:"Latin capital letter U with grave accent",Uacute:"Latin capital letter U with acute accent",Ucirc:"Latin capital letter U with circumflex",Uuml:"Latin capital letter U with diaeresis",Yacute:"Latin capital letter Y with acute accent",THORN:"Latin capital letter Thorn",szlig:"Latin small letter sharp s",agrave:"Latin small letter a with grave accent",aacute:"Latin small letter a with acute accent",acirc:"Latin small letter a with circumflex",atilde:"Latin small letter a with tilde",auml:"Latin small letter a with diaeresis",
aring:"Latin small letter a with ring above",aelig:"Latin small letter æ",ccedil:"Latin small letter c with cedilla",egrave:"Latin small letter e with grave accent",eacute:"Latin small letter e with acute accent",ecirc:"Latin small letter e with circumflex",euml:"Latin small letter e with diaeresis",igrave:"Latin small letter i with grave accent",iacute:"Latin small letter i with acute accent",icirc:"Latin small letter i with circumflex",iuml:"Latin small letter i with diaeresis",eth:"Latin small letter eth",
ntilde:"Latin small letter n with tilde",ograve:"Latin small letter o with grave accent",oacute:"Latin small letter o with acute accent",ocirc:"Latin small letter o with circumflex",otilde:"Latin small letter o with tilde",ouml:"Latin small letter o with diaeresis",divide:"Division sign",oslash:"Latin small letter o with stroke",ugrave:"Latin small letter u with grave accent",uacute:"Latin small letter u with acute accent",ucirc:"Latin small letter u with circumflex",uuml:"Latin small letter u with diaeresis",
yacute:"Latin small letter y with acute accent",thorn:"Latin small letter thorn",yuml:"Latin small letter y with diaeresis",OElig:"Latin capital ligature OE",oelig:"Latin small ligature oe",372:"Latin capital letter W with circumflex",374:"Latin capital letter Y with circumflex",373:"Latin small letter w with circumflex",375:"Latin small letter y with circumflex",sbquo:"Single low-9 quotation mark",8219:"Single high-reversed-9 quotation mark",bdquo:"Double low-9 quotation mark",hellip:"Horizontal ellipsis",
trade:"Trade mark sign",9658:"Black right-pointing pointer",bull:"Bullet",rarr:"Rightwards arrow",rArr:"Rightwards double arrow",hArr:"Left right double arrow",diams:"Black diamond suit",asymp:"Almost equal to"});
|
'use strict';
/* global app:false */
app.controller('MainCtrl', function () {
});
|
/*
Picross 3D round 2 for HTML5 Save Editor v20160704
by Marc Robledo 2016
*/
SavegameEditor={
Name:'Picross 3D: round 2',
Filename:'SAVEDATA',
AmiiboOffset:0x1a4c,
unlockAmiiboPuzzles:function(){
for(var i=0; i<9; i++){
var offset=this.AmiiboOffset+i*16;
var b=tempFile.readU8(offset);
if(!(b & 0x09)){
tempFile.writeU8(offset, b+0x09);
}
}
setValue('amiibocount', 9);
},
/* check if savegame is valid */
checkValidSavegame:function(){
return (tempFile.fileSize==45688)
},
/* load function */
load:function(){
tempFile.fileName='SAVEDATA';
var unlockedAmiibos=0;
for(var i=0; i<9; i++){
if(tempFile.readU8(this.AmiiboOffset+i*16) & 0x09){
unlockedAmiibos++;
}
}
setValue('amiibocount', unlockedAmiibos);
},
/* save function */
save:function(){
}
}
|
import OrderFormMenu from './OrderFormMenu'
export default OrderFormMenu
|
/**
* @license
* Visual Blocks Editor
*
* Copyright 2011 Google Inc.
* https://developers.google.com/blockly/
*
* 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.
*/
/**
* @fileoverview Object representing a code comment.
* @author fraser@google.com (Neil Fraser)
*/
'use strict';
goog.provide('Blockly.Comment');
goog.require('Blockly.Bubble');
goog.require('Blockly.Icon');
goog.require('goog.userAgent');
/**
* Class for a comment.
* @param {!Blockly.Block} block The block associated with this comment.
* @extends {Blockly.Icon}
* @constructor
*/
Blockly.Comment = function(block) {
Blockly.Comment.superClass_.constructor.call(this, block);
this.createIcon();
};
goog.inherits(Blockly.Comment, Blockly.Icon);
/**
* Comment text (if bubble is not visible).
* @private
*/
Blockly.Comment.prototype.text_ = '';
/**
* Width of bubble.
* @private
*/
Blockly.Comment.prototype.width_ = 160;
/**
* Height of bubble.
* @private
*/
Blockly.Comment.prototype.height_ = 80;
/**
* Draw the comment icon.
* @param {!Element} group The icon group.
* @private
*/
Blockly.Comment.prototype.drawIcon_ = function(group) {
// Circle.
Blockly.createSvgElement('circle',
{'class': 'blocklyIconShape', 'r': '8', 'cx': '8', 'cy': '8'},
group);
// Can't use a real '?' text character since different browsers and operating
// systems render it differently.
// Body of question mark.
Blockly.createSvgElement('path',
{'class': 'blocklyIconSymbol',
'd': 'm6.8,10h2c0.003,-0.617 0.271,-0.962 0.633,-1.266 2.875,-2.405 0.607,-5.534 -3.765,-3.874v1.7c3.12,-1.657 3.698,0.118 2.336,1.25 -1.201,0.998 -1.201,1.528 -1.204,2.19z'},
group);
// Dot of question point.
Blockly.createSvgElement('rect',
{'class': 'blocklyIconSymbol',
'x': '6.8', 'y': '10.78', 'height': '2', 'width': '2'},
group);
};
/**
* Create the editor for the comment's bubble.
* @return {!Element} The top-level node of the editor.
* @private
*/
Blockly.Comment.prototype.createEditor_ = function() {
/* Create the editor. Here's the markup that will be generated:
<foreignObject x="8" y="8" width="164" height="164">
<body xmlns="http://www.w3.org/1999/xhtml" class="blocklyMinimalBody">
<textarea xmlns="http://www.w3.org/1999/xhtml"
class="blocklyCommentTextarea"
style="height: 164px; width: 164px;"></textarea>
</body>
</foreignObject>
*/
this.foreignObject_ = Blockly.createSvgElement('foreignObject',
{'x': Blockly.Bubble.BORDER_WIDTH, 'y': Blockly.Bubble.BORDER_WIDTH},
null);
var body = document.createElementNS(Blockly.HTML_NS, 'body');
body.setAttribute('xmlns', Blockly.HTML_NS);
body.className = 'blocklyMinimalBody';
var textarea = document.createElementNS(Blockly.HTML_NS, 'textarea');
textarea.className = 'blocklyCommentTextarea';
textarea.setAttribute('dir', this.block_.RTL ? 'RTL' : 'LTR');
body.appendChild(textarea);
this.textarea_ = textarea;
this.foreignObject_.appendChild(body);
Blockly.bindEvent_(textarea, 'mouseup', this, this.textareaFocus_);
// Don't zoom with mousewheel.
Blockly.bindEvent_(textarea, 'wheel', this, function(e) {
e.stopPropagation();
});
Blockly.bindEvent_(textarea, 'change', this, function(e) {
if (this.text_ != textarea.value) {
Blockly.Events.fire(new Blockly.Events.Change(
this.block_, 'comment', null, this.text_, textarea.value));
this.text_ = textarea.value;
}
});
setTimeout(function() {
textarea.focus();
}, 0);
return this.foreignObject_;
};
/**
* Add or remove editability of the comment.
* @override
*/
Blockly.Comment.prototype.updateEditable = function() {
if (this.isVisible()) {
// Toggling visibility will force a rerendering.
this.setVisible(false);
this.setVisible(true);
}
// Allow the icon to update.
Blockly.Icon.prototype.updateEditable.call(this);
};
/**
* Callback function triggered when the bubble has resized.
* Resize the text area accordingly.
* @private
*/
Blockly.Comment.prototype.resizeBubble_ = function() {
if (this.isVisible()) {
var size = this.bubble_.getBubbleSize();
var doubleBorderWidth = 2 * Blockly.Bubble.BORDER_WIDTH;
this.foreignObject_.setAttribute('width', size.width - doubleBorderWidth);
this.foreignObject_.setAttribute('height', size.height - doubleBorderWidth);
this.textarea_.style.width = (size.width - doubleBorderWidth - 4) + 'px';
this.textarea_.style.height = (size.height - doubleBorderWidth - 4) + 'px';
}
};
/**
* Show or hide the comment bubble.
* @param {boolean} visible True if the bubble should be visible.
*/
Blockly.Comment.prototype.setVisible = function(visible) {
if (visible == this.isVisible()) {
// No change.
return;
}
Blockly.Events.fire(
new Blockly.Events.Ui(this.block_, 'commentOpen', !visible, visible));
if ((!this.block_.isEditable() && !this.textarea_) || goog.userAgent.IE) {
// Steal the code from warnings to make an uneditable text bubble.
// MSIE does not support foreignobject; textareas are impossible.
// http://msdn.microsoft.com/en-us/library/hh834675%28v=vs.85%29.aspx
// Always treat comments in IE as uneditable.
Blockly.Warning.prototype.setVisible.call(this, visible);
return;
}
// Save the bubble stats before the visibility switch.
var text = this.getText();
var size = this.getBubbleSize();
if (visible) {
// Create the bubble.
this.bubble_ = new Blockly.Bubble(
/** @type {!Blockly.WorkspaceSvg} */ (this.block_.workspace),
this.createEditor_(), this.block_.svgPath_,
this.iconXY_, this.width_, this.height_);
this.bubble_.registerResizeEvent(this.resizeBubble_.bind(this));
this.updateColour();
} else {
// Dispose of the bubble.
this.bubble_.dispose();
this.bubble_ = null;
this.textarea_ = null;
this.foreignObject_ = null;
}
// Restore the bubble stats after the visibility switch.
this.setText(text);
this.setBubbleSize(size.width, size.height);
};
/**
* Bring the comment to the top of the stack when clicked on.
* @param {!Event} e Mouse up event.
* @private
*/
Blockly.Comment.prototype.textareaFocus_ = function(e) {
// Ideally this would be hooked to the focus event for the comment.
// However doing so in Firefox swallows the cursor for unknown reasons.
// So this is hooked to mouseup instead. No big deal.
this.bubble_.promote_();
// Since the act of moving this node within the DOM causes a loss of focus,
// we need to reapply the focus.
this.textarea_.focus();
};
/**
* Get the dimensions of this comment's bubble.
* @return {!Object} Object with width and height properties.
*/
Blockly.Comment.prototype.getBubbleSize = function() {
if (this.isVisible()) {
return this.bubble_.getBubbleSize();
} else {
return {width: this.width_, height: this.height_};
}
};
/**
* Size this comment's bubble.
* @param {number} width Width of the bubble.
* @param {number} height Height of the bubble.
*/
Blockly.Comment.prototype.setBubbleSize = function(width, height) {
if (this.textarea_) {
this.bubble_.setBubbleSize(width, height);
} else {
this.width_ = width;
this.height_ = height;
}
};
/**
* Returns this comment's text.
* @return {string} Comment text.
*/
Blockly.Comment.prototype.getText = function() {
return this.textarea_ ? this.textarea_.value : this.text_;
};
/**
* Set this comment's text.
* @param {string} text Comment text.
*/
Blockly.Comment.prototype.setText = function(text) {
if (this.text_ != text) {
Blockly.Events.fire(new Blockly.Events.Change(
this.block_, 'comment', null, this.text_, text));
this.text_ = text;
}
if (this.textarea_) {
this.textarea_.value = text;
}
};
/**
* Dispose of this comment.
*/
Blockly.Comment.prototype.dispose = function() {
if (Blockly.Events.isEnabled()) {
this.setText(''); // Fire event to delete comment.
}
this.block_.comment = null;
Blockly.Icon.prototype.dispose.call(this);
};
|
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Tokenizer = void 0;
var TextRange_1 = require("./TextRange");
var Token_1 = require("./Token");
var Tokenizer = /** @class */ (function () {
function Tokenizer() {
}
/**
* Given a list of input lines, this returns an array of extracted tokens.
* The last token will always be TokenKind.EndOfInput.
*/
Tokenizer.readTokens = function (lines) {
Tokenizer._ensureInitialized();
var tokens = [];
var lastLine = undefined;
for (var _i = 0, lines_1 = lines; _i < lines_1.length; _i++) {
var line = lines_1[_i];
Tokenizer._pushTokensForLine(tokens, line);
lastLine = line;
}
if (lastLine) {
tokens.push(new Token_1.Token(Token_1.TokenKind.EndOfInput, lastLine.getNewRange(lastLine.end, lastLine.end), lastLine));
}
else {
tokens.push(new Token_1.Token(Token_1.TokenKind.EndOfInput, TextRange_1.TextRange.empty, TextRange_1.TextRange.empty));
}
return tokens;
};
/**
* Returns true if the token is a CommonMark punctuation character.
* These are basically all the ASCII punctuation characters.
*/
Tokenizer.isPunctuation = function (tokenKind) {
Tokenizer._ensureInitialized();
return Tokenizer._punctuationTokens[tokenKind] || false;
};
Tokenizer._pushTokensForLine = function (tokens, line) {
var buffer = line.buffer;
var end = line.end;
var bufferIndex = line.pos;
var tokenKind = undefined;
var tokenPos = bufferIndex;
while (bufferIndex < end) {
// Read a character and determine its kind
var charCode = buffer.charCodeAt(bufferIndex);
var characterKind = Tokenizer._charCodeMap[charCode];
if (characterKind === undefined) {
characterKind = Token_1.TokenKind.Other;
}
// Can we append to an existing token? Yes if:
// 1. There is an existing token, AND
// 2. It is the same kind of token, AND
// 3. It's not punctuation (which is always one character)
if (tokenKind !== undefined &&
characterKind === tokenKind &&
Tokenizer._isMultiCharacterToken(tokenKind)) {
// yes, append
}
else {
// Is there a previous completed token to push?
if (tokenKind !== undefined) {
tokens.push(new Token_1.Token(tokenKind, line.getNewRange(tokenPos, bufferIndex), line));
}
tokenPos = bufferIndex;
tokenKind = characterKind;
}
++bufferIndex;
}
// Is there a previous completed token to push?
if (tokenKind !== undefined) {
tokens.push(new Token_1.Token(tokenKind, line.getNewRange(tokenPos, bufferIndex), line));
}
tokens.push(new Token_1.Token(Token_1.TokenKind.Newline, line.getNewRange(line.end, line.end), line));
};
/**
* Returns true if the token can be comprised of multiple characters
*/
Tokenizer._isMultiCharacterToken = function (kind) {
switch (kind) {
case Token_1.TokenKind.Spacing:
case Token_1.TokenKind.AsciiWord:
case Token_1.TokenKind.Other:
return true;
}
return false;
};
Tokenizer._ensureInitialized = function () {
if (Tokenizer._charCodeMap) {
return;
}
Tokenizer._charCodeMap = {};
Tokenizer._punctuationTokens = {};
// All Markdown punctuation characters
var punctuation = Tokenizer._commonMarkPunctuationCharacters;
for (var i = 0; i < punctuation.length; ++i) {
var charCode = punctuation.charCodeAt(i);
Tokenizer._charCodeMap[charCode] = Token_1.TokenKind.OtherPunctuation;
}
// Special symbols
// !"#$%&\'()*+,\-.\/:;<=>?@[\\]^_`{|}~
var specialMap = {
'\\': Token_1.TokenKind.Backslash,
'<': Token_1.TokenKind.LessThan,
'>': Token_1.TokenKind.GreaterThan,
'=': Token_1.TokenKind.Equals,
"'": Token_1.TokenKind.SingleQuote,
'"': Token_1.TokenKind.DoubleQuote,
'/': Token_1.TokenKind.Slash,
'-': Token_1.TokenKind.Hyphen,
'@': Token_1.TokenKind.AtSign,
'{': Token_1.TokenKind.LeftCurlyBracket,
'}': Token_1.TokenKind.RightCurlyBracket,
'`': Token_1.TokenKind.Backtick,
'.': Token_1.TokenKind.Period,
':': Token_1.TokenKind.Colon,
',': Token_1.TokenKind.Comma,
'[': Token_1.TokenKind.LeftSquareBracket,
']': Token_1.TokenKind.RightSquareBracket,
'|': Token_1.TokenKind.Pipe,
'(': Token_1.TokenKind.LeftParenthesis,
')': Token_1.TokenKind.RightParenthesis,
'#': Token_1.TokenKind.PoundSymbol,
'+': Token_1.TokenKind.Plus,
$: Token_1.TokenKind.DollarSign
};
for (var _i = 0, _a = Object.getOwnPropertyNames(specialMap); _i < _a.length; _i++) {
var key = _a[_i];
Tokenizer._charCodeMap[key.charCodeAt(0)] = specialMap[key];
Tokenizer._punctuationTokens[specialMap[key]] = true;
}
Tokenizer._punctuationTokens[Token_1.TokenKind.OtherPunctuation] = true;
var word = Tokenizer._wordCharacters;
for (var i = 0; i < word.length; ++i) {
var charCode = word.charCodeAt(i);
Tokenizer._charCodeMap[charCode] = Token_1.TokenKind.AsciiWord;
}
Tokenizer._charCodeMap[' '.charCodeAt(0)] = Token_1.TokenKind.Spacing;
Tokenizer._charCodeMap['\t'.charCodeAt(0)] = Token_1.TokenKind.Spacing;
};
Tokenizer._commonMarkPunctuationCharacters = '!"#$%&\'()*+,-./:;<=>?@[\\]^`{|}~';
Tokenizer._wordCharacters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_';
return Tokenizer;
}());
exports.Tokenizer = Tokenizer;
//# sourceMappingURL=Tokenizer.js.map
|
const Times = (count, cb, thisArg) => {
return new Array(count).fill().map(
thisArg ?
function(_, index) {
return cb.bind(thisArg)(index);
} :
function(_, index) {
return cb(index)
}
);
};
export default Times
|
/* @generated */
// prettier-ignore
if (Intl.DisplayNames && typeof Intl.DisplayNames.__addLocaleData === 'function') {
Intl.DisplayNames.__addLocaleData({"data":{"types":{"language":{"long":{"aa":"Afar","ab":"Abkhazian","ace":"Achinese","ach":"Acoli","ada":"Adangme","ady":"Adyghe","ae":"Avestan","aeb":"Tunisian Arabic","af":"Afrikaans","afh":"Afrihili","agq":"Aghem","ain":"Ainu","ak":"Akan","akk":"Akkadian","akz":"Alabama","ale":"Aleut","aln":"Gheg Albanian","alt":"Southern Altai","am":"Amharic","an":"Aragonese","ang":"Old English","anp":"Angika","ar":"Arabic","ar-001":"Modern Standard Arabic","arc":"Aramaic","arn":"Mapuche","aro":"Araona","arp":"Arapaho","arq":"Algerian Arabic","ars":"Najdi Arabic","arw":"Arawak","ary":"Moroccan Arabic","arz":"Egyptian Arabic","as":"Assamese","asa":"Asu","ase":"American Sign Language","ast":"Asturian","av":"Avaric","avk":"Kotava","awa":"Awadhi","ay":"Aymara","az":"Azerbaijani","ba":"Bashkir","bal":"Baluchi","ban":"Balinese","bar":"Bavarian","bas":"Basaa","bax":"Bamun","bbc":"Batak Toba","bbj":"Ghomala","be":"Belarusian","bej":"Beja","bem":"Bemba","bew":"Betawi","bez":"Bena","bfd":"Bafut","bfq":"Badaga","bg":"Bulgarian","bgn":"Western Balochi","bho":"Bhojpuri","bi":"Bislama","bik":"Bikol","bin":"Bini","bjn":"Banjar","bkm":"Kom","bla":"Siksika","bm":"Bambara","bn":"Bangla","bo":"Tibetan","bpy":"Bishnupriya","bqi":"Bakhtiari","br":"Breton","bra":"Braj","brh":"Brahui","brx":"Bodo","bs":"Bosnian","bss":"Akoose","bua":"Buriat","bug":"Buginese","bum":"Bulu","byn":"Blin","byv":"Medumba","ca":"Catalan","cad":"Caddo","car":"Carib","cay":"Cayuga","cch":"Atsam","ccp":"Chakma","ce":"Chechen","ceb":"Cebuano","cgg":"Chiga","ch":"Chamorro","chb":"Chibcha","chg":"Chagatai","chk":"Chuukese","chm":"Mari","chn":"Chinook Jargon","cho":"Choctaw","chp":"Chipewyan","chr":"Cherokee","chy":"Cheyenne","cic":"Chickasaw","ckb":"Central Kurdish","co":"Corsican","cop":"Coptic","cps":"Capiznon","cr":"Cree","crh":"Crimean Turkish","crs":"Seselwa Creole French","cs":"Czech","csb":"Kashubian","cu":"Church Slavic","cv":"Chuvash","cy":"Welsh","da":"Danish","dak":"Dakota","dar":"Dargwa","dav":"Taita","de":"German","de-AT":"Austrian German","de-CH":"Swiss High German","del":"Delaware","den":"Slave","dgr":"Dogrib","din":"Dinka","dje":"Zarma","doi":"Dogri","dsb":"Lower Sorbian","dtp":"Central Dusun","dua":"Duala","dum":"Middle Dutch","dv":"Divehi","dyo":"Jola-Fonyi","dyu":"Dyula","dz":"Dzongkha","dzg":"Dazaga","ebu":"Embu","ee":"Ewe","efi":"Efik","egl":"Emilian","egy":"Ancient Egyptian","eka":"Ekajuk","el":"Greek","elx":"Elamite","en":"English","en-AU":"Australian English","en-CA":"Canadian English","en-GB":"British English","en-US":"American English","enm":"Middle English","eo":"Esperanto","es":"Spanish","es-419":"Latin American Spanish","es-ES":"European Spanish","es-MX":"Mexican Spanish","esu":"Central Yupik","et":"Estonian","eu":"Basque","ewo":"Ewondo","ext":"Extremaduran","fa":"Persian","fa-AF":"Dari","fan":"Fang","fat":"Fanti","ff":"Fulah","fi":"Finnish","fil":"Filipino","fit":"Tornedalen Finnish","fj":"Fijian","fo":"Faroese","fon":"Fon","fr":"French","fr-CA":"Canadian French","fr-CH":"Swiss French","frc":"Cajun French","frm":"Middle French","fro":"Old French","frp":"Arpitan","frr":"Northern Frisian","frs":"Eastern Frisian","fur":"Friulian","fy":"Western Frisian","ga":"Irish","gaa":"Ga","gag":"Gagauz","gan":"Gan Chinese","gay":"Gayo","gba":"Gbaya","gbz":"Zoroastrian Dari","gd":"Scottish Gaelic","gez":"Geez","gil":"Gilbertese","gl":"Galician","glk":"Gilaki","gmh":"Middle High German","gn":"Guarani","goh":"Old High German","gom":"Goan Konkani","gon":"Gondi","gor":"Gorontalo","got":"Gothic","grb":"Grebo","grc":"Ancient Greek","gsw":"Swiss German","gu":"Gujarati","guc":"Wayuu","gur":"Frafra","guz":"Gusii","gv":"Manx","gwi":"Gwichʼin","ha":"Hausa","hai":"Haida","hak":"Hakka Chinese","haw":"Hawaiian","he":"Hebrew","hi":"Hindi","hif":"Fiji Hindi","hil":"Hiligaynon","hit":"Hittite","hmn":"Hmong","ho":"Hiri Motu","hr":"Croatian","hsb":"Upper Sorbian","hsn":"Xiang Chinese","ht":"Haitian Creole","hu":"Hungarian","hup":"Hupa","hy":"Armenian","hz":"Herero","ia":"Interlingua","iba":"Iban","ibb":"Ibibio","id":"Indonesian","ie":"Interlingue","ig":"Igbo","ii":"Sichuan Yi","ik":"Inupiaq","ilo":"Iloko","inh":"Ingush","io":"Ido","is":"Icelandic","it":"Italian","iu":"Inuktitut","izh":"Ingrian","ja":"Japanese","jam":"Jamaican Creole English","jbo":"Lojban","jgo":"Ngomba","jmc":"Machame","jpr":"Judeo-Persian","jrb":"Judeo-Arabic","jut":"Jutish","jv":"Javanese","ka":"Georgian","kaa":"Kara-Kalpak","kab":"Kabyle","kac":"Kachin","kaj":"Jju","kam":"Kamba","kaw":"Kawi","kbd":"Kabardian","kbl":"Kanembu","kcg":"Tyap","kde":"Makonde","kea":"Kabuverdianu","ken":"Kenyang","kfo":"Koro","kg":"Kongo","kgp":"Kaingang","kha":"Khasi","kho":"Khotanese","khq":"Koyra Chiini","khw":"Khowar","ki":"Kikuyu","kiu":"Kirmanjki","kj":"Kuanyama","kk":"Kazakh","kkj":"Kako","kl":"Kalaallisut","kln":"Kalenjin","km":"Khmer","kmb":"Kimbundu","kn":"Kannada","ko":"Korean","koi":"Komi-Permyak","kok":"Konkani","kos":"Kosraean","kpe":"Kpelle","kr":"Kanuri","krc":"Karachay-Balkar","kri":"Krio","krj":"Kinaray-a","krl":"Karelian","kru":"Kurukh","ks":"Kashmiri","ksb":"Shambala","ksf":"Bafia","ksh":"Colognian","ku":"Kurdish","kum":"Kumyk","kut":"Kutenai","kv":"Komi","kw":"Cornish","ky":"Kyrgyz","la":"Latin","lad":"Ladino","lag":"Langi","lah":"Lahnda","lam":"Lamba","lb":"Luxembourgish","lez":"Lezghian","lfn":"Lingua Franca Nova","lg":"Ganda","li":"Limburgish","lij":"Ligurian","liv":"Livonian","lkt":"Lakota","lmo":"Lombard","ln":"Lingala","lo":"Lao","lol":"Mongo","lou":"Louisiana Creole","loz":"Lozi","lrc":"Northern Luri","lt":"Lithuanian","ltg":"Latgalian","lu":"Luba-Katanga","lua":"Luba-Lulua","lui":"Luiseno","lun":"Lunda","luo":"Luo","lus":"Mizo","luy":"Luyia","lv":"Latvian","lzh":"Literary Chinese","lzz":"Laz","mad":"Madurese","maf":"Mafa","mag":"Magahi","mai":"Maithili","mak":"Makasar","man":"Mandingo","mas":"Masai","mde":"Maba","mdf":"Moksha","mdr":"Mandar","men":"Mende","mer":"Meru","mfe":"Morisyen","mg":"Malagasy","mga":"Middle Irish","mgh":"Makhuwa-Meetto","mgo":"Metaʼ","mh":"Marshallese","mi":"Maori","mic":"Mi'kmaq","min":"Minangkabau","mk":"Macedonian","ml":"Malayalam","mn":"Mongolian","mnc":"Manchu","mni":"Manipuri","moh":"Mohawk","mos":"Mossi","mr":"Marathi","mrj":"Western Mari","ms":"Malay","mt":"Maltese","mua":"Mundang","mul":"Multiple languages","mus":"Creek","mwl":"Mirandese","mwr":"Marwari","mwv":"Mentawai","my":"Burmese","mye":"Myene","myv":"Erzya","mzn":"Mazanderani","na":"Nauru","nan":"Min Nan Chinese","nap":"Neapolitan","naq":"Nama","nb":"Norwegian Bokmål","nd":"North Ndebele","nds":"Low German","nds-NL":"West Low German","ne":"Nepali","new":"Newari","ng":"Ndonga","nia":"Nias","niu":"Niuean","njo":"Ao Naga","nl":"Dutch","nl-BE":"Flemish","nmg":"Kwasio","nn":"Norwegian Nynorsk","nnh":"Ngiemboon","no":"Norwegian","nog":"Nogai","non":"Old Norse","nov":"Novial","nqo":"N’Ko","nr":"South Ndebele","nso":"Northern Sotho","nus":"Nuer","nv":"Navajo","nwc":"Classical Newari","ny":"Nyanja","nym":"Nyamwezi","nyn":"Nyankole","nyo":"Nyoro","nzi":"Nzima","oc":"Occitan","oj":"Ojibwa","om":"Oromo","or":"Odia","os":"Ossetic","osa":"Osage","ota":"Ottoman Turkish","pa":"Punjabi","pag":"Pangasinan","pal":"Pahlavi","pam":"Pampanga","pap":"Papiamento","pau":"Palauan","pcd":"Picard","pcm":"Nigerian Pidgin","pdc":"Pennsylvania German","pdt":"Plautdietsch","peo":"Old Persian","pfl":"Palatine German","phn":"Phoenician","pi":"Pali","pl":"Polish","pms":"Piedmontese","pnt":"Pontic","pon":"Pohnpeian","prg":"Prussian","pro":"Old Provençal","ps":"Pashto","pt":"Portuguese","pt-BR":"Brazilian Portuguese","pt-PT":"European Portuguese","qu":"Quechua","quc":"Kʼicheʼ","qug":"Chimborazo Highland Quichua","raj":"Rajasthani","rap":"Rapanui","rar":"Rarotongan","rgn":"Romagnol","rif":"Riffian","rm":"Romansh","rn":"Rundi","ro":"Romanian","ro-MD":"Moldavian","rof":"Rombo","rom":"Romany","root":"Root","rtm":"Rotuman","ru":"Russian","rue":"Rusyn","rug":"Roviana","rup":"Aromanian","rw":"Kinyarwanda","rwk":"Rwa","sa":"Sanskrit","sad":"Sandawe","sah":"Sakha","sam":"Samaritan Aramaic","saq":"Samburu","sas":"Sasak","sat":"Santali","saz":"Saurashtra","sba":"Ngambay","sbp":"Sangu","sc":"Sardinian","scn":"Sicilian","sco":"Scots","sd":"Sindhi","sdc":"Sassarese Sardinian","sdh":"Southern Kurdish","se":"Northern Sami","see":"Seneca","seh":"Sena","sei":"Seri","sel":"Selkup","ses":"Koyraboro Senni","sg":"Sango","sga":"Old Irish","sgs":"Samogitian","sh":"Serbo-Croatian","shi":"Tachelhit","shn":"Shan","shu":"Chadian Arabic","si":"Sinhala","sid":"Sidamo","sk":"Slovak","sl":"Slovenian","sli":"Lower Silesian","sly":"Selayar","sm":"Samoan","sma":"Southern Sami","smj":"Lule Sami","smn":"Inari Sami","sms":"Skolt Sami","sn":"Shona","snk":"Soninke","so":"Somali","sog":"Sogdien","sq":"Albanian","sr":"Serbian","sr-ME":"Montenegrin","srn":"Sranan Tongo","srr":"Serer","ss":"Swati","ssy":"Saho","st":"Southern Sotho","stq":"Saterland Frisian","su":"Sundanese","suk":"Sukuma","sus":"Susu","sux":"Sumerian","sv":"Swedish","sw":"Swahili","sw-CD":"Congo Swahili","swb":"Comorian","syc":"Classical Syriac","syr":"Syriac","szl":"Silesian","ta":"Tamil","tcy":"Tulu","te":"Telugu","tem":"Timne","teo":"Teso","ter":"Tereno","tet":"Tetum","tg":"Tajik","th":"Thai","ti":"Tigrinya","tig":"Tigre","tiv":"Tiv","tk":"Turkmen","tkl":"Tokelau","tkr":"Tsakhur","tl":"Tagalog","tlh":"Klingon","tli":"Tlingit","tly":"Talysh","tmh":"Tamashek","tn":"Tswana","to":"Tongan","tog":"Nyasa Tonga","tpi":"Tok Pisin","tr":"Turkish","tru":"Turoyo","trv":"Taroko","ts":"Tsonga","tsd":"Tsakonian","tsi":"Tsimshian","tt":"Tatar","ttt":"Muslim Tat","tum":"Tumbuka","tvl":"Tuvalu","tw":"Twi","twq":"Tasawaq","ty":"Tahitian","tyv":"Tuvinian","tzm":"Central Atlas Tamazight","udm":"Udmurt","ug":"Uyghur","uga":"Ugaritic","uk":"Ukrainian","umb":"Umbundu","und":"Unknown language","ur":"Urdu","uz":"Uzbek","vai":"Vai","ve":"Venda","vec":"Venetian","vep":"Veps","vi":"Vietnamese","vls":"West Flemish","vmf":"Main-Franconian","vo":"Volapük","vot":"Votic","vro":"Võro","vun":"Vunjo","wa":"Walloon","wae":"Walser","wal":"Wolaytta","war":"Waray","was":"Washo","wbp":"Warlpiri","wo":"Wolof","wuu":"Wu Chinese","xal":"Kalmyk","xh":"Xhosa","xmf":"Mingrelian","xog":"Soga","yao":"Yao","yap":"Yapese","yav":"Yangben","ybb":"Yemba","yi":"Yiddish","yo":"Yoruba","yrl":"Nheengatu","yue":"Cantonese","za":"Zhuang","zap":"Zapotec","zbl":"Blissymbols","zea":"Zeelandic","zen":"Zenaga","zgh":"Standard Moroccan Tamazight","zh":"Chinese","zh-Hans":"Simplified Chinese","zh-Hant":"Traditional Chinese","zu":"Zulu","zun":"Zuni","zxx":"No linguistic content","zza":"Zaza"},"short":{"az":"Azeri","en-GB":"UK English","en-US":"US English"},"narrow":{}},"region":{"long":{"142":"Asia","143":"Central Asia","145":"Western Asia","150":"Europe","151":"Eastern Europe","154":"Northern Europe","155":"Western Europe","202":"Sub-Saharan Africa","419":"Latin America","001":"World","002":"Africa","003":"North America","005":"South America","009":"Oceania","011":"Western Africa","013":"Central America","014":"Eastern Africa","015":"Northern Africa","017":"Middle Africa","018":"Southern Africa","019":"Americas","021":"Northern America","029":"Caribbean","030":"Eastern Asia","034":"Southern Asia","035":"Southeast Asia","039":"Southern Europe","053":"Australasia","054":"Melanesia","057":"Micronesian Region","061":"Polynesia","AC":"Ascension Island","AD":"Andorra","AE":"United Arab Emirates","AF":"Afghanistan","AG":"Antigua & Barbuda","AI":"Anguilla","AL":"Albania","AM":"Armenia","AO":"Angola","AQ":"Antarctica","AR":"Argentina","AS":"American Samoa","AT":"Austria","AU":"Australia","AW":"Aruba","AX":"Åland Islands","AZ":"Azerbaijan","BA":"Bosnia & Herzegovina","BB":"Barbados","BD":"Bangladesh","BE":"Belgium","BF":"Burkina Faso","BG":"Bulgaria","BH":"Bahrain","BI":"Burundi","BJ":"Benin","BL":"St Barthélemy","BM":"Bermuda","BN":"Brunei","BO":"Bolivia","BQ":"Caribbean Netherlands","BR":"Brazil","BS":"Bahamas","BT":"Bhutan","BV":"Bouvet Island","BW":"Botswana","BY":"Belarus","BZ":"Belize","CA":"Canada","CC":"Cocos (Keeling) Islands","CD":"Congo - Kinshasa","CF":"Central African Republic","CG":"Congo - Brazzaville","CH":"Switzerland","CI":"Côte d’Ivoire","CK":"Cook Islands","CL":"Chile","CM":"Cameroon","CN":"China","CO":"Colombia","CP":"Clipperton Island","CR":"Costa Rica","CU":"Cuba","CV":"Cape Verde","CW":"Curaçao","CX":"Christmas Island","CY":"Cyprus","CZ":"Czechia","DE":"Germany","DG":"Diego Garcia","DJ":"Djibouti","DK":"Denmark","DM":"Dominica","DO":"Dominican Republic","DZ":"Algeria","EA":"Ceuta & Melilla","EC":"Ecuador","EE":"Estonia","EG":"Egypt","EH":"Western Sahara","ER":"Eritrea","ES":"Spain","ET":"Ethiopia","EU":"European Union","EZ":"Eurozone","FI":"Finland","FJ":"Fiji","FK":"Falkland Islands","FM":"Micronesia","FO":"Faroe Islands","FR":"France","GA":"Gabon","GB":"United Kingdom","GD":"Grenada","GE":"Georgia","GF":"French Guiana","GG":"Guernsey","GH":"Ghana","GI":"Gibraltar","GL":"Greenland","GM":"Gambia","GN":"Guinea","GP":"Guadeloupe","GQ":"Equatorial Guinea","GR":"Greece","GS":"South Georgia & South Sandwich Islands","GT":"Guatemala","GU":"Guam","GW":"Guinea-Bissau","GY":"Guyana","HK":"Hong Kong SAR China","HM":"Heard & McDonald Islands","HN":"Honduras","HR":"Croatia","HT":"Haiti","HU":"Hungary","IC":"Canary Islands","ID":"Indonesia","IE":"Ireland","IL":"Israel","IM":"Isle of Man","IN":"India","IO":"British Indian Ocean Territory","IQ":"Iraq","IR":"Iran","IS":"Iceland","IT":"Italy","JE":"Jersey","JM":"Jamaica","JO":"Jordan","JP":"Japan","KE":"Kenya","KG":"Kyrgyzstan","KH":"Cambodia","KI":"Kiribati","KM":"Comoros","KN":"St Kitts & Nevis","KP":"North Korea","KR":"South Korea","KW":"Kuwait","KY":"Cayman Islands","KZ":"Kazakhstan","LA":"Laos","LB":"Lebanon","LC":"St Lucia","LI":"Liechtenstein","LK":"Sri Lanka","LR":"Liberia","LS":"Lesotho","LT":"Lithuania","LU":"Luxembourg","LV":"Latvia","LY":"Libya","MA":"Morocco","MC":"Monaco","MD":"Moldova","ME":"Montenegro","MF":"St Martin","MG":"Madagascar","MH":"Marshall Islands","MK":"North Macedonia","ML":"Mali","MM":"Myanmar (Burma)","MN":"Mongolia","MO":"Macao SAR China","MP":"Northern Mariana Islands","MQ":"Martinique","MR":"Mauritania","MS":"Montserrat","MT":"Malta","MU":"Mauritius","MV":"Maldives","MW":"Malawi","MX":"Mexico","MY":"Malaysia","MZ":"Mozambique","NA":"Namibia","NC":"New Caledonia","NE":"Niger","NF":"Norfolk Island","NG":"Nigeria","NI":"Nicaragua","NL":"Netherlands","NO":"Norway","NP":"Nepal","NR":"Nauru","NU":"Niue","NZ":"New Zealand","OM":"Oman","PA":"Panama","PE":"Peru","PF":"French Polynesia","PG":"Papua New Guinea","PH":"Philippines","PK":"Pakistan","PL":"Poland","PM":"St Pierre & Miquelon","PN":"Pitcairn Islands","PR":"Puerto Rico","PS":"Palestinian Territories","PT":"Portugal","PW":"Palau","PY":"Paraguay","QA":"Qatar","QO":"Outlying Oceania","RE":"Réunion","RO":"Romania","RS":"Serbia","RU":"Russia","RW":"Rwanda","SA":"Saudi Arabia","SB":"Solomon Islands","SC":"Seychelles","SD":"Sudan","SE":"Sweden","SG":"Singapore","SH":"St Helena","SI":"Slovenia","SJ":"Svalbard & Jan Mayen","SK":"Slovakia","SL":"Sierra Leone","SM":"San Marino","SN":"Senegal","SO":"Somalia","SR":"Suriname","SS":"South Sudan","ST":"São Tomé & Príncipe","SV":"El Salvador","SX":"Sint Maarten","SY":"Syria","SZ":"Eswatini","TA":"Tristan da Cunha","TC":"Turks & Caicos Islands","TD":"Chad","TF":"French Southern Territories","TG":"Togo","TH":"Thailand","TJ":"Tajikistan","TK":"Tokelau","TL":"Timor-Leste","TM":"Turkmenistan","TN":"Tunisia","TO":"Tonga","TR":"Turkey","TT":"Trinidad & Tobago","TV":"Tuvalu","TW":"Taiwan","TZ":"Tanzania","UA":"Ukraine","UG":"Uganda","UM":"US Outlying Islands","UN":"United Nations","US":"United States","UY":"Uruguay","UZ":"Uzbekistan","VA":"Vatican City","VC":"St Vincent & Grenadines","VE":"Venezuela","VG":"British Virgin Islands","VI":"US Virgin Islands","VN":"Vietnam","VU":"Vanuatu","WF":"Wallis & Futuna","WS":"Samoa","XA":"Pseudo-Accents","XB":"Pseudo-Bidi","XK":"Kosovo","YE":"Yemen","YT":"Mayotte","ZA":"South Africa","ZM":"Zambia","ZW":"Zimbabwe","ZZ":"Unknown Region"},"short":{"BA":"Bosnia","GB":"UK","HK":"Hong Kong","MM":"Myanmar","MO":"Macao","PS":"Palestine","UN":"UN","US":"US"},"narrow":{}},"script":{"long":{"Adlm":"Adlam","Afak":"Afaka","Aghb":"Caucasian Albanian","Ahom":"Ahom","Arab":"Arabic","Aran":"Nastaliq","Armi":"Imperial Aramaic","Armn":"Armenian","Avst":"Avestan","Bali":"Balinese","Bamu":"Bamum","Bass":"Bassa Vah","Batk":"Batak","Beng":"Bangla","Bhks":"Bhaiksuki","Blis":"Blissymbols","Bopo":"Bopomofo","Brah":"Brahmi","Brai":"Braille","Bugi":"Buginese","Buhd":"Buhid","Cakm":"Chakma","Cans":"Unified Canadian Aboriginal Syllabics","Cari":"Carian","Cham":"Cham","Cher":"Cherokee","Chrs":"Chorasmian","Cirt":"Cirth","Copt":"Coptic","Cprt":"Cypriot","Cyrl":"Cyrillic","Cyrs":"Old Church Slavonic Cyrillic","Deva":"Devanagari","Diak":"Dives Akuru","Dogr":"Dogra","Dsrt":"Deseret","Dupl":"Duployan shorthand","Egyd":"Egyptian demotic","Egyh":"Egyptian hieratic","Egyp":"Egyptian hieroglyphs","Elba":"Elbasan","Elym":"Elymaic","Ethi":"Ethiopic","Geok":"Georgian Khutsuri","Geor":"Georgian","Glag":"Glagolitic","Gong":"Gunjala Gondi","Gonm":"Masaram Gondi","Goth":"Gothic","Gran":"Grantha","Grek":"Greek","Gujr":"Gujarati","Guru":"Gurmukhi","Hanb":"Han with Bopomofo","Hang":"Hangul","Hani":"Han","Hano":"Hanunoo","Hans":"Simplified","Hant":"Traditional","Hatr":"Hatran","Hebr":"Hebrew","Hira":"Hiragana","Hluw":"Anatolian Hieroglyphs","Hmng":"Pahawh Hmong","Hmnp":"Nyiakeng Puachue Hmong","Hrkt":"Japanese syllabaries","Hung":"Old Hungarian","Inds":"Indus","Ital":"Old Italic","Jamo":"Jamo","Java":"Javanese","Jpan":"Japanese","Jurc":"Jurchen","Kali":"Kayah Li","Kana":"Katakana","Khar":"Kharoshthi","Khmr":"Khmer","Khoj":"Khojki","Kits":"Khitan small script","Knda":"Kannada","Kore":"Korean","Kpel":"Kpelle","Kthi":"Kaithi","Lana":"Lanna","Laoo":"Lao","Latf":"Fraktur Latin","Latg":"Gaelic Latin","Latn":"Latin","Lepc":"Lepcha","Limb":"Limbu","Lina":"Linear A","Linb":"Linear B","Lisu":"Fraser","Loma":"Loma","Lyci":"Lycian","Lydi":"Lydian","Mahj":"Mahajani","Maka":"Makasar","Mand":"Mandaean","Mani":"Manichaean","Marc":"Marchen","Maya":"Mayan hieroglyphs","Medf":"Medefaidrin","Mend":"Mende","Merc":"Meroitic Cursive","Mero":"Meroitic","Mlym":"Malayalam","Modi":"Modi","Mong":"Mongolian","Moon":"Moon","Mroo":"Mro","Mtei":"Meitei Mayek","Mult":"Multani","Mymr":"Myanmar","Nand":"Nandinagari","Narb":"Old North Arabian","Nbat":"Nabataean","Newa":"Newa","Nkgb":"Naxi Geba","Nkoo":"N’Ko","Nshu":"Nüshu","Ogam":"Ogham","Olck":"Ol Chiki","Orkh":"Orkhon","Orya":"Odia","Osge":"Osage","Osma":"Osmanya","Palm":"Palmyrene","Pauc":"Pau Cin Hau","Perm":"Old Permic","Phag":"Phags-pa","Phli":"Inscriptional Pahlavi","Phlp":"Psalter Pahlavi","Phlv":"Book Pahlavi","Phnx":"Phoenician","Plrd":"Pollard Phonetic","Prti":"Inscriptional Parthian","Qaag":"Zawgyi","Rjng":"Rejang","Rohg":"Hanifi Rohingya","Roro":"Rongorongo","Runr":"Runic","Samr":"Samaritan","Sara":"Sarati","Sarb":"Old South Arabian","Saur":"Saurashtra","Sgnw":"SignWriting","Shaw":"Shavian","Shrd":"Sharada","Sidd":"Siddham","Sind":"Khudawadi","Sinh":"Sinhala","Sogd":"Sogdian","Sogo":"Old Sogdian","Sora":"Sora Sompeng","Soyo":"Soyombo","Sund":"Sundanese","Sylo":"Syloti Nagri","Syrc":"Syriac","Syre":"Estrangelo Syriac","Syrj":"Western Syriac","Syrn":"Eastern Syriac","Tagb":"Tagbanwa","Takr":"Takri","Tale":"Tai Le","Talu":"New Tai Lue","Taml":"Tamil","Tang":"Tangut","Tavt":"Tai Viet","Telu":"Telugu","Teng":"Tengwar","Tfng":"Tifinagh","Tglg":"Tagalog","Thaa":"Thaana","Thai":"Thai","Tibt":"Tibetan","Tirh":"Tirhuta","Ugar":"Ugaritic","Vaii":"Vai","Visp":"Visible Speech","Wara":"Varang Kshiti","Wcho":"Wancho","Wole":"Woleai","Xpeo":"Old Persian","Xsux":"Sumero-Akkadian Cuneiform","Yezi":"Yezidi","Yiii":"Yi","Zanb":"Zanabazar Square","Zinh":"Inherited","Zmth":"Mathematical Notation","Zsye":"Emoji","Zsym":"Symbols","Zxxx":"Unwritten","Zyyy":"Common","Zzzz":"Unknown Script"},"short":{"Cans":"UCAS","Xsux":"S-A Cuneiform"},"narrow":{}},"currency":{"long":{"ADP":"Andorran Peseta","AED":"United Arab Emirates Dirham","AFA":"Afghan Afghani (1927–2002)","AFN":"Afghan Afghani","ALK":"Albanian Lek (1946–1965)","ALL":"Albanian Lek","AMD":"Armenian Dram","ANG":"Netherlands Antillean Guilder","AOA":"Angolan Kwanza","AOK":"Angolan Kwanza (1977–1991)","AON":"Angolan New Kwanza (1990–2000)","AOR":"Angolan Readjusted Kwanza (1995–1999)","ARA":"Argentine Austral","ARL":"Argentine Peso Ley (1970–1983)","ARM":"Argentine Peso (1881–1970)","ARP":"Argentine Peso (1983–1985)","ARS":"Argentine Peso","ATS":"Austrian Schilling","AUD":"Australian Dollar","AWG":"Aruban Florin","AZM":"Azerbaijani Manat (1993–2006)","AZN":"Azerbaijani Manat","BAD":"Bosnia-Herzegovina Dinar (1992–1994)","BAM":"Bosnia-Herzegovina Convertible Mark","BAN":"Bosnia-Herzegovina New Dinar (1994–1997)","BBD":"Barbadian Dollar","BDT":"Bangladeshi Taka","BEC":"Belgian Franc (convertible)","BEF":"Belgian Franc","BEL":"Belgian Franc (financial)","BGL":"Bulgarian Hard Lev","BGM":"Bulgarian Socialist Lev","BGN":"Bulgarian Lev","BGO":"Bulgarian Lev (1879–1952)","BHD":"Bahraini Dinar","BIF":"Burundian Franc","BMD":"Bermudan Dollar","BND":"Brunei Dollar","BOB":"Bolivian Boliviano","BOL":"Bolivian Boliviano (1863–1963)","BOP":"Bolivian Peso","BOV":"Bolivian Mvdol","BRB":"Brazilian New Cruzeiro (1967–1986)","BRC":"Brazilian Cruzado (1986–1989)","BRE":"Brazilian Cruzeiro (1990–1993)","BRL":"Brazilian Real","BRN":"Brazilian New Cruzado (1989–1990)","BRR":"Brazilian Cruzeiro (1993–1994)","BRZ":"Brazilian Cruzeiro (1942–1967)","BSD":"Bahamian Dollar","BTN":"Bhutanese Ngultrum","BUK":"Burmese Kyat","BWP":"Botswanan Pula","BYB":"Belarusian New Rouble (1994–1999)","BYN":"Belarusian Rouble","BYR":"Belarusian Rouble (2000–2016)","BZD":"Belize Dollar","CAD":"Canadian Dollar","CDF":"Congolese Franc","CHE":"WIR Euro","CHF":"Swiss Franc","CHW":"WIR Franc","CLE":"Chilean Escudo","CLF":"Chilean Unit of Account (UF)","CLP":"Chilean Peso","CNH":"Chinese Yuan (offshore)","CNX":"Chinese People’s Bank Dollar","CNY":"Chinese Yuan","COP":"Colombian Peso","COU":"Colombian Real Value Unit","CRC":"Costa Rican Colón","CSD":"Serbian Dinar (2002–2006)","CSK":"Czechoslovak Hard Koruna","CUC":"Cuban Convertible Peso","CUP":"Cuban Peso","CVE":"Cape Verdean Escudo","CYP":"Cypriot Pound","CZK":"Czech Koruna","DDM":"East German Mark","DEM":"German Mark","DJF":"Djiboutian Franc","DKK":"Danish Krone","DOP":"Dominican Peso","DZD":"Algerian Dinar","ECS":"Ecuadorian Sucre","ECV":"Ecuadorian Unit of Constant Value","EEK":"Estonian Kroon","EGP":"Egyptian Pound","ERN":"Eritrean Nakfa","ESA":"Spanish Peseta (A account)","ESB":"Spanish Peseta (convertible account)","ESP":"Spanish Peseta","ETB":"Ethiopian Birr","EUR":"Euro","FIM":"Finnish Markka","FJD":"Fijian Dollar","FKP":"Falkland Islands Pound","FRF":"French Franc","GBP":"British Pound","GEK":"Georgian Kupon Larit","GEL":"Georgian Lari","GHC":"Ghanaian Cedi (1979–2007)","GHS":"Ghanaian Cedi","GIP":"Gibraltar Pound","GMD":"Gambian Dalasi","GNF":"Guinean Franc","GNS":"Guinean Syli","GQE":"Equatorial Guinean Ekwele","GRD":"Greek Drachma","GTQ":"Guatemalan Quetzal","GWE":"Portuguese Guinea Escudo","GWP":"Guinea-Bissau Peso","GYD":"Guyanaese Dollar","HKD":"Hong Kong Dollar","HNL":"Honduran Lempira","HRD":"Croatian Dinar","HRK":"Croatian Kuna","HTG":"Haitian Gourde","HUF":"Hungarian Forint","IDR":"Indonesian Rupiah","IEP":"Irish Pound","ILP":"Israeli Pound","ILR":"Israeli Shekel (1980–1985)","ILS":"Israeli New Shekel","INR":"Indian Rupee","IQD":"Iraqi Dinar","IRR":"Iranian Rial","ISJ":"Icelandic Króna (1918–1981)","ISK":"Icelandic Króna","ITL":"Italian Lira","JMD":"Jamaican Dollar","JOD":"Jordanian Dinar","JPY":"Japanese Yen","KES":"Kenyan Shilling","KGS":"Kyrgystani Som","KHR":"Cambodian Riel","KMF":"Comorian Franc","KPW":"North Korean Won","KRH":"South Korean Hwan (1953–1962)","KRO":"South Korean Won (1945–1953)","KRW":"South Korean Won","KWD":"Kuwaiti Dinar","KYD":"Cayman Islands Dollar","KZT":"Kazakhstani Tenge","LAK":"Laotian Kip","LBP":"Lebanese Pound","LKR":"Sri Lankan Rupee","LRD":"Liberian Dollar","LSL":"Lesotho Loti","LTL":"Lithuanian Litas","LTT":"Lithuanian Talonas","LUC":"Luxembourgian Convertible Franc","LUF":"Luxembourgian Franc","LUL":"Luxembourg Financial Franc","LVL":"Latvian Lats","LVR":"Latvian Rouble","LYD":"Libyan Dinar","MAD":"Moroccan Dirham","MAF":"Moroccan Franc","MCF":"Monegasque Franc","MDC":"Moldovan Cupon","MDL":"Moldovan Leu","MGA":"Malagasy Ariary","MGF":"Malagasy Franc","MKD":"Macedonian Denar","MKN":"Macedonian Denar (1992–1993)","MLF":"Malian Franc","MMK":"Myanmar Kyat","MNT":"Mongolian Tugrik","MOP":"Macanese Pataca","MRO":"Mauritanian Ouguiya (1973–2017)","MRU":"Mauritanian Ouguiya","MTL":"Maltese Lira","MTP":"Maltese Pound","MUR":"Mauritian Rupee","MVP":"Maldivian Rupee (1947–1981)","MVR":"Maldivian Rufiyaa","MWK":"Malawian Kwacha","MXN":"Mexican Peso","MXP":"Mexican Silver Peso (1861–1992)","MXV":"Mexican Investment Unit","MYR":"Malaysian Ringgit","MZE":"Mozambican Escudo","MZM":"Mozambican Metical (1980–2006)","MZN":"Mozambican Metical","NAD":"Namibian Dollar","NGN":"Nigerian Naira","NIC":"Nicaraguan Córdoba (1988–1991)","NIO":"Nicaraguan Córdoba","NLG":"Dutch Guilder","NOK":"Norwegian Krone","NPR":"Nepalese Rupee","NZD":"New Zealand Dollar","OMR":"Omani Rial","PAB":"Panamanian Balboa","PEI":"Peruvian Inti","PEN":"Peruvian Sol","PES":"Peruvian Sol (1863–1965)","PGK":"Papua New Guinean Kina","PHP":"Philippine Piso","PKR":"Pakistani Rupee","PLN":"Polish Zloty","PLZ":"Polish Zloty (1950–1995)","PTE":"Portuguese Escudo","PYG":"Paraguayan Guarani","QAR":"Qatari Rial","RHD":"Rhodesian Dollar","ROL":"Romanian Leu (1952–2006)","RON":"Romanian Leu","RSD":"Serbian Dinar","RUB":"Russian Rouble","RUR":"Russian Rouble (1991–1998)","RWF":"Rwandan Franc","SAR":"Saudi Riyal","SBD":"Solomon Islands Dollar","SCR":"Seychellois Rupee","SDD":"Sudanese Dinar (1992–2007)","SDG":"Sudanese Pound","SDP":"Sudanese Pound (1957–1998)","SEK":"Swedish Krona","SGD":"Singapore Dollar","SHP":"St Helena Pound","SIT":"Slovenian Tolar","SKK":"Slovak Koruna","SLL":"Sierra Leonean Leone","SOS":"Somali Shilling","SRD":"Surinamese Dollar","SRG":"Surinamese Guilder","SSP":"South Sudanese Pound","STD":"São Tomé & Príncipe Dobra (1977–2017)","STN":"São Tomé & Príncipe Dobra","SUR":"Soviet Rouble","SVC":"Salvadoran Colón","SYP":"Syrian Pound","SZL":"Swazi Lilangeni","THB":"Thai Baht","TJR":"Tajikistani Rouble","TJS":"Tajikistani Somoni","TMM":"Turkmenistani Manat (1993–2009)","TMT":"Turkmenistani Manat","TND":"Tunisian Dinar","TOP":"Tongan Paʻanga","TPE":"Timorese Escudo","TRL":"Turkish Lira (1922–2005)","TRY":"Turkish Lira","TTD":"Trinidad & Tobago Dollar","TWD":"New Taiwan Dollar","TZS":"Tanzanian Shilling","UAH":"Ukrainian Hryvnia","UAK":"Ukrainian Karbovanets","UGS":"Ugandan Shilling (1966–1987)","UGX":"Ugandan Shilling","USD":"US Dollar","USN":"US Dollar (Next day)","USS":"US Dollar (Same day)","UYI":"Uruguayan Peso (Indexed Units)","UYP":"Uruguayan Peso (1975–1993)","UYU":"Uruguayan Peso","UYW":"Uruguayan Nominal Wage Index Unit","UZS":"Uzbekistani Som","VEB":"Venezuelan Bolívar (1871–2008)","VEF":"Venezuelan Bolívar (2008–2018)","VES":"Venezuelan Bolívar","VND":"Vietnamese Dong","VNN":"Vietnamese Dong (1978–1985)","VUV":"Vanuatu Vatu","WST":"Samoan Tala","XAF":"Central African CFA Franc","XAG":"Silver","XAU":"Gold","XBA":"European Composite Unit","XBB":"European Monetary Unit","XBC":"European Unit of Account (XBC)","XBD":"European Unit of Account (XBD)","XCD":"East Caribbean Dollar","XDR":"Special Drawing Rights","XEU":"European Currency Unit","XFO":"French Gold Franc","XFU":"French UIC-Franc","XOF":"West African CFA Franc","XPD":"Palladium","XPF":"CFP Franc","XPT":"Platinum","XRE":"RINET Funds","XSU":"Sucre","XTS":"Testing Currency Code","XUA":"ADB Unit of Account","XXX":"Unknown Currency","YDD":"Yemeni Dinar","YER":"Yemeni Rial","YUD":"Yugoslavian Hard Dinar (1966–1990)","YUM":"Yugoslavian New Dinar (1994–2002)","YUN":"Yugoslavian Convertible Dinar (1990–1992)","YUR":"Yugoslavian Reformed Dinar (1992–1993)","ZAL":"South African Rand (financial)","ZAR":"South African Rand","ZMK":"Zambian Kwacha (1968–2012)","ZMW":"Zambian Kwacha","ZRN":"Zairean New Zaire (1993–1998)","ZRZ":"Zairean Zaire (1971–1993)","ZWD":"Zimbabwean Dollar (1980–2008)","ZWL":"Zimbabwean Dollar (2009)","ZWR":"Zimbabwean Dollar (2008)"},"short":{},"narrow":{}}},"patterns":{"locale":"{0} ({1})"}},"locale":"en-CK"}
)
}
|
/**
* @namespace Sk
*
*/
// this is stored into sys specially, rather than created by sys
Sk.sysmodules = new Sk.builtin.dict([]);
Sk.realsyspath = undefined;
/**
* @param {string} name to look for
* @param {string} ext extension to use (.py or .js)
* @param {Object=} searchPath an iterable set of path strings
*/
Sk.importSearchPathForName = function (name, ext, searchPath) {
var fn;
var j;
var fns = [];
var nameAsPath = name.replace(/\./g, "/");
var it, i;
var tryPathAndBreakOnSuccess = function(filename, packagePath) {
return Sk.misceval.chain(
Sk.misceval.tryCatch(function() {
return Sk.read(filename);
}, function(e) { /* Exceptions signal "not found" */ }),
function(code) {
if (code !== undefined) {
// This will cause the iterFor() to return the specified value
return new Sk.misceval.Break({filename: filename, code: code, packagePath: packagePath});
}
}
);
};
if (searchPath === undefined) {
searchPath = Sk.realsyspath;
}
return Sk.misceval.iterFor(searchPath.tp$iter(), function(pathStr) {
// For each element of path, try loading the module, and if that
// doesn't work, try the corresponding package.
return Sk.misceval.chain(
tryPathAndBreakOnSuccess(pathStr.v + "/" + nameAsPath + ext, false), // module
function(r) {
return r ? r : tryPathAndBreakOnSuccess(pathStr.v + "/" + nameAsPath + "/__init__" + ext,
pathStr.v + "/" + nameAsPath); // package
}
);
});
};
/**
* Complete any initialization of Python classes which relies on internal
* dependencies.
*
* This includes making Python classes subclassable and ensuring that the
* {@link Sk.builtin.object} magic methods are wrapped inside Python functions.
*
* @return {undefined}
*/
Sk.doOneTimeInitialization = function (canSuspend) {
var proto, name, i, x, func, typesWithFunctionsToWrap, builtin_type, j;
// can't fill these out when making the type because tuple/dict aren't
// defined yet.
Sk.builtin.type.basesStr_ = new Sk.builtin.str("__bases__");
Sk.builtin.type.mroStr_ = new Sk.builtin.str("__mro__");
// Register a Python class with an internal dictionary, which allows it to
// be subclassed
var setUpClass = function (child) {
var parent = child.prototype.tp$base;
var bases = [];
var base;
for (base = parent; base !== undefined; base = base.prototype.tp$base) {
if (!base.sk$abstract && Sk.builtins[base.tp$name]) {
// check the base is not an abstract class and that it is in the builtins dict
bases.push(base);
}
}
child.tp$mro = new Sk.builtin.tuple([child]);
if (!child.tp$base){
child.tp$base = bases[0];
}
child["$d"] = new Sk.builtin.dict([]);
child["$d"].mp$ass_subscript(Sk.builtin.type.basesStr_, new Sk.builtin.tuple(bases));
child["$d"].mp$ass_subscript(Sk.builtin.type.mroStr_, new Sk.builtin.tuple([child].concat(bases)));
child["$d"].mp$ass_subscript(new Sk.builtin.str("__name__"), new Sk.builtin.str(child.prototype.tp$name));
child.tp$setattr = function(pyName, value, canSuspend) {
throw new Sk.builtin.TypeError("can't set attributes of built-in/extension type '" + this.tp$name + "'");
};
};
for (x in Sk.builtin) {
func = Sk.builtin[x];
if ((func.prototype instanceof Sk.builtin.object ||
func === Sk.builtin.object) && !func.sk$abstract) {
setUpClass(func);
}
}
// Wrap the inner Javascript code of Sk.builtin.object's Python methods inside
// Sk.builtin.func, as that class was undefined when these functions were declared
typesWithFunctionsToWrap = [Sk.builtin.object, Sk.builtin.type, Sk.builtin.func, Sk.builtin.method];
for (i = 0; i < typesWithFunctionsToWrap.length; i++) {
builtin_type = typesWithFunctionsToWrap[i];
proto = builtin_type.prototype;
for (j = 0; j < builtin_type.pythonFunctions.length; j++) {
name = builtin_type.pythonFunctions[j];
if (proto[name] instanceof Sk.builtin.func) {
// If functions have already been initialized, do not wrap again.
break;
}
proto[name].co_kwargs = null;
proto[name] = new Sk.builtin.func(proto[name]);
}
}
for (var file in Sk.internalPy.files) {
var fileWithoutExtension = file.split(".")[0].split("/")[1];
var mod = Sk.importBuiltinWithBody(fileWithoutExtension, false, Sk.internalPy.files[file], true);
mod = Sk.misceval.retryOptionalSuspensionOrThrow(mod);
Sk.asserts.assert(mod["$d"][fileWithoutExtension] !== undefined, "Should have imported name " + fileWithoutExtension);
Sk.builtins[fileWithoutExtension] = mod["$d"][fileWithoutExtension];
}
};
/**
* currently only pull once from Sk.syspath. User might want to change
* from js or from py.
*/
Sk.importSetUpPath = function (canSuspend) {
var i;
var paths;
if (!Sk.realsyspath) {
paths = [
new Sk.builtin.str("src/builtin"),
new Sk.builtin.str("src/lib"),
new Sk.builtin.str(".")
];
for (i = 0; i < Sk.syspath.length; ++i) {
paths.push(new Sk.builtin.str(Sk.syspath[i]));
}
Sk.realsyspath = new Sk.builtin.list(paths);
Sk.doOneTimeInitialization(canSuspend);
}
};
/**
* @param {string} name name of module to import
* @param {boolean=} dumpJS whether to output the generated js code
* @param {string=} modname what to call the module after it's imported if
* it's to be renamed (i.e. __main__)
* @param {string=} suppliedPyBody use as the body of the text for the module
* rather than Sk.read'ing it.
* @param {Object=} relativeToPackage perform import relative to this package
* @param {boolean=} returnUndefinedOnTopLevelNotFound return 'undefined' rather than throwing ImportError if the *first* load failed
* @param {boolean=} canSuspend whether we may return a Suspension object
*/
Sk.importModuleInternal_ = function (name, dumpJS, modname, suppliedPyBody, relativeToPackage, returnUndefinedOnTopLevelNotFound, canSuspend) {
//dumpJS = true;
var filename;
var prev;
var parentModName;
var parentModule;
var modNameSplit;
var ret;
var module;
var topLevelModuleToReturn = null;
var relativePackageName = relativeToPackage !== undefined ? relativeToPackage.tp$getattr(Sk.builtin.str.$name) : undefined;
var absolutePackagePrefix = relativePackageName !== undefined ? relativePackageName.v + "." : "";
var searchPath = relativeToPackage !== undefined ? relativeToPackage.tp$getattr(Sk.builtin.str.$path) : undefined;
Sk.importSetUpPath(canSuspend);
if (relativeToPackage && !relativePackageName) {
if (returnUndefinedOnTopLevelNotFound) {
return undefined;
} else {
throw new Sk.builtin.ValueError("Attempted to import relative to invalid package (no name)");
}
}
// if no module name override, supplied, use default name
if (modname === undefined) {
modname = absolutePackagePrefix + name;
}
modNameSplit = name.split(".");
if (modNameSplit.length > 1) {
// if we're a module inside a package (i.e. a.b.c), then we'll need to return the
// top-level package ('a'). recurse upwards on our parent, importing
// all parent packages. so, here we're importing 'a.b', which will in
// turn import 'a', and then return 'a' eventually.
parentModName = modNameSplit.slice(0, modNameSplit.length - 1).join(".");
topLevelModuleToReturn = Sk.importModuleInternal_(parentModName, dumpJS, undefined, undefined, relativeToPackage, returnUndefinedOnTopLevelNotFound, canSuspend);
}
ret = Sk.misceval.chain(topLevelModuleToReturn, function(topLevelModuleToReturn_) {
topLevelModuleToReturn = topLevelModuleToReturn_;
// if leaf is already in sys.modules, early out
try {
prev = Sk.sysmodules.mp$subscript(modname);
// if we're a dotted module, return the top level, otherwise ourselves
return topLevelModuleToReturn || prev;
} catch (x) {
// not in sys.modules, continue
}
return Sk.misceval.chain(undefined, function() {
var codeAndPath, co, googClosure;
var searchFileName = name;
var result;
// If we're inside a package, look search using its __path__
if (modNameSplit.length > 1) {
if (!topLevelModuleToReturn) {
return undefined;
}
parentModule = Sk.sysmodules.mp$subscript(absolutePackagePrefix + parentModName);
searchFileName = modNameSplit[modNameSplit.length-1];
searchPath = parentModule.tp$getattr(Sk.builtin.str.$path);
}
// otherwise:
// - create module object
// - add module object to sys.modules
// - compile source to (function(){...});
// - run module and set the module locals returned to the module __dict__
module = new Sk.builtin.module();
if (suppliedPyBody) {
filename = name + ".py";
co = Sk.compile(suppliedPyBody, filename, "exec", canSuspend);
} else {
co = Sk.misceval.chain(undefined, function() {
// If an onBeforeImport method is supplied, call it and if
// the result is false or a string, prevent the import.
// This allows for a user to conditionally prevent the usage
// of certain libraries.
if (Sk.onBeforeImport && typeof Sk.onBeforeImport === "function") {
return Sk.onBeforeImport(name);
}
return;
}, function(result) {
if (result === false) {
throw new Sk.builtin.ImportError("Importing " + name + " is not allowed");
} else if (typeof result === "string") {
throw new Sk.builtin.ImportError(result);
}
// Try loading as a builtin (i.e. already in JS) module, then try .py files
return Sk.importSearchPathForName(searchFileName, ".js", searchPath);
}, function(codeAndPath) {
if (codeAndPath) {
return {
funcname: "$builtinmodule", code: codeAndPath.code,
filename: codeAndPath.filename, packagePath: codeAndPath.packagePath
};
} else {
return Sk.misceval.chain(Sk.importSearchPathForName(searchFileName, ".py", searchPath), function(codeAndPath_) {
codeAndPath = codeAndPath_; // We'll want it in a moment
if (codeAndPath) {
return Sk.compile(codeAndPath.code, codeAndPath.filename, "exec", canSuspend);
}
}, function(co) {
if (co) {
co.packagePath = codeAndPath.packagePath;
return co;
}
});
}
});
}
return co;
}, function(co) {
var finalcode;
var withLineNumbers;
var modscope;
if (!co) {
return undefined;
}
// Now we know this module exists, we can add it to the cache
Sk.sysmodules.mp$ass_subscript(modname, module);
module.$js = co.code; // todo; only in DEBUG?
finalcode = co.code;
if (filename == null) {
filename = co.filename;
}
if (Sk.dateSet == null || !Sk.dateSet) {
finalcode = "Sk.execStart = Sk.lastYield = new Date();\n" + co.code;
Sk.dateSet = true;
}
// if (!COMPILED)
// {
if (dumpJS) {
withLineNumbers = function (code) {
var j;
var pad;
var width;
var i;
var beaut = Sk.js_beautify(code);
var lines = beaut.split("\n");
for (i = 1; i <= lines.length; ++i) {
width = ("" + i).length;
pad = "";
for (j = width; j < 5; ++j) {
pad += " ";
}
lines[i - 1] = "/* " + pad + i + " */ " + lines[i - 1];
}
return lines.join("\n");
};
finalcode = withLineNumbers(finalcode);
Sk.debugout(finalcode);
}
// }
finalcode += "\n" + co.funcname + ";";
modscope = Sk.global["eval"](finalcode);
module["$d"] = {
"__name__": new Sk.builtin.str(modname),
"__doc__": Sk.builtin.none.none$,
"__package__": co.packagePath ? new Sk.builtin.str(modname) :
parentModName ? new Sk.builtin.str(absolutePackagePrefix + parentModName) :
relativePackageName ? relativePackageName : Sk.builtin.none.none$
};
if (co.packagePath) {
module["$d"]["__path__"] = new Sk.builtin.tuple([new Sk.builtin.str(co.packagePath)]);
}
return modscope(module["$d"]);
}, function (modlocs) {
var i;
if (modlocs === undefined) {
if (returnUndefinedOnTopLevelNotFound && !topLevelModuleToReturn) {
return undefined;
} else {
throw new Sk.builtin.ImportError("No module named " + name);
}
}
// Some builtin modules replace their globals entirely.
// For their benefit, we copy over any of the standard
// dunder-values they didn't supply.
if (modlocs !== module["$d"]) {
for (i in module["$d"]) {
if (!modlocs[i]) {
modlocs[i] = module["$d"][i];
}
}
module["$d"] = modlocs;
}
// If an onAfterImport method is defined on the global Sk
// then call it now after a library has been successfully imported
// and compiled.
if (Sk.onAfterImport && typeof Sk.onAfterImport === "function") {
try {
Sk.onAfterImport(name);
} catch (e) {
}
}
if (topLevelModuleToReturn) {
// if we were a dotted name, then we want to return the top-most
// package. we store ourselves into our parent as an attribute
parentModule.tp$setattr(new Sk.builtin.str(modNameSplit[modNameSplit.length - 1]), module);
//print("import returning parent module, modname", modname, "__name__", toReturn.tp$getattr("__name__").v);
return topLevelModuleToReturn;
}
if (relativeToPackage) {
relativeToPackage.tp$setattr(new Sk.builtin.str(name), module);
}
//print("name", name, "modname", modname, "returning leaf");
// otherwise we return the actual module that we just imported
return module;
});
});
return canSuspend ? ret : Sk.misceval.retryOptionalSuspensionOrThrow(ret);
};
/**
* @param {string} name the module name
* @param {boolean=} dumpJS print out the js code after compilation for debugging
* @param {boolean=} canSuspend can this function suspend and return a Suspension object?
*/
Sk.importModule = function (name, dumpJS, canSuspend) {
return Sk.importModuleInternal_(name, dumpJS, undefined, undefined, undefined, false, canSuspend);
};
Sk.importMain = function (name, dumpJS, canSuspend) {
Sk.dateSet = false;
Sk.filesLoaded = false;
// Added to reset imports
Sk.sysmodules = new Sk.builtin.dict([]);
Sk.realsyspath = undefined;
Sk.resetCompiler();
return Sk.importModuleInternal_(name, dumpJS, "__main__", undefined, undefined, false, canSuspend);
};
/**
* **Run Python Code in Skulpt**
*
* When you want to hand Skulpt a string corresponding to a Python program this is the function.
*
* @param name {string} File name to use for messages related to this run
* @param dumpJS {boolean} print out the compiled javascript
* @param body {string} Python Code
* @param canSuspend {boolean} Use Suspensions for async execution
*
*/
Sk.importMainWithBody = function (name, dumpJS, body, canSuspend) {
Sk.dateSet = false;
Sk.filesLoaded = false;
// Added to reset imports
Sk.sysmodules = new Sk.builtin.dict([]);
Sk.realsyspath = undefined;
Sk.resetCompiler();
return Sk.importModuleInternal_(name, dumpJS, "__main__", body, undefined, false, canSuspend);
};
/**
* Imports internal python files into the `__builtin__` module. Used during startup
* to compile and import all *.py files from the src/ directory.
*
* @param name {string} File name to use for messages related to this run
* @param dumpJS {boolean} print out the compiled javascript
* @param body {string} Python Code
* @param canSuspend {boolean} Use Suspensions for async execution
*
*/
Sk.importBuiltinWithBody = function (name, dumpJS, body, canSuspend) {
return Sk.importModuleInternal_(name, dumpJS, "__builtin__."+name, body, undefined, false, canSuspend);
};
Sk.builtin.__import__ = function (name, globals, locals, fromlist, level) {
//print("Importing: ", JSON.stringify(name), JSON.stringify(fromlist), level);
//if (name == "") { debugger; }
// Save the Sk.globals variable importModuleInternal_ may replace it when it compiles
// a Python language module.
var saveSk = Sk.globals;
// This might be a relative import, so first we get hold of the module object
// representing this module's package (so we can search its __path__).
// module.__package__ contains its name, so we use that to look it up in sys.modules.
var relativeToPackage;
var relativeToPackageName;
var relativeToPackageNames;
if (level === undefined) {
level = Sk.__future__.absolute_import ? 0 : -1;
}
if (level !== 0 && globals["__package__"] && globals["__package__"] !== Sk.builtin.none.none$) {
relativeToPackageName = globals["__package__"].v;
if (relativeToPackageName && level > 0) {
// Trim <level> packages off the end
relativeToPackageNames = relativeToPackageName.split(".");
if (level-1 >= relativeToPackageNames.length) {
throw new Sk.builtin.ValueError("Attempted relative import beyond toplevel package");
}
relativeToPackageNames.length -= level-1;
relativeToPackageName = relativeToPackageNames.join(".");
}
try {
relativeToPackage = Sk.sysmodules.mp$subscript(relativeToPackageName);
} catch(e) {
relativeToPackageName = undefined;
}
}
if (level > 0 && relativeToPackage === undefined) {
throw new Sk.builtin.ValueError("Attempted relative import in non-package");
}
var dottedName = name.split(".");
var firstDottedName = dottedName[0];
return Sk.misceval.chain(undefined, function() {
// Attempt local load first (and just fall through to global
// case if level == -1 and we fail to load the top-level package)
if (level !== 0 && relativeToPackage !== undefined) {
if (name === "") {
// "from .. import ..."
return relativeToPackage;
} else {
return Sk.importModuleInternal_(name, undefined, relativeToPackageName + "." + name, undefined, relativeToPackage, level==-1, true);
}
}
}, function(ret) {
if (ret === undefined) {
// Either it was always a global import, or it was an
// either-way import that just fell through.
relativeToPackage = undefined;
relativeToPackageName = undefined;
return Sk.importModuleInternal_(name, undefined, undefined, undefined, undefined, false, true);
} else {
return ret;
}
}, function(ret) {
// We might also have to load modules named by the fromlist.
// If there is no fromlist, we have reached the end of the lookup, return
if (!fromlist || fromlist.length === 0) {
return ret;
} else {
// try to load from-names as modules from the file system
// if they are not present on the module itself
var i;
var fromName;
var leafModule;
var importChain;
leafModule = Sk.sysmodules.mp$subscript(
(relativeToPackageName || "") +
((relativeToPackageName && name) ? "." : "") +
name);
for (i = 0; i < fromlist.length; i++) {
fromName = fromlist[i];
// "ret" is the module we're importing from
// Only import from file system if we have not found the fromName in the current module
if (fromName != "*" && leafModule.tp$getattr(new Sk.builtin.str(fromName)) === undefined) {
importChain = Sk.misceval.chain(importChain,
Sk.importModuleInternal_.bind(null, fromName, undefined, undefined, undefined, leafModule, true, true)
);
}
}
return Sk.misceval.chain(importChain, function() {
// if there's a fromlist we want to return the leaf module
// (ret), not the toplevel namespace
Sk.asserts.assert(leafModule);
return leafModule;
});
}
}, function(ret) {
if (saveSk !== Sk.globals) {
Sk.globals = saveSk;
}
return ret;
});
};
Sk.importStar = function (module, loc, global) {
var __all__ = module.tp$getattr(new Sk.builtin.str("__all__"));
if (__all__) {
// TODO this does not support naming *modules* in __all__,
// only variables
for(let it = Sk.abstr.iter(__all__), i = it.tp$iternext();
i !== undefined; i = it.tp$iternext()) {
loc[i.v] = Sk.abstr.gattr(module, i);
}
} else {
let props = Object["getOwnPropertyNames"](module["$d"]);
for (let i in props) {
if (props[i].charAt(0) != "_") {
loc[props[i]] = module["$d"][props[i]];
}
}
}
};
Sk.exportSymbol("Sk.importMain", Sk.importMain);
Sk.exportSymbol("Sk.importMainWithBody", Sk.importMainWithBody);
Sk.exportSymbol("Sk.importBuiltinWithBody", Sk.importBuiltinWithBody);
Sk.exportSymbol("Sk.builtin.__import__", Sk.builtin.__import__);
Sk.exportSymbol("Sk.importStar", Sk.importStar);
|
import View from 'girder/views/View';
export default View;
|
var searchData=
[
['kstatusdelaying_41',['kStatusDelaying',['../classace__routine_1_1CoroutineTemplate.html#a673ca8db9f3bf62a2f3be8d394358e6a',1,'ace_routine::CoroutineTemplate']]],
['kstatusending_42',['kStatusEnding',['../classace__routine_1_1CoroutineTemplate.html#a14912dd5c52d2a3963a377aae4059dc1',1,'ace_routine::CoroutineTemplate']]],
['kstatusrunning_43',['kStatusRunning',['../classace__routine_1_1CoroutineTemplate.html#a2b05fc95e0d6765be90955655f64cfd4',1,'ace_routine::CoroutineTemplate']]],
['kstatussuspended_44',['kStatusSuspended',['../classace__routine_1_1CoroutineTemplate.html#a51ea72999f8fe2d32f753f9bbb436234',1,'ace_routine::CoroutineTemplate']]],
['kstatusterminated_45',['kStatusTerminated',['../classace__routine_1_1CoroutineTemplate.html#ac0980cd59e49683d0f649687010e38f4',1,'ace_routine::CoroutineTemplate']]],
['kstatusyielding_46',['kStatusYielding',['../classace__routine_1_1CoroutineTemplate.html#aaa2157d08593c9f88f1b0698528573bd',1,'ace_routine::CoroutineTemplate']]]
];
|
module.exports=function(context){
context.args[0]=__dirname+"/../sounds/FUCKHER.mp3";
return require('./../commands/play')(context);
}
|
/**
* Created by Alex on 05/02/14.
*/
import { computeLine2Intersection } from "../geom/LineSegment2.js";
const Utils = {};
function pointBetweenEdges(edge1, edge2, node, thickness) {
const other1 = edge1.other(node);
const other2 = edge2.other(node);
const delta1 = other1.clone().sub(node);
const delta2 = other2.clone().sub(node);
const sum = delta2.normalize().clone().add(delta1.normalize());
let angle = edge2.angle() - edge1.angle();
if (angle < 0) {
angle += Math.PI * 2;
}
// console.log(angle * (57.295));
if (angle === 0) {
//parallel edges
sum.set(delta1.y, delta1.x);
sum.multiplyScalar(thickness / 2);
console.log(">");
} else {
const scalar = (thickness / 2) * (1 + sum.length() / 4);
sum.normalize().multiplyScalar(scalar);
if (angle > Math.PI) {
console.log("<");
sum.negate();
}
}
return sum;
}
function angleDifference(edge1, edge2) {
return edge1.angle() - edge2.angle();
}
function trace2(graph, thickness) {
//clone graph
const g = graph.clone();
let closedNodes = [];
let closedEdges = [];
//edge needs to be covered twice to be closed
let prevEdge, prevNode,
currentEdge, currentNode;
while (g.edges.length > 0) {
//pick next edge
const node = prevEdge.other(prevNode);
const neighbours = g.getAttachedEdges(node);
neighbours.sort(angleDifference);
let index = neighbours.indexOf(prevEdge);
index = (index + 1) % neighbours.length;
const edge = neighbours[index];
}
}
function makeCap(node, edge, thickness, type) {
const result = [];
//get direction
const other = edge.other(node);
const first = node.clone();
const second = other.clone();
const delta = second.clone().sub(first);
const inverseDelta = delta.clone();
//
inverseDelta.x = delta.y;
inverseDelta.y = -delta.x;
inverseDelta.normalize();
//projecting cap
if (type === "projecting") {
const half_thickness = thickness / 2;
const sid = inverseDelta.clone().multiplyScalar(half_thickness);
//projecting offset
const offset = delta.clone().normalize().multiplyScalar(half_thickness);
const anchor = node.clone().sub(offset);
result.push(sid.clone().add(anchor));
result.push(sid.negate().add(anchor));
}
return result;
}
function makeJoint2(node, edges, thickness) {
const result = [];
//sort edges by angle
edges.sort(angleDifference);
for (let i = 0; i < edges.length; i++) {
const j = (i + 1) % edges.length;
const edge1 = edges[i];
const edge2 = edges[j];
const sum = pointBetweenEdges(edge1, edge2, node, thickness);
result.push({
point: sum,
edges: [edge1, edge2]
})
}
result.forEach(function (element) {
element.point.add(node);
});
return result;
}
function graph2paths(graph, thickness) {
const points = [];
const nodes = graph.nodes;
//generating outline points
for (let i = 0; i < nodes.length; i++) {
const node = nodes[i];
const attachedEdges = graph.getAttachedEdges(node);
const length = attachedEdges.length;
if (length === 0) {
//this node is not attached to any edge
console.warn("unconnected node, not representable");
} else if (length === 1) {
//this is an end point
const attachedEdge = attachedEdges[0];
const cap = makeCap(node, attachedEdge, thickness, "projecting");
cap.forEach(function (point) {
points.push({ node: node, edges: [attachedEdge], position: point });
});
} else if (length > 1) {
//this is a joint
const joint = makeJoint2(node, attachedEdges, thickness, null);
joint.forEach(function (data) {
points.push({ node: node, edges: data.edges, position: data.point })
});
}
}
let path;
function getCommonEdge(point1, point2) {
const edges1 = point1.edges;
const edges2 = point2.edges;
const l1 = edges1.length;
const l2 = edges2.length;
for (let i = 0; i < l1; i++) {
const edge1 = edges1[i];
for (let j = 0; j < l2; j++) {
const edge2 = edges2[j];
if (edge1 === edge2) {
return edge1;
}
}
}
return null;
}
function lineIntersectsGraph(from, to, graph) {
const edges = graph.edges;
let i = 0;
const l = edges.length;
for (; i < l; i++) {
const edge = edges[i];
if (computeLine2Intersection(from, to, edge.first, edge.second)) {
return true;
}
}
return false;
}
function getNextPoint2(from) {
//filter points based on common edge
const edges0 = from.edges;
const l0 = edges0.length;
const candidates = [];
points.forEach(function (point, index) {
const edges1 = point.edges;
const l1 = edges1.length;
for (let i = 0; i < l0; i++) {
const e0 = edges0[i];
for (let j = 0; j < l1; j++) {
const e1 = edges1[j];
if (e0 === e1) {
//now filter out those that cross the graph
if (!lineIntersectsGraph(from.position, point.position, graph)) {
candidates.push(index);
}
}
}
}
});
if (candidates.length > 0) {
const index = candidates[0];
const point = points[index];
points.splice(index, 1);
return point;
} else {
console.warn("No next point from ", from);
}
}
function getNextPoint(from) {
for (let i = 0; i < points.length; i++) {
const p = points[i];
const commonEdge = getCommonEdge(p, from);
if (commonEdge != null) {
//make sure line would not intersect the edge
// var intersects = getLineIntersection(p.position, from.position, commonEdge.first, commonEdge.second);
const intersects = lineIntersectsGraph(p.position, from.position, graph);
if (intersects) {
continue;
}
points.splice(i, 1);
return p;
}
}
console.warn("No next point from", from);
return null;
}
function trace() {
//pick a point
let currentPoint = points.pop();
let nextPoint;
path.moveTo(currentPoint.position.x, currentPoint.position.y);
// console.log("path.moveTo("+currentPoint.position.x+","+currentPoint.position.y+");");
const firstPoint = currentPoint;
for (nextPoint = getNextPoint2(currentPoint); nextPoint != null; nextPoint = getNextPoint2(currentPoint)) {
path.lineTo(nextPoint.position.x, nextPoint.position.y);
// console.log("path.lineTo("+nextPoint.position.x+","+nextPoint.position.y+");");
currentPoint = nextPoint;
}
path.lineTo(firstPoint.position.x, firstPoint.position.y);
// console.log("path.lineTo("+firstPoint.position.x+","+firstPoint.position.y+");");
}
const paths = [];
while (points.length > 0) {
path = new THREE.Path();
trace();
paths.push(path);
}
return paths;
}
function graph2rects(graph, thickness) {
const edges = graph.edges;
const paths = [];
for (let i = 0; i < edges.length; i++) {
const path = new THREE.Path();
const edge = edges[i];
//outline edge
const cap1 = makeCap(edge.first, edge, thickness, "projecting");
const cap2 = makeCap(edge.second, edge, thickness, "projecting");
const points = cap1.concat(cap2);
let point = points[0];
path.moveTo(point.x, point.y);
let j = 1;
const l = points.length;
for (; j < l + 1; j++) {
point = points[j % l];
path.lineTo(point.x, point.y);
}
paths.push(path);
}
return paths;
}
Utils.makeJoint2 = makeJoint2;
Utils.paths2shapes = function (paths) {
const shapes = [];
paths.forEach(function (path) {
const r = path.toShapes();
Array.prototype.push.apply(shapes, r);
});
return shapes;
};
Utils.graph2shapes = function (graph, thickness) {
const paths = Utils.graph2paths(graph, thickness);
return Utils.paths2shapes(paths);
};
Utils.graph2paths = graph2paths;
export default Utils;
|
const Discord = require('discord.js');
exports.run = (client, message, args) => {
message.delete();
message.channel.send('<a:confuseddoggo:498045545911156736>')
}
exports.conf = {
enabled: true,
guildOnly: false,
aliases: ["cdog"],
permLevel: 0
};
exports.help = {
name: 'confuseddoggo',
description: 'Cute confused Doggo!',
usage: 'confuseddoggo'
};
|
export const round = (value, decimals) => {
return Number(Math.round(Number(`${value}e${decimals}`)) + `e-${decimals}`)
};
export const floor = (value, decimals) => Number(`${Math.floor(`${value}e${decimals}`)}e-${decimals}`);
|
const { AppState } = require('react-native')
module.exports = {
init: client => {
const explicitlyDisabled = client.config.appStateBreadcrumbsEnabled === false
const implicitlyDisabled = client.config.autoBreadcrumbs === false && client.config.appStateBreadcrumbsEnabled !== true
if (explicitlyDisabled || implicitlyDisabled) return
AppState.addEventListener('change', state => {
client.leaveBreadcrumb(`App state changed`, { state }, 'state')
})
},
configSchema: {
appStateBreadcrumbsEnabled: {
defaultValue: () => undefined,
validate: (value) => value === true || value === false || value === undefined,
message: 'should be true|false'
}
}
}
|
const options = require('./lib/arg-options.js')
const fileWriter = require('./lib/file-writer.js')
const git = require('./lib/git.js')
const version = require('./lib/version.js')
const { exact, major, minor, patch, tag } = options
let newVersion
if (exact) {
if (!version.isValid(exact)) {
console.log('Error: Incorrect version format!')
return
}
newVersion = exact
} else if (major) {
newVersion = version.getMajor()
} else if (minor) {
newVersion = version.getMinor()
} else if (patch) {
newVersion = version.getPatch()
} else {
console.log('At least 1 option required!')
return
}
fileWriter.writeNewVer(newVersion)
if (tag) {
git.createTag(newVersion)
}
console.log('Success! The new version is set to:', newVersion)
|
import path from 'path';
import 'isomorphic-fetch';
import 'ignore-styles';
import fs from 'fs-extra';
import { queryPages, buildPageTree } from 'citation-react-router';
import winston from 'winston';
import requireComponents from './require';
import urls from './urls';
import load from './load';
import prepare from './prepare';
import renderPage from './render-page';
const logger = winston.loggers.get('ReactRenderer');
export default async function render(options) {
const context = {};
context.components = requireComponents(options.components);
logger.debug(`${Object.keys(context.components).length} components loaded`);
context.pages = await queryPages(options.serverUrl).then(buildPageTree);
logger.debug(`${context.pages.length} root pages loaded`);
context.urls = await urls(context.pages);
if (context.urls.length === 0) {
context.urls = [{ url: '', pages: [] }];
}
logger.debug(`${context.urls.length} urls computed`);
context.contents = await load(options.serverUrl, context.pages);
logger.debug(`${Object.keys(context.contents).length} contents loaded`);
await fs.remove(options.renderDir);
await fs.copy(options.buildDir, options.renderDir);
const rootIndexPath = path.join(options.renderDir, 'index.html');
const indexContentBuffer = await fs.readFile(rootIndexPath);
await fs.move(rootIndexPath, path.join(options.renderDir, 'preview.html'));
context.indexContent = indexContentBuffer.toString();
logger.debug(`Index content ready with ${context.indexContent.length} chars`);
let loadedPage = 0;
for (const url of context.urls) {
try {
logger.debug('Rendering url', url.url);
context.preparedContents = prepare(url, context.contents);
// Logger.debug('Prepared contents', JSON.stringify(context.preparedContents, null, 2));
const markup = await renderPage(url, context, options);
const indexDir = path.join(options.renderDir, url.url);
const indexPath = path.join(indexDir, 'index.html');
if (indexDir !== options.renderDir) {
await fs.mkdirs(indexDir);
}
await fs.writeFile(indexPath, markup);
logger.debug(`Rendering success for ${url.url}`);
loadedPage++;
} catch (error) {
logger.warn(`Something went wrong while writing rendered page`, error);
}
}
logger.info(`Sucessfully rendered ${loadedPage} pages`);
}
|
const { runQuery } = require('../../../../../common/bigquery/test-utils');
const version = require('../../package.json').version;
test('VERSION returns the proper version', async () => {
const query = 'SELECT `@@BQ_PREFIX@@s2.VERSION`() as v';
const rows = await runQuery(query);
expect(rows.length).toEqual(1);
expect(rows[0].v).toEqual(version);
});
|
mycallback( {"CONTRIBUTOR OCCUPATION": "CEO", "CONTRIBUTION AMOUNT (F3L Bundled)": "250.00", "ELECTION CODE": "G2010", "MEMO CODE": "", "CONTRIBUTOR EMPLOYER": "OMEGA WORLD TRAVEL", "DONOR CANDIDATE STATE": "", "CONTRIBUTOR STREET 1": "1129 CREST LANE", "CONTRIBUTOR MIDDLE NAME": "", "DONOR CANDIDATE FEC ID": "", "DONOR CANDIDATE MIDDLE NAME": "", "CONTRIBUTOR STATE": "VA", "DONOR CANDIDATE FIRST NAME": "", "CONTRIBUTOR FIRST NAME": "GLORIA", "BACK REFERENCE SCHED NAME": "", "DONOR CANDIDATE DISTRICT": "", "CONTRIBUTION DATE": "20100702", "DONOR COMMITTEE NAME": "", "MEMO TEXT/DESCRIPTION": "", "Reference to SI or SL system code that identifies the Account": "", "FILER COMMITTEE ID NUMBER": "C00472050", "DONOR CANDIDATE LAST NAME": "", "CONTRIBUTOR LAST NAME": "BOHAN", "_record_type": "fec.version.v7_0.SA", "CONDUIT STREET2": "", "CONDUIT STREET1": "", "DONOR COMMITTEE FEC ID": "", "CONTRIBUTION PURPOSE DESCRIP": "CONTRIBUTION", "CONTRIBUTOR ZIP": "221011805", "CONTRIBUTOR STREET 2": "", "CONDUIT CITY": "", "ENTITY TYPE": "IND", "CONTRIBUTOR CITY": "MCLEAN", "CONTRIBUTOR SUFFIX": "", "TRANSACTION ID": "SA11.170", "DONOR CANDIDATE SUFFIX": "", "DONOR CANDIDATE OFFICE": "", "CONTRIBUTION PURPOSE CODE": "15", "ELECTION OTHER DESCRIPTION": "", "_src_file": "2011/20110504/727361.fec_1.yml", "CONDUIT STATE": "", "CONTRIBUTOR ORGANIZATION NAME": "", "BACK REFERENCE TRAN ID NUMBER": "", "DONOR CANDIDATE PREFIX": "", "CONTRIBUTOR PREFIX": "", "CONDUIT ZIP": "", "CONDUIT NAME": "", "CONTRIBUTION AGGREGATE F3L Semi-annual Bundled": "250.00", "FORM TYPE": "SA11AI"});
mycallback( {"CONTRIBUTOR OCCUPATION": "CEO", "CONTRIBUTION AMOUNT (F3L Bundled)": "250.00", "ELECTION CODE": "G2010", "MEMO CODE": "", "CONTRIBUTOR EMPLOYER": "OMEGA WORLD TRAVEL", "DONOR CANDIDATE STATE": "", "CONTRIBUTOR STREET 1": "1129 CREST LANE", "CONTRIBUTOR MIDDLE NAME": "", "DONOR CANDIDATE FEC ID": "", "DONOR CANDIDATE MIDDLE NAME": "", "CONTRIBUTOR STATE": "VA", "DONOR CANDIDATE FIRST NAME": "", "CONTRIBUTOR FIRST NAME": "GLORIA", "BACK REFERENCE SCHED NAME": "", "DONOR CANDIDATE DISTRICT": "", "CONTRIBUTION DATE": "20100702", "DONOR COMMITTEE NAME": "", "MEMO TEXT/DESCRIPTION": "", "Reference to SI or SL system code that identifies the Account": "", "FILER COMMITTEE ID NUMBER": "C00472050", "DONOR CANDIDATE LAST NAME": "", "CONTRIBUTOR LAST NAME": "BOHAN", "_record_type": "fec.version.v7_0.SA", "CONDUIT STREET2": "", "CONDUIT STREET1": "", "DONOR COMMITTEE FEC ID": "", "CONTRIBUTION PURPOSE DESCRIP": "CONTRIBUTION", "CONTRIBUTOR ZIP": "221011805", "CONTRIBUTOR STREET 2": "", "CONDUIT CITY": "", "ENTITY TYPE": "IND", "CONTRIBUTOR CITY": "MCLEAN", "CONTRIBUTOR SUFFIX": "", "TRANSACTION ID": "SA11.170", "DONOR CANDIDATE SUFFIX": "", "DONOR CANDIDATE OFFICE": "", "CONTRIBUTION PURPOSE CODE": "15", "ELECTION OTHER DESCRIPTION": "", "_src_file": "2011/20110504/727361.fec_1.yml", "CONDUIT STATE": "", "CONTRIBUTOR ORGANIZATION NAME": "", "BACK REFERENCE TRAN ID NUMBER": "", "DONOR CANDIDATE PREFIX": "", "CONTRIBUTOR PREFIX": "", "CONDUIT ZIP": "", "CONDUIT NAME": "", "CONTRIBUTION AGGREGATE F3L Semi-annual Bundled": "250.00", "FORM TYPE": "SA11AI"});
|
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[0],{
/***/ "./node_modules/@babel/runtime/helpers/arrayLikeToArray.js":
/*!*****************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***!
\*****************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
function _arrayLikeToArray(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) {
arr2[i] = arr[i];
}
return arr2;
}
module.exports = _arrayLikeToArray;
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/arrayWithHoles.js":
/*!***************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/arrayWithHoles.js ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
function _arrayWithHoles(arr) {
if (Array.isArray(arr)) return arr;
}
module.exports = _arrayWithHoles;
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js":
/*!******************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js ***!
\******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray */ "./node_modules/@babel/runtime/helpers/arrayLikeToArray.js");
function _arrayWithoutHoles(arr) {
if (Array.isArray(arr)) return arrayLikeToArray(arr);
}
module.exports = _arrayWithoutHoles;
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/assertThisInitialized.js":
/*!**********************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/assertThisInitialized.js ***!
\**********************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
function _assertThisInitialized(self) {
if (self === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self;
}
module.exports = _assertThisInitialized;
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js":
/*!*****************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
\*****************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, 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(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function () {
var self = this,
args = arguments;
return new Promise(function (resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
}
_next(undefined);
});
};
}
module.exports = _asyncToGenerator;
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/classCallCheck.js":
/*!***************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/classCallCheck.js ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
module.exports = _classCallCheck;
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/createClass.js":
/*!************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/createClass.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
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);
}
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
return Constructor;
}
module.exports = _createClass;
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/defineProperty.js":
/*!***************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/defineProperty.js ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
function _defineProperty(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;
}
module.exports = _defineProperty;
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/get.js":
/*!****************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/get.js ***!
\****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var superPropBase = __webpack_require__(/*! ./superPropBase */ "./node_modules/@babel/runtime/helpers/superPropBase.js");
function _get(target, property, receiver) {
if (typeof Reflect !== "undefined" && Reflect.get) {
module.exports = _get = Reflect.get;
} else {
module.exports = _get = function _get(target, property, receiver) {
var base = superPropBase(target, property);
if (!base) return;
var desc = Object.getOwnPropertyDescriptor(base, property);
if (desc.get) {
return desc.get.call(receiver);
}
return desc.value;
};
}
return _get(target, property, receiver || target);
}
module.exports = _get;
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js":
/*!***************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/getPrototypeOf.js ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
function _getPrototypeOf(o) {
module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
return o.__proto__ || Object.getPrototypeOf(o);
};
return _getPrototypeOf(o);
}
module.exports = _getPrototypeOf;
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/inherits.js":
/*!*********************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/inherits.js ***!
\*********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf */ "./node_modules/@babel/runtime/helpers/setPrototypeOf.js");
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function");
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
writable: true,
configurable: true
}
});
if (superClass) setPrototypeOf(subClass, superClass);
}
module.exports = _inherits;
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/iterableToArray.js":
/*!****************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/iterableToArray.js ***!
\****************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
function _iterableToArray(iter) {
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
}
module.exports = _iterableToArray;
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js":
/*!*********************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***!
\*********************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
function _iterableToArrayLimit(arr, i) {
if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
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"] != null) _i["return"]();
} finally {
if (_d) throw _e;
}
}
return _arr;
}
module.exports = _iterableToArrayLimit;
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/nonIterableRest.js":
/*!****************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/nonIterableRest.js ***!
\****************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
function _nonIterableRest() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
module.exports = _nonIterableRest;
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/nonIterableSpread.js":
/*!******************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/nonIterableSpread.js ***!
\******************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
function _nonIterableSpread() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
module.exports = _nonIterableSpread;
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js":
/*!**************************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js ***!
\**************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var _typeof = __webpack_require__(/*! ../helpers/typeof */ "./node_modules/@babel/runtime/helpers/typeof.js");
var assertThisInitialized = __webpack_require__(/*! ./assertThisInitialized */ "./node_modules/@babel/runtime/helpers/assertThisInitialized.js");
function _possibleConstructorReturn(self, call) {
if (call && (_typeof(call) === "object" || typeof call === "function")) {
return call;
}
return assertThisInitialized(self);
}
module.exports = _possibleConstructorReturn;
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/setPrototypeOf.js":
/*!***************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/setPrototypeOf.js ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
function _setPrototypeOf(o, p) {
module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
o.__proto__ = p;
return o;
};
return _setPrototypeOf(o, p);
}
module.exports = _setPrototypeOf;
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/slicedToArray.js":
/*!**************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/slicedToArray.js ***!
\**************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles */ "./node_modules/@babel/runtime/helpers/arrayWithHoles.js");
var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit */ "./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js");
var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray */ "./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js");
var nonIterableRest = __webpack_require__(/*! ./nonIterableRest */ "./node_modules/@babel/runtime/helpers/nonIterableRest.js");
function _slicedToArray(arr, i) {
return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
}
module.exports = _slicedToArray;
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/superPropBase.js":
/*!**************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/superPropBase.js ***!
\**************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var getPrototypeOf = __webpack_require__(/*! ./getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
function _superPropBase(object, property) {
while (!Object.prototype.hasOwnProperty.call(object, property)) {
object = getPrototypeOf(object);
if (object === null) break;
}
return object;
}
module.exports = _superPropBase;
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/toConsumableArray.js":
/*!******************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/toConsumableArray.js ***!
\******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var arrayWithoutHoles = __webpack_require__(/*! ./arrayWithoutHoles */ "./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js");
var iterableToArray = __webpack_require__(/*! ./iterableToArray */ "./node_modules/@babel/runtime/helpers/iterableToArray.js");
var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray */ "./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js");
var nonIterableSpread = __webpack_require__(/*! ./nonIterableSpread */ "./node_modules/@babel/runtime/helpers/nonIterableSpread.js");
function _toConsumableArray(arr) {
return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
}
module.exports = _toConsumableArray;
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/typeof.js":
/*!*******************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/typeof.js ***!
\*******************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
function _typeof(obj) {
"@babel/helpers - typeof";
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
module.exports = _typeof = function _typeof(obj) {
return typeof obj;
};
} else {
module.exports = _typeof = function _typeof(obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
}
return _typeof(obj);
}
module.exports = _typeof;
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js":
/*!***************************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***!
\***************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray */ "./node_modules/@babel/runtime/helpers/arrayLikeToArray.js");
function _unsupportedIterableToArray(o, minLen) {
if (!o) return;
if (typeof o === "string") return arrayLikeToArray(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === "Object" && o.constructor) n = o.constructor.name;
if (n === "Map" || n === "Set") return Array.from(o);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
}
module.exports = _unsupportedIterableToArray;
/***/ }),
/***/ "./node_modules/@babel/runtime/regenerator/index.js":
/*!**********************************************************!*\
!*** ./node_modules/@babel/runtime/regenerator/index.js ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(/*! regenerator-runtime */ "./node_modules/regenerator-runtime/runtime.js");
/***/ }),
/***/ "./node_modules/canvg/lib/index.es.js":
/*!********************************************!*\
!*** ./node_modules/canvg/lib/index.es.js ***!
\********************************************/
/*! exports provided: default, AElement, AnimateColorElement, AnimateElement, AnimateTransformElement, BoundingBox, CB1, CB2, CB3, CB4, Canvg, CircleElement, ClipPathElement, DefsElement, DescElement, Document, Element, EllipseElement, FeColorMatrixElement, FeCompositeElement, FeDropShadowElement, FeGaussianBlurElement, FeMorphologyElement, FilterElement, Font, FontElement, FontFaceElement, GElement, GlyphElement, GradientElement, ImageElement, LineElement, LinearGradientElement, MarkerElement, MaskElement, Matrix, MissingGlyphElement, Mouse, PSEUDO_ZERO, Parser, PathElement, PathParser, PatternElement, Point, PolygonElement, PolylineElement, Property, QB1, QB2, QB3, RadialGradientElement, RectElement, RenderedElement, Rotate, SVGElement, SVGFontLoader, Scale, Screen, Skew, SkewX, SkewY, StopElement, StyleElement, SymbolElement, TRefElement, TSpanElement, TextElement, TextPathElement, TitleElement, Transform, Translate, UnknownElement, UseElement, ViewPort, compressSpaces, getSelectorSpecificity, normalizeAttributeName, normalizeColor, parseExternalUrl, presets, toNumbers, trimLeft, trimRight, vectorMagnitude, vectorsAngle, vectorsRatio */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* WEBPACK VAR INJECTION */(function(process) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AElement", function() { return AElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimateColorElement", function() { return AnimateColorElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimateElement", function() { return AnimateElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimateTransformElement", function() { return AnimateTransformElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BoundingBox", function() { return BoundingBox; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CB1", function() { return CB1; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CB2", function() { return CB2; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CB3", function() { return CB3; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CB4", function() { return CB4; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Canvg", function() { return Canvg; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CircleElement", function() { return CircleElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ClipPathElement", function() { return ClipPathElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DefsElement", function() { return DefsElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DescElement", function() { return DescElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Document", function() { return Document; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Element", function() { return Element; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EllipseElement", function() { return EllipseElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FeColorMatrixElement", function() { return FeColorMatrixElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FeCompositeElement", function() { return FeCompositeElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FeDropShadowElement", function() { return FeDropShadowElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FeGaussianBlurElement", function() { return FeGaussianBlurElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FeMorphologyElement", function() { return FeMorphologyElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FilterElement", function() { return FilterElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Font", function() { return Font; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FontElement", function() { return FontElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FontFaceElement", function() { return FontFaceElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GElement", function() { return GElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GlyphElement", function() { return GlyphElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GradientElement", function() { return GradientElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ImageElement", function() { return ImageElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LineElement", function() { return LineElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LinearGradientElement", function() { return LinearGradientElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkerElement", function() { return MarkerElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MaskElement", function() { return MaskElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Matrix", function() { return Matrix; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MissingGlyphElement", function() { return MissingGlyphElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Mouse", function() { return Mouse; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PSEUDO_ZERO", function() { return PSEUDO_ZERO; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Parser", function() { return Parser; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PathElement", function() { return PathElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PathParser", function() { return PathParser; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PatternElement", function() { return PatternElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Point", function() { return Point; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PolygonElement", function() { return PolygonElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PolylineElement", function() { return PolylineElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Property", function() { return Property; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QB1", function() { return QB1; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QB2", function() { return QB2; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QB3", function() { return QB3; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RadialGradientElement", function() { return RadialGradientElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RectElement", function() { return RectElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RenderedElement", function() { return RenderedElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Rotate", function() { return Rotate; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SVGElement", function() { return SVGElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SVGFontLoader", function() { return SVGFontLoader; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Scale", function() { return Scale; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Screen", function() { return Screen; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Skew", function() { return Skew; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SkewX", function() { return SkewX; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SkewY", function() { return SkewY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StopElement", function() { return StopElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StyleElement", function() { return StyleElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SymbolElement", function() { return SymbolElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TRefElement", function() { return TRefElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TSpanElement", function() { return TSpanElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextElement", function() { return TextElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextPathElement", function() { return TextPathElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TitleElement", function() { return TitleElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Transform", function() { return Transform; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Translate", function() { return Translate; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UnknownElement", function() { return UnknownElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UseElement", function() { return UseElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewPort", function() { return ViewPort; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "compressSpaces", function() { return compressSpaces; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSelectorSpecificity", function() { return getSelectorSpecificity; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizeAttributeName", function() { return normalizeAttributeName; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizeColor", function() { return normalizeColor; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseExternalUrl", function() { return parseExternalUrl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "presets", function() { return index; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toNumbers", function() { return toNumbers; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "trimLeft", function() { return trimLeft; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "trimRight", function() { return trimRight; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "vectorMagnitude", function() { return vectorMagnitude; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "vectorsAngle", function() { return vectorsAngle; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "vectorsRatio", function() { return vectorsRatio; });
/* harmony import */ var core_js_modules_es_array_map__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.map */ "./node_modules/canvg/node_modules/core-js/modules/es.array.map.js");
/* harmony import */ var core_js_modules_es_array_map__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_map__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var core_js_modules_es_regexp_exec__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.regexp.exec */ "./node_modules/canvg/node_modules/core-js/modules/es.regexp.exec.js");
/* harmony import */ var core_js_modules_es_regexp_exec__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_exec__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var core_js_modules_es_string_match__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.string.match */ "./node_modules/canvg/node_modules/core-js/modules/es.string.match.js");
/* harmony import */ var core_js_modules_es_string_match__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_match__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var core_js_modules_es_string_replace__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.string.replace */ "./node_modules/canvg/node_modules/core-js/modules/es.string.replace.js");
/* harmony import */ var core_js_modules_es_string_replace__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_replace__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var core_js_modules_es_string_starts_with__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.string.starts-with */ "./node_modules/canvg/node_modules/core-js/modules/es.string.starts-with.js");
/* harmony import */ var core_js_modules_es_string_starts_with__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_starts_with__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var core_js_modules_es_array_join__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.array.join */ "./node_modules/canvg/node_modules/core-js/modules/es.array.join.js");
/* harmony import */ var core_js_modules_es_array_join__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_join__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "./node_modules/@babel/runtime/helpers/slicedToArray.js");
/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var core_js_modules_es_symbol__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.symbol */ "./node_modules/canvg/node_modules/core-js/modules/es.symbol.js");
/* harmony import */ var core_js_modules_es_symbol__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var core_js_modules_es_array_filter__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.array.filter */ "./node_modules/canvg/node_modules/core-js/modules/es.array.filter.js");
/* harmony import */ var core_js_modules_es_array_filter__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_filter__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var core_js_modules_es_array_for_each__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.array.for-each */ "./node_modules/canvg/node_modules/core-js/modules/es.array.for-each.js");
/* harmony import */ var core_js_modules_es_array_for_each__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_for_each__WEBPACK_IMPORTED_MODULE_9__);
/* harmony import */ var core_js_modules_es_object_get_own_property_descriptor__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor */ "./node_modules/canvg/node_modules/core-js/modules/es.object.get-own-property-descriptor.js");
/* harmony import */ var core_js_modules_es_object_get_own_property_descriptor__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_get_own_property_descriptor__WEBPACK_IMPORTED_MODULE_10__);
/* harmony import */ var core_js_modules_es_object_get_own_property_descriptors__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors */ "./node_modules/canvg/node_modules/core-js/modules/es.object.get-own-property-descriptors.js");
/* harmony import */ var core_js_modules_es_object_get_own_property_descriptors__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_get_own_property_descriptors__WEBPACK_IMPORTED_MODULE_11__);
/* harmony import */ var core_js_modules_es_object_keys__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.object.keys */ "./node_modules/canvg/node_modules/core-js/modules/es.object.keys.js");
/* harmony import */ var core_js_modules_es_object_keys__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_keys__WEBPACK_IMPORTED_MODULE_12__);
/* harmony import */ var core_js_modules_web_dom_collections_for_each__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/web.dom-collections.for-each */ "./node_modules/canvg/node_modules/core-js/modules/web.dom-collections.for-each.js");
/* harmony import */ var core_js_modules_web_dom_collections_for_each__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_for_each__WEBPACK_IMPORTED_MODULE_13__);
/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_14__);
/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_15__);
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/@babel/runtime/helpers/defineProperty.js");
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_16__);
/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17__);
/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18__);
/* harmony import */ var core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! core-js/modules/es.array.concat */ "./node_modules/canvg/node_modules/core-js/modules/es.array.concat.js");
/* harmony import */ var core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_19__);
/* harmony import */ var core_js_modules_es_array_every__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! core-js/modules/es.array.every */ "./node_modules/canvg/node_modules/core-js/modules/es.array.every.js");
/* harmony import */ var core_js_modules_es_array_every__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_every__WEBPACK_IMPORTED_MODULE_20__);
/* harmony import */ var core_js_modules_es_array_reduce__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! core-js/modules/es.array.reduce */ "./node_modules/canvg/node_modules/core-js/modules/es.array.reduce.js");
/* harmony import */ var core_js_modules_es_array_reduce__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_reduce__WEBPACK_IMPORTED_MODULE_21__);
/* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! core-js/modules/es.object.to-string */ "./node_modules/canvg/node_modules/core-js/modules/es.object.to-string.js");
/* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_22___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_22__);
/* harmony import */ var core_js_modules_es_promise__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! core-js/modules/es.promise */ "./node_modules/canvg/node_modules/core-js/modules/es.promise.js");
/* harmony import */ var core_js_modules_es_promise__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_promise__WEBPACK_IMPORTED_MODULE_23__);
/* harmony import */ var core_js_modules_es_string_split__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! core-js/modules/es.string.split */ "./node_modules/canvg/node_modules/core-js/modules/es.string.split.js");
/* harmony import */ var core_js_modules_es_string_split__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_split__WEBPACK_IMPORTED_MODULE_24__);
/* harmony import */ var raf__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! raf */ "./node_modules/raf/index.js");
/* harmony import */ var raf__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(raf__WEBPACK_IMPORTED_MODULE_25__);
/* harmony import */ var core_js_modules_es_function_name__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! core-js/modules/es.function.name */ "./node_modules/canvg/node_modules/core-js/modules/es.function.name.js");
/* harmony import */ var core_js_modules_es_function_name__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_function_name__WEBPACK_IMPORTED_MODULE_26__);
/* harmony import */ var rgbcolor__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! rgbcolor */ "./node_modules/rgbcolor/index.js");
/* harmony import */ var rgbcolor__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(rgbcolor__WEBPACK_IMPORTED_MODULE_27__);
/* harmony import */ var core_js_modules_es_reflect_construct__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! core-js/modules/es.reflect.construct */ "./node_modules/canvg/node_modules/core-js/modules/es.reflect.construct.js");
/* harmony import */ var core_js_modules_es_reflect_construct__WEBPACK_IMPORTED_MODULE_28___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_reflect_construct__WEBPACK_IMPORTED_MODULE_28__);
/* harmony import */ var core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! core-js/modules/es.regexp.to-string */ "./node_modules/canvg/node_modules/core-js/modules/es.regexp.to-string.js");
/* harmony import */ var core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_29___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_29__);
/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30__);
/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31__);
/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_32___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_32__);
/* harmony import */ var core_js_modules_es_array_from__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! core-js/modules/es.array.from */ "./node_modules/canvg/node_modules/core-js/modules/es.array.from.js");
/* harmony import */ var core_js_modules_es_array_from__WEBPACK_IMPORTED_MODULE_33___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_from__WEBPACK_IMPORTED_MODULE_33__);
/* harmony import */ var core_js_modules_es_array_includes__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! core-js/modules/es.array.includes */ "./node_modules/canvg/node_modules/core-js/modules/es.array.includes.js");
/* harmony import */ var core_js_modules_es_array_includes__WEBPACK_IMPORTED_MODULE_34___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_includes__WEBPACK_IMPORTED_MODULE_34__);
/* harmony import */ var core_js_modules_es_array_some__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! core-js/modules/es.array.some */ "./node_modules/canvg/node_modules/core-js/modules/es.array.some.js");
/* harmony import */ var core_js_modules_es_array_some__WEBPACK_IMPORTED_MODULE_35___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_some__WEBPACK_IMPORTED_MODULE_35__);
/* harmony import */ var core_js_modules_es_string_includes__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! core-js/modules/es.string.includes */ "./node_modules/canvg/node_modules/core-js/modules/es.string.includes.js");
/* harmony import */ var core_js_modules_es_string_includes__WEBPACK_IMPORTED_MODULE_36___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_includes__WEBPACK_IMPORTED_MODULE_36__);
/* harmony import */ var core_js_modules_es_string_iterator__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! core-js/modules/es.string.iterator */ "./node_modules/canvg/node_modules/core-js/modules/es.string.iterator.js");
/* harmony import */ var core_js_modules_es_string_iterator__WEBPACK_IMPORTED_MODULE_37___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_iterator__WEBPACK_IMPORTED_MODULE_37__);
/* harmony import */ var core_js_modules_es_string_trim__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! core-js/modules/es.string.trim */ "./node_modules/canvg/node_modules/core-js/modules/es.string.trim.js");
/* harmony import */ var core_js_modules_es_string_trim__WEBPACK_IMPORTED_MODULE_38___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_trim__WEBPACK_IMPORTED_MODULE_38__);
/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "./node_modules/@babel/runtime/helpers/toConsumableArray.js");
/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_39___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_39__);
/* harmony import */ var core_js_modules_es_array_index_of__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! core-js/modules/es.array.index-of */ "./node_modules/canvg/node_modules/core-js/modules/es.array.index-of.js");
/* harmony import */ var core_js_modules_es_array_index_of__WEBPACK_IMPORTED_MODULE_40___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_index_of__WEBPACK_IMPORTED_MODULE_40__);
/* harmony import */ var core_js_modules_es_array_reverse__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! core-js/modules/es.array.reverse */ "./node_modules/canvg/node_modules/core-js/modules/es.array.reverse.js");
/* harmony import */ var core_js_modules_es_array_reverse__WEBPACK_IMPORTED_MODULE_41___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_reverse__WEBPACK_IMPORTED_MODULE_41__);
/* harmony import */ var _babel_runtime_helpers_get__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! @babel/runtime/helpers/get */ "./node_modules/@babel/runtime/helpers/get.js");
/* harmony import */ var _babel_runtime_helpers_get__WEBPACK_IMPORTED_MODULE_42___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_get__WEBPACK_IMPORTED_MODULE_42__);
/* harmony import */ var core_js_modules_es_number_constructor__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! core-js/modules/es.number.constructor */ "./node_modules/canvg/node_modules/core-js/modules/es.number.constructor.js");
/* harmony import */ var core_js_modules_es_number_constructor__WEBPACK_IMPORTED_MODULE_43___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_number_constructor__WEBPACK_IMPORTED_MODULE_43__);
/* harmony import */ var core_js_modules_es_array_fill__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! core-js/modules/es.array.fill */ "./node_modules/canvg/node_modules/core-js/modules/es.array.fill.js");
/* harmony import */ var core_js_modules_es_array_fill__WEBPACK_IMPORTED_MODULE_44___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_fill__WEBPACK_IMPORTED_MODULE_44__);
/* harmony import */ var core_js_modules_es_reflect_delete_property__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! core-js/modules/es.reflect.delete-property */ "./node_modules/canvg/node_modules/core-js/modules/es.reflect.delete-property.js");
/* harmony import */ var core_js_modules_es_reflect_delete_property__WEBPACK_IMPORTED_MODULE_45___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_reflect_delete_property__WEBPACK_IMPORTED_MODULE_45__);
/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/assertThisInitialized.js");
/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_46___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_46__);
/* harmony import */ var core_js_modules_es_array_iterator__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! core-js/modules/es.array.iterator */ "./node_modules/canvg/node_modules/core-js/modules/es.array.iterator.js");
/* harmony import */ var core_js_modules_es_array_iterator__WEBPACK_IMPORTED_MODULE_47___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_iterator__WEBPACK_IMPORTED_MODULE_47__);
/* harmony import */ var core_js_modules_web_dom_collections_iterator__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator */ "./node_modules/canvg/node_modules/core-js/modules/web.dom-collections.iterator.js");
/* harmony import */ var core_js_modules_web_dom_collections_iterator__WEBPACK_IMPORTED_MODULE_48___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_iterator__WEBPACK_IMPORTED_MODULE_48__);
/* harmony import */ var core_js_modules_es_symbol_description__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! core-js/modules/es.symbol.description */ "./node_modules/canvg/node_modules/core-js/modules/es.symbol.description.js");
/* harmony import */ var core_js_modules_es_symbol_description__WEBPACK_IMPORTED_MODULE_49___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol_description__WEBPACK_IMPORTED_MODULE_49__);
/* harmony import */ var core_js_modules_es_symbol_iterator__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator */ "./node_modules/canvg/node_modules/core-js/modules/es.symbol.iterator.js");
/* harmony import */ var core_js_modules_es_symbol_iterator__WEBPACK_IMPORTED_MODULE_50___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol_iterator__WEBPACK_IMPORTED_MODULE_50__);
/* harmony import */ var core_js_modules_es_array_slice__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! core-js/modules/es.array.slice */ "./node_modules/canvg/node_modules/core-js/modules/es.array.slice.js");
/* harmony import */ var core_js_modules_es_array_slice__WEBPACK_IMPORTED_MODULE_51___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_slice__WEBPACK_IMPORTED_MODULE_51__);
/* harmony import */ var core_js_modules_es_map__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! core-js/modules/es.map */ "./node_modules/canvg/node_modules/core-js/modules/es.map.js");
/* harmony import */ var core_js_modules_es_map__WEBPACK_IMPORTED_MODULE_52___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_map__WEBPACK_IMPORTED_MODULE_52__);
/* harmony import */ var core_js_modules_es_reflect_apply__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! core-js/modules/es.reflect.apply */ "./node_modules/canvg/node_modules/core-js/modules/es.reflect.apply.js");
/* harmony import */ var core_js_modules_es_reflect_apply__WEBPACK_IMPORTED_MODULE_53___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_reflect_apply__WEBPACK_IMPORTED_MODULE_53__);
/* harmony import */ var core_js_modules_es_reflect_get_prototype_of__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(/*! core-js/modules/es.reflect.get-prototype-of */ "./node_modules/canvg/node_modules/core-js/modules/es.reflect.get-prototype-of.js");
/* harmony import */ var core_js_modules_es_reflect_get_prototype_of__WEBPACK_IMPORTED_MODULE_54___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_reflect_get_prototype_of__WEBPACK_IMPORTED_MODULE_54__);
/* harmony import */ var stackblur_canvas__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(/*! stackblur-canvas */ "./node_modules/stackblur-canvas/dist/stackblur-es.js");
/**
* HTML-safe compress white-spaces.
* @param str - String to compress.
*/
function compressSpaces(str) {
return str.replace(/(?!\u3000)\s+/gm, ' ');
}
/**
* HTML-safe left trim.
* @param str - String to trim.
*/
function trimLeft(str) {
return str.replace(/^[\n \t]+/, '');
}
/**
* HTML-safe right trim.
* @param str - String to trim.
*/
function trimRight(str) {
return str.replace(/[\n \t]+$/, '');
}
/**
* String to numbers array.
* @param str - Numbers string.
*/
function toNumbers(str) {
var matches = (str || '').match(/-?(\d+(?:\.\d*(?:[eE][+-]?\d+)?)?|\.\d+)(?=\D|$)/gm) || [];
return matches.map(parseFloat);
} // Microsoft Edge fix
var allUppercase = /^[A-Z-]+$/;
/**
* Normalize attribute name.
* @param name - Attribute name.
*/
function normalizeAttributeName(name) {
if (allUppercase.test(name)) {
return name.toLowerCase();
}
return name;
}
/**
* Parse external URL.
* @param url - CSS url string.
*/
function parseExternalUrl(url) {
// single quotes [2]
// v double quotes [3]
// v v no quotes [4]
// v v v
var urlMatch = url.match(/url\(('([^']+)'|"([^"]+)"|([^'"\)]+))\)/) || [];
return urlMatch[2] || urlMatch[3] || urlMatch[4];
}
/**
* Transform floats to integers in rgb colors.
* @param color - Color to normalize.
*/
function normalizeColor(color) {
if (!color.startsWith('rgb')) {
return color;
}
var rgbParts = 3;
var normalizedColor = color.replace(/\d+(\.\d+)?/g, function (num, isFloat) {
return rgbParts-- && isFloat ? String(Math.round(parseFloat(num))) : num;
});
return normalizedColor;
}
// slightly modified version of https://github.com/keeganstreet/specificity/blob/master/specificity.js
var attributeRegex = /(\[[^\]]+\])/g;
var idRegex = /(#[^\s\+>~\.\[:]+)/g;
var classRegex = /(\.[^\s\+>~\.\[:]+)/g;
var pseudoElementRegex = /(::[^\s\+>~\.\[:]+|:first-line|:first-letter|:before|:after)/gi;
var pseudoClassWithBracketsRegex = /(:[\w-]+\([^\)]*\))/gi;
var pseudoClassRegex = /(:[^\s\+>~\.\[:]+)/g;
var elementRegex = /([^\s\+>~\.\[:]+)/g;
function findSelectorMatch(selector, regex) {
var matches = selector.match(regex);
if (!matches) {
return [selector, 0];
}
return [selector.replace(regex, ' '), matches.length];
}
/**
* Measure selector specificity.
* @param selector - Selector to measure.
*/
function getSelectorSpecificity(selector) {
var specificity = [0, 0, 0];
var currentSelector = selector.replace(/:not\(([^\)]*)\)/g, ' $1 ').replace(/{[\s\S]*/gm, ' ');
var delta = 0;
var _findSelectorMatch = findSelectorMatch(currentSelector, attributeRegex);
var _findSelectorMatch2 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_6___default()(_findSelectorMatch, 2);
currentSelector = _findSelectorMatch2[0];
delta = _findSelectorMatch2[1];
specificity[1] += delta;
var _findSelectorMatch3 = findSelectorMatch(currentSelector, idRegex);
var _findSelectorMatch4 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_6___default()(_findSelectorMatch3, 2);
currentSelector = _findSelectorMatch4[0];
delta = _findSelectorMatch4[1];
specificity[0] += delta;
var _findSelectorMatch5 = findSelectorMatch(currentSelector, classRegex);
var _findSelectorMatch6 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_6___default()(_findSelectorMatch5, 2);
currentSelector = _findSelectorMatch6[0];
delta = _findSelectorMatch6[1];
specificity[1] += delta;
var _findSelectorMatch7 = findSelectorMatch(currentSelector, pseudoElementRegex);
var _findSelectorMatch8 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_6___default()(_findSelectorMatch7, 2);
currentSelector = _findSelectorMatch8[0];
delta = _findSelectorMatch8[1];
specificity[2] += delta;
var _findSelectorMatch9 = findSelectorMatch(currentSelector, pseudoClassWithBracketsRegex);
var _findSelectorMatch10 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_6___default()(_findSelectorMatch9, 2);
currentSelector = _findSelectorMatch10[0];
delta = _findSelectorMatch10[1];
specificity[1] += delta;
var _findSelectorMatch11 = findSelectorMatch(currentSelector, pseudoClassRegex);
var _findSelectorMatch12 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_6___default()(_findSelectorMatch11, 2);
currentSelector = _findSelectorMatch12[0];
delta = _findSelectorMatch12[1];
specificity[1] += delta;
currentSelector = currentSelector.replace(/[\*\s\+>~]/g, ' ').replace(/[#\.]/g, ' ');
var _findSelectorMatch13 = findSelectorMatch(currentSelector, elementRegex);
var _findSelectorMatch14 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_6___default()(_findSelectorMatch13, 2);
currentSelector = _findSelectorMatch14[0];
delta = _findSelectorMatch14[1];
// lgtm [js/useless-assignment-to-local]
specificity[2] += delta;
return specificity.join('');
}
var PSEUDO_ZERO = .00000001;
/**
* Vector magnitude.
*/
function vectorMagnitude(v) {
return Math.sqrt(Math.pow(v[0], 2) + Math.pow(v[1], 2));
}
/**
* Ratio between two vectors.
*/
function vectorsRatio(u, v) {
return (u[0] * v[0] + u[1] * v[1]) / (vectorMagnitude(u) * vectorMagnitude(v));
}
/**
* Angle between two vectors.
*/
function vectorsAngle(u, v) {
return (u[0] * v[1] < u[1] * v[0] ? -1 : 1) * Math.acos(vectorsRatio(u, v));
}
function CB1(t) {
return t * t * t;
}
function CB2(t) {
return 3 * t * t * (1 - t);
}
function CB3(t) {
return 3 * t * (1 - t) * (1 - t);
}
function CB4(t) {
return (1 - t) * (1 - t) * (1 - t);
}
function QB1(t) {
return t * t;
}
function QB2(t) {
return 2 * t * (1 - t);
}
function QB3(t) {
return (1 - t) * (1 - t);
}
function createCommonjsModule(fn, module) {
return module = { exports: {} }, fn(module, module.exports), module.exports;
}
var runtime_1 = createCommonjsModule(function (module) {
/**
* Copyright (c) 2014-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var runtime = function (exports) {
var Op = Object.prototype;
var hasOwn = Op.hasOwnProperty;
var undefined$1; // More compressible than void 0.
var $Symbol = typeof Symbol === "function" ? Symbol : {};
var iteratorSymbol = $Symbol.iterator || "@@iterator";
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
function wrap(innerFn, outerFn, self, tryLocsList) {
// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
var generator = Object.create(protoGenerator.prototype);
var context = new Context(tryLocsList || []); // The ._invoke method unifies the implementations of the .next,
// .throw, and .return methods.
generator._invoke = makeInvokeMethod(innerFn, self, context);
return generator;
}
exports.wrap = wrap; // Try/catch helper to minimize deoptimizations. Returns a completion
// record like context.tryEntries[i].completion. This interface could
// have been (and was previously) designed to take a closure to be
// invoked without arguments, but in all the cases we care about we
// already have an existing method we want to call, so there's no need
// to create a new function object. We can even get away with assuming
// the method takes exactly one argument, since that happens to be true
// in every case, so we don't have to touch the arguments object. The
// only additional allocation required is the completion record, which
// has a stable shape and so hopefully should be cheap to allocate.
function tryCatch(fn, obj, arg) {
try {
return {
type: "normal",
arg: fn.call(obj, arg)
};
} catch (err) {
return {
type: "throw",
arg: err
};
}
}
var GenStateSuspendedStart = "suspendedStart";
var GenStateSuspendedYield = "suspendedYield";
var GenStateExecuting = "executing";
var GenStateCompleted = "completed"; // Returning this object from the innerFn has the same effect as
// breaking out of the dispatch switch statement.
var ContinueSentinel = {}; // Dummy constructor functions that we use as the .constructor and
// .constructor.prototype properties for functions that return Generator
// objects. For full spec compliance, you may wish to configure your
// minifier not to mangle the names of these two functions.
function Generator() {}
function GeneratorFunction() {}
function GeneratorFunctionPrototype() {} // This is a polyfill for %IteratorPrototype% for environments that
// don't natively support it.
var IteratorPrototype = {};
IteratorPrototype[iteratorSymbol] = function () {
return this;
};
var getProto = Object.getPrototypeOf;
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
// This environment has a native %IteratorPrototype%; use it instead
// of the polyfill.
IteratorPrototype = NativeIteratorPrototype;
}
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
GeneratorFunctionPrototype.constructor = GeneratorFunction;
GeneratorFunctionPrototype[toStringTagSymbol] = GeneratorFunction.displayName = "GeneratorFunction"; // Helper for defining the .next, .throw, and .return methods of the
// Iterator interface in terms of a single ._invoke method.
function defineIteratorMethods(prototype) {
["next", "throw", "return"].forEach(function (method) {
prototype[method] = function (arg) {
return this._invoke(method, arg);
};
});
}
exports.isGeneratorFunction = function (genFun) {
var ctor = typeof genFun === "function" && genFun.constructor;
return ctor ? ctor === GeneratorFunction || // For the native GeneratorFunction constructor, the best we can
// do is to check its .name property.
(ctor.displayName || ctor.name) === "GeneratorFunction" : false;
};
exports.mark = function (genFun) {
if (Object.setPrototypeOf) {
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
} else {
genFun.__proto__ = GeneratorFunctionPrototype;
if (!(toStringTagSymbol in genFun)) {
genFun[toStringTagSymbol] = "GeneratorFunction";
}
}
genFun.prototype = Object.create(Gp);
return genFun;
}; // Within the body of any async function, `await x` is transformed to
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
// `hasOwn.call(value, "__await")` to determine if the yielded value is
// meant to be awaited.
exports.awrap = function (arg) {
return {
__await: arg
};
};
function AsyncIterator(generator, PromiseImpl) {
function invoke(method, arg, resolve, reject) {
var record = tryCatch(generator[method], generator, arg);
if (record.type === "throw") {
reject(record.arg);
} else {
var result = record.arg;
var value = result.value;
if (value && typeof value === "object" && hasOwn.call(value, "__await")) {
return PromiseImpl.resolve(value.__await).then(function (value) {
invoke("next", value, resolve, reject);
}, function (err) {
invoke("throw", err, resolve, reject);
});
}
return PromiseImpl.resolve(value).then(function (unwrapped) {
// When a yielded Promise is resolved, its final value becomes
// the .value of the Promise<{value,done}> result for the
// current iteration.
result.value = unwrapped;
resolve(result);
}, function (error) {
// If a rejected Promise was yielded, throw the rejection back
// into the async generator function so it can be handled there.
return invoke("throw", error, resolve, reject);
});
}
}
var previousPromise;
function enqueue(method, arg) {
function callInvokeWithMethodAndArg() {
return new PromiseImpl(function (resolve, reject) {
invoke(method, arg, resolve, reject);
});
}
return previousPromise = // If enqueue has been called before, then we want to wait until
// all previous Promises have been resolved before calling invoke,
// so that results are always delivered in the correct order. If
// enqueue has not been called before, then it is important to
// call invoke immediately, without waiting on a callback to fire,
// so that the async generator function has the opportunity to do
// any necessary setup in a predictable way. This predictability
// is why the Promise constructor synchronously invokes its
// executor callback, and why async functions synchronously
// execute code before the first await. Since we implement simple
// async functions in terms of async generators, it is especially
// important to get this right, even though it requires care.
previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, // Avoid propagating failures to Promises returned by later
// invocations of the iterator.
callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
} // Define the unified helper method that is used to implement .next,
// .throw, and .return (see defineIteratorMethods).
this._invoke = enqueue;
}
defineIteratorMethods(AsyncIterator.prototype);
AsyncIterator.prototype[asyncIteratorSymbol] = function () {
return this;
};
exports.AsyncIterator = AsyncIterator; // Note that simple async functions are implemented on top of
// AsyncIterator objects; they just return a Promise for the value of
// the final result produced by the iterator.
exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
if (PromiseImpl === void 0) PromiseImpl = Promise;
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
return exports.isGeneratorFunction(outerFn) ? iter // If outerFn is a generator, return the full iterator.
: iter.next().then(function (result) {
return result.done ? result.value : iter.next();
});
};
function makeInvokeMethod(innerFn, self, context) {
var state = GenStateSuspendedStart;
return function invoke(method, arg) {
if (state === GenStateExecuting) {
throw new Error("Generator is already running");
}
if (state === GenStateCompleted) {
if (method === "throw") {
throw arg;
} // Be forgiving, per 25.3.3.3.3 of the spec:
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
return doneResult();
}
context.method = method;
context.arg = arg;
while (true) {
var delegate = context.delegate;
if (delegate) {
var delegateResult = maybeInvokeDelegate(delegate, context);
if (delegateResult) {
if (delegateResult === ContinueSentinel) continue;
return delegateResult;
}
}
if (context.method === "next") {
// Setting context._sent for legacy support of Babel's
// function.sent implementation.
context.sent = context._sent = context.arg;
} else if (context.method === "throw") {
if (state === GenStateSuspendedStart) {
state = GenStateCompleted;
throw context.arg;
}
context.dispatchException(context.arg);
} else if (context.method === "return") {
context.abrupt("return", context.arg);
}
state = GenStateExecuting;
var record = tryCatch(innerFn, self, context);
if (record.type === "normal") {
// If an exception is thrown from innerFn, we leave state ===
// GenStateExecuting and loop back for another invocation.
state = context.done ? GenStateCompleted : GenStateSuspendedYield;
if (record.arg === ContinueSentinel) {
continue;
}
return {
value: record.arg,
done: context.done
};
} else if (record.type === "throw") {
state = GenStateCompleted; // Dispatch the exception by looping back around to the
// context.dispatchException(context.arg) call above.
context.method = "throw";
context.arg = record.arg;
}
}
};
} // Call delegate.iterator[context.method](context.arg) and handle the
// result, either by returning a { value, done } result from the
// delegate iterator, or by modifying context.method and context.arg,
// setting context.delegate to null, and returning the ContinueSentinel.
function maybeInvokeDelegate(delegate, context) {
var method = delegate.iterator[context.method];
if (method === undefined$1) {
// A .throw or .return when the delegate iterator has no .throw
// method always terminates the yield* loop.
context.delegate = null;
if (context.method === "throw") {
// Note: ["return"] must be used for ES3 parsing compatibility.
if (delegate.iterator["return"]) {
// If the delegate iterator has a return method, give it a
// chance to clean up.
context.method = "return";
context.arg = undefined$1;
maybeInvokeDelegate(delegate, context);
if (context.method === "throw") {
// If maybeInvokeDelegate(context) changed context.method from
// "return" to "throw", let that override the TypeError below.
return ContinueSentinel;
}
}
context.method = "throw";
context.arg = new TypeError("The iterator does not provide a 'throw' method");
}
return ContinueSentinel;
}
var record = tryCatch(method, delegate.iterator, context.arg);
if (record.type === "throw") {
context.method = "throw";
context.arg = record.arg;
context.delegate = null;
return ContinueSentinel;
}
var info = record.arg;
if (!info) {
context.method = "throw";
context.arg = new TypeError("iterator result is not an object");
context.delegate = null;
return ContinueSentinel;
}
if (info.done) {
// Assign the result of the finished delegate to the temporary
// variable specified by delegate.resultName (see delegateYield).
context[delegate.resultName] = info.value; // Resume execution at the desired location (see delegateYield).
context.next = delegate.nextLoc; // If context.method was "throw" but the delegate handled the
// exception, let the outer generator proceed normally. If
// context.method was "next", forget context.arg since it has been
// "consumed" by the delegate iterator. If context.method was
// "return", allow the original .return call to continue in the
// outer generator.
if (context.method !== "return") {
context.method = "next";
context.arg = undefined$1;
}
} else {
// Re-yield the result returned by the delegate method.
return info;
} // The delegate iterator is finished, so forget it and continue with
// the outer generator.
context.delegate = null;
return ContinueSentinel;
} // Define Generator.prototype.{next,throw,return} in terms of the
// unified ._invoke helper method.
defineIteratorMethods(Gp);
Gp[toStringTagSymbol] = "Generator"; // A Generator should always return itself as the iterator object when the
// @@iterator function is called on it. Some browsers' implementations of the
// iterator prototype chain incorrectly implement this, causing the Generator
// object to not be returned from this call. This ensures that doesn't happen.
// See https://github.com/facebook/regenerator/issues/274 for more details.
Gp[iteratorSymbol] = function () {
return this;
};
Gp.toString = function () {
return "[object Generator]";
};
function pushTryEntry(locs) {
var entry = {
tryLoc: locs[0]
};
if (1 in locs) {
entry.catchLoc = locs[1];
}
if (2 in locs) {
entry.finallyLoc = locs[2];
entry.afterLoc = locs[3];
}
this.tryEntries.push(entry);
}
function resetTryEntry(entry) {
var record = entry.completion || {};
record.type = "normal";
delete record.arg;
entry.completion = record;
}
function Context(tryLocsList) {
// The root entry object (effectively a try statement without a catch
// or a finally block) gives us a place to store values thrown from
// locations where there is no enclosing try statement.
this.tryEntries = [{
tryLoc: "root"
}];
tryLocsList.forEach(pushTryEntry, this);
this.reset(true);
}
exports.keys = function (object) {
var keys = [];
for (var key in object) {
keys.push(key);
}
keys.reverse(); // Rather than returning an object with a next method, we keep
// things simple and return the next function itself.
return function next() {
while (keys.length) {
var key = keys.pop();
if (key in object) {
next.value = key;
next.done = false;
return next;
}
} // To avoid creating an additional object, we just hang the .value
// and .done properties off the next function object itself. This
// also ensures that the minifier will not anonymize the function.
next.done = true;
return next;
};
};
function values(iterable) {
if (iterable) {
var iteratorMethod = iterable[iteratorSymbol];
if (iteratorMethod) {
return iteratorMethod.call(iterable);
}
if (typeof iterable.next === "function") {
return iterable;
}
if (!isNaN(iterable.length)) {
var i = -1,
next = function next() {
while (++i < iterable.length) {
if (hasOwn.call(iterable, i)) {
next.value = iterable[i];
next.done = false;
return next;
}
}
next.value = undefined$1;
next.done = true;
return next;
};
return next.next = next;
}
} // Return an iterator with no values.
return {
next: doneResult
};
}
exports.values = values;
function doneResult() {
return {
value: undefined$1,
done: true
};
}
Context.prototype = {
constructor: Context,
reset: function (skipTempReset) {
this.prev = 0;
this.next = 0; // Resetting context._sent for legacy support of Babel's
// function.sent implementation.
this.sent = this._sent = undefined$1;
this.done = false;
this.delegate = null;
this.method = "next";
this.arg = undefined$1;
this.tryEntries.forEach(resetTryEntry);
if (!skipTempReset) {
for (var name in this) {
// Not sure about the optimal order of these conditions:
if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) {
this[name] = undefined$1;
}
}
}
},
stop: function () {
this.done = true;
var rootEntry = this.tryEntries[0];
var rootRecord = rootEntry.completion;
if (rootRecord.type === "throw") {
throw rootRecord.arg;
}
return this.rval;
},
dispatchException: function (exception) {
if (this.done) {
throw exception;
}
var context = this;
function handle(loc, caught) {
record.type = "throw";
record.arg = exception;
context.next = loc;
if (caught) {
// If the dispatched exception was caught by a catch block,
// then let that catch block handle the exception normally.
context.method = "next";
context.arg = undefined$1;
}
return !!caught;
}
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
var record = entry.completion;
if (entry.tryLoc === "root") {
// Exception thrown outside of any try block that could handle
// it, so set the completion value of the entire function to
// throw the exception.
return handle("end");
}
if (entry.tryLoc <= this.prev) {
var hasCatch = hasOwn.call(entry, "catchLoc");
var hasFinally = hasOwn.call(entry, "finallyLoc");
if (hasCatch && hasFinally) {
if (this.prev < entry.catchLoc) {
return handle(entry.catchLoc, true);
} else if (this.prev < entry.finallyLoc) {
return handle(entry.finallyLoc);
}
} else if (hasCatch) {
if (this.prev < entry.catchLoc) {
return handle(entry.catchLoc, true);
}
} else if (hasFinally) {
if (this.prev < entry.finallyLoc) {
return handle(entry.finallyLoc);
}
} else {
throw new Error("try statement without catch or finally");
}
}
}
},
abrupt: function (type, arg) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
var finallyEntry = entry;
break;
}
}
if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) {
// Ignore the finally entry if control is not jumping to a
// location outside the try/catch block.
finallyEntry = null;
}
var record = finallyEntry ? finallyEntry.completion : {};
record.type = type;
record.arg = arg;
if (finallyEntry) {
this.method = "next";
this.next = finallyEntry.finallyLoc;
return ContinueSentinel;
}
return this.complete(record);
},
complete: function (record, afterLoc) {
if (record.type === "throw") {
throw record.arg;
}
if (record.type === "break" || record.type === "continue") {
this.next = record.arg;
} else if (record.type === "return") {
this.rval = this.arg = record.arg;
this.method = "return";
this.next = "end";
} else if (record.type === "normal" && afterLoc) {
this.next = afterLoc;
}
return ContinueSentinel;
},
finish: function (finallyLoc) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.finallyLoc === finallyLoc) {
this.complete(entry.completion, entry.afterLoc);
resetTryEntry(entry);
return ContinueSentinel;
}
}
},
"catch": function (tryLoc) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.tryLoc === tryLoc) {
var record = entry.completion;
if (record.type === "throw") {
var thrown = record.arg;
resetTryEntry(entry);
}
return thrown;
}
} // The context.catch method must only be called with a location
// argument that corresponds to a known catch block.
throw new Error("illegal catch attempt");
},
delegateYield: function (iterable, resultName, nextLoc) {
this.delegate = {
iterator: values(iterable),
resultName: resultName,
nextLoc: nextLoc
};
if (this.method === "next") {
// Deliberately forget the last sent value so that we don't
// accidentally pass it on to the delegate.
this.arg = undefined$1;
}
return ContinueSentinel;
}
}; // Regardless of whether this script is executing as a CommonJS module
// or not, return the runtime object so that we can declare the variable
// regeneratorRuntime in the outer scope, which allows this module to be
// injected easily by `bin/regenerator --include-runtime script.js`.
return exports;
}( // If this script is executing as a CommonJS module, use module.exports
// as the regeneratorRuntime namespace. Otherwise create a new empty
// object. Either way, the resulting object will be used to initialize
// the regeneratorRuntime variable at the top of this file.
module.exports );
try {
regeneratorRuntime = runtime;
} catch (accidentalStrictMode) {
// This module should not be running in strict mode, so the above
// assignment should always work unless something is misconfigured. Just
// in case runtime.js accidentally runs in strict mode, we can escape
// strict mode using a global Function call. This could conceivably fail
// if a Content Security Policy forbids using Function, but in that case
// the proper solution is to fix the accidental strict mode problem. If
// you've misconfigured your bundler to force strict mode and applied a
// CSP to forbid Function, and you're not willing to fix either of those
// problems, please detail your unique predicament in a GitHub issue.
Function("r", "regeneratorRuntime = r")(runtime);
}
});
var Property = /*#__PURE__*/function () {
function Property(document, name, value) {
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, Property);
this.document = document;
this.name = name;
this.value = value;
this.isNormalizedColor = false;
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(Property, [{
key: "hasValue",
value: function hasValue() {
var value = this.value;
return value !== null && value !== '' && value !== 0 && typeof value !== 'undefined';
}
}, {
key: "isString",
value: function isString(regexp) {
var value = this.value;
var result = typeof value === 'string';
if (!result || !regexp) {
return result;
}
return regexp.test(value);
}
}, {
key: "isUrlDefinition",
value: function isUrlDefinition() {
return this.isString(/^url\(/);
}
}, {
key: "isPixels",
value: function isPixels() {
if (!this.hasValue()) {
return false;
}
var asString = this.getString();
switch (true) {
case /px$/.test(asString):
case /^[0-9]+$/.test(asString):
return true;
default:
return false;
}
}
}, {
key: "setValue",
value: function setValue(value) {
this.value = value;
return this;
}
}, {
key: "getValue",
value: function getValue(def) {
if (typeof def === 'undefined' || this.hasValue()) {
return this.value;
}
return def;
}
}, {
key: "getNumber",
value: function getNumber(def) {
if (!this.hasValue()) {
if (typeof def === 'undefined') {
return 0;
}
return parseFloat(def);
}
var value = this.value;
var n = parseFloat(value);
if (this.isString(/%$/)) {
n = n / 100.0;
}
return n;
}
}, {
key: "getString",
value: function getString(def) {
if (typeof def === 'undefined' || this.hasValue()) {
return typeof this.value === 'undefined' ? '' : String(this.value);
}
return String(def);
}
}, {
key: "getColor",
value: function getColor(def) {
var color = this.getString(def);
if (this.isNormalizedColor) {
return color;
}
this.isNormalizedColor = true;
color = normalizeColor(color);
this.value = color;
return color;
}
}, {
key: "getDpi",
value: function getDpi() {
return 96.0; // TODO: compute?
}
}, {
key: "getRem",
value: function getRem() {
return this.document.rootEmSize;
}
}, {
key: "getEm",
value: function getEm() {
return this.document.emSize;
}
}, {
key: "getUnits",
value: function getUnits() {
return this.getString().replace(/[0-9\.\-]/g, '');
}
}, {
key: "getPixels",
value: function getPixels(axisOrIsFontSize) {
var processPercent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
if (!this.hasValue()) {
return 0;
}
var _ref = typeof axisOrIsFontSize === 'boolean' ? [undefined, axisOrIsFontSize] : [axisOrIsFontSize],
_ref2 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_6___default()(_ref, 2),
axis = _ref2[0],
isFontSize = _ref2[1];
var viewPort = this.document.screen.viewPort;
switch (true) {
case this.isString(/vmin$/):
return this.getNumber() / 100.0 * Math.min(viewPort.computeSize('x'), viewPort.computeSize('y'));
case this.isString(/vmax$/):
return this.getNumber() / 100.0 * Math.max(viewPort.computeSize('x'), viewPort.computeSize('y'));
case this.isString(/vw$/):
return this.getNumber() / 100.0 * viewPort.computeSize('x');
case this.isString(/vh$/):
return this.getNumber() / 100.0 * viewPort.computeSize('y');
case this.isString(/rem$/):
return this.getNumber() * this.getRem();
case this.isString(/em$/):
return this.getNumber() * this.getEm();
case this.isString(/ex$/):
return this.getNumber() * this.getEm() / 2.0;
case this.isString(/px$/):
return this.getNumber();
case this.isString(/pt$/):
return this.getNumber() * this.getDpi() * (1.0 / 72.0);
case this.isString(/pc$/):
return this.getNumber() * 15;
case this.isString(/cm$/):
return this.getNumber() * this.getDpi() / 2.54;
case this.isString(/mm$/):
return this.getNumber() * this.getDpi() / 25.4;
case this.isString(/in$/):
return this.getNumber() * this.getDpi();
case this.isString(/%$/) && isFontSize:
return this.getNumber() * this.getEm();
case this.isString(/%$/):
return this.getNumber() * viewPort.computeSize(axis);
default:
{
var n = this.getNumber();
if (processPercent && n < 1.0) {
return n * viewPort.computeSize(axis);
}
return n;
}
}
}
}, {
key: "getMilliseconds",
value: function getMilliseconds() {
if (!this.hasValue()) {
return 0;
}
if (this.isString(/ms$/)) {
return this.getNumber();
}
return this.getNumber() * 1000;
}
}, {
key: "getRadians",
value: function getRadians() {
if (!this.hasValue()) {
return 0;
}
switch (true) {
case this.isString(/deg$/):
return this.getNumber() * (Math.PI / 180.0);
case this.isString(/grad$/):
return this.getNumber() * (Math.PI / 200.0);
case this.isString(/rad$/):
return this.getNumber();
default:
return this.getNumber() * (Math.PI / 180.0);
}
}
}, {
key: "getDefinition",
value: function getDefinition() {
var asString = this.getString();
var name = asString.match(/#([^\)'"]+)/);
if (name) {
name = name[1];
}
if (!name) {
name = asString;
}
return this.document.definitions[name];
}
}, {
key: "getFillStyleDefinition",
value: function getFillStyleDefinition(element, opacity) {
var def = this.getDefinition();
if (!def) {
return null;
} // gradient
if (typeof def.createGradient === 'function') {
return def.createGradient(this.document.ctx, element, opacity);
} // pattern
if (typeof def.createPattern === 'function') {
if (def.getHrefAttribute().hasValue()) {
var patternTransform = def.getAttribute('patternTransform');
def = def.getHrefAttribute().getDefinition();
if (patternTransform.hasValue()) {
def.getAttribute('patternTransform', true).setValue(patternTransform.value);
}
}
return def.createPattern(this.document.ctx, element, opacity);
}
return null;
}
}, {
key: "getTextBaseline",
value: function getTextBaseline() {
if (!this.hasValue()) {
return null;
}
return Property.textBaselineMapping[this.getString()];
}
}, {
key: "addOpacity",
value: function addOpacity(opacity) {
var value = this.getColor();
var len = value.length;
var commas = 0; // Simulate old RGBColor version, which can't parse rgba.
for (var i = 0; i < len; i++) {
if (value[i] === ',') {
commas++;
}
if (commas === 3) {
break;
}
}
if (opacity.hasValue() && this.isString() && commas !== 3) {
var color = new rgbcolor__WEBPACK_IMPORTED_MODULE_27___default.a(value);
if (color.ok) {
color.alpha = opacity.getNumber();
value = color.toRGBA();
}
}
return new Property(this.document, this.name, value);
}
}], [{
key: "empty",
value: function empty(document) {
return new Property(document, 'EMPTY', '');
}
}]);
return Property;
}();
Property.textBaselineMapping = {
'baseline': 'alphabetic',
'before-edge': 'top',
'text-before-edge': 'top',
'middle': 'middle',
'central': 'middle',
'after-edge': 'bottom',
'text-after-edge': 'bottom',
'ideographic': 'ideographic',
'alphabetic': 'alphabetic',
'hanging': 'hanging',
'mathematical': 'alphabetic'
};
var ViewPort = /*#__PURE__*/function () {
function ViewPort() {
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, ViewPort);
this.viewPorts = [];
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(ViewPort, [{
key: "clear",
value: function clear() {
this.viewPorts = [];
}
}, {
key: "setCurrent",
value: function setCurrent(width, height) {
this.viewPorts.push({
width: width,
height: height
});
}
}, {
key: "removeCurrent",
value: function removeCurrent() {
this.viewPorts.pop();
}
}, {
key: "getCurrent",
value: function getCurrent() {
var viewPorts = this.viewPorts;
return viewPorts[viewPorts.length - 1];
}
}, {
key: "computeSize",
value: function computeSize(d) {
if (typeof d === 'number') {
return d;
}
if (d === 'x') {
return this.width;
}
if (d === 'y') {
return this.height;
}
return Math.sqrt(Math.pow(this.width, 2) + Math.pow(this.height, 2)) / Math.sqrt(2);
}
}, {
key: "width",
get: function get() {
return this.getCurrent().width;
}
}, {
key: "height",
get: function get() {
return this.getCurrent().height;
}
}]);
return ViewPort;
}();
var Point = /*#__PURE__*/function () {
function Point(x, y) {
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, Point);
this.x = x;
this.y = y;
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(Point, [{
key: "angleTo",
value: function angleTo(point) {
return Math.atan2(point.y - this.y, point.x - this.x);
}
}, {
key: "applyTransform",
value: function applyTransform(transform) {
var x = this.x,
y = this.y;
var xp = x * transform[0] + y * transform[2] + transform[4];
var yp = x * transform[1] + y * transform[3] + transform[5];
this.x = xp;
this.y = yp;
}
}], [{
key: "parse",
value: function parse(point) {
var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
var _toNumbers = toNumbers(point),
_toNumbers2 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_6___default()(_toNumbers, 2),
_toNumbers2$ = _toNumbers2[0],
x = _toNumbers2$ === void 0 ? defaultValue : _toNumbers2$,
_toNumbers2$2 = _toNumbers2[1],
y = _toNumbers2$2 === void 0 ? defaultValue : _toNumbers2$2;
return new Point(x, y);
}
}, {
key: "parseScale",
value: function parseScale(scale) {
var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
var _toNumbers3 = toNumbers(scale),
_toNumbers4 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_6___default()(_toNumbers3, 2),
_toNumbers4$ = _toNumbers4[0],
x = _toNumbers4$ === void 0 ? defaultValue : _toNumbers4$,
_toNumbers4$2 = _toNumbers4[1],
y = _toNumbers4$2 === void 0 ? x : _toNumbers4$2;
return new Point(x, y);
}
}, {
key: "parsePath",
value: function parsePath(path) {
var points = toNumbers(path);
var len = points.length;
var pathPoints = [];
for (var i = 0; i < len; i += 2) {
pathPoints.push(new Point(points[i], points[i + 1]));
}
return pathPoints;
}
}]);
return Point;
}();
var Mouse = /*#__PURE__*/function () {
function Mouse(screen) {
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, Mouse);
this.screen = screen;
this.working = false;
this.events = [];
this.eventElements = [];
this.onClick = this.onClick.bind(this);
this.onMouseMove = this.onMouseMove.bind(this);
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(Mouse, [{
key: "isWorking",
value: function isWorking() {
return this.working;
}
}, {
key: "start",
value: function start() {
if (this.working) {
return;
}
var screen = this.screen,
onClick = this.onClick,
onMouseMove = this.onMouseMove;
var canvas = screen.ctx.canvas;
canvas.onclick = onClick;
canvas.onmousemove = onMouseMove;
this.working = true;
}
}, {
key: "stop",
value: function stop() {
if (!this.working) {
return;
}
var canvas = this.screen.ctx.canvas;
this.working = false;
canvas.onclick = null;
canvas.onmousemove = null;
}
}, {
key: "hasEvents",
value: function hasEvents() {
return this.working && this.events.length > 0;
}
}, {
key: "runEvents",
value: function runEvents() {
if (!this.working) {
return;
}
var document = this.screen,
events = this.events,
eventElements = this.eventElements;
var style = document.ctx.canvas.style;
if (style) {
style.cursor = '';
}
events.forEach(function (_ref, i) {
var run = _ref.run;
var element = eventElements[i];
while (element) {
run(element);
element = element.parent;
}
}); // done running, clear
this.events = [];
this.eventElements = [];
}
}, {
key: "checkPath",
value: function checkPath(element, ctx) {
if (!this.working || !ctx) {
return;
}
var events = this.events,
eventElements = this.eventElements;
events.forEach(function (_ref2, i) {
var x = _ref2.x,
y = _ref2.y;
if (!eventElements[i] && ctx.isPointInPath && ctx.isPointInPath(x, y)) {
eventElements[i] = element;
}
});
}
}, {
key: "checkBoundingBox",
value: function checkBoundingBox(element, boundingBox) {
if (!this.working || !boundingBox) {
return;
}
var events = this.events,
eventElements = this.eventElements;
events.forEach(function (_ref3, i) {
var x = _ref3.x,
y = _ref3.y;
if (!eventElements[i] && boundingBox.isPointInBox(x, y)) {
eventElements[i] = element;
}
});
}
}, {
key: "mapXY",
value: function mapXY(x, y) {
var _this$screen = this.screen,
window = _this$screen.window,
ctx = _this$screen.ctx;
var point = new Point(x, y);
var element = ctx.canvas;
while (element) {
point.x -= element.offsetLeft;
point.y -= element.offsetTop;
element = element.offsetParent;
}
if (window.scrollX) {
point.x += window.scrollX;
}
if (window.scrollY) {
point.y += window.scrollY;
}
return point;
}
}, {
key: "onClick",
value: function onClick(evt) {
var _this$mapXY = this.mapXY((evt || event).clientX, (evt || event).clientY),
x = _this$mapXY.x,
y = _this$mapXY.y;
this.events.push({
type: 'onclick',
x: x,
y: y,
run: function run(event) {
if (event.onClick) {
event.onClick();
}
}
});
}
}, {
key: "onMouseMove",
value: function onMouseMove(evt) {
var _this$mapXY2 = this.mapXY((evt || event).clientX, (evt || event).clientY),
x = _this$mapXY2.x,
y = _this$mapXY2.y;
this.events.push({
type: 'onmousemove',
x: x,
y: y,
run: function run(event) {
if (event.onMouseMove) {
event.onMouseMove();
}
}
});
}
}]);
return Mouse;
}();
var defaultWindow = typeof window !== 'undefined' ? window : null;
var defaultFetch = typeof fetch !== 'undefined' ? fetch.bind(void 0) // `fetch` depends on context: `someObject.fetch(...)` will throw error.
: null;
var Screen = /*#__PURE__*/function () {
function Screen(ctx) {
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
_ref$fetch = _ref.fetch,
fetch = _ref$fetch === void 0 ? defaultFetch : _ref$fetch,
_ref$window = _ref.window,
window = _ref$window === void 0 ? defaultWindow : _ref$window;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, Screen);
this.ctx = ctx;
this.FRAMERATE = 30;
this.MAX_VIRTUAL_PIXELS = 30000;
this.CLIENT_WIDTH = 800;
this.CLIENT_HEIGHT = 600;
this.viewPort = new ViewPort();
this.mouse = new Mouse(this);
this.animations = [];
this.waits = [];
this.frameDuration = 0;
this.isReadyLock = false;
this.isFirstRender = true;
this.intervalId = null;
this.window = window;
this.fetch = fetch;
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(Screen, [{
key: "wait",
value: function wait(checker) {
this.waits.push(checker);
}
}, {
key: "ready",
value: function ready() {
if (!this.readyPromise) {
return Promise.resolve();
}
return this.readyPromise;
}
}, {
key: "isReady",
value: function isReady() {
if (this.isReadyLock) {
return true;
}
var isReadyLock = this.waits.every(function (_) {
return _();
});
if (isReadyLock) {
this.waits = [];
if (this.resolveReady) {
this.resolveReady();
}
}
this.isReadyLock = isReadyLock;
return isReadyLock;
}
}, {
key: "setDefaults",
value: function setDefaults(ctx) {
// initial values and defaults
ctx.strokeStyle = 'rgba(0,0,0,0)';
ctx.lineCap = 'butt';
ctx.lineJoin = 'miter';
ctx.miterLimit = 4;
}
}, {
key: "setViewBox",
value: function setViewBox(_ref2) {
var document = _ref2.document,
ctx = _ref2.ctx,
aspectRatio = _ref2.aspectRatio,
width = _ref2.width,
desiredWidth = _ref2.desiredWidth,
height = _ref2.height,
desiredHeight = _ref2.desiredHeight,
_ref2$minX = _ref2.minX,
minX = _ref2$minX === void 0 ? 0 : _ref2$minX,
_ref2$minY = _ref2.minY,
minY = _ref2$minY === void 0 ? 0 : _ref2$minY,
refX = _ref2.refX,
refY = _ref2.refY,
_ref2$clip = _ref2.clip,
clip = _ref2$clip === void 0 ? false : _ref2$clip,
_ref2$clipX = _ref2.clipX,
clipX = _ref2$clipX === void 0 ? 0 : _ref2$clipX,
_ref2$clipY = _ref2.clipY,
clipY = _ref2$clipY === void 0 ? 0 : _ref2$clipY;
// aspect ratio - http://www.w3.org/TR/SVG/coords.html#PreserveAspectRatioAttribute
var cleanAspectRatio = compressSpaces(aspectRatio).replace(/^defer\s/, ''); // ignore defer
var _cleanAspectRatio$spl = cleanAspectRatio.split(' '),
_cleanAspectRatio$spl2 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_6___default()(_cleanAspectRatio$spl, 2),
aspectRatioAlign = _cleanAspectRatio$spl2[0],
aspectRatioMeetOrSlice = _cleanAspectRatio$spl2[1];
var align = aspectRatioAlign || 'xMidYMid';
var meetOrSlice = aspectRatioMeetOrSlice || 'meet'; // calculate scale
var scaleX = width / desiredWidth;
var scaleY = height / desiredHeight;
var scaleMin = Math.min(scaleX, scaleY);
var scaleMax = Math.max(scaleX, scaleY);
var finalDesiredWidth = desiredWidth;
var finalDesiredHeight = desiredHeight;
if (meetOrSlice === 'meet') {
finalDesiredWidth *= scaleMin;
finalDesiredHeight *= scaleMin;
}
if (meetOrSlice === 'slice') {
finalDesiredWidth *= scaleMax;
finalDesiredHeight *= scaleMax;
}
var refXProp = new Property(document, 'refX', refX);
var refYProp = new Property(document, 'refY', refY);
var hasRefs = refXProp.hasValue() && refYProp.hasValue();
if (hasRefs) {
ctx.translate(-scaleMin * refXProp.getPixels('x'), -scaleMin * refYProp.getPixels('y'));
}
if (clip) {
var scaledClipX = scaleMin * clipX;
var scaledClipY = scaleMin * clipY;
ctx.beginPath();
ctx.moveTo(scaledClipX, scaledClipY);
ctx.lineTo(width, scaledClipY);
ctx.lineTo(width, height);
ctx.lineTo(scaledClipX, height);
ctx.closePath();
ctx.clip();
}
if (!hasRefs) {
var isMeetMinY = meetOrSlice === 'meet' && scaleMin === scaleY;
var isSliceMaxY = meetOrSlice === 'slice' && scaleMax === scaleY;
var isMeetMinX = meetOrSlice === 'meet' && scaleMin === scaleX;
var isSliceMaxX = meetOrSlice === 'slice' && scaleMax === scaleX;
if (/^xMid/.test(align) && (isMeetMinY || isSliceMaxY)) {
ctx.translate(width / 2.0 - finalDesiredWidth / 2.0, 0);
}
if (/YMid$/.test(align) && (isMeetMinX || isSliceMaxX)) {
ctx.translate(0, height / 2.0 - finalDesiredHeight / 2.0);
}
if (/^xMax/.test(align) && (isMeetMinY || isSliceMaxY)) {
ctx.translate(width - finalDesiredWidth, 0);
}
if (/YMax$/.test(align) && (isMeetMinX || isSliceMaxX)) {
ctx.translate(0, height - finalDesiredHeight);
}
} // scale
switch (true) {
case align === 'none':
ctx.scale(scaleX, scaleY);
break;
case meetOrSlice === 'meet':
ctx.scale(scaleMin, scaleMin);
break;
case meetOrSlice === 'slice':
ctx.scale(scaleMax, scaleMax);
break;
} // translate
ctx.translate(-minX, -minY);
}
}, {
key: "start",
value: function start(element) {
var _this = this;
var _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
_ref3$enableRedraw = _ref3.enableRedraw,
enableRedraw = _ref3$enableRedraw === void 0 ? false : _ref3$enableRedraw,
_ref3$ignoreMouse = _ref3.ignoreMouse,
ignoreMouse = _ref3$ignoreMouse === void 0 ? false : _ref3$ignoreMouse,
_ref3$ignoreAnimation = _ref3.ignoreAnimation,
ignoreAnimation = _ref3$ignoreAnimation === void 0 ? false : _ref3$ignoreAnimation,
_ref3$ignoreDimension = _ref3.ignoreDimensions,
ignoreDimensions = _ref3$ignoreDimension === void 0 ? false : _ref3$ignoreDimension,
_ref3$ignoreClear = _ref3.ignoreClear,
ignoreClear = _ref3$ignoreClear === void 0 ? false : _ref3$ignoreClear,
forceRedraw = _ref3.forceRedraw,
scaleWidth = _ref3.scaleWidth,
scaleHeight = _ref3.scaleHeight,
offsetX = _ref3.offsetX,
offsetY = _ref3.offsetY;
var FRAMERATE = this.FRAMERATE,
mouse = this.mouse;
var frameDuration = 1000 / FRAMERATE;
this.frameDuration = frameDuration;
this.readyPromise = new Promise(function (resolve) {
_this.resolveReady = resolve;
});
if (this.isReady()) {
this.render(element, ignoreDimensions, ignoreClear, scaleWidth, scaleHeight, offsetX, offsetY);
}
if (!enableRedraw) {
return;
}
var now = Date.now();
var then = now;
var delta = 0;
var tick = function tick() {
now = Date.now();
delta = now - then;
if (delta >= frameDuration) {
then = now - delta % frameDuration;
if (_this.shouldUpdate(ignoreAnimation, forceRedraw)) {
_this.render(element, ignoreDimensions, ignoreClear, scaleWidth, scaleHeight, offsetX, offsetY);
mouse.runEvents();
}
}
_this.intervalId = raf__WEBPACK_IMPORTED_MODULE_25___default()(tick);
};
if (!ignoreMouse) {
mouse.start();
}
this.intervalId = raf__WEBPACK_IMPORTED_MODULE_25___default()(tick);
}
}, {
key: "stop",
value: function stop() {
if (this.intervalId) {
raf__WEBPACK_IMPORTED_MODULE_25___default.a.cancel(this.intervalId);
this.intervalId = null;
}
this.mouse.stop();
}
}, {
key: "shouldUpdate",
value: function shouldUpdate(ignoreAnimation, forceRedraw) {
// need update from animations?
if (!ignoreAnimation) {
var frameDuration = this.frameDuration;
var shouldUpdate = this.animations.reduce(function (shouldUpdate, animation) {
return animation.update(frameDuration) || shouldUpdate;
}, false);
if (shouldUpdate) {
return true;
}
} // need update from redraw?
if (typeof forceRedraw === 'function' && forceRedraw()) {
return true;
}
if (!this.isReadyLock && this.isReady()) {
return true;
} // need update from mouse events?
if (this.mouse.hasEvents()) {
return true;
}
return false;
}
}, {
key: "render",
value: function render(element, ignoreDimensions, ignoreClear, scaleWidth, scaleHeight, offsetX, offsetY) {
var CLIENT_WIDTH = this.CLIENT_WIDTH,
CLIENT_HEIGHT = this.CLIENT_HEIGHT,
viewPort = this.viewPort,
ctx = this.ctx,
isFirstRender = this.isFirstRender;
var canvas = ctx.canvas;
viewPort.clear();
if (canvas.width && canvas.height) {
viewPort.setCurrent(canvas.width, canvas.height);
} else {
viewPort.setCurrent(CLIENT_WIDTH, CLIENT_HEIGHT);
}
var widthStyle = element.getStyle('width');
var heightStyle = element.getStyle('height');
if (!ignoreDimensions && (isFirstRender || typeof scaleWidth !== 'number' && typeof scaleHeight !== 'number')) {
// set canvas size
if (widthStyle.hasValue()) {
canvas.width = widthStyle.getPixels('x');
if (canvas.style) {
canvas.style.width = "".concat(canvas.width, "px");
}
}
if (heightStyle.hasValue()) {
canvas.height = heightStyle.getPixels('y');
if (canvas.style) {
canvas.style.height = "".concat(canvas.height, "px");
}
}
}
var cWidth = canvas.clientWidth || canvas.width;
var cHeight = canvas.clientHeight || canvas.height;
if (ignoreDimensions && widthStyle.hasValue() && heightStyle.hasValue()) {
cWidth = widthStyle.getPixels('x');
cHeight = heightStyle.getPixels('y');
}
viewPort.setCurrent(cWidth, cHeight);
if (typeof offsetX === 'number') {
element.getAttribute('x', true).setValue(offsetX);
}
if (typeof offsetY === 'number') {
element.getAttribute('y', true).setValue(offsetY);
}
if (typeof scaleWidth === 'number' || typeof scaleHeight === 'number') {
var viewBox = toNumbers(element.getAttribute('viewBox').getString());
var xRatio = 0;
var yRatio = 0;
if (typeof scaleWidth === 'number') {
var _widthStyle = element.getStyle('width');
if (_widthStyle.hasValue()) {
xRatio = _widthStyle.getPixels('x') / scaleWidth;
} else if (!isNaN(viewBox[2])) {
xRatio = viewBox[2] / scaleWidth;
}
}
if (typeof scaleHeight === 'number') {
var _heightStyle = element.getStyle('height');
if (_heightStyle.hasValue()) {
yRatio = _heightStyle.getPixels('y') / scaleHeight;
} else if (!isNaN(viewBox[3])) {
yRatio = viewBox[3] / scaleHeight;
}
}
if (!xRatio) {
xRatio = yRatio;
}
if (!yRatio) {
yRatio = xRatio;
}
element.getAttribute('width', true).setValue(scaleWidth);
element.getAttribute('height', true).setValue(scaleHeight);
var transformStyle = element.getStyle('transform', true, true);
transformStyle.setValue("".concat(transformStyle.getString(), " scale(").concat(1.0 / xRatio, ", ").concat(1.0 / yRatio, ")"));
} // clear and render
if (!ignoreClear) {
ctx.clearRect(0, 0, cWidth, cHeight);
}
element.render(ctx);
if (isFirstRender) {
this.isFirstRender = false;
}
}
}]);
return Screen;
}();
Screen.defaultWindow = defaultWindow;
Screen.defaultFetch = defaultFetch;
var defaultFetch$1 = Screen.defaultFetch;
var DefaultDOMParser = typeof DOMParser !== 'undefined' ? DOMParser : null;
var Parser = /*#__PURE__*/function () {
function Parser() {
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
_ref$fetch = _ref.fetch,
fetch = _ref$fetch === void 0 ? defaultFetch$1 : _ref$fetch,
_ref$DOMParser = _ref.DOMParser,
DOMParser = _ref$DOMParser === void 0 ? DefaultDOMParser : _ref$DOMParser;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, Parser);
this.fetch = fetch;
this.DOMParser = DOMParser;
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(Parser, [{
key: "parse",
value: function () {
var _parse = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_15___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_14___default.a.mark(function _callee(resource) {
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_14___default.a.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
if (!/^</.test(resource)) {
_context.next = 2;
break;
}
return _context.abrupt("return", this.parseFromString(resource));
case 2:
return _context.abrupt("return", this.load(resource));
case 3:
case "end":
return _context.stop();
}
}
}, _callee, this);
}));
function parse(_x) {
return _parse.apply(this, arguments);
}
return parse;
}()
}, {
key: "parseFromString",
value: function parseFromString(xml) {
var parser = new this.DOMParser();
try {
return this.checkDocument(parser.parseFromString(xml, 'image/svg+xml'));
} catch (err) {
return this.checkDocument(parser.parseFromString(xml, 'text/xml'));
}
}
}, {
key: "checkDocument",
value: function checkDocument(document) {
var parserError = document.getElementsByTagName('parsererror')[0];
if (parserError) {
throw new Error(parserError.textContent);
}
return document;
}
}, {
key: "load",
value: function () {
var _load = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_15___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_14___default.a.mark(function _callee2(url) {
var response, xml;
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_14___default.a.wrap(function _callee2$(_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
case 0:
_context2.next = 2;
return this.fetch(url);
case 2:
response = _context2.sent;
_context2.next = 5;
return response.text();
case 5:
xml = _context2.sent;
return _context2.abrupt("return", this.parseFromString(xml));
case 7:
case "end":
return _context2.stop();
}
}
}, _callee2, this);
}));
function load(_x2) {
return _load.apply(this, arguments);
}
return load;
}()
}]);
return Parser;
}();
var Translate = /*#__PURE__*/function () {
function Translate(_, point) {
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, Translate);
this.type = 'translate';
this.point = null;
this.point = Point.parse(point);
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(Translate, [{
key: "apply",
value: function apply(ctx) {
var _this$point = this.point,
x = _this$point.x,
y = _this$point.y;
ctx.translate(x || 0.0, y || 0.0);
}
}, {
key: "unapply",
value: function unapply(ctx) {
var _this$point2 = this.point,
x = _this$point2.x,
y = _this$point2.y;
ctx.translate(-1.0 * x || 0.0, -1.0 * y || 0.0);
}
}, {
key: "applyToPoint",
value: function applyToPoint(point) {
var _this$point3 = this.point,
x = _this$point3.x,
y = _this$point3.y;
point.applyTransform([1, 0, 0, 1, x || 0.0, y || 0.0]);
}
}]);
return Translate;
}();
var Rotate = /*#__PURE__*/function () {
function Rotate(document, rotate) {
var transformOrigin = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, Rotate);
this.type = 'rotate';
this.angle = null;
this.cx = 0;
this.cy = 0;
var numbers = toNumbers(rotate);
this.angle = new Property(document, 'angle', numbers[0]);
this.cx = (numbers[1] || 0) + (transformOrigin[0] || 0);
this.cy = (numbers[2] || 0) + (transformOrigin[1] || 0);
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(Rotate, [{
key: "apply",
value: function apply(ctx) {
var cx = this.cx,
cy = this.cy,
angle = this.angle;
ctx.translate(cx, cy);
ctx.rotate(angle.getRadians());
ctx.translate(-cx, -cy);
}
}, {
key: "unapply",
value: function unapply(ctx) {
var cx = this.cx,
cy = this.cy,
angle = this.angle;
ctx.translate(cx, cy);
ctx.rotate(-1.0 * angle.getRadians());
ctx.translate(-cx, -cy);
}
}, {
key: "applyToPoint",
value: function applyToPoint(point) {
var cx = this.cx,
cy = this.cy,
angle = this.angle;
var rad = angle.getRadians();
point.applyTransform([1, 0, 0, 1, cx || 0.0, cy || 0.0 // this.p.y
]);
point.applyTransform([Math.cos(rad), Math.sin(rad), -Math.sin(rad), Math.cos(rad), 0, 0]);
point.applyTransform([1, 0, 0, 1, -cx || 0.0, -cy || 0.0 // -this.p.y
]);
}
}]);
return Rotate;
}();
var Scale = /*#__PURE__*/function () {
function Scale(_, scale) {
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, Scale);
this.type = 'scale';
this.scale = null;
var scaleSize = Point.parseScale(scale); // Workaround for node-canvas
if (scaleSize.x === 0 || scaleSize.y === 0) {
scaleSize.x = PSEUDO_ZERO;
scaleSize.y = PSEUDO_ZERO;
}
this.scale = scaleSize;
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(Scale, [{
key: "apply",
value: function apply(ctx) {
var _this$scale = this.scale,
x = _this$scale.x,
y = _this$scale.y;
ctx.scale(x, y || x);
}
}, {
key: "unapply",
value: function unapply(ctx) {
var _this$scale2 = this.scale,
x = _this$scale2.x,
y = _this$scale2.y;
ctx.scale(1.0 / x, 1.0 / y || x);
}
}, {
key: "applyToPoint",
value: function applyToPoint(point) {
var _this$scale3 = this.scale,
x = _this$scale3.x,
y = _this$scale3.y;
point.applyTransform([x || 0.0, 0, 0, y || 0.0, 0, 0]);
}
}]);
return Scale;
}();
var Matrix = /*#__PURE__*/function () {
function Matrix(_, matrix) {
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, Matrix);
this.type = 'matrix';
this.matrix = [];
this.matrix = toNumbers(matrix);
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(Matrix, [{
key: "apply",
value: function apply(ctx) {
var matrix = this.matrix;
ctx.transform(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]);
}
}, {
key: "unapply",
value: function unapply(ctx) {
var matrix = this.matrix;
var a = matrix[0];
var b = matrix[2];
var c = matrix[4];
var d = matrix[1];
var e = matrix[3];
var f = matrix[5];
var g = 0.0;
var h = 0.0;
var i = 1.0;
var det = 1 / (a * (e * i - f * h) - b * (d * i - f * g) + c * (d * h - e * g));
ctx.transform(det * (e * i - f * h), det * (f * g - d * i), det * (c * h - b * i), det * (a * i - c * g), det * (b * f - c * e), det * (c * d - a * f));
}
}, {
key: "applyToPoint",
value: function applyToPoint(point) {
point.applyTransform(this.matrix);
}
}]);
return Matrix;
}();
function _createSuper(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30___default()(this, result); }; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var Skew = /*#__PURE__*/function (_Matrix) {
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_32___default()(Skew, _Matrix);
var _super = _createSuper(Skew);
function Skew(document, skew) {
var _this;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, Skew);
_this = _super.call(this, document, skew);
_this.type = 'skew';
_this.angle = null;
_this.angle = new Property(document, 'angle', skew);
return _this;
}
return Skew;
}(Matrix);
function _createSuper$1(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(Derived), result; if (_isNativeReflectConstruct$1()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30___default()(this, result); }; }
function _isNativeReflectConstruct$1() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var SkewX = /*#__PURE__*/function (_Skew) {
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_32___default()(SkewX, _Skew);
var _super = _createSuper$1(SkewX);
function SkewX(document, skew) {
var _this;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, SkewX);
_this = _super.call(this, document, skew);
_this.type = 'skewX';
_this.matrix = [1, 0, Math.tan(_this.angle.getRadians()), 1, 0, 0];
return _this;
}
return SkewX;
}(Skew);
function _createSuper$2(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(Derived), result; if (_isNativeReflectConstruct$2()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30___default()(this, result); }; }
function _isNativeReflectConstruct$2() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var SkewY = /*#__PURE__*/function (_Skew) {
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_32___default()(SkewY, _Skew);
var _super = _createSuper$2(SkewY);
function SkewY(document, skew) {
var _this;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, SkewY);
_this = _super.call(this, document, skew);
_this.type = 'skewY';
_this.matrix = [1, Math.tan(_this.angle.getRadians()), 0, 1, 0, 0];
return _this;
}
return SkewY;
}(Skew);
function parseTransforms(transform) {
return compressSpaces(transform).trim().replace(/\)([a-zA-Z])/g, ') $1').replace(/\)(\s?,\s?)/g, ') ').split(/\s(?=[a-z])/);
}
function parseTransform(transform) {
var _transform$split = transform.split('('),
_transform$split2 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_6___default()(_transform$split, 2),
type = _transform$split2[0],
value = _transform$split2[1];
return [type.trim(), value.trim().replace(')', '')];
}
var Transform = /*#__PURE__*/function () {
function Transform(document, transform, transformOrigin) {
var _this = this;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, Transform);
this.document = document;
this.transforms = [];
var data = parseTransforms(transform);
var originCoords = transformOrigin ? toNumbers(transformOrigin) : [];
data.forEach(function (transform) {
if (transform === 'none') {
return;
}
var _parseTransform = parseTransform(transform),
_parseTransform2 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_6___default()(_parseTransform, 2),
type = _parseTransform2[0],
value = _parseTransform2[1];
var TransformType = Transform.transformTypes[type];
if (typeof TransformType !== 'undefined') {
_this.transforms.push(new TransformType(_this.document, value, originCoords));
}
});
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(Transform, [{
key: "apply",
value: function apply(ctx) {
var transforms = this.transforms;
var len = transforms.length;
for (var i = 0; i < len; i++) {
transforms[i].apply(ctx);
}
}
}, {
key: "unapply",
value: function unapply(ctx) {
var transforms = this.transforms;
var len = transforms.length;
for (var i = len - 1; i >= 0; i--) {
transforms[i].unapply(ctx);
}
} // TODO: applyToPoint unused ... remove?
}, {
key: "applyToPoint",
value: function applyToPoint(point) {
var transforms = this.transforms;
var len = transforms.length;
for (var i = 0; i < len; i++) {
transforms[i].applyToPoint(point);
}
}
}], [{
key: "fromElement",
value: function fromElement(document, element) {
var transformStyle = element.getStyle('transform', false, true);
var transformOriginStyle = element.getStyle('transform-origin', false, true);
if (transformStyle.hasValue()) {
return new Transform(document, transformStyle.getString(), transformOriginStyle.getString());
}
return null;
}
}]);
return Transform;
}();
Transform.transformTypes = {
translate: Translate,
rotate: Rotate,
scale: Scale,
matrix: Matrix,
skewX: SkewX,
skewY: SkewY
};
var Element = /*#__PURE__*/function () {
function Element(document, node) {
var _this = this;
var captureTextNodes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, Element);
this.document = document;
this.node = node;
this.captureTextNodes = captureTextNodes;
this.attributes = {};
this.styles = {};
this.stylesSpecificity = {};
this.animationFrozen = false;
this.animationFrozenValue = '';
this.parent = null;
this.children = [];
if (!node || node.nodeType !== 1) {
// ELEMENT_NODE
return;
} // add attributes
Array.from(node.attributes).forEach(function (attribute) {
var nodeName = normalizeAttributeName(attribute.nodeName);
_this.attributes[nodeName] = new Property(document, nodeName, attribute.value);
});
this.addStylesFromStyleDefinition(); // add inline styles
if (this.getAttribute('style').hasValue()) {
var styles = this.getAttribute('style').getString().split(';').map(function (_) {
return _.trim();
});
styles.forEach(function (style) {
if (!style) {
return;
}
var _style$split$map = style.split(':').map(function (_) {
return _.trim();
}),
_style$split$map2 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_6___default()(_style$split$map, 2),
name = _style$split$map2[0],
value = _style$split$map2[1];
_this.styles[name] = new Property(document, name, value);
});
}
var definitions = document.definitions;
var id = this.getAttribute('id'); // add id
if (id.hasValue()) {
if (!definitions[id.getValue()]) {
definitions[id.getValue()] = this;
}
}
Array.from(node.childNodes).forEach(function (childNode) {
if (childNode.nodeType === 1) {
_this.addChild(childNode); // ELEMENT_NODE
} else if (captureTextNodes && (childNode.nodeType === 3 || childNode.nodeType === 4)) {
var textNode = document.createTextNode(childNode);
if (textNode.getText().length > 0) {
_this.addChild(textNode); // TEXT_NODE
}
}
});
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(Element, [{
key: "getAttribute",
value: function getAttribute(name) {
var createIfNotExists = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
var attr = this.attributes[name];
if (!attr && createIfNotExists) {
var _attr = new Property(this.document, name, '');
this.attributes[name] = _attr;
return _attr;
}
return attr || Property.empty(this.document);
}
}, {
key: "getHrefAttribute",
value: function getHrefAttribute() {
for (var key in this.attributes) {
if (key === 'href' || /:href$/.test(key)) {
return this.attributes[key];
}
}
return Property.empty(this.document);
}
}, {
key: "getStyle",
value: function getStyle(name) {
var createIfNotExists = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
var skipAncestors = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
var style = this.styles[name];
if (style) {
return style;
}
var attr = this.getAttribute(name);
if (attr && attr.hasValue()) {
this.styles[name] = attr; // move up to me to cache
return attr;
}
if (!skipAncestors) {
var parent = this.parent;
if (parent) {
var parentStyle = parent.getStyle(name);
if (parentStyle && parentStyle.hasValue()) {
return parentStyle;
}
}
}
if (createIfNotExists) {
var _style = new Property(this.document, name, '');
this.styles[name] = _style;
return _style;
}
return style || Property.empty(this.document);
}
}, {
key: "render",
value: function render(ctx) {
// don't render display=none
// don't render visibility=hidden
if (this.getStyle('display').getString() === 'none' || this.getStyle('visibility').getString() === 'hidden') {
return;
}
ctx.save();
if (this.getStyle('mask').hasValue()) {
// mask
var mask = this.getStyle('mask').getDefinition();
if (mask) {
this.applyEffects(ctx);
mask.apply(ctx, this);
}
} else if (this.getStyle('filter').getValue('none') !== 'none') {
// filter
var filter = this.getStyle('filter').getDefinition();
if (filter) {
this.applyEffects(ctx);
filter.apply(ctx, this);
}
} else {
this.setContext(ctx);
this.renderChildren(ctx);
this.clearContext(ctx);
}
ctx.restore();
}
}, {
key: "setContext",
value: function setContext(_) {}
}, {
key: "applyEffects",
value: function applyEffects(ctx) {
// transform
var transform = Transform.fromElement(this.document, this);
if (transform) {
transform.apply(ctx);
} // clip
var clipPathStyleProp = this.getStyle('clip-path', false, true);
if (clipPathStyleProp.hasValue()) {
var clip = clipPathStyleProp.getDefinition();
if (clip) {
clip.apply(ctx);
}
}
}
}, {
key: "clearContext",
value: function clearContext(_) {}
}, {
key: "renderChildren",
value: function renderChildren(ctx) {
this.children.forEach(function (child) {
child.render(ctx);
});
}
}, {
key: "addChild",
value: function addChild(childNode) {
var child = childNode instanceof Element ? childNode : this.document.createElement(childNode);
child.parent = this;
if (!Element.ignoreChildTypes.includes(child.type)) {
this.children.push(child);
}
}
}, {
key: "matchesSelector",
value: function matchesSelector(selector) {
var node = this.node;
if (typeof node.matches === 'function') {
return node.matches(selector);
}
var styleClasses = node.getAttribute('class');
if (!styleClasses || styleClasses === '') {
return false;
}
return styleClasses.split(' ').some(function (styleClass) {
if (".".concat(styleClass) === selector) {
return true;
}
});
}
}, {
key: "addStylesFromStyleDefinition",
value: function addStylesFromStyleDefinition() {
var _this$document = this.document,
styles = _this$document.styles,
stylesSpecificity = _this$document.stylesSpecificity;
for (var selector in styles) {
if (selector[0] !== '@' && this.matchesSelector(selector)) {
var style = styles[selector];
var specificity = stylesSpecificity[selector];
if (style) {
for (var name in style) {
var existingSpecificity = this.stylesSpecificity[name];
if (typeof existingSpecificity === 'undefined') {
existingSpecificity = '000';
}
if (specificity >= existingSpecificity) {
this.styles[name] = style[name];
this.stylesSpecificity[name] = specificity;
}
}
}
}
}
}
}, {
key: "removeStyles",
value: function removeStyles(element, ignoreStyles) {
var toRestore = ignoreStyles.reduce(function (toRestore, name) {
var styleProp = element.getStyle(name);
if (!styleProp.hasValue()) {
return toRestore;
}
var value = styleProp.getString();
styleProp.setValue('');
return [].concat(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_39___default()(toRestore), [[name, value]]);
}, []);
return toRestore;
}
}, {
key: "restoreStyles",
value: function restoreStyles(element, styles) {
styles.forEach(function (_ref) {
var _ref2 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_6___default()(_ref, 2),
name = _ref2[0],
value = _ref2[1];
element.getStyle(name, true).setValue(value);
});
}
}]);
return Element;
}();
Element.ignoreChildTypes = ['title'];
function _createSuper$3(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(Derived), result; if (_isNativeReflectConstruct$3()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30___default()(this, result); }; }
function _isNativeReflectConstruct$3() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var UnknownElement = /*#__PURE__*/function (_Element) {
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_32___default()(UnknownElement, _Element);
var _super = _createSuper$3(UnknownElement);
function UnknownElement(document, node, captureTextNodes) {
var _this;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, UnknownElement);
_this = _super.call(this, document, node, captureTextNodes);
return _this;
}
return UnknownElement;
}(Element);
function wrapFontFamily(fontFamily) {
var trimmed = fontFamily.trim();
return /^('|")/.test(trimmed) ? trimmed : "\"".concat(trimmed, "\"");
}
function prepareFontFamily(fontFamily) {
return typeof process === 'undefined' ? fontFamily : fontFamily.trim().split(',').map(wrapFontFamily).join(',');
}
/**
* https://developer.mozilla.org/en-US/docs/Web/CSS/font-style
*/
function prepareFontStyle(fontStyle) {
if (!fontStyle) {
return '';
}
var targetFontStyle = fontStyle.trim().toLowerCase();
switch (targetFontStyle) {
case 'normal':
case 'italic':
case 'oblique':
case 'inherit':
case 'initial':
case 'unset':
return targetFontStyle;
default:
if (/^oblique\s+(-|)\d+deg$/.test(targetFontStyle)) {
return targetFontStyle;
}
return '';
}
}
/**
* https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight
*/
function prepareFontWeight(fontWeight) {
if (!fontWeight) {
return '';
}
var targetFontWeight = fontWeight.trim().toLowerCase();
switch (targetFontWeight) {
case 'normal':
case 'bold':
case 'lighter':
case 'bolder':
case 'inherit':
case 'initial':
case 'unset':
return targetFontWeight;
default:
if (/^[\d.]+$/.test(targetFontWeight)) {
return targetFontWeight;
}
return '';
}
}
var Font = /*#__PURE__*/function () {
function Font(fontStyle, fontVariant, fontWeight, fontSize, fontFamily, inherit) {
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, Font);
var inheritFont = inherit ? typeof inherit === 'string' ? Font.parse(inherit) : inherit : {};
this.fontFamily = fontFamily || inheritFont.fontFamily;
this.fontSize = fontSize || inheritFont.fontSize;
this.fontStyle = fontStyle || inheritFont.fontStyle;
this.fontWeight = fontWeight || inheritFont.fontWeight;
this.fontVariant = fontVariant || inheritFont.fontVariant;
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(Font, [{
key: "toString",
value: function toString() {
return [prepareFontStyle(this.fontStyle), this.fontVariant, prepareFontWeight(this.fontWeight), this.fontSize, // Wrap fontFamily only on nodejs and only for canvas.ctx
prepareFontFamily(this.fontFamily)].join(' ').trim();
}
}], [{
key: "parse",
value: function parse() {
var font = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
var inherit = arguments.length > 1 ? arguments[1] : undefined;
var fontStyle = '';
var fontVariant = '';
var fontWeight = '';
var fontSize = '';
var fontFamily = '';
var parts = compressSpaces(font).trim().split(' ');
var set = {
fontSize: false,
fontStyle: false,
fontWeight: false,
fontVariant: false
};
parts.forEach(function (part) {
switch (true) {
case !set.fontStyle && Font.styles.includes(part):
if (part !== 'inherit') {
fontStyle = part;
}
set.fontStyle = true;
break;
case !set.fontVariant && Font.variants.includes(part):
if (part !== 'inherit') {
fontVariant = part;
}
set.fontStyle = true;
set.fontVariant = true;
break;
case !set.fontWeight && Font.weights.includes(part):
if (part !== 'inherit') {
fontWeight = part;
}
set.fontStyle = true;
set.fontVariant = true;
set.fontWeight = true;
break;
case !set.fontSize:
if (part !== 'inherit') {
var _part$split = part.split('/');
var _part$split2 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_6___default()(_part$split, 1);
fontSize = _part$split2[0];
}
set.fontStyle = true;
set.fontVariant = true;
set.fontWeight = true;
set.fontSize = true;
break;
default:
if (part !== 'inherit') {
fontFamily += part;
}
}
});
return new Font(fontStyle, fontVariant, fontWeight, fontSize, fontFamily, inherit);
}
}]);
return Font;
}();
Font.styles = 'normal|italic|oblique|inherit';
Font.variants = 'normal|small-caps|inherit';
Font.weights = 'normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit';
var BoundingBox = /*#__PURE__*/function () {
function BoundingBox() {
var x1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : Number.NaN;
var y1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.NaN;
var x2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : Number.NaN;
var y2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Number.NaN;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, BoundingBox);
this.x1 = x1;
this.y1 = y1;
this.x2 = x2;
this.y2 = y2;
this.addPoint(x1, y1);
this.addPoint(x2, y2);
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(BoundingBox, [{
key: "addPoint",
value: function addPoint(x, y) {
if (typeof x !== 'undefined') {
if (isNaN(this.x1) || isNaN(this.x2)) {
this.x1 = x;
this.x2 = x;
}
if (x < this.x1) {
this.x1 = x;
}
if (x > this.x2) {
this.x2 = x;
}
}
if (typeof y !== 'undefined') {
if (isNaN(this.y1) || isNaN(this.y2)) {
this.y1 = y;
this.y2 = y;
}
if (y < this.y1) {
this.y1 = y;
}
if (y > this.y2) {
this.y2 = y;
}
}
}
}, {
key: "addX",
value: function addX(x) {
this.addPoint(x, null);
}
}, {
key: "addY",
value: function addY(y) {
this.addPoint(null, y);
}
}, {
key: "addBoundingBox",
value: function addBoundingBox(boundingBox) {
if (!boundingBox) {
return;
}
var x1 = boundingBox.x1,
y1 = boundingBox.y1,
x2 = boundingBox.x2,
y2 = boundingBox.y2;
this.addPoint(x1, y1);
this.addPoint(x2, y2);
}
}, {
key: "sumCubic",
value: function sumCubic(t, p0, p1, p2, p3) {
return Math.pow(1 - t, 3) * p0 + 3 * Math.pow(1 - t, 2) * t * p1 + 3 * (1 - t) * Math.pow(t, 2) * p2 + Math.pow(t, 3) * p3;
}
}, {
key: "bezierCurveAdd",
value: function bezierCurveAdd(forX, p0, p1, p2, p3) {
var b = 6 * p0 - 12 * p1 + 6 * p2;
var a = -3 * p0 + 9 * p1 - 9 * p2 + 3 * p3;
var c = 3 * p1 - 3 * p0;
if (a === 0) {
if (b === 0) {
return;
}
var t = -c / b;
if (0 < t && t < 1) {
if (forX) {
this.addX(this.sumCubic(t, p0, p1, p2, p3));
} else {
this.addY(this.sumCubic(t, p0, p1, p2, p3));
}
}
return;
}
var b2ac = Math.pow(b, 2) - 4 * c * a;
if (b2ac < 0) {
return;
}
var t1 = (-b + Math.sqrt(b2ac)) / (2 * a);
if (0 < t1 && t1 < 1) {
if (forX) {
this.addX(this.sumCubic(t1, p0, p1, p2, p3));
} else {
this.addY(this.sumCubic(t1, p0, p1, p2, p3));
}
}
var t2 = (-b - Math.sqrt(b2ac)) / (2 * a);
if (0 < t2 && t2 < 1) {
if (forX) {
this.addX(this.sumCubic(t2, p0, p1, p2, p3));
} else {
this.addY(this.sumCubic(t2, p0, p1, p2, p3));
}
}
} // from http://blog.hackers-cafe.net/2009/06/how-to-calculate-bezier-curves-bounding.html
}, {
key: "addBezierCurve",
value: function addBezierCurve(p0x, p0y, p1x, p1y, p2x, p2y, p3x, p3y) {
this.addPoint(p0x, p0y);
this.addPoint(p3x, p3y);
this.bezierCurveAdd(true, p0x, p1x, p2x, p3x);
this.bezierCurveAdd(false, p0y, p1y, p2y, p3y);
}
}, {
key: "addQuadraticCurve",
value: function addQuadraticCurve(p0x, p0y, p1x, p1y, p2x, p2y) {
var cp1x = p0x + 2 / 3 * (p1x - p0x); // CP1 = QP0 + 2/3 *(QP1-QP0)
var cp1y = p0y + 2 / 3 * (p1y - p0y); // CP1 = QP0 + 2/3 *(QP1-QP0)
var cp2x = cp1x + 1 / 3 * (p2x - p0x); // CP2 = CP1 + 1/3 *(QP2-QP0)
var cp2y = cp1y + 1 / 3 * (p2y - p0y); // CP2 = CP1 + 1/3 *(QP2-QP0)
this.addBezierCurve(p0x, p0y, cp1x, cp2x, cp1y, cp2y, p2x, p2y);
}
}, {
key: "isPointInBox",
value: function isPointInBox(x, y) {
var x1 = this.x1,
y1 = this.y1,
x2 = this.x2,
y2 = this.y2;
return x1 <= x && x <= x2 && y1 <= y && y <= y2;
}
}, {
key: "x",
get: function get() {
return this.x1;
}
}, {
key: "y",
get: function get() {
return this.y1;
}
}, {
key: "width",
get: function get() {
return this.x2 - this.x1;
}
}, {
key: "height",
get: function get() {
return this.y2 - this.y1;
}
}]);
return BoundingBox;
}();
function _createSuper$4(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(Derived), result; if (_isNativeReflectConstruct$4()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30___default()(this, result); }; }
function _isNativeReflectConstruct$4() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var RenderedElement = /*#__PURE__*/function (_Element) {
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_32___default()(RenderedElement, _Element);
var _super = _createSuper$4(RenderedElement);
function RenderedElement() {
var _this;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, RenderedElement);
_this = _super.apply(this, arguments);
_this.modifiedEmSizeStack = false;
return _this;
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(RenderedElement, [{
key: "calculateOpacity",
value: function calculateOpacity() {
var opacity = 1.0; // tslint:disable-next-line: no-this-assignment
var element = this;
while (element) {
var opacityStyle = element.getStyle('opacity', false, true); // no ancestors on style call
if (opacityStyle.hasValue()) {
opacity *= opacityStyle.getNumber();
}
element = element.parent;
}
return opacity;
}
}, {
key: "setContext",
value: function setContext(ctx) {
var fromMeasure = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
if (!fromMeasure) {
// causes stack overflow when measuring text with gradients
// fill
var fillStyleProp = this.getStyle('fill');
var fillOpacityStyleProp = this.getStyle('fill-opacity');
var strokeStyleProp = this.getStyle('stroke');
var strokeOpacityProp = this.getStyle('stroke-opacity');
if (fillStyleProp.isUrlDefinition()) {
var fillStyle = fillStyleProp.getFillStyleDefinition(this, fillOpacityStyleProp);
if (fillStyle) {
ctx.fillStyle = fillStyle;
}
} else if (fillStyleProp.hasValue()) {
if (fillStyleProp.getString() === 'currentColor') {
fillStyleProp.setValue(this.getStyle('color').getColor());
}
var _fillStyle = fillStyleProp.getColor();
if (_fillStyle !== 'inherit') {
ctx.fillStyle = _fillStyle === 'none' ? 'rgba(0,0,0,0)' : _fillStyle;
}
}
if (fillOpacityStyleProp.hasValue()) {
var _fillStyle2 = new Property(this.document, 'fill', ctx.fillStyle).addOpacity(fillOpacityStyleProp).getColor();
ctx.fillStyle = _fillStyle2;
} // stroke
if (strokeStyleProp.isUrlDefinition()) {
var strokeStyle = strokeStyleProp.getFillStyleDefinition(this, strokeOpacityProp);
if (strokeStyle) {
ctx.strokeStyle = strokeStyle;
}
} else if (strokeStyleProp.hasValue()) {
if (strokeStyleProp.getString() === 'currentColor') {
strokeStyleProp.setValue(this.getStyle('color').getColor());
}
var _strokeStyle = strokeStyleProp.getString();
if (_strokeStyle !== 'inherit') {
ctx.strokeStyle = _strokeStyle === 'none' ? 'rgba(0,0,0,0)' : _strokeStyle;
}
}
if (strokeOpacityProp.hasValue()) {
var _strokeStyle2 = new Property(this.document, 'stroke', ctx.strokeStyle).addOpacity(strokeOpacityProp).getString();
ctx.strokeStyle = _strokeStyle2;
}
var strokeWidthStyleProp = this.getStyle('stroke-width');
if (strokeWidthStyleProp.hasValue()) {
var newLineWidth = strokeWidthStyleProp.getPixels();
ctx.lineWidth = !newLineWidth ? PSEUDO_ZERO // browsers don't respect 0 (or node-canvas? :-)
: newLineWidth;
}
var strokeLinecapStyleProp = this.getStyle('stroke-linecap');
var strokeLinejoinStyleProp = this.getStyle('stroke-linejoin');
var strokeMiterlimitProp = this.getStyle('stroke-miterlimit');
var pointOrderStyleProp = this.getStyle('paint-order');
var strokeDasharrayStyleProp = this.getStyle('stroke-dasharray');
var strokeDashoffsetProp = this.getStyle('stroke-dashoffset');
if (strokeLinecapStyleProp.hasValue()) {
ctx.lineCap = strokeLinecapStyleProp.getString();
}
if (strokeLinejoinStyleProp.hasValue()) {
ctx.lineJoin = strokeLinejoinStyleProp.getString();
}
if (strokeMiterlimitProp.hasValue()) {
ctx.miterLimit = strokeMiterlimitProp.getNumber();
}
if (pointOrderStyleProp.hasValue()) {
// ?
ctx.paintOrder = pointOrderStyleProp.getValue();
}
if (strokeDasharrayStyleProp.hasValue() && strokeDasharrayStyleProp.getString() !== 'none') {
var gaps = toNumbers(strokeDasharrayStyleProp.getString());
if (typeof ctx.setLineDash !== 'undefined') {
ctx.setLineDash(gaps);
} else if (typeof ctx.webkitLineDash !== 'undefined') {
ctx.webkitLineDash = gaps;
} else if (typeof ctx.mozDash !== 'undefined' && !(gaps.length === 1 && gaps[0] === 0)) {
ctx.mozDash = gaps;
}
var offset = strokeDashoffsetProp.getPixels();
if (typeof ctx.lineDashOffset !== 'undefined') {
ctx.lineDashOffset = offset;
} else if (typeof ctx.webkitLineDashOffset !== 'undefined') {
ctx.webkitLineDashOffset = offset;
} else if (typeof ctx.mozDashOffset !== 'undefined') {
ctx.mozDashOffset = offset;
}
}
} // font
this.modifiedEmSizeStack = false;
if (typeof ctx.font !== 'undefined') {
var fontStyleProp = this.getStyle('font');
var fontStyleStyleProp = this.getStyle('font-style');
var fontVariantStyleProp = this.getStyle('font-variant');
var fontWeightStyleProp = this.getStyle('font-weight');
var fontSizeStyleProp = this.getStyle('font-size');
var fontFamilyStyleProp = this.getStyle('font-family');
var font = new Font(fontStyleStyleProp.getString(), fontVariantStyleProp.getString(), fontWeightStyleProp.getString(), fontSizeStyleProp.hasValue() ? "".concat(fontSizeStyleProp.getPixels(true), "px") : '', fontFamilyStyleProp.getString(), Font.parse(fontStyleProp.getString(), ctx.font));
fontStyleStyleProp.setValue(font.fontStyle);
fontVariantStyleProp.setValue(font.fontVariant);
fontWeightStyleProp.setValue(font.fontWeight);
fontSizeStyleProp.setValue(font.fontSize);
fontFamilyStyleProp.setValue(font.fontFamily);
ctx.font = font.toString();
if (fontSizeStyleProp.isPixels()) {
this.document.emSize = fontSizeStyleProp.getPixels();
this.modifiedEmSizeStack = true;
}
}
if (!fromMeasure) {
// effects
this.applyEffects(ctx); // opacity
ctx.globalAlpha = this.calculateOpacity();
}
}
}, {
key: "clearContext",
value: function clearContext(ctx) {
_babel_runtime_helpers_get__WEBPACK_IMPORTED_MODULE_42___default()(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(RenderedElement.prototype), "clearContext", this).call(this, ctx);
if (this.modifiedEmSizeStack) {
this.document.popEmSize();
}
}
}]);
return RenderedElement;
}(Element);
function _createSuper$5(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(Derived), result; if (_isNativeReflectConstruct$5()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30___default()(this, result); }; }
function _isNativeReflectConstruct$5() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var TextElement = /*#__PURE__*/function (_RenderedElement) {
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_32___default()(TextElement, _RenderedElement);
var _super = _createSuper$5(TextElement);
function TextElement(document, node, captureTextNodes) {
var _this;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, TextElement);
_this = _super.call(this, document, node, (this instanceof TextElement ? this.constructor : void 0) === TextElement ? true : captureTextNodes);
_this.type = 'text';
_this.x = 0;
_this.y = 0;
_this.measureCache = -1;
return _this;
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(TextElement, [{
key: "setContext",
value: function setContext(ctx) {
var fromMeasure = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
_babel_runtime_helpers_get__WEBPACK_IMPORTED_MODULE_42___default()(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(TextElement.prototype), "setContext", this).call(this, ctx, fromMeasure);
var textBaseline = this.getStyle('dominant-baseline').getTextBaseline() || this.getStyle('alignment-baseline').getTextBaseline();
if (textBaseline) {
ctx.textBaseline = textBaseline;
}
}
}, {
key: "initializeCoordinates",
value: function initializeCoordinates(ctx) {
this.x = this.getAttribute('x').getPixels('x');
this.y = this.getAttribute('y').getPixels('y');
var dxAttr = this.getAttribute('dx');
var dyAttr = this.getAttribute('dy');
if (dxAttr.hasValue()) {
this.x += dxAttr.getPixels('x');
}
if (dyAttr.hasValue()) {
this.y += dyAttr.getPixels('y');
}
this.x += this.getAnchorDelta(ctx, this, 0);
}
}, {
key: "getBoundingBox",
value: function getBoundingBox(ctx) {
var _this2 = this;
if (this.type !== 'text') {
return this.getTElementBoundingBox(ctx);
}
this.initializeCoordinates(ctx);
var boundingBox = null;
this.children.forEach(function (_, i) {
var childBoundingBox = _this2.getChildBoundingBox(ctx, _this2, _this2, i);
if (!boundingBox) {
boundingBox = childBoundingBox;
} else {
boundingBox.addBoundingBox(childBoundingBox);
}
});
return boundingBox;
}
}, {
key: "getFontSize",
value: function getFontSize() {
var document = this.document,
parent = this.parent;
var inheritFontSize = Font.parse(document.ctx.font).fontSize;
var fontSize = parent.getStyle('font-size').getNumber(inheritFontSize);
return fontSize;
}
}, {
key: "getTElementBoundingBox",
value: function getTElementBoundingBox(ctx) {
var fontSize = this.getFontSize();
return new BoundingBox(this.x, this.y - fontSize, this.x + this.measureText(ctx), this.y);
}
}, {
key: "getGlyph",
value: function getGlyph(font, text, i) {
var char = text[i];
var glyph = null;
if (font.isArabic) {
var len = text.length;
var prevChar = text[i - 1];
var nextChar = text[i + 1];
var arabicForm = 'isolated';
if ((i === 0 || prevChar === ' ') && i < len - 2 && nextChar !== ' ') {
arabicForm = 'terminal';
}
if (i > 0 && prevChar !== ' ' && i < len - 2 && nextChar !== ' ') {
arabicForm = 'medial';
}
if (i > 0 && prevChar !== ' ' && (i === len - 1 || nextChar === ' ')) {
arabicForm = 'initial';
}
if (typeof font.glyphs[char] !== 'undefined') {
glyph = font.glyphs[char][arabicForm];
if (!glyph && font.glyphs[char].type === 'glyph') {
glyph = font.glyphs[char];
}
}
} else {
glyph = font.glyphs[char];
}
if (!glyph) {
glyph = font.missingGlyph;
}
return glyph;
}
}, {
key: "getText",
value: function getText() {
return '';
}
}, {
key: "getTextFromNode",
value: function getTextFromNode(node) {
var textNode = node || this.node;
var childNodes = Array.from(textNode.parentNode.childNodes);
var index = childNodes.indexOf(textNode);
var lastIndex = childNodes.length - 1;
var text = compressSpaces(textNode.value || textNode.text || textNode.textContent || '');
if (index === 0) {
text = trimLeft(text);
}
if (index === lastIndex) {
text = trimRight(text);
}
return text;
}
}, {
key: "renderChildren",
value: function renderChildren(ctx) {
var _this3 = this;
if (this.type !== 'text') {
this.renderTElementChildren(ctx);
return;
}
this.initializeCoordinates(ctx);
this.children.forEach(function (_, i) {
_this3.renderChild(ctx, _this3, _this3, i);
});
var mouse = this.document.screen.mouse; // Do not calc bounding box if mouse is not working.
if (mouse.isWorking()) {
mouse.checkBoundingBox(this, this.getBoundingBox(ctx));
}
}
}, {
key: "renderTElementChildren",
value: function renderTElementChildren(ctx) {
var document = this.document,
parent = this.parent;
var renderText = this.getText();
var customFont = parent.getStyle('font-family').getDefinition();
if (customFont) {
var unitsPerEm = customFont.fontFace.unitsPerEm;
var ctxFont = Font.parse(document.ctx.font);
var fontSize = parent.getStyle('font-size').getNumber(ctxFont.fontSize);
var fontStyle = parent.getStyle('font-style').getString(ctxFont.fontStyle);
var scale = fontSize / unitsPerEm;
var text = customFont.isRTL ? renderText.split('').reverse().join('') : renderText;
var dx = toNumbers(parent.getAttribute('dx').getString());
var len = text.length;
for (var i = 0; i < len; i++) {
var glyph = this.getGlyph(customFont, text, i);
ctx.translate(this.x, this.y);
ctx.scale(scale, -scale);
var lw = ctx.lineWidth;
ctx.lineWidth = ctx.lineWidth * unitsPerEm / fontSize;
if (fontStyle === 'italic') {
ctx.transform(1, 0, .4, 1, 0, 0);
}
glyph.render(ctx);
if (fontStyle === 'italic') {
ctx.transform(1, 0, -.4, 1, 0, 0);
}
ctx.lineWidth = lw;
ctx.scale(1 / scale, -1 / scale);
ctx.translate(-this.x, -this.y);
this.x += fontSize * (glyph.horizAdvX || customFont.horizAdvX) / unitsPerEm;
if (typeof dx[i] !== 'undefined' && !isNaN(dx[i])) {
this.x += dx[i];
}
}
return;
}
var x = this.x,
y = this.y;
if (ctx.paintOrder === 'stroke') {
if (ctx.strokeStyle) {
ctx.strokeText(renderText, x, y);
}
if (ctx.fillStyle) {
ctx.fillText(renderText, x, y);
}
} else {
if (ctx.fillStyle) {
ctx.fillText(renderText, x, y);
}
if (ctx.strokeStyle) {
ctx.strokeText(renderText, x, y);
}
}
}
}, {
key: "getAnchorDelta",
value: function getAnchorDelta(ctx, parent, startI) {
var textAnchor = this.getStyle('text-anchor').getString('start');
if (textAnchor !== 'start') {
var children = parent.children;
var len = children.length;
var child = null;
var width = 0;
for (var i = startI; i < len; i++) {
child = children[i];
if (i > startI && child.getAttribute('x').hasValue() || child.getAttribute('text-anchor').hasValue()) {
break; // new group
}
width += child.measureTextRecursive(ctx);
}
return -1 * (textAnchor === 'end' ? width : width / 2.0);
}
return 0;
}
}, {
key: "adjustChildCoordinates",
value: function adjustChildCoordinates(ctx, textParent, parent, i) {
var child = parent.children[i];
if (typeof child.measureText !== 'function') {
return child;
}
ctx.save();
child.setContext(ctx, true);
var xAttr = child.getAttribute('x');
var yAttr = child.getAttribute('y');
var dxAttr = child.getAttribute('dx');
var dyAttr = child.getAttribute('dy');
var textAnchor = child.getAttribute('text-anchor').getString('start');
if (i === 0 && child.type !== 'textNode') {
if (!xAttr.hasValue()) {
xAttr.setValue(textParent.getAttribute('x').getValue('0'));
}
if (!yAttr.hasValue()) {
yAttr.setValue(textParent.getAttribute('y').getValue('0'));
}
if (!dxAttr.hasValue()) {
dxAttr.setValue(textParent.getAttribute('dx').getValue('0'));
}
if (!dyAttr.hasValue()) {
dyAttr.setValue(textParent.getAttribute('dy').getValue('0'));
}
}
if (xAttr.hasValue()) {
child.x = xAttr.getPixels('x') + textParent.getAnchorDelta(ctx, parent, i);
if (textAnchor !== 'start') {
var width = child.measureTextRecursive(ctx);
child.x += -1 * (textAnchor === 'end' ? width : width / 2.0);
}
if (dxAttr.hasValue()) {
child.x += dxAttr.getPixels('x');
}
} else {
if (textAnchor !== 'start') {
var _width = child.measureTextRecursive(ctx);
textParent.x += -1 * (textAnchor === 'end' ? _width : _width / 2.0);
}
if (dxAttr.hasValue()) {
textParent.x += dxAttr.getPixels('x');
}
child.x = textParent.x;
}
textParent.x = child.x + child.measureText(ctx);
if (yAttr.hasValue()) {
child.y = yAttr.getPixels('y');
if (dyAttr.hasValue()) {
child.y += dyAttr.getPixels('y');
}
} else {
if (dyAttr.hasValue()) {
textParent.y += dyAttr.getPixels('y');
}
child.y = textParent.y;
}
textParent.y = child.y;
child.clearContext(ctx);
ctx.restore();
return child;
}
}, {
key: "getChildBoundingBox",
value: function getChildBoundingBox(ctx, textParent, parent, i) {
var child = this.adjustChildCoordinates(ctx, textParent, parent, i);
var boundingBox = child.getBoundingBox(ctx);
if (!boundingBox) {
return null;
}
child.children.forEach(function (_, i) {
var childBoundingBox = textParent.getChildBoundingBox(ctx, textParent, child, i);
boundingBox.addBoundingBox(childBoundingBox);
});
return boundingBox;
}
}, {
key: "renderChild",
value: function renderChild(ctx, textParent, parent, i) {
var child = this.adjustChildCoordinates(ctx, textParent, parent, i);
child.render(ctx);
child.children.forEach(function (_, i) {
textParent.renderChild(ctx, textParent, child, i);
});
}
}, {
key: "measureTextRecursive",
value: function measureTextRecursive(ctx) {
var width = this.children.reduce(function (width, child) {
return width + child.measureTextRecursive(ctx);
}, this.measureText(ctx));
return width;
}
}, {
key: "measureText",
value: function measureText(ctx) {
var measureCache = this.measureCache;
if (~measureCache) {
return measureCache;
}
var renderText = this.getText();
var measure = this.measureTargetText(ctx, renderText);
this.measureCache = measure;
return measure;
}
}, {
key: "measureTargetText",
value: function measureTargetText(ctx, targetText) {
if (!targetText.length) {
return 0;
}
var parent = this.parent;
var customFont = parent.getStyle('font-family').getDefinition();
if (customFont) {
var fontSize = this.getFontSize();
var text = customFont.isRTL ? targetText.split('').reverse().join('') : targetText;
var dx = toNumbers(parent.getAttribute('dx').getString());
var len = text.length;
var _measure = 0;
for (var i = 0; i < len; i++) {
var glyph = this.getGlyph(customFont, text, i);
_measure += (glyph.horizAdvX || customFont.horizAdvX) * fontSize / customFont.fontFace.unitsPerEm;
if (typeof dx[i] !== 'undefined' && !isNaN(dx[i])) {
_measure += dx[i];
}
}
return _measure;
}
if (!ctx.measureText) {
return targetText.length * 10;
}
ctx.save();
this.setContext(ctx, true);
var _ctx$measureText = ctx.measureText(targetText),
measure = _ctx$measureText.width;
this.clearContext(ctx);
ctx.restore();
return measure;
}
}]);
return TextElement;
}(RenderedElement);
function _createSuper$6(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(Derived), result; if (_isNativeReflectConstruct$6()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30___default()(this, result); }; }
function _isNativeReflectConstruct$6() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var TSpanElement = /*#__PURE__*/function (_TextElement) {
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_32___default()(TSpanElement, _TextElement);
var _super = _createSuper$6(TSpanElement);
function TSpanElement(document, node, captureTextNodes) {
var _this;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, TSpanElement);
_this = _super.call(this, document, node, (this instanceof TSpanElement ? this.constructor : void 0) === TSpanElement ? true : captureTextNodes);
_this.type = 'tspan'; // if this node has children, then they own the text
_this.text = _this.children.length > 0 ? '' : _this.getTextFromNode();
return _this;
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(TSpanElement, [{
key: "getText",
value: function getText() {
return this.text;
}
}]);
return TSpanElement;
}(TextElement);
function _createSuper$7(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(Derived), result; if (_isNativeReflectConstruct$7()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30___default()(this, result); }; }
function _isNativeReflectConstruct$7() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var TextNode = /*#__PURE__*/function (_TSpanElement) {
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_32___default()(TextNode, _TSpanElement);
var _super = _createSuper$7(TextNode);
function TextNode() {
var _this;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, TextNode);
_this = _super.apply(this, arguments);
_this.type = 'textNode';
return _this;
}
return TextNode;
}(TSpanElement);
function preparePath(path) {
var d = path.replace(/,/gm, ' ') // get rid of all commas
// As the end of a match can also be the start of the next match, we need to run this replace twice.
.replace(/([MmZzLlHhVvCcSsQqTtAa])([^\s])/gm, '$1 $2') // suffix commands with spaces
.replace(/([MmZzLlHhVvCcSsQqTtAa])([^\s])/gm, '$1 $2') // suffix commands with spaces
.replace(/([^\s])([MmZzLlHhVvCcSsQqTtAa])/gm, '$1 $2') // prefix commands with spaces
.replace(/([0-9])([+\-])/gm, '$1 $2') // separate digits on +- signs
// Again, we need to run this twice to find all occurances
.replace(/(\.[0-9]*)(\.)/gm, '$1 $2') // separate digits when they start with a comma
.replace(/(\.[0-9]*)(\.)/gm, '$1 $2') // separate digits when they start with a comma
.replace(/([Aa](?:\s+(?:[0-9]*\.)?[0-9]+){3})\s+([01])\s*([01])/gm, '$1 $2 $3 '); // shorthand elliptical arc path syntax
return compressSpaces(d).trim();
}
var PathParser = /*#__PURE__*/function () {
function PathParser(path) {
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, PathParser);
this.control = null;
this.start = null;
this.current = null;
this.command = '';
this.tokens = [];
this.i = -1;
this.previousCommand = '';
this.points = [];
this.angles = [];
this.tokens = preparePath(path).split(' ');
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(PathParser, [{
key: "reset",
value: function reset() {
this.i = -1;
this.command = '';
this.previousCommand = '';
this.start = new Point(0, 0);
this.control = new Point(0, 0);
this.current = new Point(0, 0);
this.points = [];
this.angles = [];
}
}, {
key: "isEnd",
value: function isEnd() {
var i = this.i,
tokens = this.tokens;
return i >= tokens.length - 1;
}
}, {
key: "isCommandOrEnd",
value: function isCommandOrEnd() {
if (this.isEnd()) {
return true;
}
var i = this.i,
tokens = this.tokens;
return /^[A-Za-z]$/.test(tokens[i + 1]);
}
}, {
key: "isRelativeCommand",
value: function isRelativeCommand() {
switch (this.command) {
case 'm':
case 'l':
case 'h':
case 'v':
case 'c':
case 's':
case 'q':
case 't':
case 'a':
case 'z':
return true;
default:
return false;
}
}
}, {
key: "getToken",
value: function getToken() {
this.i++;
return this.tokens[this.i];
}
}, {
key: "getScalar",
value: function getScalar() {
return parseFloat(this.getToken());
}
}, {
key: "nextCommand",
value: function nextCommand() {
this.previousCommand = this.command;
this.command = this.getToken();
}
}, {
key: "getPoint",
value: function getPoint() {
var point = new Point(this.getScalar(), this.getScalar());
return this.makeAbsolute(point);
}
}, {
key: "getAsControlPoint",
value: function getAsControlPoint() {
var point = this.getPoint();
this.control = point;
return point;
}
}, {
key: "getAsCurrentPoint",
value: function getAsCurrentPoint() {
var point = this.getPoint();
this.current = point;
return point;
}
}, {
key: "getReflectedControlPoint",
value: function getReflectedControlPoint() {
var previousCommand = this.previousCommand.toLowerCase();
if (previousCommand !== 'c' && previousCommand !== 's' && previousCommand !== 'q' && previousCommand !== 't') {
return this.current;
} // reflect point
var _this$current = this.current,
cx = _this$current.x,
cy = _this$current.y,
_this$control = this.control,
ox = _this$control.x,
oy = _this$control.y;
var point = new Point(2 * cx - ox, 2 * cy - oy);
return point;
}
}, {
key: "makeAbsolute",
value: function makeAbsolute(point) {
if (this.isRelativeCommand()) {
var _this$current2 = this.current,
x = _this$current2.x,
y = _this$current2.y;
point.x += x;
point.y += y;
}
return point;
}
}, {
key: "addMarker",
value: function addMarker(point, from, priorTo) {
var points = this.points,
angles = this.angles; // if the last angle isn't filled in because we didn't have this point yet ...
if (priorTo && angles.length > 0 && !angles[angles.length - 1]) {
angles[angles.length - 1] = points[points.length - 1].angleTo(priorTo);
}
this.addMarkerAngle(point, from ? from.angleTo(point) : null);
}
}, {
key: "addMarkerAngle",
value: function addMarkerAngle(point, angle) {
this.points.push(point);
this.angles.push(angle);
}
}, {
key: "getMarkerPoints",
value: function getMarkerPoints() {
return this.points;
}
}, {
key: "getMarkerAngles",
value: function getMarkerAngles() {
var angles = this.angles;
var len = angles.length;
for (var i = 0; i < len; i++) {
if (!angles[i]) {
for (var j = i + 1; j < len; j++) {
if (angles[j]) {
angles[i] = angles[j];
break;
}
}
}
}
return angles;
}
}]);
return PathParser;
}();
function _createSuper$8(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(Derived), result; if (_isNativeReflectConstruct$8()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30___default()(this, result); }; }
function _isNativeReflectConstruct$8() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var PathElement = /*#__PURE__*/function (_RenderedElement) {
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_32___default()(PathElement, _RenderedElement);
var _super = _createSuper$8(PathElement);
function PathElement(document, node, captureTextNodes) {
var _this;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, PathElement);
_this = _super.call(this, document, node, captureTextNodes);
_this.type = 'path';
_this.pathParser = null;
_this.pathParser = new PathParser(_this.getAttribute('d').getString());
return _this;
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(PathElement, [{
key: "path",
value: function path(ctx) {
var pathParser = this.pathParser;
var boundingBox = new BoundingBox();
pathParser.reset();
if (ctx) {
ctx.beginPath();
}
while (!pathParser.isEnd()) {
pathParser.nextCommand();
switch (pathParser.command) {
case 'M':
case 'm':
this.pathM(ctx, boundingBox);
break;
case 'L':
case 'l':
this.pathL(ctx, boundingBox);
break;
case 'H':
case 'h':
this.pathH(ctx, boundingBox);
break;
case 'V':
case 'v':
this.pathV(ctx, boundingBox);
break;
case 'C':
case 'c':
this.pathC(ctx, boundingBox);
break;
case 'S':
case 's':
this.pathS(ctx, boundingBox);
break;
case 'Q':
case 'q':
this.pathQ(ctx, boundingBox);
break;
case 'T':
case 't':
this.pathT(ctx, boundingBox);
break;
case 'A':
case 'a':
this.pathA(ctx, boundingBox);
break;
case 'Z':
case 'z':
this.pathZ(ctx, boundingBox);
break;
}
}
return boundingBox;
}
}, {
key: "getBoundingBox",
value: function getBoundingBox(_) {
return this.path();
}
}, {
key: "getMarkers",
value: function getMarkers() {
var pathParser = this.pathParser;
var points = pathParser.getMarkerPoints();
var angles = pathParser.getMarkerAngles();
var markers = points.map(function (point, i) {
return [point, angles[i]];
});
return markers;
}
}, {
key: "renderChildren",
value: function renderChildren(ctx) {
this.path(ctx);
this.document.screen.mouse.checkPath(this, ctx);
var fillRuleStyleProp = this.getStyle('fill-rule');
if (ctx.fillStyle !== '') {
if (fillRuleStyleProp.getString('inherit') !== 'inherit') {
ctx.fill(fillRuleStyleProp.getString());
} else {
ctx.fill();
}
}
if (ctx.strokeStyle !== '') {
ctx.stroke();
}
var markers = this.getMarkers();
if (markers) {
var markersLastIndex = markers.length - 1;
var markerStartStyleProp = this.getStyle('marker-start');
var markerMidStyleProp = this.getStyle('marker-mid');
var markerEndStyleProp = this.getStyle('marker-end');
if (markerStartStyleProp.isUrlDefinition()) {
var marker = markerStartStyleProp.getDefinition();
var _markers$ = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_6___default()(markers[0], 2),
point = _markers$[0],
angle = _markers$[1];
marker.render(ctx, point, angle);
}
if (markerMidStyleProp.isUrlDefinition()) {
var _marker = markerMidStyleProp.getDefinition();
for (var i = 1; i < markersLastIndex; i++) {
var _markers$i = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_6___default()(markers[i], 2),
_point = _markers$i[0],
_angle = _markers$i[1];
_marker.render(ctx, _point, _angle);
}
}
if (markerEndStyleProp.isUrlDefinition()) {
var _marker2 = markerEndStyleProp.getDefinition();
var _markers$markersLastI = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_6___default()(markers[markersLastIndex], 2),
_point2 = _markers$markersLastI[0],
_angle2 = _markers$markersLastI[1];
_marker2.render(ctx, _point2, _angle2);
}
}
}
}, {
key: "pathM",
value: function pathM(ctx, boundingBox) {
var pathParser = this.pathParser;
var point = pathParser.getAsCurrentPoint();
var x = point.x,
y = point.y;
pathParser.addMarker(point);
boundingBox.addPoint(x, y);
if (ctx) {
ctx.moveTo(x, y);
}
pathParser.start = pathParser.current;
while (!pathParser.isCommandOrEnd()) {
var _point3 = pathParser.getAsCurrentPoint();
var _x = _point3.x,
_y = _point3.y;
pathParser.addMarker(_point3, pathParser.start);
boundingBox.addPoint(_x, _y);
if (ctx) {
ctx.lineTo(_x, _y);
}
}
}
}, {
key: "pathL",
value: function pathL(ctx, boundingBox) {
var pathParser = this.pathParser;
while (!pathParser.isCommandOrEnd()) {
var current = pathParser.current;
var point = pathParser.getAsCurrentPoint();
var x = point.x,
y = point.y;
pathParser.addMarker(point, current);
boundingBox.addPoint(x, y);
if (ctx) {
ctx.lineTo(x, y);
}
}
}
}, {
key: "pathH",
value: function pathH(ctx, boundingBox) {
var pathParser = this.pathParser;
while (!pathParser.isCommandOrEnd()) {
var current = pathParser.current;
var point = new Point((pathParser.isRelativeCommand() ? current.x : 0) + pathParser.getScalar(), current.y);
pathParser.addMarker(point, current);
pathParser.current = point;
boundingBox.addPoint(point.x, point.y);
if (ctx) {
ctx.lineTo(point.x, point.y);
}
}
}
}, {
key: "pathV",
value: function pathV(ctx, boundingBox) {
var pathParser = this.pathParser;
while (!pathParser.isCommandOrEnd()) {
var current = pathParser.current;
var point = new Point(current.x, (pathParser.isRelativeCommand() ? current.y : 0) + pathParser.getScalar());
pathParser.addMarker(point, current);
pathParser.current = point;
boundingBox.addPoint(point.x, point.y);
if (ctx) {
ctx.lineTo(point.x, point.y);
}
}
}
}, {
key: "pathC",
value: function pathC(ctx, boundingBox) {
var pathParser = this.pathParser;
while (!pathParser.isCommandOrEnd()) {
var current = pathParser.current;
var point = pathParser.getPoint();
var controlPoint = pathParser.getAsControlPoint();
var currentPoint = pathParser.getAsCurrentPoint();
pathParser.addMarker(currentPoint, controlPoint, point);
boundingBox.addBezierCurve(current.x, current.y, point.x, point.y, controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
if (ctx) {
ctx.bezierCurveTo(point.x, point.y, controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
}
}
}
}, {
key: "pathS",
value: function pathS(ctx, boundingBox) {
var pathParser = this.pathParser;
while (!pathParser.isCommandOrEnd()) {
var current = pathParser.current;
var point = pathParser.getReflectedControlPoint();
var controlPoint = pathParser.getAsControlPoint();
var currentPoint = pathParser.getAsCurrentPoint();
pathParser.addMarker(currentPoint, controlPoint, point);
boundingBox.addBezierCurve(current.x, current.y, point.x, point.y, controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
if (ctx) {
ctx.bezierCurveTo(point.x, point.y, controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
}
}
}
}, {
key: "pathQ",
value: function pathQ(ctx, boundingBox) {
var pathParser = this.pathParser;
while (!pathParser.isCommandOrEnd()) {
var current = pathParser.current;
var controlPoint = pathParser.getAsControlPoint();
var currentPoint = pathParser.getAsCurrentPoint();
pathParser.addMarker(currentPoint, controlPoint, controlPoint);
boundingBox.addQuadraticCurve(current.x, current.y, controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
if (ctx) {
ctx.quadraticCurveTo(controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
}
}
}
}, {
key: "pathT",
value: function pathT(ctx, boundingBox) {
var pathParser = this.pathParser;
while (!pathParser.isCommandOrEnd()) {
var current = pathParser.current;
var controlPoint = pathParser.getReflectedControlPoint();
pathParser.control = controlPoint;
var currentPoint = pathParser.getAsCurrentPoint();
pathParser.addMarker(currentPoint, controlPoint, controlPoint);
boundingBox.addQuadraticCurve(current.x, current.y, controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
if (ctx) {
ctx.quadraticCurveTo(controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
}
}
}
}, {
key: "pathA",
value: function pathA(ctx, boundingBox) {
var pathParser = this.pathParser;
while (!pathParser.isCommandOrEnd()) {
var current = pathParser.current;
var rx = pathParser.getScalar();
var ry = pathParser.getScalar();
var xAxisRotation = pathParser.getScalar() * (Math.PI / 180.0);
var largeArcFlag = pathParser.getScalar();
var sweepFlag = pathParser.getScalar();
var currentPoint = pathParser.getAsCurrentPoint(); // Conversion from endpoint to center parameterization
// http://www.w3.org/TR/SVG11/implnote.html#ArcImplementationNotes
// x1', y1'
var currp = new Point(Math.cos(xAxisRotation) * (current.x - currentPoint.x) / 2.0 + Math.sin(xAxisRotation) * (current.y - currentPoint.y) / 2.0, -Math.sin(xAxisRotation) * (current.x - currentPoint.x) / 2.0 + Math.cos(xAxisRotation) * (current.y - currentPoint.y) / 2.0); // adjust radii
var l = Math.pow(currp.x, 2) / Math.pow(rx, 2) + Math.pow(currp.y, 2) / Math.pow(ry, 2);
if (l > 1) {
rx *= Math.sqrt(l);
ry *= Math.sqrt(l);
} // cx', cy'
var s = (largeArcFlag === sweepFlag ? -1 : 1) * Math.sqrt((Math.pow(rx, 2) * Math.pow(ry, 2) - Math.pow(rx, 2) * Math.pow(currp.y, 2) - Math.pow(ry, 2) * Math.pow(currp.x, 2)) / (Math.pow(rx, 2) * Math.pow(currp.y, 2) + Math.pow(ry, 2) * Math.pow(currp.x, 2)));
if (isNaN(s)) {
s = 0;
}
var cpp = new Point(s * rx * currp.y / ry, s * -ry * currp.x / rx); // cx, cy
var centp = new Point((current.x + currentPoint.x) / 2.0 + Math.cos(xAxisRotation) * cpp.x - Math.sin(xAxisRotation) * cpp.y, (current.y + currentPoint.y) / 2.0 + Math.sin(xAxisRotation) * cpp.x + Math.cos(xAxisRotation) * cpp.y); // initial angle
var a1 = vectorsAngle([1, 0], [(currp.x - cpp.x) / rx, (currp.y - cpp.y) / ry]); // angle delta
var u = [(currp.x - cpp.x) / rx, (currp.y - cpp.y) / ry];
var v = [(-currp.x - cpp.x) / rx, (-currp.y - cpp.y) / ry];
var ad = vectorsAngle(u, v);
if (vectorsRatio(u, v) <= -1) {
ad = Math.PI;
}
if (vectorsRatio(u, v) >= 1) {
ad = 0;
} // for markers
var dir = 1 - sweepFlag ? 1.0 : -1.0;
var ah = a1 + dir * (ad / 2.0);
var halfWay = new Point(centp.x + rx * Math.cos(ah), centp.y + ry * Math.sin(ah));
pathParser.addMarkerAngle(halfWay, ah - dir * Math.PI / 2);
pathParser.addMarkerAngle(currentPoint, ah - dir * Math.PI);
boundingBox.addPoint(currentPoint.x, currentPoint.y); // TODO: this is too naive, make it better
if (ctx && !isNaN(a1) && !isNaN(ad)) {
var r = rx > ry ? rx : ry;
var sx = rx > ry ? 1 : rx / ry;
var sy = rx > ry ? ry / rx : 1;
ctx.translate(centp.x, centp.y);
ctx.rotate(xAxisRotation);
ctx.scale(sx, sy);
ctx.arc(0, 0, r, a1, a1 + ad, Boolean(1 - sweepFlag));
ctx.scale(1 / sx, 1 / sy);
ctx.rotate(-xAxisRotation);
ctx.translate(-centp.x, -centp.y);
}
}
}
}, {
key: "pathZ",
value: function pathZ(ctx, boundingBox) {
var pathParser = this.pathParser;
if (ctx) {
// only close path if it is not a straight line
if (boundingBox.x1 !== boundingBox.x2 && boundingBox.y1 !== boundingBox.y2) {
ctx.closePath();
}
}
pathParser.current = pathParser.start;
}
}]);
return PathElement;
}(RenderedElement);
function _createSuper$9(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(Derived), result; if (_isNativeReflectConstruct$9()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30___default()(this, result); }; }
function _isNativeReflectConstruct$9() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var SVGElement = /*#__PURE__*/function (_RenderedElement) {
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_32___default()(SVGElement, _RenderedElement);
var _super = _createSuper$9(SVGElement);
function SVGElement() {
var _this;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, SVGElement);
_this = _super.apply(this, arguments);
_this.type = 'svg';
_this.root = false;
return _this;
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(SVGElement, [{
key: "clearContext",
value: function clearContext(ctx) {
_babel_runtime_helpers_get__WEBPACK_IMPORTED_MODULE_42___default()(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(SVGElement.prototype), "clearContext", this).call(this, ctx);
this.document.screen.viewPort.removeCurrent();
}
}, {
key: "setContext",
value: function setContext(ctx) {
var document = this.document;
var screen = document.screen,
window = document.window;
var canvas = ctx.canvas;
screen.setDefaults(ctx);
if (canvas.style && typeof ctx.font !== 'undefined' && window && typeof window.getComputedStyle !== 'undefined') {
ctx.font = window.getComputedStyle(canvas).getPropertyValue('font');
var fontSizeProp = new Property(document, 'fontSize', Font.parse(ctx.font).fontSize);
if (fontSizeProp.hasValue()) {
document.rootEmSize = fontSizeProp.getPixels('y');
document.emSize = document.rootEmSize;
}
}
_babel_runtime_helpers_get__WEBPACK_IMPORTED_MODULE_42___default()(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(SVGElement.prototype), "setContext", this).call(this, ctx); // create new view port
if (!this.getAttribute('x').hasValue()) {
this.getAttribute('x', true).setValue(0);
}
if (!this.getAttribute('y').hasValue()) {
this.getAttribute('y', true).setValue(0);
}
ctx.translate(this.getAttribute('x').getPixels('x'), this.getAttribute('y').getPixels('y'));
var _screen$viewPort = screen.viewPort,
width = _screen$viewPort.width,
height = _screen$viewPort.height;
if (!this.getStyle('width').hasValue()) {
this.getStyle('width', true).setValue('100%');
}
if (!this.getStyle('height').hasValue()) {
this.getStyle('height', true).setValue('100%');
}
if (!this.getStyle('color').hasValue()) {
this.getStyle('color', true).setValue('black');
}
var refXAttr = this.getAttribute('refX');
var refYAttr = this.getAttribute('refY');
var viewBoxAttr = this.getAttribute('viewBox');
var viewBox = viewBoxAttr.hasValue() ? toNumbers(viewBoxAttr.getString()) : null;
var clip = !this.root && this.getAttribute('overflow').getValue('hidden') !== 'visible';
var minX = 0;
var minY = 0;
var clipX = 0;
var clipY = 0;
if (viewBox) {
minX = viewBox[0];
minY = viewBox[1];
}
if (!this.root) {
width = this.getStyle('width').getPixels('x');
height = this.getStyle('height').getPixels('y');
if (this.type === 'marker') {
clipX = minX;
clipY = minY;
minX = 0;
minY = 0;
}
}
screen.viewPort.setCurrent(width, height);
if (viewBox) {
width = viewBox[2];
height = viewBox[3];
}
document.setViewBox({
ctx: ctx,
aspectRatio: this.getAttribute('preserveAspectRatio').getString(),
width: screen.viewPort.width,
desiredWidth: width,
height: screen.viewPort.height,
desiredHeight: height,
minX: minX,
minY: minY,
refX: refXAttr.getValue(),
refY: refYAttr.getValue(),
clip: clip,
clipX: clipX,
clipY: clipY
});
if (viewBox) {
screen.viewPort.removeCurrent();
screen.viewPort.setCurrent(width, height);
}
}
/**
* Resize SVG to fit in given size.
* @param width
* @param height
* @param preserveAspectRatio
*/
}, {
key: "resize",
value: function resize(width) {
var height = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : width;
var preserveAspectRatio = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
var widthAttr = this.getAttribute('width', true);
var heightAttr = this.getAttribute('height', true);
var viewBoxAttr = this.getAttribute('viewBox');
var styleAttr = this.getAttribute('style');
var originWidth = widthAttr.getNumber(0);
var originHeight = heightAttr.getNumber(0);
if (preserveAspectRatio) {
if (typeof preserveAspectRatio === 'string') {
this.getAttribute('preserveAspectRatio', true).setValue(preserveAspectRatio);
} else {
var preserveAspectRatioAttr = this.getAttribute('preserveAspectRatio');
if (preserveAspectRatioAttr.hasValue()) {
preserveAspectRatioAttr.setValue(preserveAspectRatioAttr.getString().replace(/^\s*(\S.*\S)\s*$/, '$1'));
}
}
}
widthAttr.setValue(width);
heightAttr.setValue(height);
if (!viewBoxAttr.hasValue()) {
viewBoxAttr.setValue("0 0 ".concat(originWidth || width, " ").concat(originHeight || height));
}
if (styleAttr.hasValue()) {
var widthStyle = this.getStyle('width');
var heightStyle = this.getStyle('height');
if (widthStyle.hasValue()) {
widthStyle.setValue("".concat(width, "px"));
}
if (heightStyle.hasValue()) {
heightStyle.setValue("".concat(height, "px"));
}
}
}
}]);
return SVGElement;
}(RenderedElement);
function _createSuper$a(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(Derived), result; if (_isNativeReflectConstruct$a()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30___default()(this, result); }; }
function _isNativeReflectConstruct$a() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var RectElement = /*#__PURE__*/function (_PathElement) {
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_32___default()(RectElement, _PathElement);
var _super = _createSuper$a(RectElement);
function RectElement() {
var _this;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, RectElement);
_this = _super.apply(this, arguments);
_this.type = 'rect';
return _this;
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(RectElement, [{
key: "path",
value: function path(ctx) {
var x = this.getAttribute('x').getPixels('x');
var y = this.getAttribute('y').getPixels('y');
var width = this.getStyle('width').getPixels('x');
var height = this.getStyle('height').getPixels('y');
var rxAttr = this.getAttribute('rx');
var ryAttr = this.getAttribute('ry');
var rx = rxAttr.getPixels('x');
var ry = ryAttr.getPixels('y');
if (rxAttr.hasValue() && !ryAttr.hasValue()) {
ry = rx;
}
if (ryAttr.hasValue() && !rxAttr.hasValue()) {
rx = ry;
}
rx = Math.min(rx, width / 2.0);
ry = Math.min(ry, height / 2.0);
if (ctx) {
var KAPPA = 4 * ((Math.sqrt(2) - 1) / 3);
ctx.beginPath(); // always start the path so we don't fill prior paths
if (height > 0 && width > 0) {
ctx.moveTo(x + rx, y);
ctx.lineTo(x + width - rx, y);
ctx.bezierCurveTo(x + width - rx + KAPPA * rx, y, x + width, y + ry - KAPPA * ry, x + width, y + ry);
ctx.lineTo(x + width, y + height - ry);
ctx.bezierCurveTo(x + width, y + height - ry + KAPPA * ry, x + width - rx + KAPPA * rx, y + height, x + width - rx, y + height);
ctx.lineTo(x + rx, y + height);
ctx.bezierCurveTo(x + rx - KAPPA * rx, y + height, x, y + height - ry + KAPPA * ry, x, y + height - ry);
ctx.lineTo(x, y + ry);
ctx.bezierCurveTo(x, y + ry - KAPPA * ry, x + rx - KAPPA * rx, y, x + rx, y);
ctx.closePath();
}
}
return new BoundingBox(x, y, x + width, y + height);
}
}, {
key: "getMarkers",
value: function getMarkers() {
return null;
}
}]);
return RectElement;
}(PathElement);
function _createSuper$b(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(Derived), result; if (_isNativeReflectConstruct$b()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30___default()(this, result); }; }
function _isNativeReflectConstruct$b() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var CircleElement = /*#__PURE__*/function (_PathElement) {
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_32___default()(CircleElement, _PathElement);
var _super = _createSuper$b(CircleElement);
function CircleElement() {
var _this;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, CircleElement);
_this = _super.apply(this, arguments);
_this.type = 'circle';
return _this;
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(CircleElement, [{
key: "path",
value: function path(ctx) {
var cx = this.getAttribute('cx').getPixels('x');
var cy = this.getAttribute('cy').getPixels('y');
var r = this.getAttribute('r').getPixels();
if (ctx && r > 0) {
ctx.beginPath();
ctx.arc(cx, cy, r, 0, Math.PI * 2, false);
ctx.closePath();
}
return new BoundingBox(cx - r, cy - r, cx + r, cy + r);
}
}, {
key: "getMarkers",
value: function getMarkers() {
return null;
}
}]);
return CircleElement;
}(PathElement);
function _createSuper$c(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(Derived), result; if (_isNativeReflectConstruct$c()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30___default()(this, result); }; }
function _isNativeReflectConstruct$c() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var EllipseElement = /*#__PURE__*/function (_PathElement) {
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_32___default()(EllipseElement, _PathElement);
var _super = _createSuper$c(EllipseElement);
function EllipseElement() {
var _this;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, EllipseElement);
_this = _super.apply(this, arguments);
_this.type = 'ellipse';
return _this;
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(EllipseElement, [{
key: "path",
value: function path(ctx) {
var KAPPA = 4 * ((Math.sqrt(2) - 1) / 3);
var rx = this.getAttribute('rx').getPixels('x');
var ry = this.getAttribute('ry').getPixels('y');
var cx = this.getAttribute('cx').getPixels('x');
var cy = this.getAttribute('cy').getPixels('y');
if (ctx && rx > 0 && ry > 0) {
ctx.beginPath();
ctx.moveTo(cx + rx, cy);
ctx.bezierCurveTo(cx + rx, cy + KAPPA * ry, cx + KAPPA * rx, cy + ry, cx, cy + ry);
ctx.bezierCurveTo(cx - KAPPA * rx, cy + ry, cx - rx, cy + KAPPA * ry, cx - rx, cy);
ctx.bezierCurveTo(cx - rx, cy - KAPPA * ry, cx - KAPPA * rx, cy - ry, cx, cy - ry);
ctx.bezierCurveTo(cx + KAPPA * rx, cy - ry, cx + rx, cy - KAPPA * ry, cx + rx, cy);
ctx.closePath();
}
return new BoundingBox(cx - rx, cy - ry, cx + rx, cy + ry);
}
}, {
key: "getMarkers",
value: function getMarkers() {
return null;
}
}]);
return EllipseElement;
}(PathElement);
function _createSuper$d(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(Derived), result; if (_isNativeReflectConstruct$d()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30___default()(this, result); }; }
function _isNativeReflectConstruct$d() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var LineElement = /*#__PURE__*/function (_PathElement) {
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_32___default()(LineElement, _PathElement);
var _super = _createSuper$d(LineElement);
function LineElement() {
var _this;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, LineElement);
_this = _super.apply(this, arguments);
_this.type = 'line';
return _this;
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(LineElement, [{
key: "getPoints",
value: function getPoints() {
return [new Point(this.getAttribute('x1').getPixels('x'), this.getAttribute('y1').getPixels('y')), new Point(this.getAttribute('x2').getPixels('x'), this.getAttribute('y2').getPixels('y'))];
}
}, {
key: "path",
value: function path(ctx) {
var _this$getPoints = this.getPoints(),
_this$getPoints2 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_6___default()(_this$getPoints, 2),
_this$getPoints2$ = _this$getPoints2[0],
x0 = _this$getPoints2$.x,
y0 = _this$getPoints2$.y,
_this$getPoints2$2 = _this$getPoints2[1],
x1 = _this$getPoints2$2.x,
y1 = _this$getPoints2$2.y;
if (ctx) {
ctx.beginPath();
ctx.moveTo(x0, y0);
ctx.lineTo(x1, y1);
}
return new BoundingBox(x0, y0, x1, y1);
}
}, {
key: "getMarkers",
value: function getMarkers() {
var _this$getPoints3 = this.getPoints(),
_this$getPoints4 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_6___default()(_this$getPoints3, 2),
p0 = _this$getPoints4[0],
p1 = _this$getPoints4[1];
var a = p0.angleTo(p1);
return [[p0, a], [p1, a]];
}
}]);
return LineElement;
}(PathElement);
function _createSuper$e(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(Derived), result; if (_isNativeReflectConstruct$e()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30___default()(this, result); }; }
function _isNativeReflectConstruct$e() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var PolylineElement = /*#__PURE__*/function (_PathElement) {
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_32___default()(PolylineElement, _PathElement);
var _super = _createSuper$e(PolylineElement);
function PolylineElement(document, node, captureTextNodes) {
var _this;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, PolylineElement);
_this = _super.call(this, document, node, captureTextNodes);
_this.type = 'polyline';
_this.points = [];
_this.points = Point.parsePath(_this.getAttribute('points').getString());
return _this;
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(PolylineElement, [{
key: "path",
value: function path(ctx) {
var points = this.points;
var _points = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_6___default()(points, 1),
_points$ = _points[0],
x0 = _points$.x,
y0 = _points$.y;
var boundingBox = new BoundingBox(x0, y0);
if (ctx) {
ctx.beginPath();
ctx.moveTo(x0, y0);
}
points.forEach(function (_ref) {
var x = _ref.x,
y = _ref.y;
boundingBox.addPoint(x, y);
if (ctx) {
ctx.lineTo(x, y);
}
});
return boundingBox;
}
}, {
key: "getMarkers",
value: function getMarkers() {
var points = this.points;
var lastIndex = points.length - 1;
var markers = [];
points.forEach(function (point, i) {
if (i === lastIndex) {
return;
}
markers.push([point, point.angleTo(points[i + 1])]);
});
if (markers.length > 0) {
markers.push([points[points.length - 1], markers[markers.length - 1][1]]);
}
return markers;
}
}]);
return PolylineElement;
}(PathElement);
function _createSuper$f(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(Derived), result; if (_isNativeReflectConstruct$f()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30___default()(this, result); }; }
function _isNativeReflectConstruct$f() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var PolygonElement = /*#__PURE__*/function (_PolylineElement) {
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_32___default()(PolygonElement, _PolylineElement);
var _super = _createSuper$f(PolygonElement);
function PolygonElement() {
var _this;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, PolygonElement);
_this = _super.apply(this, arguments);
_this.type = 'polygon';
return _this;
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(PolygonElement, [{
key: "path",
value: function path(ctx) {
var boundingBox = _babel_runtime_helpers_get__WEBPACK_IMPORTED_MODULE_42___default()(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(PolygonElement.prototype), "path", this).call(this, ctx);
var _this$points = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_6___default()(this.points, 1),
_this$points$ = _this$points[0],
x = _this$points$.x,
y = _this$points$.y;
if (ctx) {
ctx.lineTo(x, y);
ctx.closePath();
}
return boundingBox;
}
}]);
return PolygonElement;
}(PolylineElement);
function _createSuper$g(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(Derived), result; if (_isNativeReflectConstruct$g()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30___default()(this, result); }; }
function _isNativeReflectConstruct$g() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var PatternElement = /*#__PURE__*/function (_Element) {
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_32___default()(PatternElement, _Element);
var _super = _createSuper$g(PatternElement);
function PatternElement() {
var _this;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, PatternElement);
_this = _super.apply(this, arguments);
_this.type = 'pattern';
return _this;
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(PatternElement, [{
key: "createPattern",
value: function createPattern(ctx, _, parentOpacityProp) {
var width = this.getStyle('width').getPixels('x', true);
var height = this.getStyle('height').getPixels('y', true); // render me using a temporary svg element
var patternSvg = new SVGElement(this.document, null);
patternSvg.attributes.viewBox = new Property(this.document, 'viewBox', this.getAttribute('viewBox').getValue());
patternSvg.attributes.width = new Property(this.document, 'width', "".concat(width, "px"));
patternSvg.attributes.height = new Property(this.document, 'height', "".concat(height, "px"));
patternSvg.attributes.transform = new Property(this.document, 'transform', this.getAttribute('patternTransform').getValue());
patternSvg.children = this.children;
var patternCanvas = this.document.createCanvas(width, height);
var patternCtx = patternCanvas.getContext('2d');
var xAttr = this.getAttribute('x');
var yAttr = this.getAttribute('y');
if (xAttr.hasValue() && yAttr.hasValue()) {
patternCtx.translate(xAttr.getPixels('x', true), yAttr.getPixels('y', true));
}
if (parentOpacityProp.hasValue()) {
this.styles['fill-opacity'] = parentOpacityProp;
} else {
Reflect.deleteProperty(this.styles, 'fill-opacity');
} // render 3x3 grid so when we transform there's no white space on edges
for (var x = -1; x <= 1; x++) {
for (var y = -1; y <= 1; y++) {
patternCtx.save();
patternSvg.attributes.x = new Property(this.document, 'x', x * patternCanvas.width);
patternSvg.attributes.y = new Property(this.document, 'y', y * patternCanvas.height);
patternSvg.render(patternCtx);
patternCtx.restore();
}
}
var pattern = ctx.createPattern(patternCanvas, 'repeat');
return pattern;
}
}]);
return PatternElement;
}(Element);
function _createSuper$h(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(Derived), result; if (_isNativeReflectConstruct$h()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30___default()(this, result); }; }
function _isNativeReflectConstruct$h() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var MarkerElement = /*#__PURE__*/function (_Element) {
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_32___default()(MarkerElement, _Element);
var _super = _createSuper$h(MarkerElement);
function MarkerElement() {
var _this;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, MarkerElement);
_this = _super.apply(this, arguments);
_this.type = 'marker';
return _this;
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(MarkerElement, [{
key: "render",
value: function render(ctx, point, angle) {
if (!point) {
return;
}
var x = point.x,
y = point.y;
var orient = this.getAttribute('orient').getValue('auto');
var markerUnits = this.getAttribute('markerUnits').getValue('strokeWidth');
ctx.translate(x, y);
if (orient === 'auto') {
ctx.rotate(angle);
}
if (markerUnits === 'strokeWidth') {
ctx.scale(ctx.lineWidth, ctx.lineWidth);
}
ctx.save(); // render me using a temporary svg element
var markerSvg = new SVGElement(this.document, null);
markerSvg.type = this.type;
markerSvg.attributes.viewBox = new Property(this.document, 'viewBox', this.getAttribute('viewBox').getValue());
markerSvg.attributes.refX = new Property(this.document, 'refX', this.getAttribute('refX').getValue());
markerSvg.attributes.refY = new Property(this.document, 'refY', this.getAttribute('refY').getValue());
markerSvg.attributes.width = new Property(this.document, 'width', this.getAttribute('markerWidth').getValue());
markerSvg.attributes.height = new Property(this.document, 'height', this.getAttribute('markerHeight').getValue());
markerSvg.attributes.overflow = new Property(this.document, 'overflow', this.getAttribute('overflow').getValue());
markerSvg.attributes.fill = new Property(this.document, 'fill', this.getAttribute('fill').getColor('black'));
markerSvg.attributes.stroke = new Property(this.document, 'stroke', this.getAttribute('stroke').getValue('none'));
markerSvg.children = this.children;
markerSvg.render(ctx);
ctx.restore();
if (markerUnits === 'strokeWidth') {
ctx.scale(1 / ctx.lineWidth, 1 / ctx.lineWidth);
}
if (orient === 'auto') {
ctx.rotate(-angle);
}
ctx.translate(-x, -y);
}
}]);
return MarkerElement;
}(Element);
function _createSuper$i(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(Derived), result; if (_isNativeReflectConstruct$i()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30___default()(this, result); }; }
function _isNativeReflectConstruct$i() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var DefsElement = /*#__PURE__*/function (_Element) {
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_32___default()(DefsElement, _Element);
var _super = _createSuper$i(DefsElement);
function DefsElement() {
var _this;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, DefsElement);
_this = _super.apply(this, arguments);
_this.type = 'defs';
return _this;
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(DefsElement, [{
key: "render",
value: function render() {// NOOP
}
}]);
return DefsElement;
}(Element);
function _createSuper$j(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(Derived), result; if (_isNativeReflectConstruct$j()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30___default()(this, result); }; }
function _isNativeReflectConstruct$j() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var GElement = /*#__PURE__*/function (_RenderedElement) {
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_32___default()(GElement, _RenderedElement);
var _super = _createSuper$j(GElement);
function GElement() {
var _this;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, GElement);
_this = _super.apply(this, arguments);
_this.type = 'g';
return _this;
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(GElement, [{
key: "getBoundingBox",
value: function getBoundingBox(ctx) {
var boundingBox = new BoundingBox();
this.children.forEach(function (child) {
boundingBox.addBoundingBox(child.getBoundingBox(ctx));
});
return boundingBox;
}
}]);
return GElement;
}(RenderedElement);
function _createSuper$k(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(Derived), result; if (_isNativeReflectConstruct$k()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30___default()(this, result); }; }
function _isNativeReflectConstruct$k() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var GradientElement = /*#__PURE__*/function (_Element) {
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_32___default()(GradientElement, _Element);
var _super = _createSuper$k(GradientElement);
function GradientElement(document, node, captureTextNodes) {
var _this;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, GradientElement);
_this = _super.call(this, document, node, captureTextNodes);
_this.attributesToInherit = ['gradientUnits'];
_this.stops = [];
var _assertThisInitialize = _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_46___default()(_this),
stops = _assertThisInitialize.stops,
children = _assertThisInitialize.children;
children.forEach(function (child) {
if (child.type === 'stop') {
stops.push(child);
}
});
return _this;
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(GradientElement, [{
key: "getGradientUnits",
value: function getGradientUnits() {
return this.getAttribute('gradientUnits').getString('objectBoundingBox');
}
}, {
key: "createGradient",
value: function createGradient(ctx, element, parentOpacityProp) {
var _this2 = this;
// tslint:disable-next-line: no-this-assignment
var stopsContainer = this;
if (this.getHrefAttribute().hasValue()) {
stopsContainer = this.getHrefAttribute().getDefinition();
this.inheritStopContainer(stopsContainer);
}
var _stopsContainer = stopsContainer,
stops = _stopsContainer.stops;
var gradient = this.getGradient(ctx, element);
if (!gradient) {
return this.addParentOpacity(parentOpacityProp, stops[stops.length - 1].color);
}
stops.forEach(function (stop) {
gradient.addColorStop(stop.offset, _this2.addParentOpacity(parentOpacityProp, stop.color));
});
if (this.getAttribute('gradientTransform').hasValue()) {
// render as transformed pattern on temporary canvas
var document = this.document;
var _document$screen = document.screen,
MAX_VIRTUAL_PIXELS = _document$screen.MAX_VIRTUAL_PIXELS,
viewPort = _document$screen.viewPort;
var _viewPort$viewPorts = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_6___default()(viewPort.viewPorts, 1),
rootView = _viewPort$viewPorts[0];
var rect = new RectElement(document, null);
rect.attributes.x = new Property(document, 'x', -MAX_VIRTUAL_PIXELS / 3.0);
rect.attributes.y = new Property(document, 'y', -MAX_VIRTUAL_PIXELS / 3.0);
rect.attributes.width = new Property(document, 'width', MAX_VIRTUAL_PIXELS);
rect.attributes.height = new Property(document, 'height', MAX_VIRTUAL_PIXELS);
var group = new GElement(document, null);
group.attributes.transform = new Property(document, 'transform', this.getAttribute('gradientTransform').getValue());
group.children = [rect];
var patternSvg = new SVGElement(document, null);
patternSvg.attributes.x = new Property(document, 'x', 0);
patternSvg.attributes.y = new Property(document, 'y', 0);
patternSvg.attributes.width = new Property(document, 'width', rootView.width);
patternSvg.attributes.height = new Property(document, 'height', rootView.height);
patternSvg.children = [group];
var patternCanvas = document.createCanvas(rootView.width, rootView.height);
var patternCtx = patternCanvas.getContext('2d');
patternCtx.fillStyle = gradient;
patternSvg.render(patternCtx);
return patternCtx.createPattern(patternCanvas, 'no-repeat');
}
return gradient;
}
}, {
key: "inheritStopContainer",
value: function inheritStopContainer(stopsContainer) {
var _this3 = this;
this.attributesToInherit.forEach(function (attributeToInherit) {
if (!_this3.getAttribute(attributeToInherit).hasValue() && stopsContainer.getAttribute(attributeToInherit).hasValue()) {
_this3.getAttribute(attributeToInherit, true).setValue(stopsContainer.getAttribute(attributeToInherit).getValue());
}
});
}
}, {
key: "addParentOpacity",
value: function addParentOpacity(parentOpacityProp, color) {
if (parentOpacityProp.hasValue()) {
var colorProp = new Property(this.document, 'color', color);
return colorProp.addOpacity(parentOpacityProp).getColor();
}
return color;
}
}]);
return GradientElement;
}(Element);
function _createSuper$l(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(Derived), result; if (_isNativeReflectConstruct$l()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30___default()(this, result); }; }
function _isNativeReflectConstruct$l() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var LinearGradientElement = /*#__PURE__*/function (_GradientElement) {
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_32___default()(LinearGradientElement, _GradientElement);
var _super = _createSuper$l(LinearGradientElement);
function LinearGradientElement(document, node, captureTextNodes) {
var _this;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, LinearGradientElement);
_this = _super.call(this, document, node, captureTextNodes);
_this.type = 'linearGradient';
_this.attributesToInherit.push('x1', 'y1', 'x2', 'y2');
return _this;
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(LinearGradientElement, [{
key: "getGradient",
value: function getGradient(ctx, element) {
var isBoundingBoxUnits = this.getGradientUnits() === 'objectBoundingBox';
var boundingBox = isBoundingBoxUnits ? element.getBoundingBox(ctx) : null;
if (isBoundingBoxUnits && !boundingBox) {
return null;
}
if (!this.getAttribute('x1').hasValue() && !this.getAttribute('y1').hasValue() && !this.getAttribute('x2').hasValue() && !this.getAttribute('y2').hasValue()) {
this.getAttribute('x1', true).setValue(0);
this.getAttribute('y1', true).setValue(0);
this.getAttribute('x2', true).setValue(1);
this.getAttribute('y2', true).setValue(0);
}
var x1 = isBoundingBoxUnits ? boundingBox.x + boundingBox.width * this.getAttribute('x1').getNumber() : this.getAttribute('x1').getPixels('x');
var y1 = isBoundingBoxUnits ? boundingBox.y + boundingBox.height * this.getAttribute('y1').getNumber() : this.getAttribute('y1').getPixels('y');
var x2 = isBoundingBoxUnits ? boundingBox.x + boundingBox.width * this.getAttribute('x2').getNumber() : this.getAttribute('x2').getPixels('x');
var y2 = isBoundingBoxUnits ? boundingBox.y + boundingBox.height * this.getAttribute('y2').getNumber() : this.getAttribute('y2').getPixels('y');
if (x1 === x2 && y1 === y2) {
return null;
}
return ctx.createLinearGradient(x1, y1, x2, y2);
}
}]);
return LinearGradientElement;
}(GradientElement);
function _createSuper$m(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(Derived), result; if (_isNativeReflectConstruct$m()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30___default()(this, result); }; }
function _isNativeReflectConstruct$m() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var RadialGradientElement = /*#__PURE__*/function (_GradientElement) {
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_32___default()(RadialGradientElement, _GradientElement);
var _super = _createSuper$m(RadialGradientElement);
function RadialGradientElement(document, node, captureTextNodes) {
var _this;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, RadialGradientElement);
_this = _super.call(this, document, node, captureTextNodes);
_this.type = 'radialGradient';
_this.attributesToInherit.push('cx', 'cy', 'r', 'fx', 'fy', 'fr');
return _this;
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(RadialGradientElement, [{
key: "getGradient",
value: function getGradient(ctx, element) {
var isBoundingBoxUnits = this.getGradientUnits() === 'objectBoundingBox';
var boundingBox = element.getBoundingBox(ctx);
if (isBoundingBoxUnits && !boundingBox) {
return null;
}
if (!this.getAttribute('cx').hasValue()) {
this.getAttribute('cx', true).setValue('50%');
}
if (!this.getAttribute('cy').hasValue()) {
this.getAttribute('cy', true).setValue('50%');
}
if (!this.getAttribute('r').hasValue()) {
this.getAttribute('r', true).setValue('50%');
}
var cx = isBoundingBoxUnits ? boundingBox.x + boundingBox.width * this.getAttribute('cx').getNumber() : this.getAttribute('cx').getPixels('x');
var cy = isBoundingBoxUnits ? boundingBox.y + boundingBox.height * this.getAttribute('cy').getNumber() : this.getAttribute('cy').getPixels('y');
var fx = cx;
var fy = cy;
if (this.getAttribute('fx').hasValue()) {
fx = isBoundingBoxUnits ? boundingBox.x + boundingBox.width * this.getAttribute('fx').getNumber() : this.getAttribute('fx').getPixels('x');
}
if (this.getAttribute('fy').hasValue()) {
fy = isBoundingBoxUnits ? boundingBox.y + boundingBox.height * this.getAttribute('fy').getNumber() : this.getAttribute('fy').getPixels('y');
}
var r = isBoundingBoxUnits ? (boundingBox.width + boundingBox.height) / 2.0 * this.getAttribute('r').getNumber() : this.getAttribute('r').getPixels();
var fr = this.getAttribute('fr').getPixels();
return ctx.createRadialGradient(fx, fy, fr, cx, cy, r);
}
}]);
return RadialGradientElement;
}(GradientElement);
function _createSuper$n(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(Derived), result; if (_isNativeReflectConstruct$n()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30___default()(this, result); }; }
function _isNativeReflectConstruct$n() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var StopElement = /*#__PURE__*/function (_Element) {
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_32___default()(StopElement, _Element);
var _super = _createSuper$n(StopElement);
function StopElement(document, node, captureTextNodes) {
var _this;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, StopElement);
_this = _super.call(this, document, node, captureTextNodes);
_this.type = 'stop';
var offset = Math.max(0, Math.min(1, _this.getAttribute('offset').getNumber()));
var stopOpacity = _this.getStyle('stop-opacity');
var stopColor = _this.getStyle('stop-color', true);
if (stopColor.getString() === '') {
stopColor.setValue('#000');
}
if (stopOpacity.hasValue()) {
stopColor = stopColor.addOpacity(stopOpacity);
}
_this.offset = offset;
_this.color = stopColor.getColor();
return _this;
}
return StopElement;
}(Element);
function _createSuper$o(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(Derived), result; if (_isNativeReflectConstruct$o()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30___default()(this, result); }; }
function _isNativeReflectConstruct$o() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var AnimateElement = /*#__PURE__*/function (_Element) {
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_32___default()(AnimateElement, _Element);
var _super = _createSuper$o(AnimateElement);
function AnimateElement(document, node, captureTextNodes) {
var _this;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, AnimateElement);
_this = _super.call(this, document, node, captureTextNodes);
_this.type = 'animate';
_this.duration = 0;
_this.initialValue = null;
_this.initialUnits = '';
_this.removed = false;
_this.frozen = false;
document.screen.animations.push(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_46___default()(_this));
_this.begin = _this.getAttribute('begin').getMilliseconds();
_this.maxDuration = _this.begin + _this.getAttribute('dur').getMilliseconds();
_this.from = _this.getAttribute('from');
_this.to = _this.getAttribute('to');
_this.values = _this.getAttribute('values');
if (_this.values.hasValue()) {
_this.values.setValue(_this.values.getString().split(';'));
}
return _this;
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(AnimateElement, [{
key: "getProperty",
value: function getProperty() {
var attributeType = this.getAttribute('attributeType').getString();
var attributeName = this.getAttribute('attributeName').getString();
if (attributeType === 'CSS') {
return this.parent.getStyle(attributeName, true);
}
return this.parent.getAttribute(attributeName, true);
}
}, {
key: "calcValue",
value: function calcValue() {
var initialUnits = this.initialUnits;
var _this$getProgress = this.getProgress(),
progress = _this$getProgress.progress,
from = _this$getProgress.from,
to = _this$getProgress.to; // tween value linearly
var newValue = from.getNumber() + (to.getNumber() - from.getNumber()) * progress;
if (initialUnits === '%') {
newValue *= 100.0; // numValue() returns 0-1 whereas properties are 0-100
}
return "".concat(newValue).concat(initialUnits);
}
}, {
key: "update",
value: function update(delta) {
var parent = this.parent;
var prop = this.getProperty(); // set initial value
if (!this.initialValue) {
this.initialValue = prop.getString();
this.initialUnits = prop.getUnits();
} // if we're past the end time
if (this.duration > this.maxDuration) {
var fill = this.getAttribute('fill').getString('remove'); // loop for indefinitely repeating animations
if (this.getAttribute('repeatCount').getString() === 'indefinite' || this.getAttribute('repeatDur').getString() === 'indefinite') {
this.duration = 0;
} else if (fill === 'freeze' && !this.frozen) {
this.frozen = true;
parent.animationFrozen = true;
parent.animationFrozenValue = prop.getString();
} else if (fill === 'remove' && !this.removed) {
this.removed = true;
prop.setValue(parent.animationFrozen ? parent.animationFrozenValue : this.initialValue);
return true;
}
return false;
}
this.duration += delta; // if we're past the begin time
var updated = false;
if (this.begin < this.duration) {
var newValue = this.calcValue(); // tween
var typeAttr = this.getAttribute('type');
if (typeAttr.hasValue()) {
// for transform, etc.
var type = typeAttr.getString();
newValue = "".concat(type, "(").concat(newValue, ")");
}
prop.setValue(newValue);
updated = true;
}
return updated;
}
}, {
key: "getProgress",
value: function getProgress() {
var document = this.document,
values = this.values;
var result = {
progress: (this.duration - this.begin) / (this.maxDuration - this.begin)
};
if (values.hasValue()) {
var p = result.progress * (values.getValue().length - 1);
var lb = Math.floor(p);
var ub = Math.ceil(p);
result.from = new Property(document, 'from', parseFloat(values.getValue()[lb]));
result.to = new Property(document, 'to', parseFloat(values.getValue()[ub]));
result.progress = (p - lb) / (ub - lb);
} else {
result.from = this.from;
result.to = this.to;
}
return result;
}
}]);
return AnimateElement;
}(Element);
function _createSuper$p(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(Derived), result; if (_isNativeReflectConstruct$p()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30___default()(this, result); }; }
function _isNativeReflectConstruct$p() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var AnimateColorElement = /*#__PURE__*/function (_AnimateElement) {
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_32___default()(AnimateColorElement, _AnimateElement);
var _super = _createSuper$p(AnimateColorElement);
function AnimateColorElement() {
var _this;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, AnimateColorElement);
_this = _super.apply(this, arguments);
_this.type = 'animateColor';
return _this;
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(AnimateColorElement, [{
key: "calcValue",
value: function calcValue() {
var _this$getProgress = this.getProgress(),
progress = _this$getProgress.progress,
from = _this$getProgress.from,
to = _this$getProgress.to;
var colorFrom = new rgbcolor__WEBPACK_IMPORTED_MODULE_27___default.a(from.getColor());
var colorTo = new rgbcolor__WEBPACK_IMPORTED_MODULE_27___default.a(to.getColor());
if (colorFrom.ok && colorTo.ok) {
// tween color linearly
var r = colorFrom.r + (colorTo.r - colorFrom.r) * progress;
var g = colorFrom.g + (colorTo.g - colorFrom.g) * progress;
var b = colorFrom.b + (colorTo.b - colorFrom.b) * progress; // ? alpha
return "rgb(".concat(parseInt(r, 10), ", ").concat(parseInt(g, 10), ", ").concat(parseInt(b, 10), ")");
}
return this.getAttribute('from').getColor();
}
}]);
return AnimateColorElement;
}(AnimateElement);
function _createSuper$q(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(Derived), result; if (_isNativeReflectConstruct$q()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30___default()(this, result); }; }
function _isNativeReflectConstruct$q() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var AnimateTransformElement = /*#__PURE__*/function (_AnimateElement) {
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_32___default()(AnimateTransformElement, _AnimateElement);
var _super = _createSuper$q(AnimateTransformElement);
function AnimateTransformElement() {
var _this;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, AnimateTransformElement);
_this = _super.apply(this, arguments);
_this.type = 'animateTransform';
return _this;
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(AnimateTransformElement, [{
key: "calcValue",
value: function calcValue() {
var _this$getProgress = this.getProgress(),
progress = _this$getProgress.progress,
from = _this$getProgress.from,
to = _this$getProgress.to; // tween value linearly
var transformFrom = toNumbers(from.getString());
var transformTo = toNumbers(to.getString());
var newValue = transformFrom.map(function (from, i) {
var to = transformTo[i];
return from + (to - from) * progress;
}).join(' ');
return newValue;
}
}]);
return AnimateTransformElement;
}(AnimateElement);
function _createForOfIteratorHelper(o) { if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (o = _unsupportedIterableToArray(o))) { var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var it, normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
function _createSuper$r(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(Derived), result; if (_isNativeReflectConstruct$r()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30___default()(this, result); }; }
function _isNativeReflectConstruct$r() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var FontElement = /*#__PURE__*/function (_Element) {
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_32___default()(FontElement, _Element);
var _super = _createSuper$r(FontElement);
function FontElement(document, node, captureTextNodes) {
var _this;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, FontElement);
_this = _super.call(this, document, node, captureTextNodes);
_this.type = 'font';
_this.glyphs = {};
_this.horizAdvX = _this.getAttribute('horiz-adv-x').getNumber();
var definitions = document.definitions;
var _assertThisInitialize = _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_46___default()(_this),
children = _assertThisInitialize.children;
var _iterator = _createForOfIteratorHelper(children),
_step;
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var child = _step.value;
switch (child.type) {
case 'font-face':
{
_this.fontFace = child;
var fontFamilyStyle = child.getStyle('font-family');
if (fontFamilyStyle.hasValue()) {
definitions[fontFamilyStyle.getString()] = _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_46___default()(_this);
}
break;
}
case 'missing-glyph':
_this.missingGlyph = child;
break;
case 'glyph':
{
var glyph = child;
if (glyph.arabicForm) {
_this.isRTL = true;
_this.isArabic = true;
if (typeof _this.glyphs[glyph.unicode] === 'undefined') {
_this.glyphs[glyph.unicode] = {};
}
_this.glyphs[glyph.unicode][glyph.arabicForm] = glyph;
} else {
_this.glyphs[glyph.unicode] = glyph;
}
break;
}
default:
}
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
return _this;
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(FontElement, [{
key: "render",
value: function render() {// NO RENDER
}
}]);
return FontElement;
}(Element);
function _createSuper$s(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(Derived), result; if (_isNativeReflectConstruct$s()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30___default()(this, result); }; }
function _isNativeReflectConstruct$s() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var FontFaceElement = /*#__PURE__*/function (_Element) {
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_32___default()(FontFaceElement, _Element);
var _super = _createSuper$s(FontFaceElement);
function FontFaceElement(document, node, captureTextNodes) {
var _this;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, FontFaceElement);
_this = _super.call(this, document, node, captureTextNodes);
_this.type = 'font-face';
_this.ascent = _this.getAttribute('ascent').getNumber();
_this.descent = _this.getAttribute('descent').getNumber();
_this.unitsPerEm = _this.getAttribute('units-per-em').getNumber();
return _this;
}
return FontFaceElement;
}(Element);
function _createSuper$t(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(Derived), result; if (_isNativeReflectConstruct$t()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30___default()(this, result); }; }
function _isNativeReflectConstruct$t() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var MissingGlyphElement = /*#__PURE__*/function (_PathElement) {
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_32___default()(MissingGlyphElement, _PathElement);
var _super = _createSuper$t(MissingGlyphElement);
function MissingGlyphElement() {
var _this;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, MissingGlyphElement);
_this = _super.apply(this, arguments);
_this.type = 'missing-glyph';
_this.horizAdvX = 0;
return _this;
}
return MissingGlyphElement;
}(PathElement);
function _createSuper$u(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(Derived), result; if (_isNativeReflectConstruct$u()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30___default()(this, result); }; }
function _isNativeReflectConstruct$u() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var GlyphElement = /*#__PURE__*/function (_PathElement) {
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_32___default()(GlyphElement, _PathElement);
var _super = _createSuper$u(GlyphElement);
function GlyphElement(document, node, captureTextNodes) {
var _this;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, GlyphElement);
_this = _super.call(this, document, node, captureTextNodes);
_this.type = 'glyph';
_this.horizAdvX = _this.getAttribute('horiz-adv-x').getNumber();
_this.unicode = _this.getAttribute('unicode').getString();
_this.arabicForm = _this.getAttribute('arabic-form').getString();
return _this;
}
return GlyphElement;
}(PathElement);
function _createSuper$v(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(Derived), result; if (_isNativeReflectConstruct$v()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30___default()(this, result); }; }
function _isNativeReflectConstruct$v() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var TRefElement = /*#__PURE__*/function (_TextElement) {
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_32___default()(TRefElement, _TextElement);
var _super = _createSuper$v(TRefElement);
function TRefElement() {
var _this;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, TRefElement);
_this = _super.apply(this, arguments);
_this.type = 'tref';
return _this;
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(TRefElement, [{
key: "getText",
value: function getText() {
var element = this.getHrefAttribute().getDefinition();
if (element) {
var firstChild = element.children[0];
if (firstChild) {
return firstChild.getText();
}
}
return '';
}
}]);
return TRefElement;
}(TextElement);
function _createSuper$w(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(Derived), result; if (_isNativeReflectConstruct$w()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30___default()(this, result); }; }
function _isNativeReflectConstruct$w() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var AElement = /*#__PURE__*/function (_TextElement) {
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_32___default()(AElement, _TextElement);
var _super = _createSuper$w(AElement);
function AElement(document, node, captureTextNodes) {
var _this;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, AElement);
_this = _super.call(this, document, node, captureTextNodes);
_this.type = 'a';
var childNodes = node.childNodes;
var firstChild = childNodes[0];
var hasText = childNodes.length > 0 && Array.from(childNodes).every(function (node) {
return node.nodeType === 3;
});
_this.hasText = hasText;
_this.text = hasText ? _this.getTextFromNode(firstChild) : '';
return _this;
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(AElement, [{
key: "getText",
value: function getText() {
return this.text;
}
}, {
key: "renderChildren",
value: function renderChildren(ctx) {
if (this.hasText) {
// render as text element
_babel_runtime_helpers_get__WEBPACK_IMPORTED_MODULE_42___default()(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(AElement.prototype), "renderChildren", this).call(this, ctx);
var document = this.document,
x = this.x,
y = this.y;
var mouse = document.screen.mouse;
var fontSize = new Property(document, 'fontSize', Font.parse(document.ctx.font).fontSize); // Do not calc bounding box if mouse is not working.
if (mouse.isWorking()) {
mouse.checkBoundingBox(this, new BoundingBox(x, y - fontSize.getPixels('y'), x + this.measureText(ctx), y));
}
} else if (this.children.length > 0) {
// render as temporary group
var g = new GElement(this.document, null);
g.children = this.children;
g.parent = this;
g.render(ctx);
}
}
}, {
key: "onClick",
value: function onClick() {
var window = this.document.window;
if (window) {
window.open(this.getHrefAttribute().getString());
}
}
}, {
key: "onMouseMove",
value: function onMouseMove() {
var ctx = this.document.ctx;
ctx.canvas.style.cursor = 'pointer';
}
}]);
return AElement;
}(TextElement);
function _createForOfIteratorHelper$1(o) { if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (o = _unsupportedIterableToArray$1(o))) { var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var it, normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
function _unsupportedIterableToArray$1(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$1(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen); }
function _arrayLikeToArray$1(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
function _createSuper$x(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(Derived), result; if (_isNativeReflectConstruct$x()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30___default()(this, result); }; }
function _isNativeReflectConstruct$x() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var TextPathElement = /*#__PURE__*/function (_TextElement) {
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_32___default()(TextPathElement, _TextElement);
var _super = _createSuper$x(TextPathElement);
function TextPathElement(document, node, captureTextNodes) {
var _this;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, TextPathElement);
_this = _super.call(this, document, node, captureTextNodes);
_this.type = 'textPath';
_this.textWidth = 0;
_this.textHeight = 0;
_this.pathLength = -1;
_this.glyphInfo = null;
_this.letterSpacingCache = [];
_this.measuresCache = new Map([['', 0]]);
var pathElement = _this.getHrefAttribute().getDefinition();
_this.text = _this.getTextFromNode();
_this.dataArray = _this.parsePathData(pathElement);
return _this;
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(TextPathElement, [{
key: "getText",
value: function getText() {
return this.text;
}
}, {
key: "path",
value: function path(ctx) {
var dataArray = this.dataArray;
if (ctx) {
ctx.beginPath();
}
dataArray.forEach(function (_ref) {
var command = _ref.command,
points = _ref.points;
switch (command) {
case 'L':
if (ctx) {
ctx.lineTo(points[0], points[1]);
}
break;
case 'M':
if (ctx) {
ctx.moveTo(points[0], points[1]);
}
break;
case 'C':
if (ctx) {
ctx.bezierCurveTo(points[0], points[1], points[2], points[3], points[4], points[5]);
}
break;
case 'Q':
if (ctx) {
ctx.quadraticCurveTo(points[0], points[1], points[2], points[3]);
}
break;
case 'A':
{
var cx = points[0];
var cy = points[1];
var rx = points[2];
var ry = points[3];
var theta = points[4];
var dTheta = points[5];
var psi = points[6];
var fs = points[7];
var r = rx > ry ? rx : ry;
var scaleX = rx > ry ? 1 : rx / ry;
var scaleY = rx > ry ? ry / rx : 1;
if (ctx) {
ctx.translate(cx, cy);
ctx.rotate(psi);
ctx.scale(scaleX, scaleY);
ctx.arc(0, 0, r, theta, theta + dTheta, Boolean(1 - fs));
ctx.scale(1 / scaleX, 1 / scaleY);
ctx.rotate(-psi);
ctx.translate(-cx, -cy);
}
break;
}
case 'z':
if (ctx) {
ctx.closePath();
}
break;
}
});
}
}, {
key: "renderChildren",
value: function renderChildren(ctx) {
this.setTextData(ctx);
ctx.save();
var textDecoration = this.parent.getStyle('text-decoration').getString();
var fontSize = this.getFontSize();
var glyphInfo = this.glyphInfo;
var fill = ctx.fillStyle;
if (textDecoration === 'underline') {
ctx.beginPath();
}
glyphInfo.forEach(function (glyph, i) {
var p0 = glyph.p0,
p1 = glyph.p1,
partialText = glyph.text;
ctx.save();
ctx.translate(p0.x, p0.y);
ctx.rotate(glyphInfo[i].rotation);
if (ctx.fillStyle) {
ctx.fillText(partialText, 0, 0);
}
if (ctx.strokeStyle) {
ctx.strokeText(partialText, 0, 0);
}
ctx.restore();
if (textDecoration === 'underline') {
if (i === 0) {
ctx.moveTo(p0.x, p0.y + fontSize / 8);
}
ctx.lineTo(p1.x, p1.y + fontSize / 5);
} //// To assist with debugging visually, uncomment following
//
// ctx.beginPath();
// if (i % 2)
// ctx.strokeStyle = 'red';
// else
// ctx.strokeStyle = 'green';
// ctx.moveTo(p0.x, p0.y);
// ctx.lineTo(p1.x, p1.y);
// ctx.stroke();
// ctx.closePath();
});
if (textDecoration === 'underline') {
ctx.lineWidth = fontSize / 20;
ctx.strokeStyle = fill;
ctx.stroke();
ctx.closePath();
}
ctx.restore();
}
}, {
key: "getLetterSpacingAt",
value: function getLetterSpacingAt() {
var idx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
return this.letterSpacingCache[idx] || 0;
}
}, {
key: "findSegmentToFitChar",
value: function findSegmentToFitChar(ctx, anchor, textFullWidth, fullPathWidth, spacesNumber, inputOffset, c, charI) {
var offset = inputOffset;
var glyphWidth = this.measureText(ctx, c);
if (c === ' ' && anchor === 'justify' && textFullWidth < fullPathWidth) {
glyphWidth += (fullPathWidth - textFullWidth) / spacesNumber;
}
if (charI > -1) {
offset += this.getLetterSpacingAt(charI);
}
var splineStep = this.textHeight / 20;
var segment = {
p0: this.getEquidistantPointOnPath(offset, splineStep),
p1: this.getEquidistantPointOnPath(offset + glyphWidth, splineStep)
};
offset += glyphWidth;
return {
offset: offset,
segment: segment
};
}
}, {
key: "measureText",
value: function measureText(ctx, text) {
var measuresCache = this.measuresCache;
var targetText = text || this.getText();
if (measuresCache.has(targetText)) {
return measuresCache.get(targetText);
}
var measure = this.measureTargetText(ctx, targetText);
measuresCache.set(targetText, measure);
return measure;
} // This method supposes what all custom fonts already loaded.
// If some font will be loaded after this method call, <textPath> will not be rendered correctly.
// You need to call this method manually to update glyphs cache.
}, {
key: "setTextData",
value: function setTextData(ctx) {
var _this2 = this;
if (this.glyphInfo) {
return;
}
var renderText = this.getText();
var chars = renderText.split('');
var spacesNumber = renderText.split(' ').length - 1;
var dx = toNumbers(this.parent.getAttribute('dx').getString('0'));
var anchor = this.parent.getStyle('text-anchor').getString('start');
var thisSpacing = this.getStyle('letter-spacing');
var parentSpacing = this.parent.getStyle('letter-spacing');
var letterSpacing = 0;
if (!thisSpacing.hasValue() || thisSpacing.getValue() === 'inherit') {
letterSpacing = parentSpacing.getPixels();
} else if (thisSpacing.hasValue()) {
if (thisSpacing.getValue() !== 'initial' && thisSpacing.getValue() !== 'unset') {
letterSpacing = thisSpacing.getPixels();
}
} // fill letter-spacing cache
var letterSpacingCache = [];
var textLen = renderText.length;
this.letterSpacingCache = letterSpacingCache;
for (var i = 0; i < textLen; i++) {
letterSpacingCache.push(typeof dx[i] !== 'undefined' ? dx[i] : letterSpacing);
}
var dxSum = letterSpacingCache.reduce(function (acc, cur) {
return acc + cur || 0;
}, 0);
this.textWidth = this.measureText(ctx);
this.textHeight = this.getFontSize();
var textFullWidth = Math.max(this.textWidth + dxSum, 0);
this.glyphInfo = [];
var fullPathWidth = this.getPathLength();
var startOffset = this.getStyle('startOffset').getNumber(0) * fullPathWidth;
var offset = 0;
if (anchor === 'middle' || anchor === 'center') {
offset = -textFullWidth / 2;
}
if (anchor === 'end' || anchor === 'right') {
offset = -textFullWidth;
}
offset += startOffset;
chars.forEach(function (char, i) {
// Find such segment what distance between p0 and p1 is approx. width of glyph
var _this2$findSegmentToF = _this2.findSegmentToFitChar(ctx, anchor, textFullWidth, fullPathWidth, spacesNumber, offset, char, i),
nextOffset = _this2$findSegmentToF.offset,
segment = _this2$findSegmentToF.segment;
offset = nextOffset;
if (!segment.p0 || !segment.p1) {
return;
}
var width = _this2.getLineLength(segment.p0.x, segment.p0.y, segment.p1.x, segment.p1.y); // Note: Since glyphs are rendered one at a time, any kerning pair data built into the font will not be used.
// Can foresee having a rough pair table built in that the developer can override as needed.
// Or use "dx" attribute of the <text> node as a naive replacement
var kern = 0; // placeholder for future implementation
var midpoint = _this2.getPointOnLine(kern + width / 2.0, segment.p0.x, segment.p0.y, segment.p1.x, segment.p1.y);
var rotation = Math.atan2(segment.p1.y - segment.p0.y, segment.p1.x - segment.p0.x);
_this2.glyphInfo.push({
transposeX: midpoint.x,
transposeY: midpoint.y,
text: chars[i],
p0: segment.p0,
p1: segment.p1,
rotation: rotation
});
});
}
}, {
key: "parsePathData",
value: function parsePathData(path) {
this.pathLength = -1; // reset path length
if (!path) {
return [];
}
var pathCommands = [];
var pathParser = path.pathParser;
pathParser.reset(); // convert l, H, h, V, and v to L
while (!pathParser.isEnd()) {
var current = pathParser.current;
var startX = current ? current.x : 0;
var startY = current ? current.y : 0;
var cmd = '';
var points = [];
pathParser.nextCommand();
var upperCommand = pathParser.command.toUpperCase();
switch (pathParser.command) {
case 'M':
case 'm':
cmd = this.pathM(pathParser, points);
break;
case 'L':
case 'l':
cmd = this.pathL(pathParser, points);
break;
case 'H':
case 'h':
cmd = this.pathH(pathParser, points);
break;
case 'V':
case 'v':
cmd = this.pathV(pathParser, points);
break;
case 'C':
case 'c':
this.pathC(pathParser, points);
break;
case 'S':
case 's':
cmd = this.pathS(pathParser, points);
break;
case 'Q':
case 'q':
this.pathQ(pathParser, points);
break;
case 'T':
case 't':
cmd = this.pathT(pathParser, points);
break;
case 'A':
case 'a':
points = this.pathA(pathParser);
break;
case 'Z':
case 'z':
pathParser.current = pathParser.start;
break;
}
if (upperCommand !== 'Z') {
pathCommands.push({
command: cmd || upperCommand,
points: points,
start: {
x: startX,
y: startY
},
pathLength: this.calcLength(startX, startY, cmd || upperCommand, points)
});
} else {
pathCommands.push({
command: 'z',
points: [],
pathLength: 0
});
}
}
return pathCommands;
}
}, {
key: "pathM",
value: function pathM(pathParser, points) {
var p = pathParser.getAsCurrentPoint(); // pathParser.addMarker(p);
points.push(p.x, p.y);
pathParser.start = pathParser.current;
while (!pathParser.isCommandOrEnd()) {
var _p = pathParser.getAsCurrentPoint();
points.push(_p.x, _p.y);
return 'L';
}
}
}, {
key: "pathL",
value: function pathL(pathParser, points) {
while (!pathParser.isCommandOrEnd()) {
var p = pathParser.getAsCurrentPoint();
points.push(p.x, p.y);
}
return 'L';
}
}, {
key: "pathH",
value: function pathH(pathParser, points) {
while (!pathParser.isCommandOrEnd()) {
var current = pathParser.current;
var point = new Point((pathParser.isRelativeCommand() ? current.x : 0) + pathParser.getScalar(), current.y);
points.push(point.x, point.y);
pathParser.current = point;
}
return 'L';
}
}, {
key: "pathV",
value: function pathV(pathParser, points) {
while (!pathParser.isCommandOrEnd()) {
var current = pathParser.current;
var point = new Point(current.x, (pathParser.isRelativeCommand() ? current.y : 0) + pathParser.getScalar());
points.push(point.x, point.y);
pathParser.current = point;
}
return 'L';
}
}, {
key: "pathC",
value: function pathC(pathParser, points) {
while (!pathParser.isCommandOrEnd()) {
var point = pathParser.getPoint();
var controlPoint = pathParser.getAsControlPoint();
var currentPoint = pathParser.getAsCurrentPoint();
points.push(point.x, point.y, controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
}
}
}, {
key: "pathS",
value: function pathS(pathParser, points) {
while (!pathParser.isCommandOrEnd()) {
var point = pathParser.getReflectedControlPoint();
var controlPoint = pathParser.getAsControlPoint();
var currentPoint = pathParser.getAsCurrentPoint();
points.push(point.x, point.y, controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
}
return 'C';
}
}, {
key: "pathQ",
value: function pathQ(pathParser, points) {
while (!pathParser.isCommandOrEnd()) {
var controlPoint = pathParser.getAsControlPoint();
var currentPoint = pathParser.getAsCurrentPoint();
points.push(controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
}
}
}, {
key: "pathT",
value: function pathT(pathParser, points) {
while (!pathParser.isCommandOrEnd()) {
var controlPoint = pathParser.getReflectedControlPoint();
pathParser.control = controlPoint;
var currentPoint = pathParser.getAsCurrentPoint();
points.push(controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
}
return 'Q';
}
}, {
key: "pathA",
value: function pathA(pathParser) {
while (!pathParser.isCommandOrEnd()) {
var current = pathParser.current; // x1, y1
var rx = pathParser.getScalar();
var ry = pathParser.getScalar();
var xAxisRotation = pathParser.getScalar() * (Math.PI / 180.0); // φ
var largeArcFlag = pathParser.getScalar(); // fA
var sweepFlag = pathParser.getScalar(); // fS
var currentPoint = pathParser.getAsCurrentPoint(); // x2, y2
// Conversion from endpoint to center parameterization
// http://www.w3.org/TR/SVG11/implnote.html#ArcImplementationNotes
// x1', y1'
var currp = new Point(Math.cos(xAxisRotation) * (current.x - currentPoint.x) / 2.0 + Math.sin(xAxisRotation) * (current.y - currentPoint.y) / 2.0, -Math.sin(xAxisRotation) * (current.x - currentPoint.x) / 2.0 + Math.cos(xAxisRotation) * (current.y - currentPoint.y) / 2.0); // adjust radii
var l = Math.pow(currp.x, 2) / Math.pow(rx, 2) + Math.pow(currp.y, 2) / Math.pow(ry, 2);
if (l > 1) {
rx *= Math.sqrt(l);
ry *= Math.sqrt(l);
} // cx', cy'
var s = (largeArcFlag === sweepFlag ? -1 : 1) * Math.sqrt((Math.pow(rx, 2) * Math.pow(ry, 2) - Math.pow(rx, 2) * Math.pow(currp.y, 2) - Math.pow(ry, 2) * Math.pow(currp.x, 2)) / (Math.pow(rx, 2) * Math.pow(currp.y, 2) + Math.pow(ry, 2) * Math.pow(currp.x, 2)));
if (isNaN(s)) {
s = 0;
}
var cpp = new Point(s * rx * currp.y / ry, s * -ry * currp.x / rx); // cx, cy
var centp = new Point((current.x + currentPoint.x) / 2.0 + Math.cos(xAxisRotation) * cpp.x - Math.sin(xAxisRotation) * cpp.y, (current.y + currentPoint.y) / 2.0 + Math.sin(xAxisRotation) * cpp.x + Math.cos(xAxisRotation) * cpp.y); // initial angle
var a1 = vectorsAngle([1, 0], [(currp.x - cpp.x) / rx, (currp.y - cpp.y) / ry]); // θ1
// angle delta
var u = [(currp.x - cpp.x) / rx, (currp.y - cpp.y) / ry];
var v = [(-currp.x - cpp.x) / rx, (-currp.y - cpp.y) / ry];
var ad = vectorsAngle(u, v); // Δθ
if (vectorsRatio(u, v) <= -1) {
ad = Math.PI;
}
if (vectorsRatio(u, v) >= 1) {
ad = 0;
}
if (sweepFlag === 0 && ad > 0) {
ad = ad - 2 * Math.PI;
}
if (sweepFlag === 1 && ad < 0) {
ad = ad + 2 * Math.PI;
}
return [centp.x, centp.y, rx, ry, a1, ad, xAxisRotation, sweepFlag];
}
}
}, {
key: "calcLength",
value: function calcLength(x, y, cmd, points) {
var len = 0;
var p1 = null;
var p2 = null;
var t = 0;
switch (cmd) {
case 'L':
return this.getLineLength(x, y, points[0], points[1]);
case 'C':
// Approximates by breaking curve into 100 line segments
len = 0.0;
p1 = this.getPointOnCubicBezier(0, x, y, points[0], points[1], points[2], points[3], points[4], points[5]);
for (t = 0.01; t <= 1; t += 0.01) {
p2 = this.getPointOnCubicBezier(t, x, y, points[0], points[1], points[2], points[3], points[4], points[5]);
len += this.getLineLength(p1.x, p1.y, p2.x, p2.y);
p1 = p2;
}
return len;
case 'Q':
// Approximates by breaking curve into 100 line segments
len = 0.0;
p1 = this.getPointOnQuadraticBezier(0, x, y, points[0], points[1], points[2], points[3]);
for (t = 0.01; t <= 1; t += 0.01) {
p2 = this.getPointOnQuadraticBezier(t, x, y, points[0], points[1], points[2], points[3]);
len += this.getLineLength(p1.x, p1.y, p2.x, p2.y);
p1 = p2;
}
return len;
case 'A':
// Approximates by breaking curve into line segments
len = 0.0;
var start = points[4]; // 4 = theta
var dTheta = points[5]; // 5 = dTheta
var end = points[4] + dTheta;
var inc = Math.PI / 180.0; // 1 degree resolution
if (Math.abs(start - end) < inc) {
inc = Math.abs(start - end);
} // Note: for purpose of calculating arc length, not going to worry about rotating X-axis by angle psi
p1 = this.getPointOnEllipticalArc(points[0], points[1], points[2], points[3], start, 0);
if (dTheta < 0) {
// clockwise
for (t = start - inc; t > end; t -= inc) {
p2 = this.getPointOnEllipticalArc(points[0], points[1], points[2], points[3], t, 0);
len += this.getLineLength(p1.x, p1.y, p2.x, p2.y);
p1 = p2;
}
} else {
// counter-clockwise
for (t = start + inc; t < end; t += inc) {
p2 = this.getPointOnEllipticalArc(points[0], points[1], points[2], points[3], t, 0);
len += this.getLineLength(p1.x, p1.y, p2.x, p2.y);
p1 = p2;
}
}
p2 = this.getPointOnEllipticalArc(points[0], points[1], points[2], points[3], end, 0);
len += this.getLineLength(p1.x, p1.y, p2.x, p2.y);
return len;
}
return 0;
}
}, {
key: "getPointOnLine",
value: function getPointOnLine(dist, P1x, P1y, P2x, P2y) {
var fromX = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : P1x;
var fromY = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : P1y;
var m = (P2y - P1y) / (P2x - P1x + PSEUDO_ZERO);
var run = Math.sqrt(dist * dist / (1 + m * m));
if (P2x < P1x) {
run *= -1;
}
var rise = m * run;
var pt = null;
if (P2x === P1x) {
// vertical line
pt = {
x: fromX,
y: fromY + rise
};
} else if ((fromY - P1y) / (fromX - P1x + PSEUDO_ZERO) === m) {
pt = {
x: fromX + run,
y: fromY + rise
};
} else {
var ix = 0;
var iy = 0;
var len = this.getLineLength(P1x, P1y, P2x, P2y);
if (len < PSEUDO_ZERO) {
return null;
}
var u = (fromX - P1x) * (P2x - P1x) + (fromY - P1y) * (P2y - P1y);
u = u / (len * len);
ix = P1x + u * (P2x - P1x);
iy = P1y + u * (P2y - P1y);
var pRise = this.getLineLength(fromX, fromY, ix, iy);
var pRun = Math.sqrt(dist * dist - pRise * pRise);
run = Math.sqrt(pRun * pRun / (1 + m * m));
if (P2x < P1x) {
run *= -1;
}
rise = m * run;
pt = {
x: ix + run,
y: iy + rise
};
}
return pt;
}
}, {
key: "getPointOnPath",
value: function getPointOnPath(distance) {
var fullLen = this.getPathLength();
var cumulativePathLength = 0;
var p = null;
if (distance < -0.00005 || distance - 0.00005 > fullLen) {
return null;
}
var dataArray = this.dataArray;
var _iterator = _createForOfIteratorHelper$1(dataArray),
_step;
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var pathCmd = _step.value;
if (pathCmd && (pathCmd.pathLength < 0.00005 || cumulativePathLength + pathCmd.pathLength + 0.00005 < distance)) {
cumulativePathLength += pathCmd.pathLength;
continue;
}
var delta = distance - cumulativePathLength;
var currentT = 0;
switch (pathCmd.command) {
case 'L':
p = this.getPointOnLine(delta, pathCmd.start.x, pathCmd.start.y, pathCmd.points[0], pathCmd.points[1], pathCmd.start.x, pathCmd.start.y);
break;
case 'A':
var start = pathCmd.points[4]; // 4 = theta
var dTheta = pathCmd.points[5]; // 5 = dTheta
var end = pathCmd.points[4] + dTheta;
currentT = start + delta / pathCmd.pathLength * dTheta;
if (dTheta < 0 && currentT < end || dTheta >= 0 && currentT > end) {
break;
}
p = this.getPointOnEllipticalArc(pathCmd.points[0], pathCmd.points[1], pathCmd.points[2], pathCmd.points[3], currentT, pathCmd.points[6]);
break;
case 'C':
currentT = delta / pathCmd.pathLength;
if (currentT > 1) {
currentT = 1;
}
p = this.getPointOnCubicBezier(currentT, pathCmd.start.x, pathCmd.start.y, pathCmd.points[0], pathCmd.points[1], pathCmd.points[2], pathCmd.points[3], pathCmd.points[4], pathCmd.points[5]);
break;
case 'Q':
currentT = delta / pathCmd.pathLength;
if (currentT > 1) {
currentT = 1;
}
p = this.getPointOnQuadraticBezier(currentT, pathCmd.start.x, pathCmd.start.y, pathCmd.points[0], pathCmd.points[1], pathCmd.points[2], pathCmd.points[3]);
break;
default:
}
if (p) {
return p;
}
break;
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
return null;
}
}, {
key: "getLineLength",
value: function getLineLength(x1, y1, x2, y2) {
return Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
}
}, {
key: "getPathLength",
value: function getPathLength() {
if (this.pathLength === -1) {
this.pathLength = this.dataArray.reduce(function (length, command) {
return command.pathLength > 0 ? length + command.pathLength : length;
}, 0);
}
return this.pathLength;
}
}, {
key: "getPointOnCubicBezier",
value: function getPointOnCubicBezier(pct, P1x, P1y, P2x, P2y, P3x, P3y, P4x, P4y) {
var x = P4x * CB1(pct) + P3x * CB2(pct) + P2x * CB3(pct) + P1x * CB4(pct);
var y = P4y * CB1(pct) + P3y * CB2(pct) + P2y * CB3(pct) + P1y * CB4(pct);
return {
x: x,
y: y
};
}
}, {
key: "getPointOnQuadraticBezier",
value: function getPointOnQuadraticBezier(pct, P1x, P1y, P2x, P2y, P3x, P3y) {
var x = P3x * QB1(pct) + P2x * QB2(pct) + P1x * QB3(pct);
var y = P3y * QB1(pct) + P2y * QB2(pct) + P1y * QB3(pct);
return {
x: x,
y: y
};
}
}, {
key: "getPointOnEllipticalArc",
value: function getPointOnEllipticalArc(cx, cy, rx, ry, theta, psi) {
var cosPsi = Math.cos(psi);
var sinPsi = Math.sin(psi);
var pt = {
x: rx * Math.cos(theta),
y: ry * Math.sin(theta)
};
return {
x: cx + (pt.x * cosPsi - pt.y * sinPsi),
y: cy + (pt.x * sinPsi + pt.y * cosPsi)
};
} // TODO need some optimisations. possibly build cache only for curved segments?
}, {
key: "buildEquidistantCache",
value: function buildEquidistantCache(inputStep, inputPrecision) {
var fullLen = this.getPathLength();
var precision = inputPrecision || 0.25; // accuracy vs performance
var step = inputStep || fullLen / 100;
if (!this.equidistantCache || this.equidistantCache.step !== step || this.equidistantCache.precision !== precision) {
// Prepare cache
this.equidistantCache = {
step: step,
precision: precision,
points: []
}; // Calculate points
var s = 0;
for (var l = 0; l <= fullLen; l += precision) {
var p0 = this.getPointOnPath(l);
var p1 = this.getPointOnPath(l + precision);
if (!p0 || !p1) {
continue;
}
s += this.getLineLength(p0.x, p0.y, p1.x, p1.y);
if (s >= step) {
this.equidistantCache.points.push({
x: p0.x,
y: p0.y,
distance: l
});
s -= step;
}
}
}
}
}, {
key: "getEquidistantPointOnPath",
value: function getEquidistantPointOnPath(targetDistance, step, precision) {
this.buildEquidistantCache(step, precision);
if (targetDistance < 0 || targetDistance - this.getPathLength() > 0.00005) {
return null;
}
var idx = Math.round(targetDistance / this.getPathLength() * (this.equidistantCache.points.length - 1));
return this.equidistantCache.points[idx] || null;
}
}]);
return TextPathElement;
}(TextElement);
function _createSuper$y(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(Derived), result; if (_isNativeReflectConstruct$y()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30___default()(this, result); }; }
function _isNativeReflectConstruct$y() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var ImageElement = /*#__PURE__*/function (_RenderedElement) {
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_32___default()(ImageElement, _RenderedElement);
var _super = _createSuper$y(ImageElement);
function ImageElement(document, node, captureTextNodes) {
var _this;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, ImageElement);
_this = _super.call(this, document, node, captureTextNodes);
_this.type = 'image';
_this.loaded = false;
var href = _this.getHrefAttribute().getString();
if (!href) {
return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30___default()(_this);
}
var isSvg = /\.svg$/.test(href);
document.images.push(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_46___default()(_this));
if (!isSvg) {
_this.loadImage(href);
} else {
_this.loadSvg(href);
}
_this.isSvg = isSvg;
return _this;
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(ImageElement, [{
key: "loadImage",
value: function () {
var _loadImage = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_15___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_14___default.a.mark(function _callee(href) {
var image;
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_14___default.a.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
_context.prev = 0;
_context.next = 3;
return this.document.createImage(href);
case 3:
image = _context.sent;
this.image = image;
_context.next = 10;
break;
case 7:
_context.prev = 7;
_context.t0 = _context["catch"](0);
// tslint:disable-next-line: no-console
console.error("Error while loading image \"".concat(href, "\":"), _context.t0);
case 10:
this.loaded = true;
case 11:
case "end":
return _context.stop();
}
}
}, _callee, this, [[0, 7]]);
}));
function loadImage(_x) {
return _loadImage.apply(this, arguments);
}
return loadImage;
}()
}, {
key: "loadSvg",
value: function () {
var _loadSvg = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_15___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_14___default.a.mark(function _callee2(href) {
var response, svg;
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_14___default.a.wrap(function _callee2$(_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
case 0:
_context2.prev = 0;
_context2.next = 3;
return this.document.fetch(href);
case 3:
response = _context2.sent;
_context2.next = 6;
return response.text();
case 6:
svg = _context2.sent;
this.image = svg;
_context2.next = 13;
break;
case 10:
_context2.prev = 10;
_context2.t0 = _context2["catch"](0);
// tslint:disable-next-line: no-console
console.error("Error while loading image \"".concat(href, "\":"), _context2.t0);
case 13:
this.loaded = true;
case 14:
case "end":
return _context2.stop();
}
}
}, _callee2, this, [[0, 10]]);
}));
function loadSvg(_x2) {
return _loadSvg.apply(this, arguments);
}
return loadSvg;
}()
}, {
key: "renderChildren",
value: function renderChildren(ctx) {
var document = this.document,
image = this.image,
loaded = this.loaded;
var x = this.getAttribute('x').getPixels('x');
var y = this.getAttribute('y').getPixels('y');
var width = this.getStyle('width').getPixels('x');
var height = this.getStyle('height').getPixels('y');
if (!loaded || !image || !width || !height) {
return;
}
ctx.save();
if (this.isSvg) {
document.canvg.forkString(ctx, this.image, {
ignoreMouse: true,
ignoreAnimation: true,
ignoreDimensions: true,
ignoreClear: true,
offsetX: x,
offsetY: y,
scaleWidth: width,
scaleHeight: height
}).render();
} else {
var _image = this.image;
ctx.translate(x, y);
document.setViewBox({
ctx: ctx,
aspectRatio: this.getAttribute('preserveAspectRatio').getString(),
width: width,
desiredWidth: _image.width,
height: height,
desiredHeight: _image.height
});
if (this.loaded) {
if (typeof _image.complete === 'undefined' || _image.complete) {
ctx.drawImage(_image, 0, 0);
}
}
}
ctx.restore();
}
}, {
key: "getBoundingBox",
value: function getBoundingBox() {
var x = this.getAttribute('x').getPixels('x');
var y = this.getAttribute('y').getPixels('y');
var width = this.getStyle('width').getPixels('x');
var height = this.getStyle('height').getPixels('y');
return new BoundingBox(x, y, x + width, y + height);
}
}]);
return ImageElement;
}(RenderedElement);
function _createSuper$z(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(Derived), result; if (_isNativeReflectConstruct$z()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30___default()(this, result); }; }
function _isNativeReflectConstruct$z() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var SymbolElement = /*#__PURE__*/function (_RenderedElement) {
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_32___default()(SymbolElement, _RenderedElement);
var _super = _createSuper$z(SymbolElement);
function SymbolElement() {
var _this;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, SymbolElement);
_this = _super.apply(this, arguments);
_this.type = 'symbol';
return _this;
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(SymbolElement, [{
key: "render",
value: function render(_) {// NO RENDER
}
}]);
return SymbolElement;
}(RenderedElement);
var SVGFontLoader = /*#__PURE__*/function () {
function SVGFontLoader(document) {
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, SVGFontLoader);
this.document = document;
this.loaded = false;
document.fonts.push(this);
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(SVGFontLoader, [{
key: "load",
value: function () {
var _load = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_15___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_14___default.a.mark(function _callee(fontFamily, url) {
var document, svgDocument, fonts;
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_14___default.a.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
_context.prev = 0;
document = this.document;
_context.next = 4;
return document.canvg.parser.load(url);
case 4:
svgDocument = _context.sent;
fonts = svgDocument.getElementsByTagName('font');
Array.from(fonts).forEach(function (fontNode) {
var font = document.createElement(fontNode);
document.definitions[fontFamily] = font;
});
_context.next = 12;
break;
case 9:
_context.prev = 9;
_context.t0 = _context["catch"](0);
// tslint:disable-next-line: no-console
console.error("Error while loading font \"".concat(url, "\":"), _context.t0);
case 12:
this.loaded = true;
case 13:
case "end":
return _context.stop();
}
}
}, _callee, this, [[0, 9]]);
}));
function load(_x, _x2) {
return _load.apply(this, arguments);
}
return load;
}()
}]);
return SVGFontLoader;
}();
function _createSuper$A(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(Derived), result; if (_isNativeReflectConstruct$A()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30___default()(this, result); }; }
function _isNativeReflectConstruct$A() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var StyleElement = /*#__PURE__*/function (_Element) {
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_32___default()(StyleElement, _Element);
var _super = _createSuper$A(StyleElement);
function StyleElement(document, node, captureTextNodes) {
var _this;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, StyleElement);
_this = _super.call(this, document, node, captureTextNodes);
_this.type = 'style';
var css = compressSpaces(Array.from(node.childNodes).map(function (_) {
return _.data;
}).join('').replace(/(\/\*([^*]|[\r\n]|(\*+([^*\/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm, '') // remove comments
.replace(/@import.*;/g, '') // remove imports
);
var cssDefs = css.split('}');
cssDefs.forEach(function (_) {
var def = _.trim();
if (!def) {
return;
}
var cssParts = def.split('{');
var cssClasses = cssParts[0].split(',');
var cssProps = cssParts[1].split(';');
cssClasses.forEach(function (_) {
var cssClass = _.trim();
if (!cssClass) {
return;
}
var props = document.styles[cssClass] || {};
cssProps.forEach(function (cssProp) {
var prop = cssProp.indexOf(':');
var name = cssProp.substr(0, prop).trim();
var value = cssProp.substr(prop + 1, cssProp.length - prop).trim();
if (name && value) {
props[name] = new Property(document, name, value);
}
});
document.styles[cssClass] = props;
document.stylesSpecificity[cssClass] = getSelectorSpecificity(cssClass);
if (cssClass === '@font-face') {
// && !nodeEnv
var fontFamily = props['font-family'].getString().replace(/"|'/g, '');
var srcs = props.src.getString().split(',');
srcs.forEach(function (src) {
if (src.indexOf('format("svg")') > 0) {
var url = parseExternalUrl(src);
if (url) {
new SVGFontLoader(document).load(fontFamily, url);
}
}
});
}
});
});
return _this;
}
return StyleElement;
}(Element);
StyleElement.parseExternalUrl = parseExternalUrl;
function _createSuper$B(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(Derived), result; if (_isNativeReflectConstruct$B()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30___default()(this, result); }; }
function _isNativeReflectConstruct$B() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var UseElement = /*#__PURE__*/function (_RenderedElement) {
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_32___default()(UseElement, _RenderedElement);
var _super = _createSuper$B(UseElement);
function UseElement() {
var _this;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, UseElement);
_this = _super.apply(this, arguments);
_this.type = 'use';
return _this;
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(UseElement, [{
key: "setContext",
value: function setContext(ctx) {
_babel_runtime_helpers_get__WEBPACK_IMPORTED_MODULE_42___default()(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(UseElement.prototype), "setContext", this).call(this, ctx);
var xAttr = this.getAttribute('x');
var yAttr = this.getAttribute('y');
if (xAttr.hasValue()) {
ctx.translate(xAttr.getPixels('x'), 0);
}
if (yAttr.hasValue()) {
ctx.translate(0, yAttr.getPixels('y'));
}
}
}, {
key: "path",
value: function path(ctx) {
var element = this.element;
if (element) {
element.path(ctx);
}
}
}, {
key: "renderChildren",
value: function renderChildren(ctx) {
var document = this.document,
element = this.element;
if (element) {
var tempSvg = element;
if (element.type === 'symbol') {
// render me using a temporary svg element in symbol cases (http://www.w3.org/TR/SVG/struct.html#UseElement)
tempSvg = new SVGElement(document, null);
tempSvg.attributes.viewBox = new Property(document, 'viewBox', element.getAttribute('viewBox').getString());
tempSvg.attributes.preserveAspectRatio = new Property(document, 'preserveAspectRatio', element.getAttribute('preserveAspectRatio').getString());
tempSvg.attributes.overflow = new Property(document, 'overflow', element.getAttribute('overflow').getString());
tempSvg.children = element.children;
}
if (tempSvg.type === 'svg') {
var widthStyle = this.getStyle('width', false, true);
var heightStyle = this.getStyle('height', false, true); // if symbol or svg, inherit width/height from me
if (widthStyle.hasValue()) {
tempSvg.attributes.width = new Property(document, 'width', widthStyle.getString());
}
if (heightStyle.hasValue()) {
tempSvg.attributes.height = new Property(document, 'height', heightStyle.getString());
}
}
var oldParent = tempSvg.parent;
tempSvg.parent = this;
tempSvg.render(ctx);
tempSvg.parent = oldParent;
}
}
}, {
key: "getBoundingBox",
value: function getBoundingBox(ctx) {
var element = this.element;
if (element) {
return element.getBoundingBox(ctx);
}
return null;
}
}, {
key: "elementTransform",
value: function elementTransform() {
var document = this.document,
element = this.element;
return Transform.fromElement(document, element);
}
}, {
key: "element",
get: function get() {
if (!this._element) {
this._element = this.getHrefAttribute().getDefinition();
}
return this._element;
}
}]);
return UseElement;
}(RenderedElement);
function _createSuper$C(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(Derived), result; if (_isNativeReflectConstruct$C()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30___default()(this, result); }; }
function _isNativeReflectConstruct$C() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
function imGet(img, x, y, width, _, rgba) {
return img[y * width * 4 + x * 4 + rgba];
}
function imSet(img, x, y, width, _, rgba, val) {
img[y * width * 4 + x * 4 + rgba] = val;
}
function m(matrix, i, v) {
var mi = matrix[i];
return mi * (mi < 0 ? v - 255 : v);
}
function c(a, m1, m2, m3) {
return m1 + Math.cos(a) * m2 + Math.sin(a) * m3;
}
var FeColorMatrixElement = /*#__PURE__*/function (_Element) {
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_32___default()(FeColorMatrixElement, _Element);
var _super = _createSuper$C(FeColorMatrixElement);
function FeColorMatrixElement(document, node, captureTextNodes) {
var _this;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, FeColorMatrixElement);
_this = _super.call(this, document, node, captureTextNodes);
_this.type = 'feColorMatrix';
var matrix = toNumbers(_this.getAttribute('values').getString());
switch (_this.getAttribute('type').getString('matrix')) {
// http://www.w3.org/TR/SVG/filters.html#feColorMatrixElement
case 'saturate':
{
var s = matrix[0];
matrix = [0.213 + 0.787 * s, 0.715 - 0.715 * s, 0.072 - 0.072 * s, 0, 0, 0.213 - 0.213 * s, 0.715 + 0.285 * s, 0.072 - 0.072 * s, 0, 0, 0.213 - 0.213 * s, 0.715 - 0.715 * s, 0.072 + 0.928 * s, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1];
break;
}
case 'hueRotate':
{
var a = matrix[0] * Math.PI / 180.0;
matrix = [c(a, 0.213, 0.787, -0.213), c(a, 0.715, -0.715, -0.715), c(a, 0.072, -0.072, 0.928), 0, 0, c(a, 0.213, -0.213, 0.143), c(a, 0.715, 0.285, 0.140), c(a, 0.072, -0.072, -0.283), 0, 0, c(a, 0.213, -0.213, -0.787), c(a, 0.715, -0.715, 0.715), c(a, 0.072, 0.928, 0.072), 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1];
break;
}
case 'luminanceToAlpha':
matrix = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2125, 0.7154, 0.0721, 0, 0, 0, 0, 0, 0, 1];
break;
}
_this.matrix = matrix;
_this.includeOpacity = _this.getAttribute('includeOpacity').hasValue();
return _this;
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(FeColorMatrixElement, [{
key: "apply",
value: function apply(ctx, _, __, width, height) {
// assuming x==0 && y==0 for now
var includeOpacity = this.includeOpacity,
matrix = this.matrix;
var srcData = ctx.getImageData(0, 0, width, height);
for (var y = 0; y < height; y++) {
for (var x = 0; x < width; x++) {
var r = imGet(srcData.data, x, y, width, height, 0);
var g = imGet(srcData.data, x, y, width, height, 1);
var b = imGet(srcData.data, x, y, width, height, 2);
var a = imGet(srcData.data, x, y, width, height, 3);
var nr = m(matrix, 0, r) + m(matrix, 1, g) + m(matrix, 2, b) + m(matrix, 3, a) + m(matrix, 4, 1);
var ng = m(matrix, 5, r) + m(matrix, 6, g) + m(matrix, 7, b) + m(matrix, 8, a) + m(matrix, 9, 1);
var nb = m(matrix, 10, r) + m(matrix, 11, g) + m(matrix, 12, b) + m(matrix, 13, a) + m(matrix, 14, 1);
var na = m(matrix, 15, r) + m(matrix, 16, g) + m(matrix, 17, b) + m(matrix, 18, a) + m(matrix, 19, 1);
if (includeOpacity) {
nr = ng = nb = 0;
na *= a / 255;
}
imSet(srcData.data, x, y, width, height, 0, nr);
imSet(srcData.data, x, y, width, height, 1, ng);
imSet(srcData.data, x, y, width, height, 2, nb);
imSet(srcData.data, x, y, width, height, 3, na);
}
}
ctx.clearRect(0, 0, width, height);
ctx.putImageData(srcData, 0, 0);
}
}]);
return FeColorMatrixElement;
}(Element);
function _createSuper$D(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(Derived), result; if (_isNativeReflectConstruct$D()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30___default()(this, result); }; }
function _isNativeReflectConstruct$D() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var MaskElement = /*#__PURE__*/function (_Element) {
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_32___default()(MaskElement, _Element);
var _super = _createSuper$D(MaskElement);
function MaskElement() {
var _this;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, MaskElement);
_this = _super.apply(this, arguments);
_this.type = 'mask';
return _this;
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(MaskElement, [{
key: "apply",
value: function apply(ctx, element) {
var document = this.document; // render as temp svg
var x = this.getAttribute('x').getPixels('x');
var y = this.getAttribute('y').getPixels('y');
var width = this.getStyle('width').getPixels('x');
var height = this.getStyle('height').getPixels('y');
if (!width && !height) {
var boundingBox = new BoundingBox();
this.children.forEach(function (child) {
boundingBox.addBoundingBox(child.getBoundingBox(ctx));
});
x = Math.floor(boundingBox.x1);
y = Math.floor(boundingBox.y1);
width = Math.floor(boundingBox.width);
height = Math.floor(boundingBox.height);
}
var ignoredStyles = this.removeStyles(element, MaskElement.ignoreStyles);
var maskCanvas = document.createCanvas(x + width, y + height);
var maskCtx = maskCanvas.getContext('2d');
document.screen.setDefaults(maskCtx);
this.renderChildren(maskCtx); // convert mask to alpha with a fake node
// TODO: refactor out apply from feColorMatrix
new FeColorMatrixElement(document, {
nodeType: 1,
childNodes: [],
attributes: [{
nodeName: 'type',
value: 'luminanceToAlpha'
}, {
nodeName: 'includeOpacity',
value: 'true'
}]
}).apply(maskCtx, 0, 0, x + width, y + height);
var tmpCanvas = document.createCanvas(x + width, y + height);
var tmpCtx = tmpCanvas.getContext('2d');
document.screen.setDefaults(tmpCtx);
element.render(tmpCtx);
tmpCtx.globalCompositeOperation = 'destination-in';
tmpCtx.fillStyle = maskCtx.createPattern(maskCanvas, 'no-repeat');
tmpCtx.fillRect(0, 0, x + width, y + height);
ctx.fillStyle = tmpCtx.createPattern(tmpCanvas, 'no-repeat');
ctx.fillRect(0, 0, x + width, y + height); // reassign mask
this.restoreStyles(element, ignoredStyles);
}
}, {
key: "render",
value: function render(_) {// NO RENDER
}
}]);
return MaskElement;
}(Element);
MaskElement.ignoreStyles = ['mask', 'transform', 'clip-path'];
function _createSuper$E(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(Derived), result; if (_isNativeReflectConstruct$E()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30___default()(this, result); }; }
function _isNativeReflectConstruct$E() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var noop = function noop() {};
var ClipPathElement = /*#__PURE__*/function (_Element) {
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_32___default()(ClipPathElement, _Element);
var _super = _createSuper$E(ClipPathElement);
function ClipPathElement() {
var _this;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, ClipPathElement);
_this = _super.apply(this, arguments);
_this.type = 'clipPath';
return _this;
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(ClipPathElement, [{
key: "apply",
value: function apply(ctx) {
var document = this.document;
var contextProto = Reflect.getPrototypeOf(ctx);
var beginPath = ctx.beginPath,
closePath = ctx.closePath;
if (contextProto) {
contextProto.beginPath = noop;
contextProto.closePath = noop;
}
Reflect.apply(beginPath, ctx, []);
this.children.forEach(function (child) {
if (typeof child.path === 'undefined') {
return;
}
var transform = typeof child.elementTransform !== 'undefined' ? child.elementTransform() : null; // handle <use />
if (!transform) {
transform = Transform.fromElement(document, child);
}
if (transform) {
transform.apply(ctx);
}
child.path(ctx);
if (contextProto) {
contextProto.closePath = closePath;
}
if (transform) {
transform.unapply(ctx);
}
});
Reflect.apply(closePath, ctx, []);
ctx.clip();
if (contextProto) {
contextProto.beginPath = beginPath;
contextProto.closePath = closePath;
}
}
}, {
key: "render",
value: function render(_) {// NO RENDER
}
}]);
return ClipPathElement;
}(Element);
function _createSuper$F(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(Derived), result; if (_isNativeReflectConstruct$F()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30___default()(this, result); }; }
function _isNativeReflectConstruct$F() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var FilterElement = /*#__PURE__*/function (_Element) {
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_32___default()(FilterElement, _Element);
var _super = _createSuper$F(FilterElement);
function FilterElement() {
var _this;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, FilterElement);
_this = _super.apply(this, arguments);
_this.type = 'filter';
return _this;
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(FilterElement, [{
key: "apply",
value: function apply(ctx, element) {
// render as temp svg
var document = this.document,
children = this.children;
var boundingBox = element.getBoundingBox(ctx);
if (!boundingBox) {
return;
}
var px = 0;
var py = 0;
children.forEach(function (child) {
var efd = child.extraFilterDistance || 0;
px = Math.max(px, efd);
py = Math.max(py, efd);
});
var width = Math.floor(boundingBox.width);
var height = Math.floor(boundingBox.height);
var tmpCanvasWidth = width + 2 * px;
var tmpCanvasHeight = height + 2 * py;
if (tmpCanvasWidth < 1 || tmpCanvasHeight < 1) {
return;
}
var x = Math.floor(boundingBox.x);
var y = Math.floor(boundingBox.y);
var ignoredStyles = this.removeStyles(element, FilterElement.ignoreStyles);
var tmpCanvas = document.createCanvas(tmpCanvasWidth, tmpCanvasHeight);
var tmpCtx = tmpCanvas.getContext('2d');
document.screen.setDefaults(tmpCtx);
tmpCtx.translate(-x + px, -y + py);
element.render(tmpCtx); // apply filters
children.forEach(function (child) {
if (typeof child.apply === 'function') {
child.apply(tmpCtx, 0, 0, tmpCanvasWidth, tmpCanvasHeight);
}
}); // render on me
ctx.drawImage(tmpCanvas, 0, 0, tmpCanvasWidth, tmpCanvasHeight, x - px, y - py, tmpCanvasWidth, tmpCanvasHeight);
this.restoreStyles(element, ignoredStyles);
}
}, {
key: "render",
value: function render(_) {// NO RENDER
}
}]);
return FilterElement;
}(Element);
FilterElement.ignoreStyles = ['filter', 'transform', 'clip-path'];
function _createSuper$G(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(Derived), result; if (_isNativeReflectConstruct$G()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30___default()(this, result); }; }
function _isNativeReflectConstruct$G() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var FeDropShadowElement = /*#__PURE__*/function (_Element) {
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_32___default()(FeDropShadowElement, _Element);
var _super = _createSuper$G(FeDropShadowElement);
function FeDropShadowElement(document, node, captureTextNodes) {
var _this;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, FeDropShadowElement);
_this = _super.call(this, document, node, captureTextNodes);
_this.type = 'feDropShadow';
_this.addStylesFromStyleDefinition();
return _this;
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(FeDropShadowElement, [{
key: "apply",
value: function apply(_, __, ___, ____, _____) {// TODO: implement
}
}]);
return FeDropShadowElement;
}(Element);
function _createSuper$H(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(Derived), result; if (_isNativeReflectConstruct$H()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30___default()(this, result); }; }
function _isNativeReflectConstruct$H() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var FeMorphologyElement = /*#__PURE__*/function (_Element) {
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_32___default()(FeMorphologyElement, _Element);
var _super = _createSuper$H(FeMorphologyElement);
function FeMorphologyElement() {
var _this;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, FeMorphologyElement);
_this = _super.apply(this, arguments);
_this.type = 'feMorphology';
return _this;
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(FeMorphologyElement, [{
key: "apply",
value: function apply(_, __, ___, ____, _____) {// TODO: implement
}
}]);
return FeMorphologyElement;
}(Element);
function _createSuper$I(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(Derived), result; if (_isNativeReflectConstruct$I()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30___default()(this, result); }; }
function _isNativeReflectConstruct$I() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var FeCompositeElement = /*#__PURE__*/function (_Element) {
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_32___default()(FeCompositeElement, _Element);
var _super = _createSuper$I(FeCompositeElement);
function FeCompositeElement() {
var _this;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, FeCompositeElement);
_this = _super.apply(this, arguments);
_this.type = 'feComposite';
return _this;
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(FeCompositeElement, [{
key: "apply",
value: function apply(_, __, ___, ____, _____) {// TODO: implement
}
}]);
return FeCompositeElement;
}(Element);
function _createSuper$J(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(Derived), result; if (_isNativeReflectConstruct$J()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30___default()(this, result); }; }
function _isNativeReflectConstruct$J() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var FeGaussianBlurElement = /*#__PURE__*/function (_Element) {
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_32___default()(FeGaussianBlurElement, _Element);
var _super = _createSuper$J(FeGaussianBlurElement);
function FeGaussianBlurElement(document, node, captureTextNodes) {
var _this;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, FeGaussianBlurElement);
_this = _super.call(this, document, node, captureTextNodes);
_this.type = 'feGaussianBlur';
_this.blurRadius = Math.floor(_this.getAttribute('stdDeviation').getNumber());
_this.extraFilterDistance = _this.blurRadius;
return _this;
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(FeGaussianBlurElement, [{
key: "apply",
value: function apply(ctx, x, y, width, height) {
var document = this.document,
blurRadius = this.blurRadius;
var body = document.window ? document.window.document.body : null;
var canvas = ctx.canvas; // StackBlur requires canvas be on document
canvas.id = document.getUniqueId();
if (body) {
canvas.style.display = 'none';
body.appendChild(canvas);
}
Object(stackblur_canvas__WEBPACK_IMPORTED_MODULE_55__["canvasRGBA"])(canvas, x, y, width, height, blurRadius);
if (body) {
body.removeChild(canvas);
}
}
}]);
return FeGaussianBlurElement;
}(Element);
function _createSuper$K(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(Derived), result; if (_isNativeReflectConstruct$K()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30___default()(this, result); }; }
function _isNativeReflectConstruct$K() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var TitleElement = /*#__PURE__*/function (_Element) {
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_32___default()(TitleElement, _Element);
var _super = _createSuper$K(TitleElement);
function TitleElement() {
var _this;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, TitleElement);
_this = _super.apply(this, arguments);
_this.type = 'title';
return _this;
}
return TitleElement;
}(Element);
function _createSuper$L(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(Derived), result; if (_isNativeReflectConstruct$L()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_31___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_30___default()(this, result); }; }
function _isNativeReflectConstruct$L() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var DescElement = /*#__PURE__*/function (_Element) {
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_32___default()(DescElement, _Element);
var _super = _createSuper$L(DescElement);
function DescElement() {
var _this;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, DescElement);
_this = _super.apply(this, arguments);
_this.type = 'desc';
return _this;
}
return DescElement;
}(Element);
var elementTypes = {
'svg': SVGElement,
'rect': RectElement,
'circle': CircleElement,
'ellipse': EllipseElement,
'line': LineElement,
'polyline': PolylineElement,
'polygon': PolygonElement,
'path': PathElement,
'pattern': PatternElement,
'marker': MarkerElement,
'defs': DefsElement,
'linearGradient': LinearGradientElement,
'radialGradient': RadialGradientElement,
'stop': StopElement,
'animate': AnimateElement,
'animateColor': AnimateColorElement,
'animateTransform': AnimateTransformElement,
'font': FontElement,
'font-face': FontFaceElement,
'missing-glyph': MissingGlyphElement,
'glyph': GlyphElement,
'text': TextElement,
'tspan': TSpanElement,
'tref': TRefElement,
'a': AElement,
'textPath': TextPathElement,
'image': ImageElement,
'g': GElement,
'symbol': SymbolElement,
'style': StyleElement,
'use': UseElement,
'mask': MaskElement,
'clipPath': ClipPathElement,
'filter': FilterElement,
'feDropShadow': FeDropShadowElement,
'feMorphology': FeMorphologyElement,
'feComposite': FeCompositeElement,
'feColorMatrix': FeColorMatrixElement,
'feGaussianBlur': FeGaussianBlurElement,
'title': TitleElement,
'desc': DescElement
};
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_16___default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function createCanvas(width, height) {
var canvas = document.createElement('canvas');
canvas.width = width;
canvas.height = height;
return canvas;
}
function createImage(_x) {
return _createImage.apply(this, arguments);
}
function _createImage() {
_createImage = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_15___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_14___default.a.mark(function _callee(src) {
var anonymousCrossOrigin,
image,
_args = arguments;
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_14___default.a.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
anonymousCrossOrigin = _args.length > 1 && _args[1] !== undefined ? _args[1] : false;
image = document.createElement('img');
if (anonymousCrossOrigin) {
image.crossOrigin = 'Anonymous';
}
return _context.abrupt("return", new Promise(function (resolve, reject) {
image.onload = function () {
resolve(image);
};
image.onerror = function () {
reject();
};
image.src = src;
}));
case 4:
case "end":
return _context.stop();
}
}
}, _callee);
}));
return _createImage.apply(this, arguments);
}
var Document = /*#__PURE__*/function () {
function Document(canvg) {
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
_ref$rootEmSize = _ref.rootEmSize,
rootEmSize = _ref$rootEmSize === void 0 ? 12 : _ref$rootEmSize,
_ref$emSize = _ref.emSize,
emSize = _ref$emSize === void 0 ? 12 : _ref$emSize,
_ref$createCanvas = _ref.createCanvas,
createCanvas = _ref$createCanvas === void 0 ? Document.createCanvas : _ref$createCanvas,
_ref$createImage = _ref.createImage,
createImage = _ref$createImage === void 0 ? Document.createImage : _ref$createImage,
anonymousCrossOrigin = _ref.anonymousCrossOrigin;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, Document);
this.canvg = canvg;
this.definitions = {};
this.styles = {};
this.stylesSpecificity = {};
this.images = [];
this.fonts = [];
this.emSizeStack = [];
this.uniqueId = 0;
this.screen = canvg.screen;
this.rootEmSize = rootEmSize;
this.emSize = emSize;
this.createCanvas = createCanvas;
this.createImage = this.bindCreateImage(createImage, anonymousCrossOrigin);
this.screen.wait(this.isImagesLoaded.bind(this));
this.screen.wait(this.isFontsLoaded.bind(this));
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(Document, [{
key: "bindCreateImage",
value: function bindCreateImage(createImage, anonymousCrossOrigin) {
if (typeof anonymousCrossOrigin === 'boolean') {
return function (source, forceAnonymousCrossOrigin) {
return createImage(source, typeof forceAnonymousCrossOrigin === 'boolean' ? forceAnonymousCrossOrigin : anonymousCrossOrigin);
};
}
return createImage;
}
}, {
key: "popEmSize",
value: function popEmSize() {
var emSizeStack = this.emSizeStack;
emSizeStack.pop();
}
}, {
key: "getUniqueId",
value: function getUniqueId() {
return "canvg".concat(++this.uniqueId);
}
}, {
key: "isImagesLoaded",
value: function isImagesLoaded() {
return this.images.every(function (_) {
return _.loaded;
});
}
}, {
key: "isFontsLoaded",
value: function isFontsLoaded() {
return this.fonts.every(function (_) {
return _.loaded;
});
}
}, {
key: "createDocumentElement",
value: function createDocumentElement(document) {
var documentElement = this.createElement(document.documentElement);
documentElement.root = true;
documentElement.addStylesFromStyleDefinition();
this.documentElement = documentElement;
return documentElement;
}
}, {
key: "createElement",
value: function createElement(node) {
var elementType = node.nodeName.replace(/^[^:]+:/, '');
var ElementType = Document.elementTypes[elementType];
if (typeof ElementType !== 'undefined') {
return new ElementType(this, node);
}
return new UnknownElement(this, node);
}
}, {
key: "createTextNode",
value: function createTextNode(node) {
return new TextNode(this, node);
}
}, {
key: "setViewBox",
value: function setViewBox(config) {
this.screen.setViewBox(_objectSpread({
document: this
}, config));
}
}, {
key: "window",
get: function get() {
return this.screen.window;
}
}, {
key: "fetch",
get: function get() {
return this.screen.fetch;
}
}, {
key: "ctx",
get: function get() {
return this.screen.ctx;
}
}, {
key: "emSize",
get: function get() {
var emSizeStack = this.emSizeStack;
return emSizeStack[emSizeStack.length - 1];
},
set: function set(value) {
var emSizeStack = this.emSizeStack;
emSizeStack.push(value);
}
}]);
return Document;
}();
Document.createCanvas = createCanvas;
Document.createImage = createImage;
Document.elementTypes = elementTypes;
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$1(Object(source), true).forEach(function (key) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_16___default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
/**
* SVG renderer on canvas.
*/
var Canvg = /*#__PURE__*/function () {
/**
* Main constructor.
* @param ctx - Rendering context.
* @param svg - SVG Document.
* @param options - Rendering options.
*/
function Canvg(ctx, svg) {
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_17___default()(this, Canvg);
this.parser = new Parser(options);
this.screen = new Screen(ctx, options);
this.options = options;
var document = new Document(this, options);
var documentElement = document.createDocumentElement(svg);
this.document = document;
this.documentElement = documentElement;
}
/**
* Create Canvg isntance from SVG source string or URL.
* @param ctx - Rendering context.
* @param svg - SVG source string or URL.
* @param options - Rendering options.
*/
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_18___default()(Canvg, [{
key: "fork",
/**
* Create new Canvg instance with inherited options.
* @param ctx - Rendering context.
* @param svg - SVG source string or URL.
* @param options - Rendering options.
*/
value: function fork(ctx, svg) {
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
return Canvg.from(ctx, svg, _objectSpread$1({}, this.options, {}, options));
}
/**
* Create new Canvg instance with inherited options.
* @param ctx - Rendering context.
* @param svg - SVG source string.
* @param options - Rendering options.
*/
}, {
key: "forkString",
value: function forkString(ctx, svg) {
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
return Canvg.fromString(ctx, svg, _objectSpread$1({}, this.options, {}, options));
}
/**
* Document is ready promise.
*/
}, {
key: "ready",
value: function ready() {
return this.screen.ready();
}
/**
* Document is ready value.
*/
}, {
key: "isReady",
value: function isReady() {
return this.screen.isReady();
}
/**
* Render only first frame, ignoring animations and mouse.
* @param options - Rendering options.
*/
}, {
key: "render",
value: function () {
var _render = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_15___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_14___default.a.mark(function _callee() {
var options,
_args = arguments;
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_14___default.a.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
options = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
this.start(_objectSpread$1({
enableRedraw: true,
ignoreAnimation: true,
ignoreMouse: true
}, options));
_context.next = 4;
return this.ready();
case 4:
this.stop();
case 5:
case "end":
return _context.stop();
}
}
}, _callee, this);
}));
function render() {
return _render.apply(this, arguments);
}
return render;
}()
/**
* Start rendering.
* @param options - Render options.
*/
}, {
key: "start",
value: function start() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var documentElement = this.documentElement,
screen = this.screen,
baseOptions = this.options;
screen.start(documentElement, _objectSpread$1({
enableRedraw: true
}, baseOptions, {}, options));
}
/**
* Stop rendering.
*/
}, {
key: "stop",
value: function stop() {
this.screen.stop();
}
/**
* Resize SVG to fit in given size.
* @param width
* @param height
* @param preserveAspectRatio
*/
}, {
key: "resize",
value: function resize(width) {
var height = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : width;
var preserveAspectRatio = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
this.documentElement.resize(width, height, preserveAspectRatio);
}
}], [{
key: "from",
value: function () {
var _from = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_15___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_14___default.a.mark(function _callee2(ctx, svg) {
var options,
parser,
svgDocument,
_args2 = arguments;
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_14___default.a.wrap(function _callee2$(_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
case 0:
options = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : {};
parser = new Parser(options);
_context2.next = 4;
return parser.parse(svg);
case 4:
svgDocument = _context2.sent;
return _context2.abrupt("return", new Canvg(ctx, svgDocument, options));
case 6:
case "end":
return _context2.stop();
}
}
}, _callee2);
}));
function from(_x, _x2) {
return _from.apply(this, arguments);
}
return from;
}()
/**
* Create Canvg isntance from SVG source string.
* @param ctx - Rendering context.
* @param svg - SVG source string.
* @param options - Rendering options.
*/
}, {
key: "fromString",
value: function fromString(ctx, svg) {
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
var parser = new Parser(options);
var svgDocument = parser.parseFromString(svg);
return new Canvg(ctx, svgDocument, options);
}
}]);
return Canvg;
}();
/**
* Options preset for `OffscreenCanvas`.
* @param config - Preset requirements.
* @param config.DOMParser - XML/HTML parser from string into DOM Document.
*/
function offscreen() {
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
DOMParserFallback = _ref.DOMParser;
var preset = {
window: null,
ignoreAnimation: true,
ignoreMouse: true,
DOMParser: DOMParserFallback,
createCanvas: function createCanvas(width, height) {
return new OffscreenCanvas(width, height);
},
createImage: function createImage(url) {
return _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_15___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_14___default.a.mark(function _callee() {
var response, blob, img;
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_14___default.a.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return fetch(url);
case 2:
response = _context.sent;
_context.next = 5;
return response.blob();
case 5:
blob = _context.sent;
_context.next = 8;
return createImageBitmap(blob);
case 8:
img = _context.sent;
return _context.abrupt("return", img);
case 10:
case "end":
return _context.stop();
}
}
}, _callee);
}))();
}
};
if (typeof DOMParser !== 'undefined' || typeof DOMParserFallback === 'undefined') {
Reflect.deleteProperty(preset, 'DOMParser');
}
return preset;
}
/**
* Options preset for `node-canvas`.
* @param config - Preset requirements.
* @param config.DOMParser - XML/HTML parser from string into DOM Document.
* @param config.canvas - `node-canvas` exports.
* @param config.fetch - WHATWG-compatible `fetch` function.
*/
function node(_ref) {
var DOMParser = _ref.DOMParser,
canvas = _ref.canvas,
fetch = _ref.fetch;
return {
window: null,
ignoreAnimation: true,
ignoreMouse: true,
DOMParser: DOMParser,
fetch: fetch,
createCanvas: canvas.createCanvas,
createImage: canvas.loadImage
};
}
var index = /*#__PURE__*/Object.freeze({
__proto__: null,
offscreen: offscreen,
node: node
});
/* harmony default export */ __webpack_exports__["default"] = (Canvg);
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZXMuanMiLCJzb3VyY2VzIjpbIi4uL25vZGVfbW9kdWxlcy9yZWdlbmVyYXRvci1ydW50aW1lL3J1bnRpbWUuanMiXSwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBDb3B5cmlnaHQgKGMpIDIwMTQtcHJlc2VudCwgRmFjZWJvb2ssIEluYy5cbiAqXG4gKiBUaGlzIHNvdXJjZSBjb2RlIGlzIGxpY2V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5Q2F0Y2goaW5uZXJGbiwgc2VsZiwgY29udGV4dCk7XG4gICAgICAgIGlmIChyZWNvcmQudHlwZSA9PT0gXCJub3JtYWxcIikge1xuICAgICAgICAgIC8vIElmIGFuIGV4Y2VwdGlvbiBpcyB0aHJvd24gZnJvbSBpbm5lckZuLCB3ZSBsZWF2ZSBzdGF0ZSA9PT1cbiAgICAgICAgICAvLyBHZW5TdGF0ZUV4ZWN1dGluZyBhbmQgbG9vcCBiYWNrIGZvciBhbm90aGVyIGludm9jYXRpb24uXG4gICAgICAgICAgc3RhdGUgPSBjb250ZXh0LmRvbmVcbiAgICAgICAgICAgID8gR2VuU3RhdGVDb21wbGV0ZWRcbiAgICAgICAgICAgIDogR2VuU3RhdGVTdXNwZW5kZWRZaWVsZDtcblxuICAgICAgICAgIGlmIChyZWNvcmQuYXJnID09PSBDb250aW51ZVNlbnRpbmVsKSB7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgdmFsdWU6IHJlY29yZC5hcmcsXG4gICAgICAgICAgICBkb25lOiBjb250ZXh0LmRvbmVcbiAgICAgICAgICB9O1xuXG4gICAgICAgIH0gZWxzZSBpZiAocmVjb3JkLnR5cGUgPT09IFwidGhyb3dcIikge1xuICAgICAgICAgIHN0YXRlID0gR2VuU3RhdGVDb21wbGV0ZWQ7XG4gICAgICAgICAgLy8gRGlzcGF0Y2ggdGhlIGV4Y2VwdGlvbiBieSBsb29waW5nIGJhY2sgYXJvdW5kIHRvIHRoZVxuICAgICAgICAgIC8vIGNvbnRleHQuZGlzcGF0Y2hFeGNlcHRpb24oY29udGV4dC5hcmcpIGNhbGwgYWJvdmUuXG4gICAgICAgICAgY29udGV4dC5tZXRob2QgPSBcInRocm93XCI7XG4gICAgICAgICAgY29udGV4dC5hcmcgPSByZWNvcmQuYXJnO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfTtcbiAgfVxuXG4gIC8v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ICAgIC8vIGNoYW5jZSB0byBjbGVhbiB1cC5cbiAgICAgICAgICBjb250ZXh0Lm1ldGhvZCA9IFwicmV0dXJuXCI7XG4gICAgICAgICAgY29udGV4dC5hcmcgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgbWF5YmVJbnZva2VEZWxlZ2F0ZShkZWxlZ2F0ZSwgY29udGV4dCk7XG5cbiAgICAgICAgICBpZiAoY29udGV4dC5tZXRob2QgPT09IFwidGhyb3dcIikge1xuICAgICAgICAgICAgLy8gSWYgbWF5YmVJbnZva2VEZWxlZ2F0ZShjb250ZXh0KSBjaGFuZ2VkIGNvbnRleHQubWV0aG9kIGZyb21cbiAgICAgICAgICAgIC8vIFwicmV0dXJuXCIgdG8gXCJ0aHJvd1wiLCBsZXQgdGhhdCBvdmVycmlkZSB0aGUgVHlwZUVycm9yIGJlbG93LlxuICAgICAgICAgICAgcmV0dXJuIENvbnRpbnVlU2VudGluZWw7XG4gICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgY29udGV4dC5tZXRob2QgPSBcInRocm93XCI7XG4gICAgICAgIGNvbnRleHQuYXJnID0gbmV3IFR5cGVFcnJvcihcbiAgICAgICAgICBcIlRoZSBpdGVyYXRvciBkb2VzIG5vdCBwcm92aWRlIGEgJ3Rocm93JyBtZXRob2RcIik7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiBDb250aW51ZVNlbnRpbmVsO1xuICAgIH1cblxuICAgIHZhciByZWNvcmQgPSB0cnlDYXRjaChtZXRob2QsIGRlbGVnYXRlLml0ZXJhdG9yLCBjb250ZXh0LmFyZyk7XG5cbiAgICBpZiAocmVjb3JkLnR5cGUgPT09IFwidGhyb3dcIikge1xuICAgICAgY29udGV4dC5tZXRob2QgPSBcInRocm93XCI7XG4gICAgICBjb250ZXh0LmFyZyA9IHJlY29yZC5hcmc7XG4gICAgICBjb250ZXh0LmRlbGVnYXRlID0gbnVsbDtcbiAgICAgIHJldHVybiBDb250aW51ZVNlbnRpbmVs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0ZSA9IG51bGw7XG5cbiAgICAgIHRoaXMubWV0aG9kID0gXCJuZXh0XCI7XG4gICAgICB0aGlzLmFyZyA9IHVuZGVmaW5lZDtcblxuICAgICAgdGhpcy50cnlFbnRyaWVzLmZvckVhY2gocmVzZXRUcnlFbnRyeSk7XG5cbiAgICAgIGlmICghc2tpcFRlbXBSZXNldCkge1xuICAgICAgICBmb3IgKHZhciBuYW1lIGluIHRoaXMpIHtcbiAgICAgICAgICAvLyBOb3Qgc3VyZSBhYm91dCB0aGUgb3B0aW1hbCBvcmRlciBvZiB0aGVzZSBjb25kaXRpb25zOlxuICAgICAgICAgIGlmIChuYW1lLmNoYXJBdCgwKSA9PT0gXCJ0XCIgJiZcbiAgICAgICAgICAgICAgaGFzT3duLmNhbGwodGhpcywgbmFtZSkgJiZcbiAgICAgICAgICAgICAgIWlzTmFOKCtuYW1lLnNsaWNlKDEpKSkge1xuICAgICAgICAgICAgdGhpc1tuYW1lXSA9IHVuZGVmaW5lZDtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9LFxuXG4gICAgc3RvcDogZnVuY3Rpb24oKSB7XG4gICAgICB0aGlzLmRvbmUgPSB0cnVlO1xuXG4gICAgICB2YXIgcm9vdEVudHJ5ID0gdGhpcy50cnlFbnRyaWVzWzBdO1xuICAgICAgdmFyIHJvb3RSZWNvcmQgPSByb290RW50cnkuY29tcGxldGlvbjtcbiAgICAgIGlmIChyb290UmVjb3JkLnR5cGUgPT09IFwidGhyb3dcIikge1xuICAgICAgICB0aHJvdyByb290UmVjb3JkLmFyZztcbiAgICAgIH1cblxuICAgICAgcmV0dXJuIHRoaXMucnZhbDtcbiAgICB9LFxuXG4gICAgZGlzcGF0Y2hFeGNlcHRpb246IGZ1bmN0aW9uKGV4Y2VwdGlvbikge1xuICAgICAgaWYgKHRoaXMuZG9uZSkge1xuICAgICAgICB0aHJvdyBleGNlcHRpb247XG4gICAgICB9XG5cbiAgICAgIHZhciBjb250ZXh0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5kXCIpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGVudHJ5LnRyeUxvYyA8PSB0aGlzLnByZXYpIHtcbiAgICAgICAgICB2YXIgaGFzQ2F0Y2ggPSBoYXNPd24uY2FsbChlbnRyeSwgXCJjYXRjaExvY1wiKTtcbiAgICAgICAgICB2YXIgaGFzRmluYWxseSA9IGhhc093bi5jYWxsKGVudHJ5LCBcImZpbmFsbHlMb2NcIik7XG5cbiAgICAgICAgICBpZiAoaGFzQ2F0Y2ggJiYgaGFzRmluYWxseSkge1xuICAgICAgICAgICAgaWYgKHRoaXMucHJldiA8IGVudHJ5LmNhdGNoTG9jKSB7XG4gICAgICAgICAgICAgIHJldHVybiBoYW5kbGUoZW50cnkuY2F0Y2hMb2MsIHRydWUpO1xuICAgICAgICAgICAgfSBlbHNlIGlmICh0aGlzLnByZXYgPCBlbnRyeS5maW5hbGx5TG9jKSB7XG4gICAgICAgICAgICAgIHJldHVybiBoYW5kbGUoZW50cnkuZmluYWxseUxvYyk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICB9IGVsc2UgaWYgKGhhc0NhdGNoKSB7XG4gICAgICAgICAgICBpZiAodGhpcy5wcmV2IDwgZW50cnkuY2F0Y2hMb2MpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIGhhbmRsZShlbnRyeS5jYXRjaExvYywgdHJ1ZSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICB9IGVsc2UgaWYgKGhhc0ZpbmFsbHkpIHtcbiAgICAgICAgICAgIGlmICh0aGlzLnByZXYgPCBlbnRyeS5maW5hbGx5TG9jKSB7XG4gICAgICAgICAgICAgIHJldHVybiBoYW5kbGUoZW50cnkuZmluYWxseUxvYyk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwidHJ5IHN0YXRlbWVudCB3aXRob3V0IGNhdGNoIG9yIGZpbmFsbHlcIik7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfSxcblxuICAgIGFicnVwdDogZnVuY3Rpb24odHlwZSwgYXJnKSB7XG4gICAgICBmb3IgKHZhciBpID0gdGhpcy50cnlFbnRyaWVzLmxlbmd0aCAtIDE7IGkgPj0gMDsgLS1pKSB7XG4gICAgICAgIHZhciBlbnRyeSA9IHRoaXMudHJ5RW50cmllc1tpXTtcbiAgICAgICAgaWYgKGVudHJ5LnRyeUxvYyA8PSB0aGlzLnByZXYgJiZcbiAgICAgICAgICAgIGhhc093bi5jYWxsKGVudHJ5LCBcImZpbmFsbHlMb2NcIikgJiZcbiAgICAgICAgICAgIHRoaXMucHJldiA8IGVudHJ5LmZpbmFsbHlMb2MpIHtcbiAgICAgICAgICB2YXIgZmluYWxseUVudHJ5ID0gZW50cnk7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgaWYgKGZpbmFsbHlFbnRyeSAmJlxuICAgICAgICAgICh0eXBlID09PSBcImJyZWFrXCIgfHxcbiAgICAgICAgICAgdHlwZSA9PT0gXCJjb250aW51ZVwiKSAmJlxuICAgICAgICAgIGZpbmFsbHlFbnRyeS50cnlMb2MgPD0gYXJnICYmXG4gICAgICAgICAgYXJnIDw9IGZpbmFsbHlFbnRyeS5maW5hbGx5TG9jKSB7XG4gICAgICAgIC8vIElnbm9yZSB0aGUgZmluYWxseSBlbnRyeSBpZiBjb250cm9sIGlzIG5vdCBqdW1waW5nIHRvIGFcbiAgICAgICAgLy8gbG9jYXRpb24gb3V0c2lkZSB0aGUgdHJ5L2NhdGNoIGJsb2NrLlxuICAgICAgICBmaW5hbGx5RW50cnkgPSBudWxsO1xuICAgICAgfVxuXG4gICAgICB2YXIgcmVjb3JkID0gZmluYWxseUVudHJ5ID8gZmluYWxseUVudHJ5LmNvbXBsZXRpb24gOiB7fTtcbiAgICAgIHJlY29yZC50eXBlID0gdHlwZTtcbiAgICAgIHJlY29yZC5hcmcgPSBhcmc7XG5cbiAgICAgIGlmIChmaW5hbGx5RW50cnkpIHtcbiAgICAgICAgdGhpcy5tZXRob2QgPSBcIm5leHRcIjtcbiAgICAgICAgdGhpcy5uZXh0ID0gZmluYWxseUVudHJ5LmZpbmFsbHlMb2M7XG4gICAgICAgIHJldHVybiBDb250aW51ZVNlbnRpbmVsO1xuICAgICAgfVxuXG4gICAgICByZXR1cm4gdGhpcy5jb21wbGV0ZShyZWNvcmQpO1xuICAgIH0sXG5cbiAgICBjb21wbGV0ZTogZnVuY3Rpb24ocmVjb3JkLCBhZnRlckxvYykge1xuICAgICAgaWYgKHJlY29yZC50eXBlID09PSBcInRocm93XCIpIHtcbiAgICAgICAgdGhyb3cgcmVjb3JkLmFyZztcbiAgICAgIH1cblxuICAgICAgaWYgKHJlY29yZC50eXBlID09PSBcImJyZWFrXCIgfHxcbiAgICAgICAgICByZWNvcmQudHlwZSA9PT0gXCJjb250aW51ZVwiKSB7XG4gICAgICAgIHRoaXMubmV4dCA9IHJlY29yZC5hcmc7XG4gICAgICB9IGVsc2UgaWYgKHJlY29yZC50eXBlID09PSBcInJldHVyblwiKSB7XG4gICAgICAgIHRoaXMucnZhbCA9IHRoaXMuYXJnID0gcmVjb3JkLmFyZztcbiAgICAgICAgdGhpcy5tZXRob2QgPSBcInJldHVyblwiO1xuICAgICAgICB0aGlzLm5leHQgPSBcImVuZFwiO1xuICAgICAgfSBlbHNlIGlmIChyZWNvcmQudHlwZSA9PT0gXCJub3JtYWxcIiAmJiBhZnRlckxvYykge1xuICAgICAgICB0aGlzLm5leHQgPSBhZnRlckxvYztcbiAgICAgIH1cblxuICAgICAgcmV0dXJuIENvbnRpbnVlU2VudGluZWw7XG4gICAgfSxcblxuICAgIGZpbmlzaDogZnVuY3Rpb24oZmluYWxseUxvYykge1xuICAgICAgZm9yICh2YXIgaSA9IHRoaXMudHJ5RW50cmllcy5sZW5ndGggLSAxOyBpID49IDA7IC0taSkge1xuICAgICAgICB2YXIgZW50cnkgPS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7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OyJ9
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../process/browser.js */ "./node_modules/process/browser.js")))
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/a-function.js":
/*!*************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/a-function.js ***!
\*************************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = function (it) {
if (typeof it != 'function') {
throw TypeError(String(it) + ' is not a function');
} return it;
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/a-possible-prototype.js":
/*!***********************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/a-possible-prototype.js ***!
\***********************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/canvg/node_modules/core-js/internals/is-object.js");
module.exports = function (it) {
if (!isObject(it) && it !== null) {
throw TypeError("Can't set " + String(it) + ' as a prototype');
} return it;
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/add-to-unscopables.js":
/*!*********************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/add-to-unscopables.js ***!
\*********************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/canvg/node_modules/core-js/internals/well-known-symbol.js");
var create = __webpack_require__(/*! ../internals/object-create */ "./node_modules/canvg/node_modules/core-js/internals/object-create.js");
var definePropertyModule = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/canvg/node_modules/core-js/internals/object-define-property.js");
var UNSCOPABLES = wellKnownSymbol('unscopables');
var ArrayPrototype = Array.prototype;
// Array.prototype[@@unscopables]
// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
if (ArrayPrototype[UNSCOPABLES] == undefined) {
definePropertyModule.f(ArrayPrototype, UNSCOPABLES, {
configurable: true,
value: create(null)
});
}
// add a key to Array.prototype[@@unscopables]
module.exports = function (key) {
ArrayPrototype[UNSCOPABLES][key] = true;
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/advance-string-index.js":
/*!***********************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/advance-string-index.js ***!
\***********************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var charAt = __webpack_require__(/*! ../internals/string-multibyte */ "./node_modules/canvg/node_modules/core-js/internals/string-multibyte.js").charAt;
// `AdvanceStringIndex` abstract operation
// https://tc39.github.io/ecma262/#sec-advancestringindex
module.exports = function (S, index, unicode) {
return index + (unicode ? charAt(S, index).length : 1);
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/an-instance.js":
/*!**************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/an-instance.js ***!
\**************************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = function (it, Constructor, name) {
if (!(it instanceof Constructor)) {
throw TypeError('Incorrect ' + (name ? name + ' ' : '') + 'invocation');
} return it;
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/an-object.js":
/*!************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/an-object.js ***!
\************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/canvg/node_modules/core-js/internals/is-object.js");
module.exports = function (it) {
if (!isObject(it)) {
throw TypeError(String(it) + ' is not an object');
} return it;
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/array-fill.js":
/*!*************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/array-fill.js ***!
\*************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var toObject = __webpack_require__(/*! ../internals/to-object */ "./node_modules/canvg/node_modules/core-js/internals/to-object.js");
var toAbsoluteIndex = __webpack_require__(/*! ../internals/to-absolute-index */ "./node_modules/canvg/node_modules/core-js/internals/to-absolute-index.js");
var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/canvg/node_modules/core-js/internals/to-length.js");
// `Array.prototype.fill` method implementation
// https://tc39.github.io/ecma262/#sec-array.prototype.fill
module.exports = function fill(value /* , start = 0, end = @length */) {
var O = toObject(this);
var length = toLength(O.length);
var argumentsLength = arguments.length;
var index = toAbsoluteIndex(argumentsLength > 1 ? arguments[1] : undefined, length);
var end = argumentsLength > 2 ? arguments[2] : undefined;
var endPos = end === undefined ? length : toAbsoluteIndex(end, length);
while (endPos > index) O[index++] = value;
return O;
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/array-for-each.js":
/*!*****************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/array-for-each.js ***!
\*****************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $forEach = __webpack_require__(/*! ../internals/array-iteration */ "./node_modules/canvg/node_modules/core-js/internals/array-iteration.js").forEach;
var arrayMethodIsStrict = __webpack_require__(/*! ../internals/array-method-is-strict */ "./node_modules/canvg/node_modules/core-js/internals/array-method-is-strict.js");
var arrayMethodUsesToLength = __webpack_require__(/*! ../internals/array-method-uses-to-length */ "./node_modules/canvg/node_modules/core-js/internals/array-method-uses-to-length.js");
var STRICT_METHOD = arrayMethodIsStrict('forEach');
var USES_TO_LENGTH = arrayMethodUsesToLength('forEach');
// `Array.prototype.forEach` method implementation
// https://tc39.github.io/ecma262/#sec-array.prototype.foreach
module.exports = (!STRICT_METHOD || !USES_TO_LENGTH) ? function forEach(callbackfn /* , thisArg */) {
return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
} : [].forEach;
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/array-from.js":
/*!*************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/array-from.js ***!
\*************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var bind = __webpack_require__(/*! ../internals/function-bind-context */ "./node_modules/canvg/node_modules/core-js/internals/function-bind-context.js");
var toObject = __webpack_require__(/*! ../internals/to-object */ "./node_modules/canvg/node_modules/core-js/internals/to-object.js");
var callWithSafeIterationClosing = __webpack_require__(/*! ../internals/call-with-safe-iteration-closing */ "./node_modules/canvg/node_modules/core-js/internals/call-with-safe-iteration-closing.js");
var isArrayIteratorMethod = __webpack_require__(/*! ../internals/is-array-iterator-method */ "./node_modules/canvg/node_modules/core-js/internals/is-array-iterator-method.js");
var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/canvg/node_modules/core-js/internals/to-length.js");
var createProperty = __webpack_require__(/*! ../internals/create-property */ "./node_modules/canvg/node_modules/core-js/internals/create-property.js");
var getIteratorMethod = __webpack_require__(/*! ../internals/get-iterator-method */ "./node_modules/canvg/node_modules/core-js/internals/get-iterator-method.js");
// `Array.from` method implementation
// https://tc39.github.io/ecma262/#sec-array.from
module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
var O = toObject(arrayLike);
var C = typeof this == 'function' ? this : Array;
var argumentsLength = arguments.length;
var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
var mapping = mapfn !== undefined;
var iteratorMethod = getIteratorMethod(O);
var index = 0;
var length, result, step, iterator, next, value;
if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined, 2);
// if the target is not iterable or it's an array with the default iterator - use a simple case
if (iteratorMethod != undefined && !(C == Array && isArrayIteratorMethod(iteratorMethod))) {
iterator = iteratorMethod.call(O);
next = iterator.next;
result = new C();
for (;!(step = next.call(iterator)).done; index++) {
value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
createProperty(result, index, value);
}
} else {
length = toLength(O.length);
result = new C(length);
for (;length > index; index++) {
value = mapping ? mapfn(O[index], index) : O[index];
createProperty(result, index, value);
}
}
result.length = index;
return result;
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/array-includes.js":
/*!*****************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/array-includes.js ***!
\*****************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "./node_modules/canvg/node_modules/core-js/internals/to-indexed-object.js");
var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/canvg/node_modules/core-js/internals/to-length.js");
var toAbsoluteIndex = __webpack_require__(/*! ../internals/to-absolute-index */ "./node_modules/canvg/node_modules/core-js/internals/to-absolute-index.js");
// `Array.prototype.{ indexOf, includes }` methods implementation
var createMethod = function (IS_INCLUDES) {
return function ($this, el, fromIndex) {
var O = toIndexedObject($this);
var length = toLength(O.length);
var index = toAbsoluteIndex(fromIndex, length);
var value;
// Array#includes uses SameValueZero equality algorithm
// eslint-disable-next-line no-self-compare
if (IS_INCLUDES && el != el) while (length > index) {
value = O[index++];
// eslint-disable-next-line no-self-compare
if (value != value) return true;
// Array#indexOf ignores holes, Array#includes - not
} else for (;length > index; index++) {
if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
} return !IS_INCLUDES && -1;
};
};
module.exports = {
// `Array.prototype.includes` method
// https://tc39.github.io/ecma262/#sec-array.prototype.includes
includes: createMethod(true),
// `Array.prototype.indexOf` method
// https://tc39.github.io/ecma262/#sec-array.prototype.indexof
indexOf: createMethod(false)
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/array-iteration.js":
/*!******************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/array-iteration.js ***!
\******************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var bind = __webpack_require__(/*! ../internals/function-bind-context */ "./node_modules/canvg/node_modules/core-js/internals/function-bind-context.js");
var IndexedObject = __webpack_require__(/*! ../internals/indexed-object */ "./node_modules/canvg/node_modules/core-js/internals/indexed-object.js");
var toObject = __webpack_require__(/*! ../internals/to-object */ "./node_modules/canvg/node_modules/core-js/internals/to-object.js");
var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/canvg/node_modules/core-js/internals/to-length.js");
var arraySpeciesCreate = __webpack_require__(/*! ../internals/array-species-create */ "./node_modules/canvg/node_modules/core-js/internals/array-species-create.js");
var push = [].push;
// `Array.prototype.{ forEach, map, filter, some, every, find, findIndex }` methods implementation
var createMethod = function (TYPE) {
var IS_MAP = TYPE == 1;
var IS_FILTER = TYPE == 2;
var IS_SOME = TYPE == 3;
var IS_EVERY = TYPE == 4;
var IS_FIND_INDEX = TYPE == 6;
var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
return function ($this, callbackfn, that, specificCreate) {
var O = toObject($this);
var self = IndexedObject(O);
var boundFunction = bind(callbackfn, that, 3);
var length = toLength(self.length);
var index = 0;
var create = specificCreate || arraySpeciesCreate;
var target = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
var value, result;
for (;length > index; index++) if (NO_HOLES || index in self) {
value = self[index];
result = boundFunction(value, index, O);
if (TYPE) {
if (IS_MAP) target[index] = result; // map
else if (result) switch (TYPE) {
case 3: return true; // some
case 5: return value; // find
case 6: return index; // findIndex
case 2: push.call(target, value); // filter
} else if (IS_EVERY) return false; // every
}
}
return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
};
};
module.exports = {
// `Array.prototype.forEach` method
// https://tc39.github.io/ecma262/#sec-array.prototype.foreach
forEach: createMethod(0),
// `Array.prototype.map` method
// https://tc39.github.io/ecma262/#sec-array.prototype.map
map: createMethod(1),
// `Array.prototype.filter` method
// https://tc39.github.io/ecma262/#sec-array.prototype.filter
filter: createMethod(2),
// `Array.prototype.some` method
// https://tc39.github.io/ecma262/#sec-array.prototype.some
some: createMethod(3),
// `Array.prototype.every` method
// https://tc39.github.io/ecma262/#sec-array.prototype.every
every: createMethod(4),
// `Array.prototype.find` method
// https://tc39.github.io/ecma262/#sec-array.prototype.find
find: createMethod(5),
// `Array.prototype.findIndex` method
// https://tc39.github.io/ecma262/#sec-array.prototype.findIndex
findIndex: createMethod(6)
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/array-method-has-species-support.js":
/*!***********************************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/array-method-has-species-support.js ***!
\***********************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/canvg/node_modules/core-js/internals/fails.js");
var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/canvg/node_modules/core-js/internals/well-known-symbol.js");
var V8_VERSION = __webpack_require__(/*! ../internals/engine-v8-version */ "./node_modules/canvg/node_modules/core-js/internals/engine-v8-version.js");
var SPECIES = wellKnownSymbol('species');
module.exports = function (METHOD_NAME) {
// We can't use this feature detection in V8 since it causes
// deoptimization and serious performance degradation
// https://github.com/zloirock/core-js/issues/677
return V8_VERSION >= 51 || !fails(function () {
var array = [];
var constructor = array.constructor = {};
constructor[SPECIES] = function () {
return { foo: 1 };
};
return array[METHOD_NAME](Boolean).foo !== 1;
});
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/array-method-is-strict.js":
/*!*************************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/array-method-is-strict.js ***!
\*************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/canvg/node_modules/core-js/internals/fails.js");
module.exports = function (METHOD_NAME, argument) {
var method = [][METHOD_NAME];
return !!method && fails(function () {
// eslint-disable-next-line no-useless-call,no-throw-literal
method.call(null, argument || function () { throw 1; }, 1);
});
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/array-method-uses-to-length.js":
/*!******************************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/array-method-uses-to-length.js ***!
\******************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/canvg/node_modules/core-js/internals/descriptors.js");
var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/canvg/node_modules/core-js/internals/fails.js");
var has = __webpack_require__(/*! ../internals/has */ "./node_modules/canvg/node_modules/core-js/internals/has.js");
var defineProperty = Object.defineProperty;
var cache = {};
var thrower = function (it) { throw it; };
module.exports = function (METHOD_NAME, options) {
if (has(cache, METHOD_NAME)) return cache[METHOD_NAME];
if (!options) options = {};
var method = [][METHOD_NAME];
var ACCESSORS = has(options, 'ACCESSORS') ? options.ACCESSORS : false;
var argument0 = has(options, 0) ? options[0] : thrower;
var argument1 = has(options, 1) ? options[1] : undefined;
return cache[METHOD_NAME] = !!method && !fails(function () {
if (ACCESSORS && !DESCRIPTORS) return true;
var O = { length: -1 };
if (ACCESSORS) defineProperty(O, 1, { enumerable: true, get: thrower });
else O[1] = 1;
method.call(O, argument0, argument1);
});
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/array-reduce.js":
/*!***************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/array-reduce.js ***!
\***************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var aFunction = __webpack_require__(/*! ../internals/a-function */ "./node_modules/canvg/node_modules/core-js/internals/a-function.js");
var toObject = __webpack_require__(/*! ../internals/to-object */ "./node_modules/canvg/node_modules/core-js/internals/to-object.js");
var IndexedObject = __webpack_require__(/*! ../internals/indexed-object */ "./node_modules/canvg/node_modules/core-js/internals/indexed-object.js");
var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/canvg/node_modules/core-js/internals/to-length.js");
// `Array.prototype.{ reduce, reduceRight }` methods implementation
var createMethod = function (IS_RIGHT) {
return function (that, callbackfn, argumentsLength, memo) {
aFunction(callbackfn);
var O = toObject(that);
var self = IndexedObject(O);
var length = toLength(O.length);
var index = IS_RIGHT ? length - 1 : 0;
var i = IS_RIGHT ? -1 : 1;
if (argumentsLength < 2) while (true) {
if (index in self) {
memo = self[index];
index += i;
break;
}
index += i;
if (IS_RIGHT ? index < 0 : length <= index) {
throw TypeError('Reduce of empty array with no initial value');
}
}
for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
memo = callbackfn(memo, self[index], index, O);
}
return memo;
};
};
module.exports = {
// `Array.prototype.reduce` method
// https://tc39.github.io/ecma262/#sec-array.prototype.reduce
left: createMethod(false),
// `Array.prototype.reduceRight` method
// https://tc39.github.io/ecma262/#sec-array.prototype.reduceright
right: createMethod(true)
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/array-species-create.js":
/*!***********************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/array-species-create.js ***!
\***********************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/canvg/node_modules/core-js/internals/is-object.js");
var isArray = __webpack_require__(/*! ../internals/is-array */ "./node_modules/canvg/node_modules/core-js/internals/is-array.js");
var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/canvg/node_modules/core-js/internals/well-known-symbol.js");
var SPECIES = wellKnownSymbol('species');
// `ArraySpeciesCreate` abstract operation
// https://tc39.github.io/ecma262/#sec-arrayspeciescreate
module.exports = function (originalArray, length) {
var C;
if (isArray(originalArray)) {
C = originalArray.constructor;
// cross-realm fallback
if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
else if (isObject(C)) {
C = C[SPECIES];
if (C === null) C = undefined;
}
} return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/call-with-safe-iteration-closing.js":
/*!***********************************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/call-with-safe-iteration-closing.js ***!
\***********************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/canvg/node_modules/core-js/internals/an-object.js");
// call something on iterator step with safe closing on error
module.exports = function (iterator, fn, value, ENTRIES) {
try {
return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
// 7.4.6 IteratorClose(iterator, completion)
} catch (error) {
var returnMethod = iterator['return'];
if (returnMethod !== undefined) anObject(returnMethod.call(iterator));
throw error;
}
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/check-correctness-of-iteration.js":
/*!*********************************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/check-correctness-of-iteration.js ***!
\*********************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/canvg/node_modules/core-js/internals/well-known-symbol.js");
var ITERATOR = wellKnownSymbol('iterator');
var SAFE_CLOSING = false;
try {
var called = 0;
var iteratorWithReturn = {
next: function () {
return { done: !!called++ };
},
'return': function () {
SAFE_CLOSING = true;
}
};
iteratorWithReturn[ITERATOR] = function () {
return this;
};
// eslint-disable-next-line no-throw-literal
Array.from(iteratorWithReturn, function () { throw 2; });
} catch (error) { /* empty */ }
module.exports = function (exec, SKIP_CLOSING) {
if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
var ITERATION_SUPPORT = false;
try {
var object = {};
object[ITERATOR] = function () {
return {
next: function () {
return { done: ITERATION_SUPPORT = true };
}
};
};
exec(object);
} catch (error) { /* empty */ }
return ITERATION_SUPPORT;
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/classof-raw.js":
/*!**************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/classof-raw.js ***!
\**************************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
var toString = {}.toString;
module.exports = function (it) {
return toString.call(it).slice(8, -1);
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/classof.js":
/*!**********************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/classof.js ***!
\**********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var TO_STRING_TAG_SUPPORT = __webpack_require__(/*! ../internals/to-string-tag-support */ "./node_modules/canvg/node_modules/core-js/internals/to-string-tag-support.js");
var classofRaw = __webpack_require__(/*! ../internals/classof-raw */ "./node_modules/canvg/node_modules/core-js/internals/classof-raw.js");
var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/canvg/node_modules/core-js/internals/well-known-symbol.js");
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
// ES3 wrong here
var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
// fallback for IE11 Script Access Denied error
var tryGet = function (it, key) {
try {
return it[key];
} catch (error) { /* empty */ }
};
// getting tag from ES6+ `Object.prototype.toString`
module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
var O, tag, result;
return it === undefined ? 'Undefined' : it === null ? 'Null'
// @@toStringTag case
: typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag
// builtinTag case
: CORRECT_ARGUMENTS ? classofRaw(O)
// ES3 arguments fallback
: (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/collection-strong.js":
/*!********************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/collection-strong.js ***!
\********************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var defineProperty = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/canvg/node_modules/core-js/internals/object-define-property.js").f;
var create = __webpack_require__(/*! ../internals/object-create */ "./node_modules/canvg/node_modules/core-js/internals/object-create.js");
var redefineAll = __webpack_require__(/*! ../internals/redefine-all */ "./node_modules/canvg/node_modules/core-js/internals/redefine-all.js");
var bind = __webpack_require__(/*! ../internals/function-bind-context */ "./node_modules/canvg/node_modules/core-js/internals/function-bind-context.js");
var anInstance = __webpack_require__(/*! ../internals/an-instance */ "./node_modules/canvg/node_modules/core-js/internals/an-instance.js");
var iterate = __webpack_require__(/*! ../internals/iterate */ "./node_modules/canvg/node_modules/core-js/internals/iterate.js");
var defineIterator = __webpack_require__(/*! ../internals/define-iterator */ "./node_modules/canvg/node_modules/core-js/internals/define-iterator.js");
var setSpecies = __webpack_require__(/*! ../internals/set-species */ "./node_modules/canvg/node_modules/core-js/internals/set-species.js");
var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/canvg/node_modules/core-js/internals/descriptors.js");
var fastKey = __webpack_require__(/*! ../internals/internal-metadata */ "./node_modules/canvg/node_modules/core-js/internals/internal-metadata.js").fastKey;
var InternalStateModule = __webpack_require__(/*! ../internals/internal-state */ "./node_modules/canvg/node_modules/core-js/internals/internal-state.js");
var setInternalState = InternalStateModule.set;
var internalStateGetterFor = InternalStateModule.getterFor;
module.exports = {
getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
var C = wrapper(function (that, iterable) {
anInstance(that, C, CONSTRUCTOR_NAME);
setInternalState(that, {
type: CONSTRUCTOR_NAME,
index: create(null),
first: undefined,
last: undefined,
size: 0
});
if (!DESCRIPTORS) that.size = 0;
if (iterable != undefined) iterate(iterable, that[ADDER], that, IS_MAP);
});
var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
var define = function (that, key, value) {
var state = getInternalState(that);
var entry = getEntry(that, key);
var previous, index;
// change existing entry
if (entry) {
entry.value = value;
// create new entry
} else {
state.last = entry = {
index: index = fastKey(key, true),
key: key,
value: value,
previous: previous = state.last,
next: undefined,
removed: false
};
if (!state.first) state.first = entry;
if (previous) previous.next = entry;
if (DESCRIPTORS) state.size++;
else that.size++;
// add to index
if (index !== 'F') state.index[index] = entry;
} return that;
};
var getEntry = function (that, key) {
var state = getInternalState(that);
// fast case
var index = fastKey(key);
var entry;
if (index !== 'F') return state.index[index];
// frozen object case
for (entry = state.first; entry; entry = entry.next) {
if (entry.key == key) return entry;
}
};
redefineAll(C.prototype, {
// 23.1.3.1 Map.prototype.clear()
// 23.2.3.2 Set.prototype.clear()
clear: function clear() {
var that = this;
var state = getInternalState(that);
var data = state.index;
var entry = state.first;
while (entry) {
entry.removed = true;
if (entry.previous) entry.previous = entry.previous.next = undefined;
delete data[entry.index];
entry = entry.next;
}
state.first = state.last = undefined;
if (DESCRIPTORS) state.size = 0;
else that.size = 0;
},
// 23.1.3.3 Map.prototype.delete(key)
// 23.2.3.4 Set.prototype.delete(value)
'delete': function (key) {
var that = this;
var state = getInternalState(that);
var entry = getEntry(that, key);
if (entry) {
var next = entry.next;
var prev = entry.previous;
delete state.index[entry.index];
entry.removed = true;
if (prev) prev.next = next;
if (next) next.previous = prev;
if (state.first == entry) state.first = next;
if (state.last == entry) state.last = prev;
if (DESCRIPTORS) state.size--;
else that.size--;
} return !!entry;
},
// 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)
// 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)
forEach: function forEach(callbackfn /* , that = undefined */) {
var state = getInternalState(this);
var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);
var entry;
while (entry = entry ? entry.next : state.first) {
boundFunction(entry.value, entry.key, this);
// revert to the last existing entry
while (entry && entry.removed) entry = entry.previous;
}
},
// 23.1.3.7 Map.prototype.has(key)
// 23.2.3.7 Set.prototype.has(value)
has: function has(key) {
return !!getEntry(this, key);
}
});
redefineAll(C.prototype, IS_MAP ? {
// 23.1.3.6 Map.prototype.get(key)
get: function get(key) {
var entry = getEntry(this, key);
return entry && entry.value;
},
// 23.1.3.9 Map.prototype.set(key, value)
set: function set(key, value) {
return define(this, key === 0 ? 0 : key, value);
}
} : {
// 23.2.3.1 Set.prototype.add(value)
add: function add(value) {
return define(this, value = value === 0 ? 0 : value, value);
}
});
if (DESCRIPTORS) defineProperty(C.prototype, 'size', {
get: function () {
return getInternalState(this).size;
}
});
return C;
},
setStrong: function (C, CONSTRUCTOR_NAME, IS_MAP) {
var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator';
var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME);
var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME);
// add .keys, .values, .entries, [@@iterator]
// 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11
defineIterator(C, CONSTRUCTOR_NAME, function (iterated, kind) {
setInternalState(this, {
type: ITERATOR_NAME,
target: iterated,
state: getInternalCollectionState(iterated),
kind: kind,
last: undefined
});
}, function () {
var state = getInternalIteratorState(this);
var kind = state.kind;
var entry = state.last;
// revert to the last existing entry
while (entry && entry.removed) entry = entry.previous;
// get next entry
if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) {
// or finish the iteration
state.target = undefined;
return { value: undefined, done: true };
}
// return step by kind
if (kind == 'keys') return { value: entry.key, done: false };
if (kind == 'values') return { value: entry.value, done: false };
return { value: [entry.key, entry.value], done: false };
}, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
// add [@@species], 23.1.2.2, 23.2.2.2
setSpecies(CONSTRUCTOR_NAME);
}
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/collection.js":
/*!*************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/collection.js ***!
\*************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/canvg/node_modules/core-js/internals/export.js");
var global = __webpack_require__(/*! ../internals/global */ "./node_modules/canvg/node_modules/core-js/internals/global.js");
var isForced = __webpack_require__(/*! ../internals/is-forced */ "./node_modules/canvg/node_modules/core-js/internals/is-forced.js");
var redefine = __webpack_require__(/*! ../internals/redefine */ "./node_modules/canvg/node_modules/core-js/internals/redefine.js");
var InternalMetadataModule = __webpack_require__(/*! ../internals/internal-metadata */ "./node_modules/canvg/node_modules/core-js/internals/internal-metadata.js");
var iterate = __webpack_require__(/*! ../internals/iterate */ "./node_modules/canvg/node_modules/core-js/internals/iterate.js");
var anInstance = __webpack_require__(/*! ../internals/an-instance */ "./node_modules/canvg/node_modules/core-js/internals/an-instance.js");
var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/canvg/node_modules/core-js/internals/is-object.js");
var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/canvg/node_modules/core-js/internals/fails.js");
var checkCorrectnessOfIteration = __webpack_require__(/*! ../internals/check-correctness-of-iteration */ "./node_modules/canvg/node_modules/core-js/internals/check-correctness-of-iteration.js");
var setToStringTag = __webpack_require__(/*! ../internals/set-to-string-tag */ "./node_modules/canvg/node_modules/core-js/internals/set-to-string-tag.js");
var inheritIfRequired = __webpack_require__(/*! ../internals/inherit-if-required */ "./node_modules/canvg/node_modules/core-js/internals/inherit-if-required.js");
module.exports = function (CONSTRUCTOR_NAME, wrapper, common) {
var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1;
var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1;
var ADDER = IS_MAP ? 'set' : 'add';
var NativeConstructor = global[CONSTRUCTOR_NAME];
var NativePrototype = NativeConstructor && NativeConstructor.prototype;
var Constructor = NativeConstructor;
var exported = {};
var fixMethod = function (KEY) {
var nativeMethod = NativePrototype[KEY];
redefine(NativePrototype, KEY,
KEY == 'add' ? function add(value) {
nativeMethod.call(this, value === 0 ? 0 : value);
return this;
} : KEY == 'delete' ? function (key) {
return IS_WEAK && !isObject(key) ? false : nativeMethod.call(this, key === 0 ? 0 : key);
} : KEY == 'get' ? function get(key) {
return IS_WEAK && !isObject(key) ? undefined : nativeMethod.call(this, key === 0 ? 0 : key);
} : KEY == 'has' ? function has(key) {
return IS_WEAK && !isObject(key) ? false : nativeMethod.call(this, key === 0 ? 0 : key);
} : function set(key, value) {
nativeMethod.call(this, key === 0 ? 0 : key, value);
return this;
}
);
};
// eslint-disable-next-line max-len
if (isForced(CONSTRUCTOR_NAME, typeof NativeConstructor != 'function' || !(IS_WEAK || NativePrototype.forEach && !fails(function () {
new NativeConstructor().entries().next();
})))) {
// create collection constructor
Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER);
InternalMetadataModule.REQUIRED = true;
} else if (isForced(CONSTRUCTOR_NAME, true)) {
var instance = new Constructor();
// early implementations not supports chaining
var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;
// V8 ~ Chromium 40- weak-collections throws on primitives, but should return false
var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); });
// most early implementations doesn't supports iterables, most modern - not close it correctly
// eslint-disable-next-line no-new
var ACCEPT_ITERABLES = checkCorrectnessOfIteration(function (iterable) { new NativeConstructor(iterable); });
// for early implementations -0 and +0 not the same
var BUGGY_ZERO = !IS_WEAK && fails(function () {
// V8 ~ Chromium 42- fails only with 5+ elements
var $instance = new NativeConstructor();
var index = 5;
while (index--) $instance[ADDER](index, index);
return !$instance.has(-0);
});
if (!ACCEPT_ITERABLES) {
Constructor = wrapper(function (dummy, iterable) {
anInstance(dummy, Constructor, CONSTRUCTOR_NAME);
var that = inheritIfRequired(new NativeConstructor(), dummy, Constructor);
if (iterable != undefined) iterate(iterable, that[ADDER], that, IS_MAP);
return that;
});
Constructor.prototype = NativePrototype;
NativePrototype.constructor = Constructor;
}
if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {
fixMethod('delete');
fixMethod('has');
IS_MAP && fixMethod('get');
}
if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER);
// weak collections should not contains .clear method
if (IS_WEAK && NativePrototype.clear) delete NativePrototype.clear;
}
exported[CONSTRUCTOR_NAME] = Constructor;
$({ global: true, forced: Constructor != NativeConstructor }, exported);
setToStringTag(Constructor, CONSTRUCTOR_NAME);
if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP);
return Constructor;
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/copy-constructor-properties.js":
/*!******************************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/copy-constructor-properties.js ***!
\******************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var has = __webpack_require__(/*! ../internals/has */ "./node_modules/canvg/node_modules/core-js/internals/has.js");
var ownKeys = __webpack_require__(/*! ../internals/own-keys */ "./node_modules/canvg/node_modules/core-js/internals/own-keys.js");
var getOwnPropertyDescriptorModule = __webpack_require__(/*! ../internals/object-get-own-property-descriptor */ "./node_modules/canvg/node_modules/core-js/internals/object-get-own-property-descriptor.js");
var definePropertyModule = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/canvg/node_modules/core-js/internals/object-define-property.js");
module.exports = function (target, source) {
var keys = ownKeys(source);
var defineProperty = definePropertyModule.f;
var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
}
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/correct-is-regexp-logic.js":
/*!**************************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/correct-is-regexp-logic.js ***!
\**************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/canvg/node_modules/core-js/internals/well-known-symbol.js");
var MATCH = wellKnownSymbol('match');
module.exports = function (METHOD_NAME) {
var regexp = /./;
try {
'/./'[METHOD_NAME](regexp);
} catch (e) {
try {
regexp[MATCH] = false;
return '/./'[METHOD_NAME](regexp);
} catch (f) { /* empty */ }
} return false;
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/correct-prototype-getter.js":
/*!***************************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/correct-prototype-getter.js ***!
\***************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/canvg/node_modules/core-js/internals/fails.js");
module.exports = !fails(function () {
function F() { /* empty */ }
F.prototype.constructor = null;
return Object.getPrototypeOf(new F()) !== F.prototype;
});
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/create-iterator-constructor.js":
/*!******************************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/create-iterator-constructor.js ***!
\******************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var IteratorPrototype = __webpack_require__(/*! ../internals/iterators-core */ "./node_modules/canvg/node_modules/core-js/internals/iterators-core.js").IteratorPrototype;
var create = __webpack_require__(/*! ../internals/object-create */ "./node_modules/canvg/node_modules/core-js/internals/object-create.js");
var createPropertyDescriptor = __webpack_require__(/*! ../internals/create-property-descriptor */ "./node_modules/canvg/node_modules/core-js/internals/create-property-descriptor.js");
var setToStringTag = __webpack_require__(/*! ../internals/set-to-string-tag */ "./node_modules/canvg/node_modules/core-js/internals/set-to-string-tag.js");
var Iterators = __webpack_require__(/*! ../internals/iterators */ "./node_modules/canvg/node_modules/core-js/internals/iterators.js");
var returnThis = function () { return this; };
module.exports = function (IteratorConstructor, NAME, next) {
var TO_STRING_TAG = NAME + ' Iterator';
IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(1, next) });
setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);
Iterators[TO_STRING_TAG] = returnThis;
return IteratorConstructor;
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/create-non-enumerable-property.js":
/*!*********************************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/create-non-enumerable-property.js ***!
\*********************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/canvg/node_modules/core-js/internals/descriptors.js");
var definePropertyModule = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/canvg/node_modules/core-js/internals/object-define-property.js");
var createPropertyDescriptor = __webpack_require__(/*! ../internals/create-property-descriptor */ "./node_modules/canvg/node_modules/core-js/internals/create-property-descriptor.js");
module.exports = DESCRIPTORS ? function (object, key, value) {
return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
} : function (object, key, value) {
object[key] = value;
return object;
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/create-property-descriptor.js":
/*!*****************************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/create-property-descriptor.js ***!
\*****************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = function (bitmap, value) {
return {
enumerable: !(bitmap & 1),
configurable: !(bitmap & 2),
writable: !(bitmap & 4),
value: value
};
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/create-property.js":
/*!******************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/create-property.js ***!
\******************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var toPrimitive = __webpack_require__(/*! ../internals/to-primitive */ "./node_modules/canvg/node_modules/core-js/internals/to-primitive.js");
var definePropertyModule = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/canvg/node_modules/core-js/internals/object-define-property.js");
var createPropertyDescriptor = __webpack_require__(/*! ../internals/create-property-descriptor */ "./node_modules/canvg/node_modules/core-js/internals/create-property-descriptor.js");
module.exports = function (object, key, value) {
var propertyKey = toPrimitive(key);
if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));
else object[propertyKey] = value;
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/define-iterator.js":
/*!******************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/define-iterator.js ***!
\******************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/canvg/node_modules/core-js/internals/export.js");
var createIteratorConstructor = __webpack_require__(/*! ../internals/create-iterator-constructor */ "./node_modules/canvg/node_modules/core-js/internals/create-iterator-constructor.js");
var getPrototypeOf = __webpack_require__(/*! ../internals/object-get-prototype-of */ "./node_modules/canvg/node_modules/core-js/internals/object-get-prototype-of.js");
var setPrototypeOf = __webpack_require__(/*! ../internals/object-set-prototype-of */ "./node_modules/canvg/node_modules/core-js/internals/object-set-prototype-of.js");
var setToStringTag = __webpack_require__(/*! ../internals/set-to-string-tag */ "./node_modules/canvg/node_modules/core-js/internals/set-to-string-tag.js");
var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "./node_modules/canvg/node_modules/core-js/internals/create-non-enumerable-property.js");
var redefine = __webpack_require__(/*! ../internals/redefine */ "./node_modules/canvg/node_modules/core-js/internals/redefine.js");
var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/canvg/node_modules/core-js/internals/well-known-symbol.js");
var IS_PURE = __webpack_require__(/*! ../internals/is-pure */ "./node_modules/canvg/node_modules/core-js/internals/is-pure.js");
var Iterators = __webpack_require__(/*! ../internals/iterators */ "./node_modules/canvg/node_modules/core-js/internals/iterators.js");
var IteratorsCore = __webpack_require__(/*! ../internals/iterators-core */ "./node_modules/canvg/node_modules/core-js/internals/iterators-core.js");
var IteratorPrototype = IteratorsCore.IteratorPrototype;
var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
var ITERATOR = wellKnownSymbol('iterator');
var KEYS = 'keys';
var VALUES = 'values';
var ENTRIES = 'entries';
var returnThis = function () { return this; };
module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
createIteratorConstructor(IteratorConstructor, NAME, next);
var getIterationMethod = function (KIND) {
if (KIND === DEFAULT && defaultIterator) return defaultIterator;
if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
switch (KIND) {
case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
} return function () { return new IteratorConstructor(this); };
};
var TO_STRING_TAG = NAME + ' Iterator';
var INCORRECT_VALUES_NAME = false;
var IterablePrototype = Iterable.prototype;
var nativeIterator = IterablePrototype[ITERATOR]
|| IterablePrototype['@@iterator']
|| DEFAULT && IterablePrototype[DEFAULT];
var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
var CurrentIteratorPrototype, methods, KEY;
// fix native
if (anyNativeIterator) {
CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
if (IteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
if (setPrototypeOf) {
setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
} else if (typeof CurrentIteratorPrototype[ITERATOR] != 'function') {
createNonEnumerableProperty(CurrentIteratorPrototype, ITERATOR, returnThis);
}
}
// Set @@toStringTag to native iterators
setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);
if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis;
}
}
// fix Array#{values, @@iterator}.name in V8 / FF
if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
INCORRECT_VALUES_NAME = true;
defaultIterator = function values() { return nativeIterator.call(this); };
}
// define iterator
if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {
createNonEnumerableProperty(IterablePrototype, ITERATOR, defaultIterator);
}
Iterators[NAME] = defaultIterator;
// export additional methods
if (DEFAULT) {
methods = {
values: getIterationMethod(VALUES),
keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
entries: getIterationMethod(ENTRIES)
};
if (FORCED) for (KEY in methods) {
if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
redefine(IterablePrototype, KEY, methods[KEY]);
}
} else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
}
return methods;
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/define-well-known-symbol.js":
/*!***************************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/define-well-known-symbol.js ***!
\***************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var path = __webpack_require__(/*! ../internals/path */ "./node_modules/canvg/node_modules/core-js/internals/path.js");
var has = __webpack_require__(/*! ../internals/has */ "./node_modules/canvg/node_modules/core-js/internals/has.js");
var wrappedWellKnownSymbolModule = __webpack_require__(/*! ../internals/well-known-symbol-wrapped */ "./node_modules/canvg/node_modules/core-js/internals/well-known-symbol-wrapped.js");
var defineProperty = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/canvg/node_modules/core-js/internals/object-define-property.js").f;
module.exports = function (NAME) {
var Symbol = path.Symbol || (path.Symbol = {});
if (!has(Symbol, NAME)) defineProperty(Symbol, NAME, {
value: wrappedWellKnownSymbolModule.f(NAME)
});
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/descriptors.js":
/*!**************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/descriptors.js ***!
\**************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/canvg/node_modules/core-js/internals/fails.js");
// Thank's IE8 for his funny defineProperty
module.exports = !fails(function () {
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
});
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/document-create-element.js":
/*!**************************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/document-create-element.js ***!
\**************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__(/*! ../internals/global */ "./node_modules/canvg/node_modules/core-js/internals/global.js");
var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/canvg/node_modules/core-js/internals/is-object.js");
var document = global.document;
// typeof document.createElement is 'object' in old IE
var EXISTS = isObject(document) && isObject(document.createElement);
module.exports = function (it) {
return EXISTS ? document.createElement(it) : {};
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/dom-iterables.js":
/*!****************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/dom-iterables.js ***!
\****************************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
// iterable DOM collections
// flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
module.exports = {
CSSRuleList: 0,
CSSStyleDeclaration: 0,
CSSValueList: 0,
ClientRectList: 0,
DOMRectList: 0,
DOMStringList: 0,
DOMTokenList: 1,
DataTransferItemList: 0,
FileList: 0,
HTMLAllCollection: 0,
HTMLCollection: 0,
HTMLFormElement: 0,
HTMLSelectElement: 0,
MediaList: 0,
MimeTypeArray: 0,
NamedNodeMap: 0,
NodeList: 1,
PaintRequestList: 0,
Plugin: 0,
PluginArray: 0,
SVGLengthList: 0,
SVGNumberList: 0,
SVGPathSegList: 0,
SVGPointList: 0,
SVGStringList: 0,
SVGTransformList: 0,
SourceBufferList: 0,
StyleSheetList: 0,
TextTrackCueList: 0,
TextTrackList: 0,
TouchList: 0
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/engine-is-ios.js":
/*!****************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/engine-is-ios.js ***!
\****************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var userAgent = __webpack_require__(/*! ../internals/engine-user-agent */ "./node_modules/canvg/node_modules/core-js/internals/engine-user-agent.js");
module.exports = /(iphone|ipod|ipad).*applewebkit/i.test(userAgent);
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/engine-user-agent.js":
/*!********************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/engine-user-agent.js ***!
\********************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ "./node_modules/canvg/node_modules/core-js/internals/get-built-in.js");
module.exports = getBuiltIn('navigator', 'userAgent') || '';
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/engine-v8-version.js":
/*!********************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/engine-v8-version.js ***!
\********************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__(/*! ../internals/global */ "./node_modules/canvg/node_modules/core-js/internals/global.js");
var userAgent = __webpack_require__(/*! ../internals/engine-user-agent */ "./node_modules/canvg/node_modules/core-js/internals/engine-user-agent.js");
var process = global.process;
var versions = process && process.versions;
var v8 = versions && versions.v8;
var match, version;
if (v8) {
match = v8.split('.');
version = match[0] + match[1];
} else if (userAgent) {
match = userAgent.match(/Edge\/(\d+)/);
if (!match || match[1] >= 74) {
match = userAgent.match(/Chrome\/(\d+)/);
if (match) version = match[1];
}
}
module.exports = version && +version;
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/enum-bug-keys.js":
/*!****************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/enum-bug-keys.js ***!
\****************************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
// IE8- don't enum bug keys
module.exports = [
'constructor',
'hasOwnProperty',
'isPrototypeOf',
'propertyIsEnumerable',
'toLocaleString',
'toString',
'valueOf'
];
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/export.js":
/*!*********************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/export.js ***!
\*********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__(/*! ../internals/global */ "./node_modules/canvg/node_modules/core-js/internals/global.js");
var getOwnPropertyDescriptor = __webpack_require__(/*! ../internals/object-get-own-property-descriptor */ "./node_modules/canvg/node_modules/core-js/internals/object-get-own-property-descriptor.js").f;
var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "./node_modules/canvg/node_modules/core-js/internals/create-non-enumerable-property.js");
var redefine = __webpack_require__(/*! ../internals/redefine */ "./node_modules/canvg/node_modules/core-js/internals/redefine.js");
var setGlobal = __webpack_require__(/*! ../internals/set-global */ "./node_modules/canvg/node_modules/core-js/internals/set-global.js");
var copyConstructorProperties = __webpack_require__(/*! ../internals/copy-constructor-properties */ "./node_modules/canvg/node_modules/core-js/internals/copy-constructor-properties.js");
var isForced = __webpack_require__(/*! ../internals/is-forced */ "./node_modules/canvg/node_modules/core-js/internals/is-forced.js");
/*
options.target - name of the target object
options.global - target is the global object
options.stat - export as static methods of target
options.proto - export as prototype methods of target
options.real - real prototype method for the `pure` version
options.forced - export even if the native feature is available
options.bind - bind methods to the target, required for the `pure` version
options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
options.unsafe - use the simple assignment of property instead of delete + defineProperty
options.sham - add a flag to not completely full polyfills
options.enumerable - export as enumerable property
options.noTargetGet - prevent calling a getter on target
*/
module.exports = function (options, source) {
var TARGET = options.target;
var GLOBAL = options.global;
var STATIC = options.stat;
var FORCED, target, key, targetProperty, sourceProperty, descriptor;
if (GLOBAL) {
target = global;
} else if (STATIC) {
target = global[TARGET] || setGlobal(TARGET, {});
} else {
target = (global[TARGET] || {}).prototype;
}
if (target) for (key in source) {
sourceProperty = source[key];
if (options.noTargetGet) {
descriptor = getOwnPropertyDescriptor(target, key);
targetProperty = descriptor && descriptor.value;
} else targetProperty = target[key];
FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
// contained in target
if (!FORCED && targetProperty !== undefined) {
if (typeof sourceProperty === typeof targetProperty) continue;
copyConstructorProperties(sourceProperty, targetProperty);
}
// add a flag to not completely full polyfills
if (options.sham || (targetProperty && targetProperty.sham)) {
createNonEnumerableProperty(sourceProperty, 'sham', true);
}
// extend global
redefine(target, key, sourceProperty, options);
}
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/fails.js":
/*!********************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/fails.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = function (exec) {
try {
return !!exec();
} catch (error) {
return true;
}
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js":
/*!*************************************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js ***!
\*************************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// TODO: Remove from `core-js@4` since it's moved to entry points
__webpack_require__(/*! ../modules/es.regexp.exec */ "./node_modules/canvg/node_modules/core-js/modules/es.regexp.exec.js");
var redefine = __webpack_require__(/*! ../internals/redefine */ "./node_modules/canvg/node_modules/core-js/internals/redefine.js");
var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/canvg/node_modules/core-js/internals/fails.js");
var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/canvg/node_modules/core-js/internals/well-known-symbol.js");
var regexpExec = __webpack_require__(/*! ../internals/regexp-exec */ "./node_modules/canvg/node_modules/core-js/internals/regexp-exec.js");
var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "./node_modules/canvg/node_modules/core-js/internals/create-non-enumerable-property.js");
var SPECIES = wellKnownSymbol('species');
var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
// #replace needs built-in support for named groups.
// #match works fine because it just return the exec results, even if it has
// a "grops" property.
var re = /./;
re.exec = function () {
var result = [];
result.groups = { a: '7' };
return result;
};
return ''.replace(re, '$<a>') !== '7';
});
// IE <= 11 replaces $0 with the whole match, as if it was $&
// https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
var REPLACE_KEEPS_$0 = (function () {
return 'a'.replace(/./, '$0') === '$0';
})();
var REPLACE = wellKnownSymbol('replace');
// Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
if (/./[REPLACE]) {
return /./[REPLACE]('a', '$0') === '';
}
return false;
})();
// Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
// Weex JS has frozen built-in prototypes, so use try / catch wrapper
var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
var re = /(?:)/;
var originalExec = re.exec;
re.exec = function () { return originalExec.apply(this, arguments); };
var result = 'ab'.split(re);
return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
});
module.exports = function (KEY, length, exec, sham) {
var SYMBOL = wellKnownSymbol(KEY);
var DELEGATES_TO_SYMBOL = !fails(function () {
// String methods call symbol-named RegEp methods
var O = {};
O[SYMBOL] = function () { return 7; };
return ''[KEY](O) != 7;
});
var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
// Symbol-named RegExp methods call .exec
var execCalled = false;
var re = /a/;
if (KEY === 'split') {
// We can't use real regex here since it causes deoptimization
// and serious performance degradation in V8
// https://github.com/zloirock/core-js/issues/306
re = {};
// RegExp[@@split] doesn't call the regex's exec method, but first creates
// a new one. We need to return the patched regex when creating the new one.
re.constructor = {};
re.constructor[SPECIES] = function () { return re; };
re.flags = '';
re[SYMBOL] = /./[SYMBOL];
}
re.exec = function () { execCalled = true; return null; };
re[SYMBOL]('');
return !execCalled;
});
if (
!DELEGATES_TO_SYMBOL ||
!DELEGATES_TO_EXEC ||
(KEY === 'replace' && !(
REPLACE_SUPPORTS_NAMED_GROUPS &&
REPLACE_KEEPS_$0 &&
!REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
)) ||
(KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
) {
var nativeRegExpMethod = /./[SYMBOL];
var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
if (regexp.exec === regexpExec) {
if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
// The native String method already delegates to @@method (this
// polyfilled function), leasing to infinite recursion.
// We avoid it by directly calling the native @@method method.
return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
}
return { done: true, value: nativeMethod.call(str, regexp, arg2) };
}
return { done: false };
}, {
REPLACE_KEEPS_$0: REPLACE_KEEPS_$0,
REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE: REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
});
var stringMethod = methods[0];
var regexMethod = methods[1];
redefine(String.prototype, KEY, stringMethod);
redefine(RegExp.prototype, SYMBOL, length == 2
// 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
// 21.2.5.11 RegExp.prototype[@@split](string, limit)
? function (string, arg) { return regexMethod.call(string, this, arg); }
// 21.2.5.6 RegExp.prototype[@@match](string)
// 21.2.5.9 RegExp.prototype[@@search](string)
: function (string) { return regexMethod.call(string, this); }
);
}
if (sham) createNonEnumerableProperty(RegExp.prototype[SYMBOL], 'sham', true);
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/freezing.js":
/*!***********************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/freezing.js ***!
\***********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/canvg/node_modules/core-js/internals/fails.js");
module.exports = !fails(function () {
return Object.isExtensible(Object.preventExtensions({}));
});
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/function-bind-context.js":
/*!************************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/function-bind-context.js ***!
\************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var aFunction = __webpack_require__(/*! ../internals/a-function */ "./node_modules/canvg/node_modules/core-js/internals/a-function.js");
// optional / simple context binding
module.exports = function (fn, that, length) {
aFunction(fn);
if (that === undefined) return fn;
switch (length) {
case 0: return function () {
return fn.call(that);
};
case 1: return function (a) {
return fn.call(that, a);
};
case 2: return function (a, b) {
return fn.call(that, a, b);
};
case 3: return function (a, b, c) {
return fn.call(that, a, b, c);
};
}
return function (/* ...args */) {
return fn.apply(that, arguments);
};
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/function-bind.js":
/*!****************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/function-bind.js ***!
\****************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var aFunction = __webpack_require__(/*! ../internals/a-function */ "./node_modules/canvg/node_modules/core-js/internals/a-function.js");
var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/canvg/node_modules/core-js/internals/is-object.js");
var slice = [].slice;
var factories = {};
var construct = function (C, argsLength, args) {
if (!(argsLength in factories)) {
for (var list = [], i = 0; i < argsLength; i++) list[i] = 'a[' + i + ']';
// eslint-disable-next-line no-new-func
factories[argsLength] = Function('C,a', 'return new C(' + list.join(',') + ')');
} return factories[argsLength](C, args);
};
// `Function.prototype.bind` method implementation
// https://tc39.github.io/ecma262/#sec-function.prototype.bind
module.exports = Function.bind || function bind(that /* , ...args */) {
var fn = aFunction(this);
var partArgs = slice.call(arguments, 1);
var boundFunction = function bound(/* args... */) {
var args = partArgs.concat(slice.call(arguments));
return this instanceof boundFunction ? construct(fn, args.length, args) : fn.apply(that, args);
};
if (isObject(fn.prototype)) boundFunction.prototype = fn.prototype;
return boundFunction;
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/get-built-in.js":
/*!***************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/get-built-in.js ***!
\***************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var path = __webpack_require__(/*! ../internals/path */ "./node_modules/canvg/node_modules/core-js/internals/path.js");
var global = __webpack_require__(/*! ../internals/global */ "./node_modules/canvg/node_modules/core-js/internals/global.js");
var aFunction = function (variable) {
return typeof variable == 'function' ? variable : undefined;
};
module.exports = function (namespace, method) {
return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace])
: path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method];
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/get-iterator-method.js":
/*!**********************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/get-iterator-method.js ***!
\**********************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var classof = __webpack_require__(/*! ../internals/classof */ "./node_modules/canvg/node_modules/core-js/internals/classof.js");
var Iterators = __webpack_require__(/*! ../internals/iterators */ "./node_modules/canvg/node_modules/core-js/internals/iterators.js");
var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/canvg/node_modules/core-js/internals/well-known-symbol.js");
var ITERATOR = wellKnownSymbol('iterator');
module.exports = function (it) {
if (it != undefined) return it[ITERATOR]
|| it['@@iterator']
|| Iterators[classof(it)];
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/global.js":
/*!*********************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/global.js ***!
\*********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {var check = function (it) {
return it && it.Math == Math && it;
};
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
module.exports =
// eslint-disable-next-line no-undef
check(typeof globalThis == 'object' && globalThis) ||
check(typeof window == 'object' && window) ||
check(typeof self == 'object' && self) ||
check(typeof global == 'object' && global) ||
// eslint-disable-next-line no-new-func
Function('return this')();
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/has.js":
/*!******************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/has.js ***!
\******************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
var hasOwnProperty = {}.hasOwnProperty;
module.exports = function (it, key) {
return hasOwnProperty.call(it, key);
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/hidden-keys.js":
/*!**************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/hidden-keys.js ***!
\**************************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = {};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/host-report-errors.js":
/*!*********************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/host-report-errors.js ***!
\*********************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__(/*! ../internals/global */ "./node_modules/canvg/node_modules/core-js/internals/global.js");
module.exports = function (a, b) {
var console = global.console;
if (console && console.error) {
arguments.length === 1 ? console.error(a) : console.error(a, b);
}
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/html.js":
/*!*******************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/html.js ***!
\*******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ "./node_modules/canvg/node_modules/core-js/internals/get-built-in.js");
module.exports = getBuiltIn('document', 'documentElement');
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/ie8-dom-define.js":
/*!*****************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/ie8-dom-define.js ***!
\*****************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/canvg/node_modules/core-js/internals/descriptors.js");
var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/canvg/node_modules/core-js/internals/fails.js");
var createElement = __webpack_require__(/*! ../internals/document-create-element */ "./node_modules/canvg/node_modules/core-js/internals/document-create-element.js");
// Thank's IE8 for his funny defineProperty
module.exports = !DESCRIPTORS && !fails(function () {
return Object.defineProperty(createElement('div'), 'a', {
get: function () { return 7; }
}).a != 7;
});
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/indexed-object.js":
/*!*****************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/indexed-object.js ***!
\*****************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/canvg/node_modules/core-js/internals/fails.js");
var classof = __webpack_require__(/*! ../internals/classof-raw */ "./node_modules/canvg/node_modules/core-js/internals/classof-raw.js");
var split = ''.split;
// fallback for non-array-like ES3 and non-enumerable old V8 strings
module.exports = fails(function () {
// throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
// eslint-disable-next-line no-prototype-builtins
return !Object('z').propertyIsEnumerable(0);
}) ? function (it) {
return classof(it) == 'String' ? split.call(it, '') : Object(it);
} : Object;
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/inherit-if-required.js":
/*!**********************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/inherit-if-required.js ***!
\**********************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/canvg/node_modules/core-js/internals/is-object.js");
var setPrototypeOf = __webpack_require__(/*! ../internals/object-set-prototype-of */ "./node_modules/canvg/node_modules/core-js/internals/object-set-prototype-of.js");
// makes subclassing work correct for wrapped built-ins
module.exports = function ($this, dummy, Wrapper) {
var NewTarget, NewTargetPrototype;
if (
// it can work only with native `setPrototypeOf`
setPrototypeOf &&
// we haven't completely correct pre-ES6 way for getting `new.target`, so use this
typeof (NewTarget = dummy.constructor) == 'function' &&
NewTarget !== Wrapper &&
isObject(NewTargetPrototype = NewTarget.prototype) &&
NewTargetPrototype !== Wrapper.prototype
) setPrototypeOf($this, NewTargetPrototype);
return $this;
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/inspect-source.js":
/*!*****************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/inspect-source.js ***!
\*****************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var store = __webpack_require__(/*! ../internals/shared-store */ "./node_modules/canvg/node_modules/core-js/internals/shared-store.js");
var functionToString = Function.toString;
// this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
if (typeof store.inspectSource != 'function') {
store.inspectSource = function (it) {
return functionToString.call(it);
};
}
module.exports = store.inspectSource;
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/internal-metadata.js":
/*!********************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/internal-metadata.js ***!
\********************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var hiddenKeys = __webpack_require__(/*! ../internals/hidden-keys */ "./node_modules/canvg/node_modules/core-js/internals/hidden-keys.js");
var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/canvg/node_modules/core-js/internals/is-object.js");
var has = __webpack_require__(/*! ../internals/has */ "./node_modules/canvg/node_modules/core-js/internals/has.js");
var defineProperty = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/canvg/node_modules/core-js/internals/object-define-property.js").f;
var uid = __webpack_require__(/*! ../internals/uid */ "./node_modules/canvg/node_modules/core-js/internals/uid.js");
var FREEZING = __webpack_require__(/*! ../internals/freezing */ "./node_modules/canvg/node_modules/core-js/internals/freezing.js");
var METADATA = uid('meta');
var id = 0;
var isExtensible = Object.isExtensible || function () {
return true;
};
var setMetadata = function (it) {
defineProperty(it, METADATA, { value: {
objectID: 'O' + ++id, // object ID
weakData: {} // weak collections IDs
} });
};
var fastKey = function (it, create) {
// return a primitive with prefix
if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
if (!has(it, METADATA)) {
// can't set metadata to uncaught frozen object
if (!isExtensible(it)) return 'F';
// not necessary to add metadata
if (!create) return 'E';
// add missing metadata
setMetadata(it);
// return object ID
} return it[METADATA].objectID;
};
var getWeakData = function (it, create) {
if (!has(it, METADATA)) {
// can't set metadata to uncaught frozen object
if (!isExtensible(it)) return true;
// not necessary to add metadata
if (!create) return false;
// add missing metadata
setMetadata(it);
// return the store of weak collections IDs
} return it[METADATA].weakData;
};
// add metadata on freeze-family methods calling
var onFreeze = function (it) {
if (FREEZING && meta.REQUIRED && isExtensible(it) && !has(it, METADATA)) setMetadata(it);
return it;
};
var meta = module.exports = {
REQUIRED: false,
fastKey: fastKey,
getWeakData: getWeakData,
onFreeze: onFreeze
};
hiddenKeys[METADATA] = true;
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/internal-state.js":
/*!*****************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/internal-state.js ***!
\*****************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var NATIVE_WEAK_MAP = __webpack_require__(/*! ../internals/native-weak-map */ "./node_modules/canvg/node_modules/core-js/internals/native-weak-map.js");
var global = __webpack_require__(/*! ../internals/global */ "./node_modules/canvg/node_modules/core-js/internals/global.js");
var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/canvg/node_modules/core-js/internals/is-object.js");
var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "./node_modules/canvg/node_modules/core-js/internals/create-non-enumerable-property.js");
var objectHas = __webpack_require__(/*! ../internals/has */ "./node_modules/canvg/node_modules/core-js/internals/has.js");
var sharedKey = __webpack_require__(/*! ../internals/shared-key */ "./node_modules/canvg/node_modules/core-js/internals/shared-key.js");
var hiddenKeys = __webpack_require__(/*! ../internals/hidden-keys */ "./node_modules/canvg/node_modules/core-js/internals/hidden-keys.js");
var WeakMap = global.WeakMap;
var set, get, has;
var enforce = function (it) {
return has(it) ? get(it) : set(it, {});
};
var getterFor = function (TYPE) {
return function (it) {
var state;
if (!isObject(it) || (state = get(it)).type !== TYPE) {
throw TypeError('Incompatible receiver, ' + TYPE + ' required');
} return state;
};
};
if (NATIVE_WEAK_MAP) {
var store = new WeakMap();
var wmget = store.get;
var wmhas = store.has;
var wmset = store.set;
set = function (it, metadata) {
wmset.call(store, it, metadata);
return metadata;
};
get = function (it) {
return wmget.call(store, it) || {};
};
has = function (it) {
return wmhas.call(store, it);
};
} else {
var STATE = sharedKey('state');
hiddenKeys[STATE] = true;
set = function (it, metadata) {
createNonEnumerableProperty(it, STATE, metadata);
return metadata;
};
get = function (it) {
return objectHas(it, STATE) ? it[STATE] : {};
};
has = function (it) {
return objectHas(it, STATE);
};
}
module.exports = {
set: set,
get: get,
has: has,
enforce: enforce,
getterFor: getterFor
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/is-array-iterator-method.js":
/*!***************************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/is-array-iterator-method.js ***!
\***************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/canvg/node_modules/core-js/internals/well-known-symbol.js");
var Iterators = __webpack_require__(/*! ../internals/iterators */ "./node_modules/canvg/node_modules/core-js/internals/iterators.js");
var ITERATOR = wellKnownSymbol('iterator');
var ArrayPrototype = Array.prototype;
// check on default Array iterator
module.exports = function (it) {
return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/is-array.js":
/*!***********************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/is-array.js ***!
\***********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var classof = __webpack_require__(/*! ../internals/classof-raw */ "./node_modules/canvg/node_modules/core-js/internals/classof-raw.js");
// `IsArray` abstract operation
// https://tc39.github.io/ecma262/#sec-isarray
module.exports = Array.isArray || function isArray(arg) {
return classof(arg) == 'Array';
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/is-forced.js":
/*!************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/is-forced.js ***!
\************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/canvg/node_modules/core-js/internals/fails.js");
var replacement = /#|\.prototype\./;
var isForced = function (feature, detection) {
var value = data[normalize(feature)];
return value == POLYFILL ? true
: value == NATIVE ? false
: typeof detection == 'function' ? fails(detection)
: !!detection;
};
var normalize = isForced.normalize = function (string) {
return String(string).replace(replacement, '.').toLowerCase();
};
var data = isForced.data = {};
var NATIVE = isForced.NATIVE = 'N';
var POLYFILL = isForced.POLYFILL = 'P';
module.exports = isForced;
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/is-object.js":
/*!************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/is-object.js ***!
\************************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = function (it) {
return typeof it === 'object' ? it !== null : typeof it === 'function';
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/is-pure.js":
/*!**********************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/is-pure.js ***!
\**********************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = false;
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/is-regexp.js":
/*!************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/is-regexp.js ***!
\************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/canvg/node_modules/core-js/internals/is-object.js");
var classof = __webpack_require__(/*! ../internals/classof-raw */ "./node_modules/canvg/node_modules/core-js/internals/classof-raw.js");
var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/canvg/node_modules/core-js/internals/well-known-symbol.js");
var MATCH = wellKnownSymbol('match');
// `IsRegExp` abstract operation
// https://tc39.github.io/ecma262/#sec-isregexp
module.exports = function (it) {
var isRegExp;
return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) == 'RegExp');
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/iterate.js":
/*!**********************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/iterate.js ***!
\**********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/canvg/node_modules/core-js/internals/an-object.js");
var isArrayIteratorMethod = __webpack_require__(/*! ../internals/is-array-iterator-method */ "./node_modules/canvg/node_modules/core-js/internals/is-array-iterator-method.js");
var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/canvg/node_modules/core-js/internals/to-length.js");
var bind = __webpack_require__(/*! ../internals/function-bind-context */ "./node_modules/canvg/node_modules/core-js/internals/function-bind-context.js");
var getIteratorMethod = __webpack_require__(/*! ../internals/get-iterator-method */ "./node_modules/canvg/node_modules/core-js/internals/get-iterator-method.js");
var callWithSafeIterationClosing = __webpack_require__(/*! ../internals/call-with-safe-iteration-closing */ "./node_modules/canvg/node_modules/core-js/internals/call-with-safe-iteration-closing.js");
var Result = function (stopped, result) {
this.stopped = stopped;
this.result = result;
};
var iterate = module.exports = function (iterable, fn, that, AS_ENTRIES, IS_ITERATOR) {
var boundFunction = bind(fn, that, AS_ENTRIES ? 2 : 1);
var iterator, iterFn, index, length, result, next, step;
if (IS_ITERATOR) {
iterator = iterable;
} else {
iterFn = getIteratorMethod(iterable);
if (typeof iterFn != 'function') throw TypeError('Target is not iterable');
// optimisation for array iterators
if (isArrayIteratorMethod(iterFn)) {
for (index = 0, length = toLength(iterable.length); length > index; index++) {
result = AS_ENTRIES
? boundFunction(anObject(step = iterable[index])[0], step[1])
: boundFunction(iterable[index]);
if (result && result instanceof Result) return result;
} return new Result(false);
}
iterator = iterFn.call(iterable);
}
next = iterator.next;
while (!(step = next.call(iterator)).done) {
result = callWithSafeIterationClosing(iterator, boundFunction, step.value, AS_ENTRIES);
if (typeof result == 'object' && result && result instanceof Result) return result;
} return new Result(false);
};
iterate.stop = function (result) {
return new Result(true, result);
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/iterators-core.js":
/*!*****************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/iterators-core.js ***!
\*****************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var getPrototypeOf = __webpack_require__(/*! ../internals/object-get-prototype-of */ "./node_modules/canvg/node_modules/core-js/internals/object-get-prototype-of.js");
var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "./node_modules/canvg/node_modules/core-js/internals/create-non-enumerable-property.js");
var has = __webpack_require__(/*! ../internals/has */ "./node_modules/canvg/node_modules/core-js/internals/has.js");
var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/canvg/node_modules/core-js/internals/well-known-symbol.js");
var IS_PURE = __webpack_require__(/*! ../internals/is-pure */ "./node_modules/canvg/node_modules/core-js/internals/is-pure.js");
var ITERATOR = wellKnownSymbol('iterator');
var BUGGY_SAFARI_ITERATORS = false;
var returnThis = function () { return this; };
// `%IteratorPrototype%` object
// https://tc39.github.io/ecma262/#sec-%iteratorprototype%-object
var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
if ([].keys) {
arrayIterator = [].keys();
// Safari 8 has buggy iterators w/o `next`
if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;
else {
PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));
if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;
}
}
if (IteratorPrototype == undefined) IteratorPrototype = {};
// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
if (!IS_PURE && !has(IteratorPrototype, ITERATOR)) {
createNonEnumerableProperty(IteratorPrototype, ITERATOR, returnThis);
}
module.exports = {
IteratorPrototype: IteratorPrototype,
BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/iterators.js":
/*!************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/iterators.js ***!
\************************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = {};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/microtask.js":
/*!************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/microtask.js ***!
\************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__(/*! ../internals/global */ "./node_modules/canvg/node_modules/core-js/internals/global.js");
var getOwnPropertyDescriptor = __webpack_require__(/*! ../internals/object-get-own-property-descriptor */ "./node_modules/canvg/node_modules/core-js/internals/object-get-own-property-descriptor.js").f;
var classof = __webpack_require__(/*! ../internals/classof-raw */ "./node_modules/canvg/node_modules/core-js/internals/classof-raw.js");
var macrotask = __webpack_require__(/*! ../internals/task */ "./node_modules/canvg/node_modules/core-js/internals/task.js").set;
var IS_IOS = __webpack_require__(/*! ../internals/engine-is-ios */ "./node_modules/canvg/node_modules/core-js/internals/engine-is-ios.js");
var MutationObserver = global.MutationObserver || global.WebKitMutationObserver;
var process = global.process;
var Promise = global.Promise;
var IS_NODE = classof(process) == 'process';
// Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`
var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global, 'queueMicrotask');
var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
var flush, head, last, notify, toggle, node, promise, then;
// modern engines have queueMicrotask method
if (!queueMicrotask) {
flush = function () {
var parent, fn;
if (IS_NODE && (parent = process.domain)) parent.exit();
while (head) {
fn = head.fn;
head = head.next;
try {
fn();
} catch (error) {
if (head) notify();
else last = undefined;
throw error;
}
} last = undefined;
if (parent) parent.enter();
};
// Node.js
if (IS_NODE) {
notify = function () {
process.nextTick(flush);
};
// browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339
} else if (MutationObserver && !IS_IOS) {
toggle = true;
node = document.createTextNode('');
new MutationObserver(flush).observe(node, { characterData: true });
notify = function () {
node.data = toggle = !toggle;
};
// environments with maybe non-completely correct, but existent Promise
} else if (Promise && Promise.resolve) {
// Promise.resolve without an argument throws an error in LG WebOS 2
promise = Promise.resolve(undefined);
then = promise.then;
notify = function () {
then.call(promise, flush);
};
// for other environments - macrotask based on:
// - setImmediate
// - MessageChannel
// - window.postMessag
// - onreadystatechange
// - setTimeout
} else {
notify = function () {
// strange IE + webpack dev server bug - use .call(global)
macrotask.call(global, flush);
};
}
}
module.exports = queueMicrotask || function (fn) {
var task = { fn: fn, next: undefined };
if (last) last.next = task;
if (!head) {
head = task;
notify();
} last = task;
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/native-promise-constructor.js":
/*!*****************************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/native-promise-constructor.js ***!
\*****************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__(/*! ../internals/global */ "./node_modules/canvg/node_modules/core-js/internals/global.js");
module.exports = global.Promise;
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/native-symbol.js":
/*!****************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/native-symbol.js ***!
\****************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/canvg/node_modules/core-js/internals/fails.js");
module.exports = !!Object.getOwnPropertySymbols && !fails(function () {
// Chrome 38 Symbol has incorrect toString conversion
// eslint-disable-next-line no-undef
return !String(Symbol());
});
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/native-weak-map.js":
/*!******************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/native-weak-map.js ***!
\******************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__(/*! ../internals/global */ "./node_modules/canvg/node_modules/core-js/internals/global.js");
var inspectSource = __webpack_require__(/*! ../internals/inspect-source */ "./node_modules/canvg/node_modules/core-js/internals/inspect-source.js");
var WeakMap = global.WeakMap;
module.exports = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/new-promise-capability.js":
/*!*************************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/new-promise-capability.js ***!
\*************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var aFunction = __webpack_require__(/*! ../internals/a-function */ "./node_modules/canvg/node_modules/core-js/internals/a-function.js");
var PromiseCapability = function (C) {
var resolve, reject;
this.promise = new C(function ($$resolve, $$reject) {
if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
resolve = $$resolve;
reject = $$reject;
});
this.resolve = aFunction(resolve);
this.reject = aFunction(reject);
};
// 25.4.1.5 NewPromiseCapability(C)
module.exports.f = function (C) {
return new PromiseCapability(C);
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/not-a-regexp.js":
/*!***************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/not-a-regexp.js ***!
\***************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var isRegExp = __webpack_require__(/*! ../internals/is-regexp */ "./node_modules/canvg/node_modules/core-js/internals/is-regexp.js");
module.exports = function (it) {
if (isRegExp(it)) {
throw TypeError("The method doesn't accept regular expressions");
} return it;
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/object-create.js":
/*!****************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/object-create.js ***!
\****************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/canvg/node_modules/core-js/internals/an-object.js");
var defineProperties = __webpack_require__(/*! ../internals/object-define-properties */ "./node_modules/canvg/node_modules/core-js/internals/object-define-properties.js");
var enumBugKeys = __webpack_require__(/*! ../internals/enum-bug-keys */ "./node_modules/canvg/node_modules/core-js/internals/enum-bug-keys.js");
var hiddenKeys = __webpack_require__(/*! ../internals/hidden-keys */ "./node_modules/canvg/node_modules/core-js/internals/hidden-keys.js");
var html = __webpack_require__(/*! ../internals/html */ "./node_modules/canvg/node_modules/core-js/internals/html.js");
var documentCreateElement = __webpack_require__(/*! ../internals/document-create-element */ "./node_modules/canvg/node_modules/core-js/internals/document-create-element.js");
var sharedKey = __webpack_require__(/*! ../internals/shared-key */ "./node_modules/canvg/node_modules/core-js/internals/shared-key.js");
var GT = '>';
var LT = '<';
var PROTOTYPE = 'prototype';
var SCRIPT = 'script';
var IE_PROTO = sharedKey('IE_PROTO');
var EmptyConstructor = function () { /* empty */ };
var scriptTag = function (content) {
return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
};
// Create object with fake `null` prototype: use ActiveX Object with cleared prototype
var NullProtoObjectViaActiveX = function (activeXDocument) {
activeXDocument.write(scriptTag(''));
activeXDocument.close();
var temp = activeXDocument.parentWindow.Object;
activeXDocument = null; // avoid memory leak
return temp;
};
// Create object with fake `null` prototype: use iframe Object with cleared prototype
var NullProtoObjectViaIFrame = function () {
// Thrash, waste and sodomy: IE GC bug
var iframe = documentCreateElement('iframe');
var JS = 'java' + SCRIPT + ':';
var iframeDocument;
iframe.style.display = 'none';
html.appendChild(iframe);
// https://github.com/zloirock/core-js/issues/475
iframe.src = String(JS);
iframeDocument = iframe.contentWindow.document;
iframeDocument.open();
iframeDocument.write(scriptTag('document.F=Object'));
iframeDocument.close();
return iframeDocument.F;
};
// Check for document.domain and active x support
// No need to use active x approach when document.domain is not set
// see https://github.com/es-shims/es5-shim/issues/150
// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
// avoid IE GC bug
var activeXDocument;
var NullProtoObject = function () {
try {
/* global ActiveXObject */
activeXDocument = document.domain && new ActiveXObject('htmlfile');
} catch (error) { /* ignore */ }
NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
var length = enumBugKeys.length;
while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
return NullProtoObject();
};
hiddenKeys[IE_PROTO] = true;
// `Object.create` method
// https://tc39.github.io/ecma262/#sec-object.create
module.exports = Object.create || function create(O, Properties) {
var result;
if (O !== null) {
EmptyConstructor[PROTOTYPE] = anObject(O);
result = new EmptyConstructor();
EmptyConstructor[PROTOTYPE] = null;
// add "__proto__" for Object.getPrototypeOf polyfill
result[IE_PROTO] = O;
} else result = NullProtoObject();
return Properties === undefined ? result : defineProperties(result, Properties);
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/object-define-properties.js":
/*!***************************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/object-define-properties.js ***!
\***************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/canvg/node_modules/core-js/internals/descriptors.js");
var definePropertyModule = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/canvg/node_modules/core-js/internals/object-define-property.js");
var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/canvg/node_modules/core-js/internals/an-object.js");
var objectKeys = __webpack_require__(/*! ../internals/object-keys */ "./node_modules/canvg/node_modules/core-js/internals/object-keys.js");
// `Object.defineProperties` method
// https://tc39.github.io/ecma262/#sec-object.defineproperties
module.exports = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) {
anObject(O);
var keys = objectKeys(Properties);
var length = keys.length;
var index = 0;
var key;
while (length > index) definePropertyModule.f(O, key = keys[index++], Properties[key]);
return O;
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/object-define-property.js":
/*!*************************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/object-define-property.js ***!
\*************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/canvg/node_modules/core-js/internals/descriptors.js");
var IE8_DOM_DEFINE = __webpack_require__(/*! ../internals/ie8-dom-define */ "./node_modules/canvg/node_modules/core-js/internals/ie8-dom-define.js");
var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/canvg/node_modules/core-js/internals/an-object.js");
var toPrimitive = __webpack_require__(/*! ../internals/to-primitive */ "./node_modules/canvg/node_modules/core-js/internals/to-primitive.js");
var nativeDefineProperty = Object.defineProperty;
// `Object.defineProperty` method
// https://tc39.github.io/ecma262/#sec-object.defineproperty
exports.f = DESCRIPTORS ? nativeDefineProperty : function defineProperty(O, P, Attributes) {
anObject(O);
P = toPrimitive(P, true);
anObject(Attributes);
if (IE8_DOM_DEFINE) try {
return nativeDefineProperty(O, P, Attributes);
} catch (error) { /* empty */ }
if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
if ('value' in Attributes) O[P] = Attributes.value;
return O;
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/object-get-own-property-descriptor.js":
/*!*************************************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/object-get-own-property-descriptor.js ***!
\*************************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/canvg/node_modules/core-js/internals/descriptors.js");
var propertyIsEnumerableModule = __webpack_require__(/*! ../internals/object-property-is-enumerable */ "./node_modules/canvg/node_modules/core-js/internals/object-property-is-enumerable.js");
var createPropertyDescriptor = __webpack_require__(/*! ../internals/create-property-descriptor */ "./node_modules/canvg/node_modules/core-js/internals/create-property-descriptor.js");
var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "./node_modules/canvg/node_modules/core-js/internals/to-indexed-object.js");
var toPrimitive = __webpack_require__(/*! ../internals/to-primitive */ "./node_modules/canvg/node_modules/core-js/internals/to-primitive.js");
var has = __webpack_require__(/*! ../internals/has */ "./node_modules/canvg/node_modules/core-js/internals/has.js");
var IE8_DOM_DEFINE = __webpack_require__(/*! ../internals/ie8-dom-define */ "./node_modules/canvg/node_modules/core-js/internals/ie8-dom-define.js");
var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
// `Object.getOwnPropertyDescriptor` method
// https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor
exports.f = DESCRIPTORS ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
O = toIndexedObject(O);
P = toPrimitive(P, true);
if (IE8_DOM_DEFINE) try {
return nativeGetOwnPropertyDescriptor(O, P);
} catch (error) { /* empty */ }
if (has(O, P)) return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O, P), O[P]);
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/object-get-own-property-names-external.js":
/*!*****************************************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/object-get-own-property-names-external.js ***!
\*****************************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "./node_modules/canvg/node_modules/core-js/internals/to-indexed-object.js");
var nativeGetOwnPropertyNames = __webpack_require__(/*! ../internals/object-get-own-property-names */ "./node_modules/canvg/node_modules/core-js/internals/object-get-own-property-names.js").f;
var toString = {}.toString;
var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
? Object.getOwnPropertyNames(window) : [];
var getWindowNames = function (it) {
try {
return nativeGetOwnPropertyNames(it);
} catch (error) {
return windowNames.slice();
}
};
// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
module.exports.f = function getOwnPropertyNames(it) {
return windowNames && toString.call(it) == '[object Window]'
? getWindowNames(it)
: nativeGetOwnPropertyNames(toIndexedObject(it));
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/object-get-own-property-names.js":
/*!********************************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/object-get-own-property-names.js ***!
\********************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var internalObjectKeys = __webpack_require__(/*! ../internals/object-keys-internal */ "./node_modules/canvg/node_modules/core-js/internals/object-keys-internal.js");
var enumBugKeys = __webpack_require__(/*! ../internals/enum-bug-keys */ "./node_modules/canvg/node_modules/core-js/internals/enum-bug-keys.js");
var hiddenKeys = enumBugKeys.concat('length', 'prototype');
// `Object.getOwnPropertyNames` method
// https://tc39.github.io/ecma262/#sec-object.getownpropertynames
exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
return internalObjectKeys(O, hiddenKeys);
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/object-get-own-property-symbols.js":
/*!**********************************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/object-get-own-property-symbols.js ***!
\**********************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
exports.f = Object.getOwnPropertySymbols;
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/object-get-prototype-of.js":
/*!**************************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/object-get-prototype-of.js ***!
\**************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var has = __webpack_require__(/*! ../internals/has */ "./node_modules/canvg/node_modules/core-js/internals/has.js");
var toObject = __webpack_require__(/*! ../internals/to-object */ "./node_modules/canvg/node_modules/core-js/internals/to-object.js");
var sharedKey = __webpack_require__(/*! ../internals/shared-key */ "./node_modules/canvg/node_modules/core-js/internals/shared-key.js");
var CORRECT_PROTOTYPE_GETTER = __webpack_require__(/*! ../internals/correct-prototype-getter */ "./node_modules/canvg/node_modules/core-js/internals/correct-prototype-getter.js");
var IE_PROTO = sharedKey('IE_PROTO');
var ObjectPrototype = Object.prototype;
// `Object.getPrototypeOf` method
// https://tc39.github.io/ecma262/#sec-object.getprototypeof
module.exports = CORRECT_PROTOTYPE_GETTER ? Object.getPrototypeOf : function (O) {
O = toObject(O);
if (has(O, IE_PROTO)) return O[IE_PROTO];
if (typeof O.constructor == 'function' && O instanceof O.constructor) {
return O.constructor.prototype;
} return O instanceof Object ? ObjectPrototype : null;
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/object-keys-internal.js":
/*!***********************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/object-keys-internal.js ***!
\***********************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var has = __webpack_require__(/*! ../internals/has */ "./node_modules/canvg/node_modules/core-js/internals/has.js");
var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "./node_modules/canvg/node_modules/core-js/internals/to-indexed-object.js");
var indexOf = __webpack_require__(/*! ../internals/array-includes */ "./node_modules/canvg/node_modules/core-js/internals/array-includes.js").indexOf;
var hiddenKeys = __webpack_require__(/*! ../internals/hidden-keys */ "./node_modules/canvg/node_modules/core-js/internals/hidden-keys.js");
module.exports = function (object, names) {
var O = toIndexedObject(object);
var i = 0;
var result = [];
var key;
for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);
// Don't enum bug & hidden keys
while (names.length > i) if (has(O, key = names[i++])) {
~indexOf(result, key) || result.push(key);
}
return result;
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/object-keys.js":
/*!**************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/object-keys.js ***!
\**************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var internalObjectKeys = __webpack_require__(/*! ../internals/object-keys-internal */ "./node_modules/canvg/node_modules/core-js/internals/object-keys-internal.js");
var enumBugKeys = __webpack_require__(/*! ../internals/enum-bug-keys */ "./node_modules/canvg/node_modules/core-js/internals/enum-bug-keys.js");
// `Object.keys` method
// https://tc39.github.io/ecma262/#sec-object.keys
module.exports = Object.keys || function keys(O) {
return internalObjectKeys(O, enumBugKeys);
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/object-property-is-enumerable.js":
/*!********************************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/object-property-is-enumerable.js ***!
\********************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
// Nashorn ~ JDK8 bug
var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
// `Object.prototype.propertyIsEnumerable` method implementation
// https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable
exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
var descriptor = getOwnPropertyDescriptor(this, V);
return !!descriptor && descriptor.enumerable;
} : nativePropertyIsEnumerable;
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/object-set-prototype-of.js":
/*!**************************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/object-set-prototype-of.js ***!
\**************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/canvg/node_modules/core-js/internals/an-object.js");
var aPossiblePrototype = __webpack_require__(/*! ../internals/a-possible-prototype */ "./node_modules/canvg/node_modules/core-js/internals/a-possible-prototype.js");
// `Object.setPrototypeOf` method
// https://tc39.github.io/ecma262/#sec-object.setprototypeof
// Works with __proto__ only. Old v8 can't work with null proto objects.
/* eslint-disable no-proto */
module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {
var CORRECT_SETTER = false;
var test = {};
var setter;
try {
setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;
setter.call(test, []);
CORRECT_SETTER = test instanceof Array;
} catch (error) { /* empty */ }
return function setPrototypeOf(O, proto) {
anObject(O);
aPossiblePrototype(proto);
if (CORRECT_SETTER) setter.call(O, proto);
else O.__proto__ = proto;
return O;
};
}() : undefined);
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/object-to-string.js":
/*!*******************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/object-to-string.js ***!
\*******************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var TO_STRING_TAG_SUPPORT = __webpack_require__(/*! ../internals/to-string-tag-support */ "./node_modules/canvg/node_modules/core-js/internals/to-string-tag-support.js");
var classof = __webpack_require__(/*! ../internals/classof */ "./node_modules/canvg/node_modules/core-js/internals/classof.js");
// `Object.prototype.toString` method implementation
// https://tc39.github.io/ecma262/#sec-object.prototype.tostring
module.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() {
return '[object ' + classof(this) + ']';
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/own-keys.js":
/*!***********************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/own-keys.js ***!
\***********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ "./node_modules/canvg/node_modules/core-js/internals/get-built-in.js");
var getOwnPropertyNamesModule = __webpack_require__(/*! ../internals/object-get-own-property-names */ "./node_modules/canvg/node_modules/core-js/internals/object-get-own-property-names.js");
var getOwnPropertySymbolsModule = __webpack_require__(/*! ../internals/object-get-own-property-symbols */ "./node_modules/canvg/node_modules/core-js/internals/object-get-own-property-symbols.js");
var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/canvg/node_modules/core-js/internals/an-object.js");
// all object keys, includes non-enumerable and symbols
module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
var keys = getOwnPropertyNamesModule.f(anObject(it));
var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/path.js":
/*!*******************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/path.js ***!
\*******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__(/*! ../internals/global */ "./node_modules/canvg/node_modules/core-js/internals/global.js");
module.exports = global;
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/perform.js":
/*!**********************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/perform.js ***!
\**********************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = function (exec) {
try {
return { error: false, value: exec() };
} catch (error) {
return { error: true, value: error };
}
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/promise-resolve.js":
/*!******************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/promise-resolve.js ***!
\******************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/canvg/node_modules/core-js/internals/an-object.js");
var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/canvg/node_modules/core-js/internals/is-object.js");
var newPromiseCapability = __webpack_require__(/*! ../internals/new-promise-capability */ "./node_modules/canvg/node_modules/core-js/internals/new-promise-capability.js");
module.exports = function (C, x) {
anObject(C);
if (isObject(x) && x.constructor === C) return x;
var promiseCapability = newPromiseCapability.f(C);
var resolve = promiseCapability.resolve;
resolve(x);
return promiseCapability.promise;
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/redefine-all.js":
/*!***************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/redefine-all.js ***!
\***************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var redefine = __webpack_require__(/*! ../internals/redefine */ "./node_modules/canvg/node_modules/core-js/internals/redefine.js");
module.exports = function (target, src, options) {
for (var key in src) redefine(target, key, src[key], options);
return target;
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/redefine.js":
/*!***********************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/redefine.js ***!
\***********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__(/*! ../internals/global */ "./node_modules/canvg/node_modules/core-js/internals/global.js");
var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "./node_modules/canvg/node_modules/core-js/internals/create-non-enumerable-property.js");
var has = __webpack_require__(/*! ../internals/has */ "./node_modules/canvg/node_modules/core-js/internals/has.js");
var setGlobal = __webpack_require__(/*! ../internals/set-global */ "./node_modules/canvg/node_modules/core-js/internals/set-global.js");
var inspectSource = __webpack_require__(/*! ../internals/inspect-source */ "./node_modules/canvg/node_modules/core-js/internals/inspect-source.js");
var InternalStateModule = __webpack_require__(/*! ../internals/internal-state */ "./node_modules/canvg/node_modules/core-js/internals/internal-state.js");
var getInternalState = InternalStateModule.get;
var enforceInternalState = InternalStateModule.enforce;
var TEMPLATE = String(String).split('String');
(module.exports = function (O, key, value, options) {
var unsafe = options ? !!options.unsafe : false;
var simple = options ? !!options.enumerable : false;
var noTargetGet = options ? !!options.noTargetGet : false;
if (typeof value == 'function') {
if (typeof key == 'string' && !has(value, 'name')) createNonEnumerableProperty(value, 'name', key);
enforceInternalState(value).source = TEMPLATE.join(typeof key == 'string' ? key : '');
}
if (O === global) {
if (simple) O[key] = value;
else setGlobal(key, value);
return;
} else if (!unsafe) {
delete O[key];
} else if (!noTargetGet && O[key]) {
simple = true;
}
if (simple) O[key] = value;
else createNonEnumerableProperty(O, key, value);
// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
})(Function.prototype, 'toString', function toString() {
return typeof this == 'function' && getInternalState(this).source || inspectSource(this);
});
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/regexp-exec-abstract.js":
/*!***********************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/regexp-exec-abstract.js ***!
\***********************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var classof = __webpack_require__(/*! ./classof-raw */ "./node_modules/canvg/node_modules/core-js/internals/classof-raw.js");
var regexpExec = __webpack_require__(/*! ./regexp-exec */ "./node_modules/canvg/node_modules/core-js/internals/regexp-exec.js");
// `RegExpExec` abstract operation
// https://tc39.github.io/ecma262/#sec-regexpexec
module.exports = function (R, S) {
var exec = R.exec;
if (typeof exec === 'function') {
var result = exec.call(R, S);
if (typeof result !== 'object') {
throw TypeError('RegExp exec method returned something other than an Object or null');
}
return result;
}
if (classof(R) !== 'RegExp') {
throw TypeError('RegExp#exec called on incompatible receiver');
}
return regexpExec.call(R, S);
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/regexp-exec.js":
/*!**************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/regexp-exec.js ***!
\**************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var regexpFlags = __webpack_require__(/*! ./regexp-flags */ "./node_modules/canvg/node_modules/core-js/internals/regexp-flags.js");
var stickyHelpers = __webpack_require__(/*! ./regexp-sticky-helpers */ "./node_modules/canvg/node_modules/core-js/internals/regexp-sticky-helpers.js");
var nativeExec = RegExp.prototype.exec;
// This always refers to the native implementation, because the
// String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
// which loads this file before patching the method.
var nativeReplace = String.prototype.replace;
var patchedExec = nativeExec;
var UPDATES_LAST_INDEX_WRONG = (function () {
var re1 = /a/;
var re2 = /b*/g;
nativeExec.call(re1, 'a');
nativeExec.call(re2, 'a');
return re1.lastIndex !== 0 || re2.lastIndex !== 0;
})();
var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y || stickyHelpers.BROKEN_CARET;
// nonparticipating capturing group, copied from es5-shim's String#split patch.
var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y;
if (PATCH) {
patchedExec = function exec(str) {
var re = this;
var lastIndex, reCopy, match, i;
var sticky = UNSUPPORTED_Y && re.sticky;
var flags = regexpFlags.call(re);
var source = re.source;
var charsAdded = 0;
var strCopy = str;
if (sticky) {
flags = flags.replace('y', '');
if (flags.indexOf('g') === -1) {
flags += 'g';
}
strCopy = String(str).slice(re.lastIndex);
// Support anchored sticky behavior.
if (re.lastIndex > 0 && (!re.multiline || re.multiline && str[re.lastIndex - 1] !== '\n')) {
source = '(?: ' + source + ')';
strCopy = ' ' + strCopy;
charsAdded++;
}
// ^(? + rx + ) is needed, in combination with some str slicing, to
// simulate the 'y' flag.
reCopy = new RegExp('^(?:' + source + ')', flags);
}
if (NPCG_INCLUDED) {
reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
}
if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
match = nativeExec.call(sticky ? reCopy : re, strCopy);
if (sticky) {
if (match) {
match.input = match.input.slice(charsAdded);
match[0] = match[0].slice(charsAdded);
match.index = re.lastIndex;
re.lastIndex += match[0].length;
} else re.lastIndex = 0;
} else if (UPDATES_LAST_INDEX_WRONG && match) {
re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
}
if (NPCG_INCLUDED && match && match.length > 1) {
// Fix browsers whose `exec` methods don't consistently return `undefined`
// for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
nativeReplace.call(match[0], reCopy, function () {
for (i = 1; i < arguments.length - 2; i++) {
if (arguments[i] === undefined) match[i] = undefined;
}
});
}
return match;
};
}
module.exports = patchedExec;
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/regexp-flags.js":
/*!***************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/regexp-flags.js ***!
\***************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/canvg/node_modules/core-js/internals/an-object.js");
// `RegExp.prototype.flags` getter implementation
// https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags
module.exports = function () {
var that = anObject(this);
var result = '';
if (that.global) result += 'g';
if (that.ignoreCase) result += 'i';
if (that.multiline) result += 'm';
if (that.dotAll) result += 's';
if (that.unicode) result += 'u';
if (that.sticky) result += 'y';
return result;
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/regexp-sticky-helpers.js":
/*!************************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/regexp-sticky-helpers.js ***!
\************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var fails = __webpack_require__(/*! ./fails */ "./node_modules/canvg/node_modules/core-js/internals/fails.js");
// babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError,
// so we use an intermediate function.
function RE(s, f) {
return RegExp(s, f);
}
exports.UNSUPPORTED_Y = fails(function () {
// babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
var re = RE('a', 'y');
re.lastIndex = 2;
return re.exec('abcd') != null;
});
exports.BROKEN_CARET = fails(function () {
// https://bugzilla.mozilla.org/show_bug.cgi?id=773687
var re = RE('^r', 'gy');
re.lastIndex = 2;
return re.exec('str') != null;
});
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/require-object-coercible.js":
/*!***************************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/require-object-coercible.js ***!
\***************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
// `RequireObjectCoercible` abstract operation
// https://tc39.github.io/ecma262/#sec-requireobjectcoercible
module.exports = function (it) {
if (it == undefined) throw TypeError("Can't call method on " + it);
return it;
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/set-global.js":
/*!*************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/set-global.js ***!
\*************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__(/*! ../internals/global */ "./node_modules/canvg/node_modules/core-js/internals/global.js");
var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "./node_modules/canvg/node_modules/core-js/internals/create-non-enumerable-property.js");
module.exports = function (key, value) {
try {
createNonEnumerableProperty(global, key, value);
} catch (error) {
global[key] = value;
} return value;
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/set-species.js":
/*!**************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/set-species.js ***!
\**************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ "./node_modules/canvg/node_modules/core-js/internals/get-built-in.js");
var definePropertyModule = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/canvg/node_modules/core-js/internals/object-define-property.js");
var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/canvg/node_modules/core-js/internals/well-known-symbol.js");
var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/canvg/node_modules/core-js/internals/descriptors.js");
var SPECIES = wellKnownSymbol('species');
module.exports = function (CONSTRUCTOR_NAME) {
var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
var defineProperty = definePropertyModule.f;
if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) {
defineProperty(Constructor, SPECIES, {
configurable: true,
get: function () { return this; }
});
}
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/set-to-string-tag.js":
/*!********************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/set-to-string-tag.js ***!
\********************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var defineProperty = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/canvg/node_modules/core-js/internals/object-define-property.js").f;
var has = __webpack_require__(/*! ../internals/has */ "./node_modules/canvg/node_modules/core-js/internals/has.js");
var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/canvg/node_modules/core-js/internals/well-known-symbol.js");
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
module.exports = function (it, TAG, STATIC) {
if (it && !has(it = STATIC ? it : it.prototype, TO_STRING_TAG)) {
defineProperty(it, TO_STRING_TAG, { configurable: true, value: TAG });
}
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/shared-key.js":
/*!*************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/shared-key.js ***!
\*************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var shared = __webpack_require__(/*! ../internals/shared */ "./node_modules/canvg/node_modules/core-js/internals/shared.js");
var uid = __webpack_require__(/*! ../internals/uid */ "./node_modules/canvg/node_modules/core-js/internals/uid.js");
var keys = shared('keys');
module.exports = function (key) {
return keys[key] || (keys[key] = uid(key));
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/shared-store.js":
/*!***************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/shared-store.js ***!
\***************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__(/*! ../internals/global */ "./node_modules/canvg/node_modules/core-js/internals/global.js");
var setGlobal = __webpack_require__(/*! ../internals/set-global */ "./node_modules/canvg/node_modules/core-js/internals/set-global.js");
var SHARED = '__core-js_shared__';
var store = global[SHARED] || setGlobal(SHARED, {});
module.exports = store;
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/shared.js":
/*!*********************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/shared.js ***!
\*********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var IS_PURE = __webpack_require__(/*! ../internals/is-pure */ "./node_modules/canvg/node_modules/core-js/internals/is-pure.js");
var store = __webpack_require__(/*! ../internals/shared-store */ "./node_modules/canvg/node_modules/core-js/internals/shared-store.js");
(module.exports = function (key, value) {
return store[key] || (store[key] = value !== undefined ? value : {});
})('versions', []).push({
version: '3.6.5',
mode: IS_PURE ? 'pure' : 'global',
copyright: '© 2020 Denis Pushkarev (zloirock.ru)'
});
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/species-constructor.js":
/*!**********************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/species-constructor.js ***!
\**********************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/canvg/node_modules/core-js/internals/an-object.js");
var aFunction = __webpack_require__(/*! ../internals/a-function */ "./node_modules/canvg/node_modules/core-js/internals/a-function.js");
var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/canvg/node_modules/core-js/internals/well-known-symbol.js");
var SPECIES = wellKnownSymbol('species');
// `SpeciesConstructor` abstract operation
// https://tc39.github.io/ecma262/#sec-speciesconstructor
module.exports = function (O, defaultConstructor) {
var C = anObject(O).constructor;
var S;
return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aFunction(S);
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/string-multibyte.js":
/*!*******************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/string-multibyte.js ***!
\*******************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var toInteger = __webpack_require__(/*! ../internals/to-integer */ "./node_modules/canvg/node_modules/core-js/internals/to-integer.js");
var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "./node_modules/canvg/node_modules/core-js/internals/require-object-coercible.js");
// `String.prototype.{ codePointAt, at }` methods implementation
var createMethod = function (CONVERT_TO_STRING) {
return function ($this, pos) {
var S = String(requireObjectCoercible($this));
var position = toInteger(pos);
var size = S.length;
var first, second;
if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
first = S.charCodeAt(position);
return first < 0xD800 || first > 0xDBFF || position + 1 === size
|| (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF
? CONVERT_TO_STRING ? S.charAt(position) : first
: CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
};
};
module.exports = {
// `String.prototype.codePointAt` method
// https://tc39.github.io/ecma262/#sec-string.prototype.codepointat
codeAt: createMethod(false),
// `String.prototype.at` method
// https://github.com/mathiasbynens/String.prototype.at
charAt: createMethod(true)
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/string-trim-forced.js":
/*!*********************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/string-trim-forced.js ***!
\*********************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/canvg/node_modules/core-js/internals/fails.js");
var whitespaces = __webpack_require__(/*! ../internals/whitespaces */ "./node_modules/canvg/node_modules/core-js/internals/whitespaces.js");
var non = '\u200B\u0085\u180E';
// check that a method works with the correct list
// of whitespaces and has a correct name
module.exports = function (METHOD_NAME) {
return fails(function () {
return !!whitespaces[METHOD_NAME]() || non[METHOD_NAME]() != non || whitespaces[METHOD_NAME].name !== METHOD_NAME;
});
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/string-trim.js":
/*!**************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/string-trim.js ***!
\**************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "./node_modules/canvg/node_modules/core-js/internals/require-object-coercible.js");
var whitespaces = __webpack_require__(/*! ../internals/whitespaces */ "./node_modules/canvg/node_modules/core-js/internals/whitespaces.js");
var whitespace = '[' + whitespaces + ']';
var ltrim = RegExp('^' + whitespace + whitespace + '*');
var rtrim = RegExp(whitespace + whitespace + '*$');
// `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
var createMethod = function (TYPE) {
return function ($this) {
var string = String(requireObjectCoercible($this));
if (TYPE & 1) string = string.replace(ltrim, '');
if (TYPE & 2) string = string.replace(rtrim, '');
return string;
};
};
module.exports = {
// `String.prototype.{ trimLeft, trimStart }` methods
// https://tc39.github.io/ecma262/#sec-string.prototype.trimstart
start: createMethod(1),
// `String.prototype.{ trimRight, trimEnd }` methods
// https://tc39.github.io/ecma262/#sec-string.prototype.trimend
end: createMethod(2),
// `String.prototype.trim` method
// https://tc39.github.io/ecma262/#sec-string.prototype.trim
trim: createMethod(3)
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/task.js":
/*!*******************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/task.js ***!
\*******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__(/*! ../internals/global */ "./node_modules/canvg/node_modules/core-js/internals/global.js");
var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/canvg/node_modules/core-js/internals/fails.js");
var classof = __webpack_require__(/*! ../internals/classof-raw */ "./node_modules/canvg/node_modules/core-js/internals/classof-raw.js");
var bind = __webpack_require__(/*! ../internals/function-bind-context */ "./node_modules/canvg/node_modules/core-js/internals/function-bind-context.js");
var html = __webpack_require__(/*! ../internals/html */ "./node_modules/canvg/node_modules/core-js/internals/html.js");
var createElement = __webpack_require__(/*! ../internals/document-create-element */ "./node_modules/canvg/node_modules/core-js/internals/document-create-element.js");
var IS_IOS = __webpack_require__(/*! ../internals/engine-is-ios */ "./node_modules/canvg/node_modules/core-js/internals/engine-is-ios.js");
var location = global.location;
var set = global.setImmediate;
var clear = global.clearImmediate;
var process = global.process;
var MessageChannel = global.MessageChannel;
var Dispatch = global.Dispatch;
var counter = 0;
var queue = {};
var ONREADYSTATECHANGE = 'onreadystatechange';
var defer, channel, port;
var run = function (id) {
// eslint-disable-next-line no-prototype-builtins
if (queue.hasOwnProperty(id)) {
var fn = queue[id];
delete queue[id];
fn();
}
};
var runner = function (id) {
return function () {
run(id);
};
};
var listener = function (event) {
run(event.data);
};
var post = function (id) {
// old engines have not location.origin
global.postMessage(id + '', location.protocol + '//' + location.host);
};
// Node.js 0.9+ & IE10+ has setImmediate, otherwise:
if (!set || !clear) {
set = function setImmediate(fn) {
var args = [];
var i = 1;
while (arguments.length > i) args.push(arguments[i++]);
queue[++counter] = function () {
// eslint-disable-next-line no-new-func
(typeof fn == 'function' ? fn : Function(fn)).apply(undefined, args);
};
defer(counter);
return counter;
};
clear = function clearImmediate(id) {
delete queue[id];
};
// Node.js 0.8-
if (classof(process) == 'process') {
defer = function (id) {
process.nextTick(runner(id));
};
// Sphere (JS game engine) Dispatch API
} else if (Dispatch && Dispatch.now) {
defer = function (id) {
Dispatch.now(runner(id));
};
// Browsers with MessageChannel, includes WebWorkers
// except iOS - https://github.com/zloirock/core-js/issues/624
} else if (MessageChannel && !IS_IOS) {
channel = new MessageChannel();
port = channel.port2;
channel.port1.onmessage = listener;
defer = bind(port.postMessage, port, 1);
// Browsers with postMessage, skip WebWorkers
// IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
} else if (
global.addEventListener &&
typeof postMessage == 'function' &&
!global.importScripts &&
!fails(post) &&
location.protocol !== 'file:'
) {
defer = post;
global.addEventListener('message', listener, false);
// IE8-
} else if (ONREADYSTATECHANGE in createElement('script')) {
defer = function (id) {
html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {
html.removeChild(this);
run(id);
};
};
// Rest old browsers
} else {
defer = function (id) {
setTimeout(runner(id), 0);
};
}
}
module.exports = {
set: set,
clear: clear
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/to-absolute-index.js":
/*!********************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/to-absolute-index.js ***!
\********************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var toInteger = __webpack_require__(/*! ../internals/to-integer */ "./node_modules/canvg/node_modules/core-js/internals/to-integer.js");
var max = Math.max;
var min = Math.min;
// Helper for a popular repeating case of the spec:
// Let integer be ? ToInteger(index).
// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
module.exports = function (index, length) {
var integer = toInteger(index);
return integer < 0 ? max(integer + length, 0) : min(integer, length);
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/to-indexed-object.js":
/*!********************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/to-indexed-object.js ***!
\********************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// toObject with fallback for non-array-like ES3 strings
var IndexedObject = __webpack_require__(/*! ../internals/indexed-object */ "./node_modules/canvg/node_modules/core-js/internals/indexed-object.js");
var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "./node_modules/canvg/node_modules/core-js/internals/require-object-coercible.js");
module.exports = function (it) {
return IndexedObject(requireObjectCoercible(it));
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/to-integer.js":
/*!*************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/to-integer.js ***!
\*************************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
var ceil = Math.ceil;
var floor = Math.floor;
// `ToInteger` abstract operation
// https://tc39.github.io/ecma262/#sec-tointeger
module.exports = function (argument) {
return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/to-length.js":
/*!************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/to-length.js ***!
\************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var toInteger = __webpack_require__(/*! ../internals/to-integer */ "./node_modules/canvg/node_modules/core-js/internals/to-integer.js");
var min = Math.min;
// `ToLength` abstract operation
// https://tc39.github.io/ecma262/#sec-tolength
module.exports = function (argument) {
return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/to-object.js":
/*!************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/to-object.js ***!
\************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "./node_modules/canvg/node_modules/core-js/internals/require-object-coercible.js");
// `ToObject` abstract operation
// https://tc39.github.io/ecma262/#sec-toobject
module.exports = function (argument) {
return Object(requireObjectCoercible(argument));
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/to-primitive.js":
/*!***************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/to-primitive.js ***!
\***************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/canvg/node_modules/core-js/internals/is-object.js");
// `ToPrimitive` abstract operation
// https://tc39.github.io/ecma262/#sec-toprimitive
// instead of the ES6 spec version, we didn't implement @@toPrimitive case
// and the second argument - flag - preferred type is a string
module.exports = function (input, PREFERRED_STRING) {
if (!isObject(input)) return input;
var fn, val;
if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
throw TypeError("Can't convert object to primitive value");
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/to-string-tag-support.js":
/*!************************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/to-string-tag-support.js ***!
\************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/canvg/node_modules/core-js/internals/well-known-symbol.js");
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
var test = {};
test[TO_STRING_TAG] = 'z';
module.exports = String(test) === '[object z]';
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/uid.js":
/*!******************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/uid.js ***!
\******************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
var id = 0;
var postfix = Math.random();
module.exports = function (key) {
return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/use-symbol-as-uid.js":
/*!********************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/use-symbol-as-uid.js ***!
\********************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var NATIVE_SYMBOL = __webpack_require__(/*! ../internals/native-symbol */ "./node_modules/canvg/node_modules/core-js/internals/native-symbol.js");
module.exports = NATIVE_SYMBOL
// eslint-disable-next-line no-undef
&& !Symbol.sham
// eslint-disable-next-line no-undef
&& typeof Symbol.iterator == 'symbol';
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/well-known-symbol-wrapped.js":
/*!****************************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/well-known-symbol-wrapped.js ***!
\****************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/canvg/node_modules/core-js/internals/well-known-symbol.js");
exports.f = wellKnownSymbol;
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/well-known-symbol.js":
/*!********************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/well-known-symbol.js ***!
\********************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__(/*! ../internals/global */ "./node_modules/canvg/node_modules/core-js/internals/global.js");
var shared = __webpack_require__(/*! ../internals/shared */ "./node_modules/canvg/node_modules/core-js/internals/shared.js");
var has = __webpack_require__(/*! ../internals/has */ "./node_modules/canvg/node_modules/core-js/internals/has.js");
var uid = __webpack_require__(/*! ../internals/uid */ "./node_modules/canvg/node_modules/core-js/internals/uid.js");
var NATIVE_SYMBOL = __webpack_require__(/*! ../internals/native-symbol */ "./node_modules/canvg/node_modules/core-js/internals/native-symbol.js");
var USE_SYMBOL_AS_UID = __webpack_require__(/*! ../internals/use-symbol-as-uid */ "./node_modules/canvg/node_modules/core-js/internals/use-symbol-as-uid.js");
var WellKnownSymbolsStore = shared('wks');
var Symbol = global.Symbol;
var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid;
module.exports = function (name) {
if (!has(WellKnownSymbolsStore, name)) {
if (NATIVE_SYMBOL && has(Symbol, name)) WellKnownSymbolsStore[name] = Symbol[name];
else WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
} return WellKnownSymbolsStore[name];
};
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/internals/whitespaces.js":
/*!**************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/internals/whitespaces.js ***!
\**************************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
// a string of all valid unicode whitespaces
// eslint-disable-next-line max-len
module.exports = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/modules/es.array.concat.js":
/*!****************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/modules/es.array.concat.js ***!
\****************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/canvg/node_modules/core-js/internals/export.js");
var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/canvg/node_modules/core-js/internals/fails.js");
var isArray = __webpack_require__(/*! ../internals/is-array */ "./node_modules/canvg/node_modules/core-js/internals/is-array.js");
var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/canvg/node_modules/core-js/internals/is-object.js");
var toObject = __webpack_require__(/*! ../internals/to-object */ "./node_modules/canvg/node_modules/core-js/internals/to-object.js");
var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/canvg/node_modules/core-js/internals/to-length.js");
var createProperty = __webpack_require__(/*! ../internals/create-property */ "./node_modules/canvg/node_modules/core-js/internals/create-property.js");
var arraySpeciesCreate = __webpack_require__(/*! ../internals/array-species-create */ "./node_modules/canvg/node_modules/core-js/internals/array-species-create.js");
var arrayMethodHasSpeciesSupport = __webpack_require__(/*! ../internals/array-method-has-species-support */ "./node_modules/canvg/node_modules/core-js/internals/array-method-has-species-support.js");
var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/canvg/node_modules/core-js/internals/well-known-symbol.js");
var V8_VERSION = __webpack_require__(/*! ../internals/engine-v8-version */ "./node_modules/canvg/node_modules/core-js/internals/engine-v8-version.js");
var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
// We can't use this feature detection in V8 since it causes
// deoptimization and serious performance degradation
// https://github.com/zloirock/core-js/issues/679
var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function () {
var array = [];
array[IS_CONCAT_SPREADABLE] = false;
return array.concat()[0] !== array;
});
var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
var isConcatSpreadable = function (O) {
if (!isObject(O)) return false;
var spreadable = O[IS_CONCAT_SPREADABLE];
return spreadable !== undefined ? !!spreadable : isArray(O);
};
var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
// `Array.prototype.concat` method
// https://tc39.github.io/ecma262/#sec-array.prototype.concat
// with adding support of @@isConcatSpreadable and @@species
$({ target: 'Array', proto: true, forced: FORCED }, {
concat: function concat(arg) { // eslint-disable-line no-unused-vars
var O = toObject(this);
var A = arraySpeciesCreate(O, 0);
var n = 0;
var i, k, length, len, E;
for (i = -1, length = arguments.length; i < length; i++) {
E = i === -1 ? O : arguments[i];
if (isConcatSpreadable(E)) {
len = toLength(E.length);
if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
} else {
if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
createProperty(A, n++, E);
}
}
A.length = n;
return A;
}
});
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/modules/es.array.every.js":
/*!***************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/modules/es.array.every.js ***!
\***************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/canvg/node_modules/core-js/internals/export.js");
var $every = __webpack_require__(/*! ../internals/array-iteration */ "./node_modules/canvg/node_modules/core-js/internals/array-iteration.js").every;
var arrayMethodIsStrict = __webpack_require__(/*! ../internals/array-method-is-strict */ "./node_modules/canvg/node_modules/core-js/internals/array-method-is-strict.js");
var arrayMethodUsesToLength = __webpack_require__(/*! ../internals/array-method-uses-to-length */ "./node_modules/canvg/node_modules/core-js/internals/array-method-uses-to-length.js");
var STRICT_METHOD = arrayMethodIsStrict('every');
var USES_TO_LENGTH = arrayMethodUsesToLength('every');
// `Array.prototype.every` method
// https://tc39.github.io/ecma262/#sec-array.prototype.every
$({ target: 'Array', proto: true, forced: !STRICT_METHOD || !USES_TO_LENGTH }, {
every: function every(callbackfn /* , thisArg */) {
return $every(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
}
});
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/modules/es.array.fill.js":
/*!**************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/modules/es.array.fill.js ***!
\**************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/canvg/node_modules/core-js/internals/export.js");
var fill = __webpack_require__(/*! ../internals/array-fill */ "./node_modules/canvg/node_modules/core-js/internals/array-fill.js");
var addToUnscopables = __webpack_require__(/*! ../internals/add-to-unscopables */ "./node_modules/canvg/node_modules/core-js/internals/add-to-unscopables.js");
// `Array.prototype.fill` method
// https://tc39.github.io/ecma262/#sec-array.prototype.fill
$({ target: 'Array', proto: true }, {
fill: fill
});
// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
addToUnscopables('fill');
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/modules/es.array.filter.js":
/*!****************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/modules/es.array.filter.js ***!
\****************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/canvg/node_modules/core-js/internals/export.js");
var $filter = __webpack_require__(/*! ../internals/array-iteration */ "./node_modules/canvg/node_modules/core-js/internals/array-iteration.js").filter;
var arrayMethodHasSpeciesSupport = __webpack_require__(/*! ../internals/array-method-has-species-support */ "./node_modules/canvg/node_modules/core-js/internals/array-method-has-species-support.js");
var arrayMethodUsesToLength = __webpack_require__(/*! ../internals/array-method-uses-to-length */ "./node_modules/canvg/node_modules/core-js/internals/array-method-uses-to-length.js");
var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
// Edge 14- issue
var USES_TO_LENGTH = arrayMethodUsesToLength('filter');
// `Array.prototype.filter` method
// https://tc39.github.io/ecma262/#sec-array.prototype.filter
// with adding support of @@species
$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
filter: function filter(callbackfn /* , thisArg */) {
return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
}
});
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/modules/es.array.for-each.js":
/*!******************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/modules/es.array.for-each.js ***!
\******************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/canvg/node_modules/core-js/internals/export.js");
var forEach = __webpack_require__(/*! ../internals/array-for-each */ "./node_modules/canvg/node_modules/core-js/internals/array-for-each.js");
// `Array.prototype.forEach` method
// https://tc39.github.io/ecma262/#sec-array.prototype.foreach
$({ target: 'Array', proto: true, forced: [].forEach != forEach }, {
forEach: forEach
});
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/modules/es.array.from.js":
/*!**************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/modules/es.array.from.js ***!
\**************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/canvg/node_modules/core-js/internals/export.js");
var from = __webpack_require__(/*! ../internals/array-from */ "./node_modules/canvg/node_modules/core-js/internals/array-from.js");
var checkCorrectnessOfIteration = __webpack_require__(/*! ../internals/check-correctness-of-iteration */ "./node_modules/canvg/node_modules/core-js/internals/check-correctness-of-iteration.js");
var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) {
Array.from(iterable);
});
// `Array.from` method
// https://tc39.github.io/ecma262/#sec-array.from
$({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, {
from: from
});
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/modules/es.array.includes.js":
/*!******************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/modules/es.array.includes.js ***!
\******************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/canvg/node_modules/core-js/internals/export.js");
var $includes = __webpack_require__(/*! ../internals/array-includes */ "./node_modules/canvg/node_modules/core-js/internals/array-includes.js").includes;
var addToUnscopables = __webpack_require__(/*! ../internals/add-to-unscopables */ "./node_modules/canvg/node_modules/core-js/internals/add-to-unscopables.js");
var arrayMethodUsesToLength = __webpack_require__(/*! ../internals/array-method-uses-to-length */ "./node_modules/canvg/node_modules/core-js/internals/array-method-uses-to-length.js");
var USES_TO_LENGTH = arrayMethodUsesToLength('indexOf', { ACCESSORS: true, 1: 0 });
// `Array.prototype.includes` method
// https://tc39.github.io/ecma262/#sec-array.prototype.includes
$({ target: 'Array', proto: true, forced: !USES_TO_LENGTH }, {
includes: function includes(el /* , fromIndex = 0 */) {
return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
}
});
// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
addToUnscopables('includes');
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/modules/es.array.index-of.js":
/*!******************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/modules/es.array.index-of.js ***!
\******************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/canvg/node_modules/core-js/internals/export.js");
var $indexOf = __webpack_require__(/*! ../internals/array-includes */ "./node_modules/canvg/node_modules/core-js/internals/array-includes.js").indexOf;
var arrayMethodIsStrict = __webpack_require__(/*! ../internals/array-method-is-strict */ "./node_modules/canvg/node_modules/core-js/internals/array-method-is-strict.js");
var arrayMethodUsesToLength = __webpack_require__(/*! ../internals/array-method-uses-to-length */ "./node_modules/canvg/node_modules/core-js/internals/array-method-uses-to-length.js");
var nativeIndexOf = [].indexOf;
var NEGATIVE_ZERO = !!nativeIndexOf && 1 / [1].indexOf(1, -0) < 0;
var STRICT_METHOD = arrayMethodIsStrict('indexOf');
var USES_TO_LENGTH = arrayMethodUsesToLength('indexOf', { ACCESSORS: true, 1: 0 });
// `Array.prototype.indexOf` method
// https://tc39.github.io/ecma262/#sec-array.prototype.indexof
$({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD || !USES_TO_LENGTH }, {
indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
return NEGATIVE_ZERO
// convert -0 to +0
? nativeIndexOf.apply(this, arguments) || 0
: $indexOf(this, searchElement, arguments.length > 1 ? arguments[1] : undefined);
}
});
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/modules/es.array.iterator.js":
/*!******************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/modules/es.array.iterator.js ***!
\******************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "./node_modules/canvg/node_modules/core-js/internals/to-indexed-object.js");
var addToUnscopables = __webpack_require__(/*! ../internals/add-to-unscopables */ "./node_modules/canvg/node_modules/core-js/internals/add-to-unscopables.js");
var Iterators = __webpack_require__(/*! ../internals/iterators */ "./node_modules/canvg/node_modules/core-js/internals/iterators.js");
var InternalStateModule = __webpack_require__(/*! ../internals/internal-state */ "./node_modules/canvg/node_modules/core-js/internals/internal-state.js");
var defineIterator = __webpack_require__(/*! ../internals/define-iterator */ "./node_modules/canvg/node_modules/core-js/internals/define-iterator.js");
var ARRAY_ITERATOR = 'Array Iterator';
var setInternalState = InternalStateModule.set;
var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
// `Array.prototype.entries` method
// https://tc39.github.io/ecma262/#sec-array.prototype.entries
// `Array.prototype.keys` method
// https://tc39.github.io/ecma262/#sec-array.prototype.keys
// `Array.prototype.values` method
// https://tc39.github.io/ecma262/#sec-array.prototype.values
// `Array.prototype[@@iterator]` method
// https://tc39.github.io/ecma262/#sec-array.prototype-@@iterator
// `CreateArrayIterator` internal method
// https://tc39.github.io/ecma262/#sec-createarrayiterator
module.exports = defineIterator(Array, 'Array', function (iterated, kind) {
setInternalState(this, {
type: ARRAY_ITERATOR,
target: toIndexedObject(iterated), // target
index: 0, // next index
kind: kind // kind
});
// `%ArrayIteratorPrototype%.next` method
// https://tc39.github.io/ecma262/#sec-%arrayiteratorprototype%.next
}, function () {
var state = getInternalState(this);
var target = state.target;
var kind = state.kind;
var index = state.index++;
if (!target || index >= target.length) {
state.target = undefined;
return { value: undefined, done: true };
}
if (kind == 'keys') return { value: index, done: false };
if (kind == 'values') return { value: target[index], done: false };
return { value: [index, target[index]], done: false };
}, 'values');
// argumentsList[@@iterator] is %ArrayProto_values%
// https://tc39.github.io/ecma262/#sec-createunmappedargumentsobject
// https://tc39.github.io/ecma262/#sec-createmappedargumentsobject
Iterators.Arguments = Iterators.Array;
// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
addToUnscopables('keys');
addToUnscopables('values');
addToUnscopables('entries');
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/modules/es.array.join.js":
/*!**************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/modules/es.array.join.js ***!
\**************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/canvg/node_modules/core-js/internals/export.js");
var IndexedObject = __webpack_require__(/*! ../internals/indexed-object */ "./node_modules/canvg/node_modules/core-js/internals/indexed-object.js");
var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "./node_modules/canvg/node_modules/core-js/internals/to-indexed-object.js");
var arrayMethodIsStrict = __webpack_require__(/*! ../internals/array-method-is-strict */ "./node_modules/canvg/node_modules/core-js/internals/array-method-is-strict.js");
var nativeJoin = [].join;
var ES3_STRINGS = IndexedObject != Object;
var STRICT_METHOD = arrayMethodIsStrict('join', ',');
// `Array.prototype.join` method
// https://tc39.github.io/ecma262/#sec-array.prototype.join
$({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD }, {
join: function join(separator) {
return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator);
}
});
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/modules/es.array.map.js":
/*!*************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/modules/es.array.map.js ***!
\*************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/canvg/node_modules/core-js/internals/export.js");
var $map = __webpack_require__(/*! ../internals/array-iteration */ "./node_modules/canvg/node_modules/core-js/internals/array-iteration.js").map;
var arrayMethodHasSpeciesSupport = __webpack_require__(/*! ../internals/array-method-has-species-support */ "./node_modules/canvg/node_modules/core-js/internals/array-method-has-species-support.js");
var arrayMethodUsesToLength = __webpack_require__(/*! ../internals/array-method-uses-to-length */ "./node_modules/canvg/node_modules/core-js/internals/array-method-uses-to-length.js");
var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map');
// FF49- issue
var USES_TO_LENGTH = arrayMethodUsesToLength('map');
// `Array.prototype.map` method
// https://tc39.github.io/ecma262/#sec-array.prototype.map
// with adding support of @@species
$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
map: function map(callbackfn /* , thisArg */) {
return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
}
});
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/modules/es.array.reduce.js":
/*!****************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/modules/es.array.reduce.js ***!
\****************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/canvg/node_modules/core-js/internals/export.js");
var $reduce = __webpack_require__(/*! ../internals/array-reduce */ "./node_modules/canvg/node_modules/core-js/internals/array-reduce.js").left;
var arrayMethodIsStrict = __webpack_require__(/*! ../internals/array-method-is-strict */ "./node_modules/canvg/node_modules/core-js/internals/array-method-is-strict.js");
var arrayMethodUsesToLength = __webpack_require__(/*! ../internals/array-method-uses-to-length */ "./node_modules/canvg/node_modules/core-js/internals/array-method-uses-to-length.js");
var STRICT_METHOD = arrayMethodIsStrict('reduce');
var USES_TO_LENGTH = arrayMethodUsesToLength('reduce', { 1: 0 });
// `Array.prototype.reduce` method
// https://tc39.github.io/ecma262/#sec-array.prototype.reduce
$({ target: 'Array', proto: true, forced: !STRICT_METHOD || !USES_TO_LENGTH }, {
reduce: function reduce(callbackfn /* , initialValue */) {
return $reduce(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined);
}
});
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/modules/es.array.reverse.js":
/*!*****************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/modules/es.array.reverse.js ***!
\*****************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/canvg/node_modules/core-js/internals/export.js");
var isArray = __webpack_require__(/*! ../internals/is-array */ "./node_modules/canvg/node_modules/core-js/internals/is-array.js");
var nativeReverse = [].reverse;
var test = [1, 2];
// `Array.prototype.reverse` method
// https://tc39.github.io/ecma262/#sec-array.prototype.reverse
// fix for Safari 12.0 bug
// https://bugs.webkit.org/show_bug.cgi?id=188794
$({ target: 'Array', proto: true, forced: String(test) === String(test.reverse()) }, {
reverse: function reverse() {
// eslint-disable-next-line no-self-assign
if (isArray(this)) this.length = this.length;
return nativeReverse.call(this);
}
});
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/modules/es.array.slice.js":
/*!***************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/modules/es.array.slice.js ***!
\***************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/canvg/node_modules/core-js/internals/export.js");
var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/canvg/node_modules/core-js/internals/is-object.js");
var isArray = __webpack_require__(/*! ../internals/is-array */ "./node_modules/canvg/node_modules/core-js/internals/is-array.js");
var toAbsoluteIndex = __webpack_require__(/*! ../internals/to-absolute-index */ "./node_modules/canvg/node_modules/core-js/internals/to-absolute-index.js");
var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/canvg/node_modules/core-js/internals/to-length.js");
var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "./node_modules/canvg/node_modules/core-js/internals/to-indexed-object.js");
var createProperty = __webpack_require__(/*! ../internals/create-property */ "./node_modules/canvg/node_modules/core-js/internals/create-property.js");
var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/canvg/node_modules/core-js/internals/well-known-symbol.js");
var arrayMethodHasSpeciesSupport = __webpack_require__(/*! ../internals/array-method-has-species-support */ "./node_modules/canvg/node_modules/core-js/internals/array-method-has-species-support.js");
var arrayMethodUsesToLength = __webpack_require__(/*! ../internals/array-method-uses-to-length */ "./node_modules/canvg/node_modules/core-js/internals/array-method-uses-to-length.js");
var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice');
var USES_TO_LENGTH = arrayMethodUsesToLength('slice', { ACCESSORS: true, 0: 0, 1: 2 });
var SPECIES = wellKnownSymbol('species');
var nativeSlice = [].slice;
var max = Math.max;
// `Array.prototype.slice` method
// https://tc39.github.io/ecma262/#sec-array.prototype.slice
// fallback for not array-like ES3 strings and DOM objects
$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
slice: function slice(start, end) {
var O = toIndexedObject(this);
var length = toLength(O.length);
var k = toAbsoluteIndex(start, length);
var fin = toAbsoluteIndex(end === undefined ? length : end, length);
// inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
var Constructor, result, n;
if (isArray(O)) {
Constructor = O.constructor;
// cross-realm fallback
if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) {
Constructor = undefined;
} else if (isObject(Constructor)) {
Constructor = Constructor[SPECIES];
if (Constructor === null) Constructor = undefined;
}
if (Constructor === Array || Constructor === undefined) {
return nativeSlice.call(O, k, fin);
}
}
result = new (Constructor === undefined ? Array : Constructor)(max(fin - k, 0));
for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
result.length = n;
return result;
}
});
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/modules/es.array.some.js":
/*!**************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/modules/es.array.some.js ***!
\**************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/canvg/node_modules/core-js/internals/export.js");
var $some = __webpack_require__(/*! ../internals/array-iteration */ "./node_modules/canvg/node_modules/core-js/internals/array-iteration.js").some;
var arrayMethodIsStrict = __webpack_require__(/*! ../internals/array-method-is-strict */ "./node_modules/canvg/node_modules/core-js/internals/array-method-is-strict.js");
var arrayMethodUsesToLength = __webpack_require__(/*! ../internals/array-method-uses-to-length */ "./node_modules/canvg/node_modules/core-js/internals/array-method-uses-to-length.js");
var STRICT_METHOD = arrayMethodIsStrict('some');
var USES_TO_LENGTH = arrayMethodUsesToLength('some');
// `Array.prototype.some` method
// https://tc39.github.io/ecma262/#sec-array.prototype.some
$({ target: 'Array', proto: true, forced: !STRICT_METHOD || !USES_TO_LENGTH }, {
some: function some(callbackfn /* , thisArg */) {
return $some(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
}
});
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/modules/es.function.name.js":
/*!*****************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/modules/es.function.name.js ***!
\*****************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/canvg/node_modules/core-js/internals/descriptors.js");
var defineProperty = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/canvg/node_modules/core-js/internals/object-define-property.js").f;
var FunctionPrototype = Function.prototype;
var FunctionPrototypeToString = FunctionPrototype.toString;
var nameRE = /^\s*function ([^ (]*)/;
var NAME = 'name';
// Function instances `.name` property
// https://tc39.github.io/ecma262/#sec-function-instances-name
if (DESCRIPTORS && !(NAME in FunctionPrototype)) {
defineProperty(FunctionPrototype, NAME, {
configurable: true,
get: function () {
try {
return FunctionPrototypeToString.call(this).match(nameRE)[1];
} catch (error) {
return '';
}
}
});
}
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/modules/es.map.js":
/*!*******************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/modules/es.map.js ***!
\*******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var collection = __webpack_require__(/*! ../internals/collection */ "./node_modules/canvg/node_modules/core-js/internals/collection.js");
var collectionStrong = __webpack_require__(/*! ../internals/collection-strong */ "./node_modules/canvg/node_modules/core-js/internals/collection-strong.js");
// `Map` constructor
// https://tc39.github.io/ecma262/#sec-map-objects
module.exports = collection('Map', function (init) {
return function Map() { return init(this, arguments.length ? arguments[0] : undefined); };
}, collectionStrong);
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/modules/es.number.constructor.js":
/*!**********************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/modules/es.number.constructor.js ***!
\**********************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/canvg/node_modules/core-js/internals/descriptors.js");
var global = __webpack_require__(/*! ../internals/global */ "./node_modules/canvg/node_modules/core-js/internals/global.js");
var isForced = __webpack_require__(/*! ../internals/is-forced */ "./node_modules/canvg/node_modules/core-js/internals/is-forced.js");
var redefine = __webpack_require__(/*! ../internals/redefine */ "./node_modules/canvg/node_modules/core-js/internals/redefine.js");
var has = __webpack_require__(/*! ../internals/has */ "./node_modules/canvg/node_modules/core-js/internals/has.js");
var classof = __webpack_require__(/*! ../internals/classof-raw */ "./node_modules/canvg/node_modules/core-js/internals/classof-raw.js");
var inheritIfRequired = __webpack_require__(/*! ../internals/inherit-if-required */ "./node_modules/canvg/node_modules/core-js/internals/inherit-if-required.js");
var toPrimitive = __webpack_require__(/*! ../internals/to-primitive */ "./node_modules/canvg/node_modules/core-js/internals/to-primitive.js");
var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/canvg/node_modules/core-js/internals/fails.js");
var create = __webpack_require__(/*! ../internals/object-create */ "./node_modules/canvg/node_modules/core-js/internals/object-create.js");
var getOwnPropertyNames = __webpack_require__(/*! ../internals/object-get-own-property-names */ "./node_modules/canvg/node_modules/core-js/internals/object-get-own-property-names.js").f;
var getOwnPropertyDescriptor = __webpack_require__(/*! ../internals/object-get-own-property-descriptor */ "./node_modules/canvg/node_modules/core-js/internals/object-get-own-property-descriptor.js").f;
var defineProperty = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/canvg/node_modules/core-js/internals/object-define-property.js").f;
var trim = __webpack_require__(/*! ../internals/string-trim */ "./node_modules/canvg/node_modules/core-js/internals/string-trim.js").trim;
var NUMBER = 'Number';
var NativeNumber = global[NUMBER];
var NumberPrototype = NativeNumber.prototype;
// Opera ~12 has broken Object#toString
var BROKEN_CLASSOF = classof(create(NumberPrototype)) == NUMBER;
// `ToNumber` abstract operation
// https://tc39.github.io/ecma262/#sec-tonumber
var toNumber = function (argument) {
var it = toPrimitive(argument, false);
var first, third, radix, maxCode, digits, length, index, code;
if (typeof it == 'string' && it.length > 2) {
it = trim(it);
first = it.charCodeAt(0);
if (first === 43 || first === 45) {
third = it.charCodeAt(2);
if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix
} else if (first === 48) {
switch (it.charCodeAt(1)) {
case 66: case 98: radix = 2; maxCode = 49; break; // fast equal of /^0b[01]+$/i
case 79: case 111: radix = 8; maxCode = 55; break; // fast equal of /^0o[0-7]+$/i
default: return +it;
}
digits = it.slice(2);
length = digits.length;
for (index = 0; index < length; index++) {
code = digits.charCodeAt(index);
// parseInt parses a string to a first unavailable symbol
// but ToNumber should return NaN if a string contains unavailable symbols
if (code < 48 || code > maxCode) return NaN;
} return parseInt(digits, radix);
}
} return +it;
};
// `Number` constructor
// https://tc39.github.io/ecma262/#sec-number-constructor
if (isForced(NUMBER, !NativeNumber(' 0o1') || !NativeNumber('0b1') || NativeNumber('+0x1'))) {
var NumberWrapper = function Number(value) {
var it = arguments.length < 1 ? 0 : value;
var dummy = this;
return dummy instanceof NumberWrapper
// check on 1..constructor(foo) case
&& (BROKEN_CLASSOF ? fails(function () { NumberPrototype.valueOf.call(dummy); }) : classof(dummy) != NUMBER)
? inheritIfRequired(new NativeNumber(toNumber(it)), dummy, NumberWrapper) : toNumber(it);
};
for (var keys = DESCRIPTORS ? getOwnPropertyNames(NativeNumber) : (
// ES3:
'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +
// ES2015 (in case, if modules with ES2015 Number statics required before):
'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' +
'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger'
).split(','), j = 0, key; keys.length > j; j++) {
if (has(NativeNumber, key = keys[j]) && !has(NumberWrapper, key)) {
defineProperty(NumberWrapper, key, getOwnPropertyDescriptor(NativeNumber, key));
}
}
NumberWrapper.prototype = NumberPrototype;
NumberPrototype.constructor = NumberWrapper;
redefine(global, NUMBER, NumberWrapper);
}
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/modules/es.object.get-own-property-descriptor.js":
/*!**************************************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/modules/es.object.get-own-property-descriptor.js ***!
\**************************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/canvg/node_modules/core-js/internals/export.js");
var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/canvg/node_modules/core-js/internals/fails.js");
var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "./node_modules/canvg/node_modules/core-js/internals/to-indexed-object.js");
var nativeGetOwnPropertyDescriptor = __webpack_require__(/*! ../internals/object-get-own-property-descriptor */ "./node_modules/canvg/node_modules/core-js/internals/object-get-own-property-descriptor.js").f;
var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/canvg/node_modules/core-js/internals/descriptors.js");
var FAILS_ON_PRIMITIVES = fails(function () { nativeGetOwnPropertyDescriptor(1); });
var FORCED = !DESCRIPTORS || FAILS_ON_PRIMITIVES;
// `Object.getOwnPropertyDescriptor` method
// https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor
$({ target: 'Object', stat: true, forced: FORCED, sham: !DESCRIPTORS }, {
getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it, key) {
return nativeGetOwnPropertyDescriptor(toIndexedObject(it), key);
}
});
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/modules/es.object.get-own-property-descriptors.js":
/*!***************************************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/modules/es.object.get-own-property-descriptors.js ***!
\***************************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/canvg/node_modules/core-js/internals/export.js");
var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/canvg/node_modules/core-js/internals/descriptors.js");
var ownKeys = __webpack_require__(/*! ../internals/own-keys */ "./node_modules/canvg/node_modules/core-js/internals/own-keys.js");
var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "./node_modules/canvg/node_modules/core-js/internals/to-indexed-object.js");
var getOwnPropertyDescriptorModule = __webpack_require__(/*! ../internals/object-get-own-property-descriptor */ "./node_modules/canvg/node_modules/core-js/internals/object-get-own-property-descriptor.js");
var createProperty = __webpack_require__(/*! ../internals/create-property */ "./node_modules/canvg/node_modules/core-js/internals/create-property.js");
// `Object.getOwnPropertyDescriptors` method
// https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptors
$({ target: 'Object', stat: true, sham: !DESCRIPTORS }, {
getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {
var O = toIndexedObject(object);
var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
var keys = ownKeys(O);
var result = {};
var index = 0;
var key, descriptor;
while (keys.length > index) {
descriptor = getOwnPropertyDescriptor(O, key = keys[index++]);
if (descriptor !== undefined) createProperty(result, key, descriptor);
}
return result;
}
});
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/modules/es.object.keys.js":
/*!***************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/modules/es.object.keys.js ***!
\***************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/canvg/node_modules/core-js/internals/export.js");
var toObject = __webpack_require__(/*! ../internals/to-object */ "./node_modules/canvg/node_modules/core-js/internals/to-object.js");
var nativeKeys = __webpack_require__(/*! ../internals/object-keys */ "./node_modules/canvg/node_modules/core-js/internals/object-keys.js");
var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/canvg/node_modules/core-js/internals/fails.js");
var FAILS_ON_PRIMITIVES = fails(function () { nativeKeys(1); });
// `Object.keys` method
// https://tc39.github.io/ecma262/#sec-object.keys
$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
keys: function keys(it) {
return nativeKeys(toObject(it));
}
});
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/modules/es.object.to-string.js":
/*!********************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/modules/es.object.to-string.js ***!
\********************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var TO_STRING_TAG_SUPPORT = __webpack_require__(/*! ../internals/to-string-tag-support */ "./node_modules/canvg/node_modules/core-js/internals/to-string-tag-support.js");
var redefine = __webpack_require__(/*! ../internals/redefine */ "./node_modules/canvg/node_modules/core-js/internals/redefine.js");
var toString = __webpack_require__(/*! ../internals/object-to-string */ "./node_modules/canvg/node_modules/core-js/internals/object-to-string.js");
// `Object.prototype.toString` method
// https://tc39.github.io/ecma262/#sec-object.prototype.tostring
if (!TO_STRING_TAG_SUPPORT) {
redefine(Object.prototype, 'toString', toString, { unsafe: true });
}
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/modules/es.promise.js":
/*!***********************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/modules/es.promise.js ***!
\***********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/canvg/node_modules/core-js/internals/export.js");
var IS_PURE = __webpack_require__(/*! ../internals/is-pure */ "./node_modules/canvg/node_modules/core-js/internals/is-pure.js");
var global = __webpack_require__(/*! ../internals/global */ "./node_modules/canvg/node_modules/core-js/internals/global.js");
var getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ "./node_modules/canvg/node_modules/core-js/internals/get-built-in.js");
var NativePromise = __webpack_require__(/*! ../internals/native-promise-constructor */ "./node_modules/canvg/node_modules/core-js/internals/native-promise-constructor.js");
var redefine = __webpack_require__(/*! ../internals/redefine */ "./node_modules/canvg/node_modules/core-js/internals/redefine.js");
var redefineAll = __webpack_require__(/*! ../internals/redefine-all */ "./node_modules/canvg/node_modules/core-js/internals/redefine-all.js");
var setToStringTag = __webpack_require__(/*! ../internals/set-to-string-tag */ "./node_modules/canvg/node_modules/core-js/internals/set-to-string-tag.js");
var setSpecies = __webpack_require__(/*! ../internals/set-species */ "./node_modules/canvg/node_modules/core-js/internals/set-species.js");
var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/canvg/node_modules/core-js/internals/is-object.js");
var aFunction = __webpack_require__(/*! ../internals/a-function */ "./node_modules/canvg/node_modules/core-js/internals/a-function.js");
var anInstance = __webpack_require__(/*! ../internals/an-instance */ "./node_modules/canvg/node_modules/core-js/internals/an-instance.js");
var classof = __webpack_require__(/*! ../internals/classof-raw */ "./node_modules/canvg/node_modules/core-js/internals/classof-raw.js");
var inspectSource = __webpack_require__(/*! ../internals/inspect-source */ "./node_modules/canvg/node_modules/core-js/internals/inspect-source.js");
var iterate = __webpack_require__(/*! ../internals/iterate */ "./node_modules/canvg/node_modules/core-js/internals/iterate.js");
var checkCorrectnessOfIteration = __webpack_require__(/*! ../internals/check-correctness-of-iteration */ "./node_modules/canvg/node_modules/core-js/internals/check-correctness-of-iteration.js");
var speciesConstructor = __webpack_require__(/*! ../internals/species-constructor */ "./node_modules/canvg/node_modules/core-js/internals/species-constructor.js");
var task = __webpack_require__(/*! ../internals/task */ "./node_modules/canvg/node_modules/core-js/internals/task.js").set;
var microtask = __webpack_require__(/*! ../internals/microtask */ "./node_modules/canvg/node_modules/core-js/internals/microtask.js");
var promiseResolve = __webpack_require__(/*! ../internals/promise-resolve */ "./node_modules/canvg/node_modules/core-js/internals/promise-resolve.js");
var hostReportErrors = __webpack_require__(/*! ../internals/host-report-errors */ "./node_modules/canvg/node_modules/core-js/internals/host-report-errors.js");
var newPromiseCapabilityModule = __webpack_require__(/*! ../internals/new-promise-capability */ "./node_modules/canvg/node_modules/core-js/internals/new-promise-capability.js");
var perform = __webpack_require__(/*! ../internals/perform */ "./node_modules/canvg/node_modules/core-js/internals/perform.js");
var InternalStateModule = __webpack_require__(/*! ../internals/internal-state */ "./node_modules/canvg/node_modules/core-js/internals/internal-state.js");
var isForced = __webpack_require__(/*! ../internals/is-forced */ "./node_modules/canvg/node_modules/core-js/internals/is-forced.js");
var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/canvg/node_modules/core-js/internals/well-known-symbol.js");
var V8_VERSION = __webpack_require__(/*! ../internals/engine-v8-version */ "./node_modules/canvg/node_modules/core-js/internals/engine-v8-version.js");
var SPECIES = wellKnownSymbol('species');
var PROMISE = 'Promise';
var getInternalState = InternalStateModule.get;
var setInternalState = InternalStateModule.set;
var getInternalPromiseState = InternalStateModule.getterFor(PROMISE);
var PromiseConstructor = NativePromise;
var TypeError = global.TypeError;
var document = global.document;
var process = global.process;
var $fetch = getBuiltIn('fetch');
var newPromiseCapability = newPromiseCapabilityModule.f;
var newGenericPromiseCapability = newPromiseCapability;
var IS_NODE = classof(process) == 'process';
var DISPATCH_EVENT = !!(document && document.createEvent && global.dispatchEvent);
var UNHANDLED_REJECTION = 'unhandledrejection';
var REJECTION_HANDLED = 'rejectionhandled';
var PENDING = 0;
var FULFILLED = 1;
var REJECTED = 2;
var HANDLED = 1;
var UNHANDLED = 2;
var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
var FORCED = isForced(PROMISE, function () {
var GLOBAL_CORE_JS_PROMISE = inspectSource(PromiseConstructor) !== String(PromiseConstructor);
if (!GLOBAL_CORE_JS_PROMISE) {
// V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
// https://bugs.chromium.org/p/chromium/issues/detail?id=830565
// We can't detect it synchronously, so just check versions
if (V8_VERSION === 66) return true;
// Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
if (!IS_NODE && typeof PromiseRejectionEvent != 'function') return true;
}
// We need Promise#finally in the pure version for preventing prototype pollution
if (IS_PURE && !PromiseConstructor.prototype['finally']) return true;
// We can't use @@species feature detection in V8 since it causes
// deoptimization and performance degradation
// https://github.com/zloirock/core-js/issues/679
if (V8_VERSION >= 51 && /native code/.test(PromiseConstructor)) return false;
// Detect correctness of subclassing with @@species support
var promise = PromiseConstructor.resolve(1);
var FakePromise = function (exec) {
exec(function () { /* empty */ }, function () { /* empty */ });
};
var constructor = promise.constructor = {};
constructor[SPECIES] = FakePromise;
return !(promise.then(function () { /* empty */ }) instanceof FakePromise);
});
var INCORRECT_ITERATION = FORCED || !checkCorrectnessOfIteration(function (iterable) {
PromiseConstructor.all(iterable)['catch'](function () { /* empty */ });
});
// helpers
var isThenable = function (it) {
var then;
return isObject(it) && typeof (then = it.then) == 'function' ? then : false;
};
var notify = function (promise, state, isReject) {
if (state.notified) return;
state.notified = true;
var chain = state.reactions;
microtask(function () {
var value = state.value;
var ok = state.state == FULFILLED;
var index = 0;
// variable length - can't use forEach
while (chain.length > index) {
var reaction = chain[index++];
var handler = ok ? reaction.ok : reaction.fail;
var resolve = reaction.resolve;
var reject = reaction.reject;
var domain = reaction.domain;
var result, then, exited;
try {
if (handler) {
if (!ok) {
if (state.rejection === UNHANDLED) onHandleUnhandled(promise, state);
state.rejection = HANDLED;
}
if (handler === true) result = value;
else {
if (domain) domain.enter();
result = handler(value); // can throw
if (domain) {
domain.exit();
exited = true;
}
}
if (result === reaction.promise) {
reject(TypeError('Promise-chain cycle'));
} else if (then = isThenable(result)) {
then.call(result, resolve, reject);
} else resolve(result);
} else reject(value);
} catch (error) {
if (domain && !exited) domain.exit();
reject(error);
}
}
state.reactions = [];
state.notified = false;
if (isReject && !state.rejection) onUnhandled(promise, state);
});
};
var dispatchEvent = function (name, promise, reason) {
var event, handler;
if (DISPATCH_EVENT) {
event = document.createEvent('Event');
event.promise = promise;
event.reason = reason;
event.initEvent(name, false, true);
global.dispatchEvent(event);
} else event = { promise: promise, reason: reason };
if (handler = global['on' + name]) handler(event);
else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
};
var onUnhandled = function (promise, state) {
task.call(global, function () {
var value = state.value;
var IS_UNHANDLED = isUnhandled(state);
var result;
if (IS_UNHANDLED) {
result = perform(function () {
if (IS_NODE) {
process.emit('unhandledRejection', value, promise);
} else dispatchEvent(UNHANDLED_REJECTION, promise, value);
});
// Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;
if (result.error) throw result.value;
}
});
};
var isUnhandled = function (state) {
return state.rejection !== HANDLED && !state.parent;
};
var onHandleUnhandled = function (promise, state) {
task.call(global, function () {
if (IS_NODE) {
process.emit('rejectionHandled', promise);
} else dispatchEvent(REJECTION_HANDLED, promise, state.value);
});
};
var bind = function (fn, promise, state, unwrap) {
return function (value) {
fn(promise, state, value, unwrap);
};
};
var internalReject = function (promise, state, value, unwrap) {
if (state.done) return;
state.done = true;
if (unwrap) state = unwrap;
state.value = value;
state.state = REJECTED;
notify(promise, state, true);
};
var internalResolve = function (promise, state, value, unwrap) {
if (state.done) return;
state.done = true;
if (unwrap) state = unwrap;
try {
if (promise === value) throw TypeError("Promise can't be resolved itself");
var then = isThenable(value);
if (then) {
microtask(function () {
var wrapper = { done: false };
try {
then.call(value,
bind(internalResolve, promise, wrapper, state),
bind(internalReject, promise, wrapper, state)
);
} catch (error) {
internalReject(promise, wrapper, error, state);
}
});
} else {
state.value = value;
state.state = FULFILLED;
notify(promise, state, false);
}
} catch (error) {
internalReject(promise, { done: false }, error, state);
}
};
// constructor polyfill
if (FORCED) {
// 25.4.3.1 Promise(executor)
PromiseConstructor = function Promise(executor) {
anInstance(this, PromiseConstructor, PROMISE);
aFunction(executor);
Internal.call(this);
var state = getInternalState(this);
try {
executor(bind(internalResolve, this, state), bind(internalReject, this, state));
} catch (error) {
internalReject(this, state, error);
}
};
// eslint-disable-next-line no-unused-vars
Internal = function Promise(executor) {
setInternalState(this, {
type: PROMISE,
done: false,
notified: false,
parent: false,
reactions: [],
rejection: false,
state: PENDING,
value: undefined
});
};
Internal.prototype = redefineAll(PromiseConstructor.prototype, {
// `Promise.prototype.then` method
// https://tc39.github.io/ecma262/#sec-promise.prototype.then
then: function then(onFulfilled, onRejected) {
var state = getInternalPromiseState(this);
var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));
reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;
reaction.fail = typeof onRejected == 'function' && onRejected;
reaction.domain = IS_NODE ? process.domain : undefined;
state.parent = true;
state.reactions.push(reaction);
if (state.state != PENDING) notify(this, state, false);
return reaction.promise;
},
// `Promise.prototype.catch` method
// https://tc39.github.io/ecma262/#sec-promise.prototype.catch
'catch': function (onRejected) {
return this.then(undefined, onRejected);
}
});
OwnPromiseCapability = function () {
var promise = new Internal();
var state = getInternalState(promise);
this.promise = promise;
this.resolve = bind(internalResolve, promise, state);
this.reject = bind(internalReject, promise, state);
};
newPromiseCapabilityModule.f = newPromiseCapability = function (C) {
return C === PromiseConstructor || C === PromiseWrapper
? new OwnPromiseCapability(C)
: newGenericPromiseCapability(C);
};
if (!IS_PURE && typeof NativePromise == 'function') {
nativeThen = NativePromise.prototype.then;
// wrap native Promise#then for native async functions
redefine(NativePromise.prototype, 'then', function then(onFulfilled, onRejected) {
var that = this;
return new PromiseConstructor(function (resolve, reject) {
nativeThen.call(that, resolve, reject);
}).then(onFulfilled, onRejected);
// https://github.com/zloirock/core-js/issues/640
}, { unsafe: true });
// wrap fetch result
if (typeof $fetch == 'function') $({ global: true, enumerable: true, forced: true }, {
// eslint-disable-next-line no-unused-vars
fetch: function fetch(input /* , init */) {
return promiseResolve(PromiseConstructor, $fetch.apply(global, arguments));
}
});
}
}
$({ global: true, wrap: true, forced: FORCED }, {
Promise: PromiseConstructor
});
setToStringTag(PromiseConstructor, PROMISE, false, true);
setSpecies(PROMISE);
PromiseWrapper = getBuiltIn(PROMISE);
// statics
$({ target: PROMISE, stat: true, forced: FORCED }, {
// `Promise.reject` method
// https://tc39.github.io/ecma262/#sec-promise.reject
reject: function reject(r) {
var capability = newPromiseCapability(this);
capability.reject.call(undefined, r);
return capability.promise;
}
});
$({ target: PROMISE, stat: true, forced: IS_PURE || FORCED }, {
// `Promise.resolve` method
// https://tc39.github.io/ecma262/#sec-promise.resolve
resolve: function resolve(x) {
return promiseResolve(IS_PURE && this === PromiseWrapper ? PromiseConstructor : this, x);
}
});
$({ target: PROMISE, stat: true, forced: INCORRECT_ITERATION }, {
// `Promise.all` method
// https://tc39.github.io/ecma262/#sec-promise.all
all: function all(iterable) {
var C = this;
var capability = newPromiseCapability(C);
var resolve = capability.resolve;
var reject = capability.reject;
var result = perform(function () {
var $promiseResolve = aFunction(C.resolve);
var values = [];
var counter = 0;
var remaining = 1;
iterate(iterable, function (promise) {
var index = counter++;
var alreadyCalled = false;
values.push(undefined);
remaining++;
$promiseResolve.call(C, promise).then(function (value) {
if (alreadyCalled) return;
alreadyCalled = true;
values[index] = value;
--remaining || resolve(values);
}, reject);
});
--remaining || resolve(values);
});
if (result.error) reject(result.value);
return capability.promise;
},
// `Promise.race` method
// https://tc39.github.io/ecma262/#sec-promise.race
race: function race(iterable) {
var C = this;
var capability = newPromiseCapability(C);
var reject = capability.reject;
var result = perform(function () {
var $promiseResolve = aFunction(C.resolve);
iterate(iterable, function (promise) {
$promiseResolve.call(C, promise).then(capability.resolve, reject);
});
});
if (result.error) reject(result.value);
return capability.promise;
}
});
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/modules/es.reflect.apply.js":
/*!*****************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/modules/es.reflect.apply.js ***!
\*****************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/canvg/node_modules/core-js/internals/export.js");
var getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ "./node_modules/canvg/node_modules/core-js/internals/get-built-in.js");
var aFunction = __webpack_require__(/*! ../internals/a-function */ "./node_modules/canvg/node_modules/core-js/internals/a-function.js");
var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/canvg/node_modules/core-js/internals/an-object.js");
var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/canvg/node_modules/core-js/internals/fails.js");
var nativeApply = getBuiltIn('Reflect', 'apply');
var functionApply = Function.apply;
// MS Edge argumentsList argument is optional
var OPTIONAL_ARGUMENTS_LIST = !fails(function () {
nativeApply(function () { /* empty */ });
});
// `Reflect.apply` method
// https://tc39.github.io/ecma262/#sec-reflect.apply
$({ target: 'Reflect', stat: true, forced: OPTIONAL_ARGUMENTS_LIST }, {
apply: function apply(target, thisArgument, argumentsList) {
aFunction(target);
anObject(argumentsList);
return nativeApply
? nativeApply(target, thisArgument, argumentsList)
: functionApply.call(target, thisArgument, argumentsList);
}
});
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/modules/es.reflect.construct.js":
/*!*********************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/modules/es.reflect.construct.js ***!
\*********************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/canvg/node_modules/core-js/internals/export.js");
var getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ "./node_modules/canvg/node_modules/core-js/internals/get-built-in.js");
var aFunction = __webpack_require__(/*! ../internals/a-function */ "./node_modules/canvg/node_modules/core-js/internals/a-function.js");
var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/canvg/node_modules/core-js/internals/an-object.js");
var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/canvg/node_modules/core-js/internals/is-object.js");
var create = __webpack_require__(/*! ../internals/object-create */ "./node_modules/canvg/node_modules/core-js/internals/object-create.js");
var bind = __webpack_require__(/*! ../internals/function-bind */ "./node_modules/canvg/node_modules/core-js/internals/function-bind.js");
var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/canvg/node_modules/core-js/internals/fails.js");
var nativeConstruct = getBuiltIn('Reflect', 'construct');
// `Reflect.construct` method
// https://tc39.github.io/ecma262/#sec-reflect.construct
// MS Edge supports only 2 arguments and argumentsList argument is optional
// FF Nightly sets third argument as `new.target`, but does not create `this` from it
var NEW_TARGET_BUG = fails(function () {
function F() { /* empty */ }
return !(nativeConstruct(function () { /* empty */ }, [], F) instanceof F);
});
var ARGS_BUG = !fails(function () {
nativeConstruct(function () { /* empty */ });
});
var FORCED = NEW_TARGET_BUG || ARGS_BUG;
$({ target: 'Reflect', stat: true, forced: FORCED, sham: FORCED }, {
construct: function construct(Target, args /* , newTarget */) {
aFunction(Target);
anObject(args);
var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]);
if (ARGS_BUG && !NEW_TARGET_BUG) return nativeConstruct(Target, args, newTarget);
if (Target == newTarget) {
// w/o altered newTarget, optimization for 0-4 arguments
switch (args.length) {
case 0: return new Target();
case 1: return new Target(args[0]);
case 2: return new Target(args[0], args[1]);
case 3: return new Target(args[0], args[1], args[2]);
case 4: return new Target(args[0], args[1], args[2], args[3]);
}
// w/o altered newTarget, lot of arguments case
var $args = [null];
$args.push.apply($args, args);
return new (bind.apply(Target, $args))();
}
// with altered newTarget, not support built-in constructors
var proto = newTarget.prototype;
var instance = create(isObject(proto) ? proto : Object.prototype);
var result = Function.apply.call(Target, instance, args);
return isObject(result) ? result : instance;
}
});
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/modules/es.reflect.delete-property.js":
/*!***************************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/modules/es.reflect.delete-property.js ***!
\***************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/canvg/node_modules/core-js/internals/export.js");
var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/canvg/node_modules/core-js/internals/an-object.js");
var getOwnPropertyDescriptor = __webpack_require__(/*! ../internals/object-get-own-property-descriptor */ "./node_modules/canvg/node_modules/core-js/internals/object-get-own-property-descriptor.js").f;
// `Reflect.deleteProperty` method
// https://tc39.github.io/ecma262/#sec-reflect.deleteproperty
$({ target: 'Reflect', stat: true }, {
deleteProperty: function deleteProperty(target, propertyKey) {
var descriptor = getOwnPropertyDescriptor(anObject(target), propertyKey);
return descriptor && !descriptor.configurable ? false : delete target[propertyKey];
}
});
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/modules/es.reflect.get-prototype-of.js":
/*!****************************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/modules/es.reflect.get-prototype-of.js ***!
\****************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/canvg/node_modules/core-js/internals/export.js");
var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/canvg/node_modules/core-js/internals/an-object.js");
var objectGetPrototypeOf = __webpack_require__(/*! ../internals/object-get-prototype-of */ "./node_modules/canvg/node_modules/core-js/internals/object-get-prototype-of.js");
var CORRECT_PROTOTYPE_GETTER = __webpack_require__(/*! ../internals/correct-prototype-getter */ "./node_modules/canvg/node_modules/core-js/internals/correct-prototype-getter.js");
// `Reflect.getPrototypeOf` method
// https://tc39.github.io/ecma262/#sec-reflect.getprototypeof
$({ target: 'Reflect', stat: true, sham: !CORRECT_PROTOTYPE_GETTER }, {
getPrototypeOf: function getPrototypeOf(target) {
return objectGetPrototypeOf(anObject(target));
}
});
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/modules/es.regexp.exec.js":
/*!***************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/modules/es.regexp.exec.js ***!
\***************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/canvg/node_modules/core-js/internals/export.js");
var exec = __webpack_require__(/*! ../internals/regexp-exec */ "./node_modules/canvg/node_modules/core-js/internals/regexp-exec.js");
$({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, {
exec: exec
});
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/modules/es.regexp.to-string.js":
/*!********************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/modules/es.regexp.to-string.js ***!
\********************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var redefine = __webpack_require__(/*! ../internals/redefine */ "./node_modules/canvg/node_modules/core-js/internals/redefine.js");
var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/canvg/node_modules/core-js/internals/an-object.js");
var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/canvg/node_modules/core-js/internals/fails.js");
var flags = __webpack_require__(/*! ../internals/regexp-flags */ "./node_modules/canvg/node_modules/core-js/internals/regexp-flags.js");
var TO_STRING = 'toString';
var RegExpPrototype = RegExp.prototype;
var nativeToString = RegExpPrototype[TO_STRING];
var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
// FF44- RegExp#toString has a wrong name
var INCORRECT_NAME = nativeToString.name != TO_STRING;
// `RegExp.prototype.toString` method
// https://tc39.github.io/ecma262/#sec-regexp.prototype.tostring
if (NOT_GENERIC || INCORRECT_NAME) {
redefine(RegExp.prototype, TO_STRING, function toString() {
var R = anObject(this);
var p = String(R.source);
var rf = R.flags;
var f = String(rf === undefined && R instanceof RegExp && !('flags' in RegExpPrototype) ? flags.call(R) : rf);
return '/' + p + '/' + f;
}, { unsafe: true });
}
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/modules/es.string.includes.js":
/*!*******************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/modules/es.string.includes.js ***!
\*******************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/canvg/node_modules/core-js/internals/export.js");
var notARegExp = __webpack_require__(/*! ../internals/not-a-regexp */ "./node_modules/canvg/node_modules/core-js/internals/not-a-regexp.js");
var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "./node_modules/canvg/node_modules/core-js/internals/require-object-coercible.js");
var correctIsRegExpLogic = __webpack_require__(/*! ../internals/correct-is-regexp-logic */ "./node_modules/canvg/node_modules/core-js/internals/correct-is-regexp-logic.js");
// `String.prototype.includes` method
// https://tc39.github.io/ecma262/#sec-string.prototype.includes
$({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {
includes: function includes(searchString /* , position = 0 */) {
return !!~String(requireObjectCoercible(this))
.indexOf(notARegExp(searchString), arguments.length > 1 ? arguments[1] : undefined);
}
});
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/modules/es.string.iterator.js":
/*!*******************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/modules/es.string.iterator.js ***!
\*******************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var charAt = __webpack_require__(/*! ../internals/string-multibyte */ "./node_modules/canvg/node_modules/core-js/internals/string-multibyte.js").charAt;
var InternalStateModule = __webpack_require__(/*! ../internals/internal-state */ "./node_modules/canvg/node_modules/core-js/internals/internal-state.js");
var defineIterator = __webpack_require__(/*! ../internals/define-iterator */ "./node_modules/canvg/node_modules/core-js/internals/define-iterator.js");
var STRING_ITERATOR = 'String Iterator';
var setInternalState = InternalStateModule.set;
var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR);
// `String.prototype[@@iterator]` method
// https://tc39.github.io/ecma262/#sec-string.prototype-@@iterator
defineIterator(String, 'String', function (iterated) {
setInternalState(this, {
type: STRING_ITERATOR,
string: String(iterated),
index: 0
});
// `%StringIteratorPrototype%.next` method
// https://tc39.github.io/ecma262/#sec-%stringiteratorprototype%.next
}, function next() {
var state = getInternalState(this);
var string = state.string;
var index = state.index;
var point;
if (index >= string.length) return { value: undefined, done: true };
point = charAt(string, index);
state.index += point.length;
return { value: point, done: false };
});
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/modules/es.string.match.js":
/*!****************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/modules/es.string.match.js ***!
\****************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var fixRegExpWellKnownSymbolLogic = __webpack_require__(/*! ../internals/fix-regexp-well-known-symbol-logic */ "./node_modules/canvg/node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js");
var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/canvg/node_modules/core-js/internals/an-object.js");
var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/canvg/node_modules/core-js/internals/to-length.js");
var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "./node_modules/canvg/node_modules/core-js/internals/require-object-coercible.js");
var advanceStringIndex = __webpack_require__(/*! ../internals/advance-string-index */ "./node_modules/canvg/node_modules/core-js/internals/advance-string-index.js");
var regExpExec = __webpack_require__(/*! ../internals/regexp-exec-abstract */ "./node_modules/canvg/node_modules/core-js/internals/regexp-exec-abstract.js");
// @@match logic
fixRegExpWellKnownSymbolLogic('match', 1, function (MATCH, nativeMatch, maybeCallNative) {
return [
// `String.prototype.match` method
// https://tc39.github.io/ecma262/#sec-string.prototype.match
function match(regexp) {
var O = requireObjectCoercible(this);
var matcher = regexp == undefined ? undefined : regexp[MATCH];
return matcher !== undefined ? matcher.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));
},
// `RegExp.prototype[@@match]` method
// https://tc39.github.io/ecma262/#sec-regexp.prototype-@@match
function (regexp) {
var res = maybeCallNative(nativeMatch, regexp, this);
if (res.done) return res.value;
var rx = anObject(regexp);
var S = String(this);
if (!rx.global) return regExpExec(rx, S);
var fullUnicode = rx.unicode;
rx.lastIndex = 0;
var A = [];
var n = 0;
var result;
while ((result = regExpExec(rx, S)) !== null) {
var matchStr = String(result[0]);
A[n] = matchStr;
if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
n++;
}
return n === 0 ? null : A;
}
];
});
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/modules/es.string.replace.js":
/*!******************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/modules/es.string.replace.js ***!
\******************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var fixRegExpWellKnownSymbolLogic = __webpack_require__(/*! ../internals/fix-regexp-well-known-symbol-logic */ "./node_modules/canvg/node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js");
var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/canvg/node_modules/core-js/internals/an-object.js");
var toObject = __webpack_require__(/*! ../internals/to-object */ "./node_modules/canvg/node_modules/core-js/internals/to-object.js");
var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/canvg/node_modules/core-js/internals/to-length.js");
var toInteger = __webpack_require__(/*! ../internals/to-integer */ "./node_modules/canvg/node_modules/core-js/internals/to-integer.js");
var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "./node_modules/canvg/node_modules/core-js/internals/require-object-coercible.js");
var advanceStringIndex = __webpack_require__(/*! ../internals/advance-string-index */ "./node_modules/canvg/node_modules/core-js/internals/advance-string-index.js");
var regExpExec = __webpack_require__(/*! ../internals/regexp-exec-abstract */ "./node_modules/canvg/node_modules/core-js/internals/regexp-exec-abstract.js");
var max = Math.max;
var min = Math.min;
var floor = Math.floor;
var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d\d?|<[^>]*>)/g;
var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d\d?)/g;
var maybeToString = function (it) {
return it === undefined ? it : String(it);
};
// @@replace logic
fixRegExpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, maybeCallNative, reason) {
var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = reason.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE;
var REPLACE_KEEPS_$0 = reason.REPLACE_KEEPS_$0;
var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
return [
// `String.prototype.replace` method
// https://tc39.github.io/ecma262/#sec-string.prototype.replace
function replace(searchValue, replaceValue) {
var O = requireObjectCoercible(this);
var replacer = searchValue == undefined ? undefined : searchValue[REPLACE];
return replacer !== undefined
? replacer.call(searchValue, O, replaceValue)
: nativeReplace.call(String(O), searchValue, replaceValue);
},
// `RegExp.prototype[@@replace]` method
// https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace
function (regexp, replaceValue) {
if (
(!REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE && REPLACE_KEEPS_$0) ||
(typeof replaceValue === 'string' && replaceValue.indexOf(UNSAFE_SUBSTITUTE) === -1)
) {
var res = maybeCallNative(nativeReplace, regexp, this, replaceValue);
if (res.done) return res.value;
}
var rx = anObject(regexp);
var S = String(this);
var functionalReplace = typeof replaceValue === 'function';
if (!functionalReplace) replaceValue = String(replaceValue);
var global = rx.global;
if (global) {
var fullUnicode = rx.unicode;
rx.lastIndex = 0;
}
var results = [];
while (true) {
var result = regExpExec(rx, S);
if (result === null) break;
results.push(result);
if (!global) break;
var matchStr = String(result[0]);
if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
}
var accumulatedResult = '';
var nextSourcePosition = 0;
for (var i = 0; i < results.length; i++) {
result = results[i];
var matched = String(result[0]);
var position = max(min(toInteger(result.index), S.length), 0);
var captures = [];
// NOTE: This is equivalent to
// captures = result.slice(1).map(maybeToString)
// but for some reason `nativeSlice.call(result, 1, result.length)` (called in
// the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
// causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));
var namedCaptures = result.groups;
if (functionalReplace) {
var replacerArgs = [matched].concat(captures, position, S);
if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);
var replacement = String(replaceValue.apply(undefined, replacerArgs));
} else {
replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
}
if (position >= nextSourcePosition) {
accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
nextSourcePosition = position + matched.length;
}
}
return accumulatedResult + S.slice(nextSourcePosition);
}
];
// https://tc39.github.io/ecma262/#sec-getsubstitution
function getSubstitution(matched, str, position, captures, namedCaptures, replacement) {
var tailPos = position + matched.length;
var m = captures.length;
var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
if (namedCaptures !== undefined) {
namedCaptures = toObject(namedCaptures);
symbols = SUBSTITUTION_SYMBOLS;
}
return nativeReplace.call(replacement, symbols, function (match, ch) {
var capture;
switch (ch.charAt(0)) {
case '$': return '$';
case '&': return matched;
case '`': return str.slice(0, position);
case "'": return str.slice(tailPos);
case '<':
capture = namedCaptures[ch.slice(1, -1)];
break;
default: // \d\d?
var n = +ch;
if (n === 0) return match;
if (n > m) {
var f = floor(n / 10);
if (f === 0) return match;
if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
return match;
}
capture = captures[n - 1];
}
return capture === undefined ? '' : capture;
});
}
});
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/modules/es.string.split.js":
/*!****************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/modules/es.string.split.js ***!
\****************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var fixRegExpWellKnownSymbolLogic = __webpack_require__(/*! ../internals/fix-regexp-well-known-symbol-logic */ "./node_modules/canvg/node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js");
var isRegExp = __webpack_require__(/*! ../internals/is-regexp */ "./node_modules/canvg/node_modules/core-js/internals/is-regexp.js");
var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/canvg/node_modules/core-js/internals/an-object.js");
var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "./node_modules/canvg/node_modules/core-js/internals/require-object-coercible.js");
var speciesConstructor = __webpack_require__(/*! ../internals/species-constructor */ "./node_modules/canvg/node_modules/core-js/internals/species-constructor.js");
var advanceStringIndex = __webpack_require__(/*! ../internals/advance-string-index */ "./node_modules/canvg/node_modules/core-js/internals/advance-string-index.js");
var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/canvg/node_modules/core-js/internals/to-length.js");
var callRegExpExec = __webpack_require__(/*! ../internals/regexp-exec-abstract */ "./node_modules/canvg/node_modules/core-js/internals/regexp-exec-abstract.js");
var regexpExec = __webpack_require__(/*! ../internals/regexp-exec */ "./node_modules/canvg/node_modules/core-js/internals/regexp-exec.js");
var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/canvg/node_modules/core-js/internals/fails.js");
var arrayPush = [].push;
var min = Math.min;
var MAX_UINT32 = 0xFFFFFFFF;
// babel-minify transpiles RegExp('x', 'y') -> /x/y and it causes SyntaxError
var SUPPORTS_Y = !fails(function () { return !RegExp(MAX_UINT32, 'y'); });
// @@split logic
fixRegExpWellKnownSymbolLogic('split', 2, function (SPLIT, nativeSplit, maybeCallNative) {
var internalSplit;
if (
'abbc'.split(/(b)*/)[1] == 'c' ||
'test'.split(/(?:)/, -1).length != 4 ||
'ab'.split(/(?:ab)*/).length != 2 ||
'.'.split(/(.?)(.?)/).length != 4 ||
'.'.split(/()()/).length > 1 ||
''.split(/.?/).length
) {
// based on es5-shim implementation, need to rework it
internalSplit = function (separator, limit) {
var string = String(requireObjectCoercible(this));
var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
if (lim === 0) return [];
if (separator === undefined) return [string];
// If `separator` is not a regex, use native split
if (!isRegExp(separator)) {
return nativeSplit.call(string, separator, lim);
}
var output = [];
var flags = (separator.ignoreCase ? 'i' : '') +
(separator.multiline ? 'm' : '') +
(separator.unicode ? 'u' : '') +
(separator.sticky ? 'y' : '');
var lastLastIndex = 0;
// Make `global` and avoid `lastIndex` issues by working with a copy
var separatorCopy = new RegExp(separator.source, flags + 'g');
var match, lastIndex, lastLength;
while (match = regexpExec.call(separatorCopy, string)) {
lastIndex = separatorCopy.lastIndex;
if (lastIndex > lastLastIndex) {
output.push(string.slice(lastLastIndex, match.index));
if (match.length > 1 && match.index < string.length) arrayPush.apply(output, match.slice(1));
lastLength = match[0].length;
lastLastIndex = lastIndex;
if (output.length >= lim) break;
}
if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop
}
if (lastLastIndex === string.length) {
if (lastLength || !separatorCopy.test('')) output.push('');
} else output.push(string.slice(lastLastIndex));
return output.length > lim ? output.slice(0, lim) : output;
};
// Chakra, V8
} else if ('0'.split(undefined, 0).length) {
internalSplit = function (separator, limit) {
return separator === undefined && limit === 0 ? [] : nativeSplit.call(this, separator, limit);
};
} else internalSplit = nativeSplit;
return [
// `String.prototype.split` method
// https://tc39.github.io/ecma262/#sec-string.prototype.split
function split(separator, limit) {
var O = requireObjectCoercible(this);
var splitter = separator == undefined ? undefined : separator[SPLIT];
return splitter !== undefined
? splitter.call(separator, O, limit)
: internalSplit.call(String(O), separator, limit);
},
// `RegExp.prototype[@@split]` method
// https://tc39.github.io/ecma262/#sec-regexp.prototype-@@split
//
// NOTE: This cannot be properly polyfilled in engines that don't support
// the 'y' flag.
function (regexp, limit) {
var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== nativeSplit);
if (res.done) return res.value;
var rx = anObject(regexp);
var S = String(this);
var C = speciesConstructor(rx, RegExp);
var unicodeMatching = rx.unicode;
var flags = (rx.ignoreCase ? 'i' : '') +
(rx.multiline ? 'm' : '') +
(rx.unicode ? 'u' : '') +
(SUPPORTS_Y ? 'y' : 'g');
// ^(? + rx + ) is needed, in combination with some S slicing, to
// simulate the 'y' flag.
var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags);
var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
if (lim === 0) return [];
if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : [];
var p = 0;
var q = 0;
var A = [];
while (q < S.length) {
splitter.lastIndex = SUPPORTS_Y ? q : 0;
var z = callRegExpExec(splitter, SUPPORTS_Y ? S : S.slice(q));
var e;
if (
z === null ||
(e = min(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p
) {
q = advanceStringIndex(S, q, unicodeMatching);
} else {
A.push(S.slice(p, q));
if (A.length === lim) return A;
for (var i = 1; i <= z.length - 1; i++) {
A.push(z[i]);
if (A.length === lim) return A;
}
q = p = e;
}
}
A.push(S.slice(p));
return A;
}
];
}, !SUPPORTS_Y);
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/modules/es.string.starts-with.js":
/*!**********************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/modules/es.string.starts-with.js ***!
\**********************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/canvg/node_modules/core-js/internals/export.js");
var getOwnPropertyDescriptor = __webpack_require__(/*! ../internals/object-get-own-property-descriptor */ "./node_modules/canvg/node_modules/core-js/internals/object-get-own-property-descriptor.js").f;
var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/canvg/node_modules/core-js/internals/to-length.js");
var notARegExp = __webpack_require__(/*! ../internals/not-a-regexp */ "./node_modules/canvg/node_modules/core-js/internals/not-a-regexp.js");
var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "./node_modules/canvg/node_modules/core-js/internals/require-object-coercible.js");
var correctIsRegExpLogic = __webpack_require__(/*! ../internals/correct-is-regexp-logic */ "./node_modules/canvg/node_modules/core-js/internals/correct-is-regexp-logic.js");
var IS_PURE = __webpack_require__(/*! ../internals/is-pure */ "./node_modules/canvg/node_modules/core-js/internals/is-pure.js");
var nativeStartsWith = ''.startsWith;
var min = Math.min;
var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('startsWith');
// https://github.com/zloirock/core-js/pull/702
var MDN_POLYFILL_BUG = !IS_PURE && !CORRECT_IS_REGEXP_LOGIC && !!function () {
var descriptor = getOwnPropertyDescriptor(String.prototype, 'startsWith');
return descriptor && !descriptor.writable;
}();
// `String.prototype.startsWith` method
// https://tc39.github.io/ecma262/#sec-string.prototype.startswith
$({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, {
startsWith: function startsWith(searchString /* , position = 0 */) {
var that = String(requireObjectCoercible(this));
notARegExp(searchString);
var index = toLength(min(arguments.length > 1 ? arguments[1] : undefined, that.length));
var search = String(searchString);
return nativeStartsWith
? nativeStartsWith.call(that, search, index)
: that.slice(index, index + search.length) === search;
}
});
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/modules/es.string.trim.js":
/*!***************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/modules/es.string.trim.js ***!
\***************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/canvg/node_modules/core-js/internals/export.js");
var $trim = __webpack_require__(/*! ../internals/string-trim */ "./node_modules/canvg/node_modules/core-js/internals/string-trim.js").trim;
var forcedStringTrimMethod = __webpack_require__(/*! ../internals/string-trim-forced */ "./node_modules/canvg/node_modules/core-js/internals/string-trim-forced.js");
// `String.prototype.trim` method
// https://tc39.github.io/ecma262/#sec-string.prototype.trim
$({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
trim: function trim() {
return $trim(this);
}
});
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/modules/es.symbol.description.js":
/*!**********************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/modules/es.symbol.description.js ***!
\**********************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// `Symbol.prototype.description` getter
// https://tc39.github.io/ecma262/#sec-symbol.prototype.description
var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/canvg/node_modules/core-js/internals/export.js");
var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/canvg/node_modules/core-js/internals/descriptors.js");
var global = __webpack_require__(/*! ../internals/global */ "./node_modules/canvg/node_modules/core-js/internals/global.js");
var has = __webpack_require__(/*! ../internals/has */ "./node_modules/canvg/node_modules/core-js/internals/has.js");
var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/canvg/node_modules/core-js/internals/is-object.js");
var defineProperty = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/canvg/node_modules/core-js/internals/object-define-property.js").f;
var copyConstructorProperties = __webpack_require__(/*! ../internals/copy-constructor-properties */ "./node_modules/canvg/node_modules/core-js/internals/copy-constructor-properties.js");
var NativeSymbol = global.Symbol;
if (DESCRIPTORS && typeof NativeSymbol == 'function' && (!('description' in NativeSymbol.prototype) ||
// Safari 12 bug
NativeSymbol().description !== undefined
)) {
var EmptyStringDescriptionStore = {};
// wrap Symbol constructor for correct work with undefined description
var SymbolWrapper = function Symbol() {
var description = arguments.length < 1 || arguments[0] === undefined ? undefined : String(arguments[0]);
var result = this instanceof SymbolWrapper
? new NativeSymbol(description)
// in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)'
: description === undefined ? NativeSymbol() : NativeSymbol(description);
if (description === '') EmptyStringDescriptionStore[result] = true;
return result;
};
copyConstructorProperties(SymbolWrapper, NativeSymbol);
var symbolPrototype = SymbolWrapper.prototype = NativeSymbol.prototype;
symbolPrototype.constructor = SymbolWrapper;
var symbolToString = symbolPrototype.toString;
var native = String(NativeSymbol('test')) == 'Symbol(test)';
var regexp = /^Symbol\((.*)\)[^)]+$/;
defineProperty(symbolPrototype, 'description', {
configurable: true,
get: function description() {
var symbol = isObject(this) ? this.valueOf() : this;
var string = symbolToString.call(symbol);
if (has(EmptyStringDescriptionStore, symbol)) return '';
var desc = native ? string.slice(7, -1) : string.replace(regexp, '$1');
return desc === '' ? undefined : desc;
}
});
$({ global: true, forced: true }, {
Symbol: SymbolWrapper
});
}
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/modules/es.symbol.iterator.js":
/*!*******************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/modules/es.symbol.iterator.js ***!
\*******************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var defineWellKnownSymbol = __webpack_require__(/*! ../internals/define-well-known-symbol */ "./node_modules/canvg/node_modules/core-js/internals/define-well-known-symbol.js");
// `Symbol.iterator` well-known symbol
// https://tc39.github.io/ecma262/#sec-symbol.iterator
defineWellKnownSymbol('iterator');
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/modules/es.symbol.js":
/*!**********************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/modules/es.symbol.js ***!
\**********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/canvg/node_modules/core-js/internals/export.js");
var global = __webpack_require__(/*! ../internals/global */ "./node_modules/canvg/node_modules/core-js/internals/global.js");
var getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ "./node_modules/canvg/node_modules/core-js/internals/get-built-in.js");
var IS_PURE = __webpack_require__(/*! ../internals/is-pure */ "./node_modules/canvg/node_modules/core-js/internals/is-pure.js");
var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/canvg/node_modules/core-js/internals/descriptors.js");
var NATIVE_SYMBOL = __webpack_require__(/*! ../internals/native-symbol */ "./node_modules/canvg/node_modules/core-js/internals/native-symbol.js");
var USE_SYMBOL_AS_UID = __webpack_require__(/*! ../internals/use-symbol-as-uid */ "./node_modules/canvg/node_modules/core-js/internals/use-symbol-as-uid.js");
var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/canvg/node_modules/core-js/internals/fails.js");
var has = __webpack_require__(/*! ../internals/has */ "./node_modules/canvg/node_modules/core-js/internals/has.js");
var isArray = __webpack_require__(/*! ../internals/is-array */ "./node_modules/canvg/node_modules/core-js/internals/is-array.js");
var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/canvg/node_modules/core-js/internals/is-object.js");
var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/canvg/node_modules/core-js/internals/an-object.js");
var toObject = __webpack_require__(/*! ../internals/to-object */ "./node_modules/canvg/node_modules/core-js/internals/to-object.js");
var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "./node_modules/canvg/node_modules/core-js/internals/to-indexed-object.js");
var toPrimitive = __webpack_require__(/*! ../internals/to-primitive */ "./node_modules/canvg/node_modules/core-js/internals/to-primitive.js");
var createPropertyDescriptor = __webpack_require__(/*! ../internals/create-property-descriptor */ "./node_modules/canvg/node_modules/core-js/internals/create-property-descriptor.js");
var nativeObjectCreate = __webpack_require__(/*! ../internals/object-create */ "./node_modules/canvg/node_modules/core-js/internals/object-create.js");
var objectKeys = __webpack_require__(/*! ../internals/object-keys */ "./node_modules/canvg/node_modules/core-js/internals/object-keys.js");
var getOwnPropertyNamesModule = __webpack_require__(/*! ../internals/object-get-own-property-names */ "./node_modules/canvg/node_modules/core-js/internals/object-get-own-property-names.js");
var getOwnPropertyNamesExternal = __webpack_require__(/*! ../internals/object-get-own-property-names-external */ "./node_modules/canvg/node_modules/core-js/internals/object-get-own-property-names-external.js");
var getOwnPropertySymbolsModule = __webpack_require__(/*! ../internals/object-get-own-property-symbols */ "./node_modules/canvg/node_modules/core-js/internals/object-get-own-property-symbols.js");
var getOwnPropertyDescriptorModule = __webpack_require__(/*! ../internals/object-get-own-property-descriptor */ "./node_modules/canvg/node_modules/core-js/internals/object-get-own-property-descriptor.js");
var definePropertyModule = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/canvg/node_modules/core-js/internals/object-define-property.js");
var propertyIsEnumerableModule = __webpack_require__(/*! ../internals/object-property-is-enumerable */ "./node_modules/canvg/node_modules/core-js/internals/object-property-is-enumerable.js");
var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "./node_modules/canvg/node_modules/core-js/internals/create-non-enumerable-property.js");
var redefine = __webpack_require__(/*! ../internals/redefine */ "./node_modules/canvg/node_modules/core-js/internals/redefine.js");
var shared = __webpack_require__(/*! ../internals/shared */ "./node_modules/canvg/node_modules/core-js/internals/shared.js");
var sharedKey = __webpack_require__(/*! ../internals/shared-key */ "./node_modules/canvg/node_modules/core-js/internals/shared-key.js");
var hiddenKeys = __webpack_require__(/*! ../internals/hidden-keys */ "./node_modules/canvg/node_modules/core-js/internals/hidden-keys.js");
var uid = __webpack_require__(/*! ../internals/uid */ "./node_modules/canvg/node_modules/core-js/internals/uid.js");
var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/canvg/node_modules/core-js/internals/well-known-symbol.js");
var wrappedWellKnownSymbolModule = __webpack_require__(/*! ../internals/well-known-symbol-wrapped */ "./node_modules/canvg/node_modules/core-js/internals/well-known-symbol-wrapped.js");
var defineWellKnownSymbol = __webpack_require__(/*! ../internals/define-well-known-symbol */ "./node_modules/canvg/node_modules/core-js/internals/define-well-known-symbol.js");
var setToStringTag = __webpack_require__(/*! ../internals/set-to-string-tag */ "./node_modules/canvg/node_modules/core-js/internals/set-to-string-tag.js");
var InternalStateModule = __webpack_require__(/*! ../internals/internal-state */ "./node_modules/canvg/node_modules/core-js/internals/internal-state.js");
var $forEach = __webpack_require__(/*! ../internals/array-iteration */ "./node_modules/canvg/node_modules/core-js/internals/array-iteration.js").forEach;
var HIDDEN = sharedKey('hidden');
var SYMBOL = 'Symbol';
var PROTOTYPE = 'prototype';
var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
var setInternalState = InternalStateModule.set;
var getInternalState = InternalStateModule.getterFor(SYMBOL);
var ObjectPrototype = Object[PROTOTYPE];
var $Symbol = global.Symbol;
var $stringify = getBuiltIn('JSON', 'stringify');
var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
var nativeDefineProperty = definePropertyModule.f;
var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f;
var nativePropertyIsEnumerable = propertyIsEnumerableModule.f;
var AllSymbols = shared('symbols');
var ObjectPrototypeSymbols = shared('op-symbols');
var StringToSymbolRegistry = shared('string-to-symbol-registry');
var SymbolToStringRegistry = shared('symbol-to-string-registry');
var WellKnownSymbolsStore = shared('wks');
var QObject = global.QObject;
// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
var USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
var setSymbolDescriptor = DESCRIPTORS && fails(function () {
return nativeObjectCreate(nativeDefineProperty({}, 'a', {
get: function () { return nativeDefineProperty(this, 'a', { value: 7 }).a; }
})).a != 7;
}) ? function (O, P, Attributes) {
var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor(ObjectPrototype, P);
if (ObjectPrototypeDescriptor) delete ObjectPrototype[P];
nativeDefineProperty(O, P, Attributes);
if (ObjectPrototypeDescriptor && O !== ObjectPrototype) {
nativeDefineProperty(ObjectPrototype, P, ObjectPrototypeDescriptor);
}
} : nativeDefineProperty;
var wrap = function (tag, description) {
var symbol = AllSymbols[tag] = nativeObjectCreate($Symbol[PROTOTYPE]);
setInternalState(symbol, {
type: SYMBOL,
tag: tag,
description: description
});
if (!DESCRIPTORS) symbol.description = description;
return symbol;
};
var isSymbol = USE_SYMBOL_AS_UID ? function (it) {
return typeof it == 'symbol';
} : function (it) {
return Object(it) instanceof $Symbol;
};
var $defineProperty = function defineProperty(O, P, Attributes) {
if (O === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, P, Attributes);
anObject(O);
var key = toPrimitive(P, true);
anObject(Attributes);
if (has(AllSymbols, key)) {
if (!Attributes.enumerable) {
if (!has(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, {}));
O[HIDDEN][key] = true;
} else {
if (has(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false;
Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) });
} return setSymbolDescriptor(O, key, Attributes);
} return nativeDefineProperty(O, key, Attributes);
};
var $defineProperties = function defineProperties(O, Properties) {
anObject(O);
var properties = toIndexedObject(Properties);
var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties));
$forEach(keys, function (key) {
if (!DESCRIPTORS || $propertyIsEnumerable.call(properties, key)) $defineProperty(O, key, properties[key]);
});
return O;
};
var $create = function create(O, Properties) {
return Properties === undefined ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties);
};
var $propertyIsEnumerable = function propertyIsEnumerable(V) {
var P = toPrimitive(V, true);
var enumerable = nativePropertyIsEnumerable.call(this, P);
if (this === ObjectPrototype && has(AllSymbols, P) && !has(ObjectPrototypeSymbols, P)) return false;
return enumerable || !has(this, P) || !has(AllSymbols, P) || has(this, HIDDEN) && this[HIDDEN][P] ? enumerable : true;
};
var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) {
var it = toIndexedObject(O);
var key = toPrimitive(P, true);
if (it === ObjectPrototype && has(AllSymbols, key) && !has(ObjectPrototypeSymbols, key)) return;
var descriptor = nativeGetOwnPropertyDescriptor(it, key);
if (descriptor && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) {
descriptor.enumerable = true;
}
return descriptor;
};
var $getOwnPropertyNames = function getOwnPropertyNames(O) {
var names = nativeGetOwnPropertyNames(toIndexedObject(O));
var result = [];
$forEach(names, function (key) {
if (!has(AllSymbols, key) && !has(hiddenKeys, key)) result.push(key);
});
return result;
};
var $getOwnPropertySymbols = function getOwnPropertySymbols(O) {
var IS_OBJECT_PROTOTYPE = O === ObjectPrototype;
var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O));
var result = [];
$forEach(names, function (key) {
if (has(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || has(ObjectPrototype, key))) {
result.push(AllSymbols[key]);
}
});
return result;
};
// `Symbol` constructor
// https://tc39.github.io/ecma262/#sec-symbol-constructor
if (!NATIVE_SYMBOL) {
$Symbol = function Symbol() {
if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor');
var description = !arguments.length || arguments[0] === undefined ? undefined : String(arguments[0]);
var tag = uid(description);
var setter = function (value) {
if (this === ObjectPrototype) setter.call(ObjectPrototypeSymbols, value);
if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value));
};
if (DESCRIPTORS && USE_SETTER) setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter });
return wrap(tag, description);
};
redefine($Symbol[PROTOTYPE], 'toString', function toString() {
return getInternalState(this).tag;
});
redefine($Symbol, 'withoutSetter', function (description) {
return wrap(uid(description), description);
});
propertyIsEnumerableModule.f = $propertyIsEnumerable;
definePropertyModule.f = $defineProperty;
getOwnPropertyDescriptorModule.f = $getOwnPropertyDescriptor;
getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames;
getOwnPropertySymbolsModule.f = $getOwnPropertySymbols;
wrappedWellKnownSymbolModule.f = function (name) {
return wrap(wellKnownSymbol(name), name);
};
if (DESCRIPTORS) {
// https://github.com/tc39/proposal-Symbol-description
nativeDefineProperty($Symbol[PROTOTYPE], 'description', {
configurable: true,
get: function description() {
return getInternalState(this).description;
}
});
if (!IS_PURE) {
redefine(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true });
}
}
}
$({ global: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, {
Symbol: $Symbol
});
$forEach(objectKeys(WellKnownSymbolsStore), function (name) {
defineWellKnownSymbol(name);
});
$({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL }, {
// `Symbol.for` method
// https://tc39.github.io/ecma262/#sec-symbol.for
'for': function (key) {
var string = String(key);
if (has(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string];
var symbol = $Symbol(string);
StringToSymbolRegistry[string] = symbol;
SymbolToStringRegistry[symbol] = string;
return symbol;
},
// `Symbol.keyFor` method
// https://tc39.github.io/ecma262/#sec-symbol.keyfor
keyFor: function keyFor(sym) {
if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol');
if (has(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym];
},
useSetter: function () { USE_SETTER = true; },
useSimple: function () { USE_SETTER = false; }
});
$({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL, sham: !DESCRIPTORS }, {
// `Object.create` method
// https://tc39.github.io/ecma262/#sec-object.create
create: $create,
// `Object.defineProperty` method
// https://tc39.github.io/ecma262/#sec-object.defineproperty
defineProperty: $defineProperty,
// `Object.defineProperties` method
// https://tc39.github.io/ecma262/#sec-object.defineproperties
defineProperties: $defineProperties,
// `Object.getOwnPropertyDescriptor` method
// https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptors
getOwnPropertyDescriptor: $getOwnPropertyDescriptor
});
$({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL }, {
// `Object.getOwnPropertyNames` method
// https://tc39.github.io/ecma262/#sec-object.getownpropertynames
getOwnPropertyNames: $getOwnPropertyNames,
// `Object.getOwnPropertySymbols` method
// https://tc39.github.io/ecma262/#sec-object.getownpropertysymbols
getOwnPropertySymbols: $getOwnPropertySymbols
});
// Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives
// https://bugs.chromium.org/p/v8/issues/detail?id=3443
$({ target: 'Object', stat: true, forced: fails(function () { getOwnPropertySymbolsModule.f(1); }) }, {
getOwnPropertySymbols: function getOwnPropertySymbols(it) {
return getOwnPropertySymbolsModule.f(toObject(it));
}
});
// `JSON.stringify` method behavior with symbols
// https://tc39.github.io/ecma262/#sec-json.stringify
if ($stringify) {
var FORCED_JSON_STRINGIFY = !NATIVE_SYMBOL || fails(function () {
var symbol = $Symbol();
// MS Edge converts symbol values to JSON as {}
return $stringify([symbol]) != '[null]'
// WebKit converts symbol values to JSON as null
|| $stringify({ a: symbol }) != '{}'
// V8 throws on boxed symbols
|| $stringify(Object(symbol)) != '{}';
});
$({ target: 'JSON', stat: true, forced: FORCED_JSON_STRINGIFY }, {
// eslint-disable-next-line no-unused-vars
stringify: function stringify(it, replacer, space) {
var args = [it];
var index = 1;
var $replacer;
while (arguments.length > index) args.push(arguments[index++]);
$replacer = replacer;
if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
if (!isArray(replacer)) replacer = function (key, value) {
if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
if (!isSymbol(value)) return value;
};
args[1] = replacer;
return $stringify.apply(null, args);
}
});
}
// `Symbol.prototype[@@toPrimitive]` method
// https://tc39.github.io/ecma262/#sec-symbol.prototype-@@toprimitive
if (!$Symbol[PROTOTYPE][TO_PRIMITIVE]) {
createNonEnumerableProperty($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
}
// `Symbol.prototype[@@toStringTag]` property
// https://tc39.github.io/ecma262/#sec-symbol.prototype-@@tostringtag
setToStringTag($Symbol, SYMBOL);
hiddenKeys[HIDDEN] = true;
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/modules/web.dom-collections.for-each.js":
/*!*****************************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/modules/web.dom-collections.for-each.js ***!
\*****************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__(/*! ../internals/global */ "./node_modules/canvg/node_modules/core-js/internals/global.js");
var DOMIterables = __webpack_require__(/*! ../internals/dom-iterables */ "./node_modules/canvg/node_modules/core-js/internals/dom-iterables.js");
var forEach = __webpack_require__(/*! ../internals/array-for-each */ "./node_modules/canvg/node_modules/core-js/internals/array-for-each.js");
var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "./node_modules/canvg/node_modules/core-js/internals/create-non-enumerable-property.js");
for (var COLLECTION_NAME in DOMIterables) {
var Collection = global[COLLECTION_NAME];
var CollectionPrototype = Collection && Collection.prototype;
// some Chrome versions have non-configurable methods on DOMTokenList
if (CollectionPrototype && CollectionPrototype.forEach !== forEach) try {
createNonEnumerableProperty(CollectionPrototype, 'forEach', forEach);
} catch (error) {
CollectionPrototype.forEach = forEach;
}
}
/***/ }),
/***/ "./node_modules/canvg/node_modules/core-js/modules/web.dom-collections.iterator.js":
/*!*****************************************************************************************!*\
!*** ./node_modules/canvg/node_modules/core-js/modules/web.dom-collections.iterator.js ***!
\*****************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__(/*! ../internals/global */ "./node_modules/canvg/node_modules/core-js/internals/global.js");
var DOMIterables = __webpack_require__(/*! ../internals/dom-iterables */ "./node_modules/canvg/node_modules/core-js/internals/dom-iterables.js");
var ArrayIteratorMethods = __webpack_require__(/*! ../modules/es.array.iterator */ "./node_modules/canvg/node_modules/core-js/modules/es.array.iterator.js");
var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "./node_modules/canvg/node_modules/core-js/internals/create-non-enumerable-property.js");
var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/canvg/node_modules/core-js/internals/well-known-symbol.js");
var ITERATOR = wellKnownSymbol('iterator');
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
var ArrayValues = ArrayIteratorMethods.values;
for (var COLLECTION_NAME in DOMIterables) {
var Collection = global[COLLECTION_NAME];
var CollectionPrototype = Collection && Collection.prototype;
if (CollectionPrototype) {
// some Chrome versions have non-configurable methods on DOMTokenList
if (CollectionPrototype[ITERATOR] !== ArrayValues) try {
createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);
} catch (error) {
CollectionPrototype[ITERATOR] = ArrayValues;
}
if (!CollectionPrototype[TO_STRING_TAG]) {
createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);
}
if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
// some Chrome versions have non-configurable methods on DOMTokenList
if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
} catch (error) {
CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
}
}
}
}
/***/ }),
/***/ "./node_modules/performance-now/lib/performance-now.js":
/*!*************************************************************!*\
!*** ./node_modules/performance-now/lib/performance-now.js ***!
\*************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {// Generated by CoffeeScript 1.12.2
(function() {
var getNanoSeconds, hrtime, loadTime, moduleLoadTime, nodeLoadTime, upTime;
if ((typeof performance !== "undefined" && performance !== null) && performance.now) {
module.exports = function() {
return performance.now();
};
} else if ((typeof process !== "undefined" && process !== null) && process.hrtime) {
module.exports = function() {
return (getNanoSeconds() - nodeLoadTime) / 1e6;
};
hrtime = process.hrtime;
getNanoSeconds = function() {
var hr;
hr = hrtime();
return hr[0] * 1e9 + hr[1];
};
moduleLoadTime = getNanoSeconds();
upTime = process.uptime() * 1e9;
nodeLoadTime = moduleLoadTime - upTime;
} else if (Date.now) {
module.exports = function() {
return Date.now() - loadTime;
};
loadTime = Date.now();
} else {
module.exports = function() {
return new Date().getTime() - loadTime;
};
loadTime = new Date().getTime();
}
}).call(this);
//# sourceMappingURL=performance-now.js.map
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../process/browser.js */ "./node_modules/process/browser.js")))
/***/ }),
/***/ "./node_modules/raf/index.js":
/*!***********************************!*\
!*** ./node_modules/raf/index.js ***!
\***********************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {var now = __webpack_require__(/*! performance-now */ "./node_modules/performance-now/lib/performance-now.js")
, root = typeof window === 'undefined' ? global : window
, vendors = ['moz', 'webkit']
, suffix = 'AnimationFrame'
, raf = root['request' + suffix]
, caf = root['cancel' + suffix] || root['cancelRequest' + suffix]
for(var i = 0; !raf && i < vendors.length; i++) {
raf = root[vendors[i] + 'Request' + suffix]
caf = root[vendors[i] + 'Cancel' + suffix]
|| root[vendors[i] + 'CancelRequest' + suffix]
}
// Some versions of FF have rAF but not cAF
if(!raf || !caf) {
var last = 0
, id = 0
, queue = []
, frameDuration = 1000 / 60
raf = function(callback) {
if(queue.length === 0) {
var _now = now()
, next = Math.max(0, frameDuration - (_now - last))
last = next + _now
setTimeout(function() {
var cp = queue.slice(0)
// Clear queue here to prevent
// callbacks from appending listeners
// to the current frame's queue
queue.length = 0
for(var i = 0; i < cp.length; i++) {
if(!cp[i].cancelled) {
try{
cp[i].callback(last)
} catch(e) {
setTimeout(function() { throw e }, 0)
}
}
}
}, Math.round(next))
}
queue.push({
handle: ++id,
callback: callback,
cancelled: false
})
return id
}
caf = function(handle) {
for(var i = 0; i < queue.length; i++) {
if(queue[i].handle === handle) {
queue[i].cancelled = true
}
}
}
}
module.exports = function(fn) {
// Wrap in a new function to prevent
// `cancel` potentially being assigned
// to the native rAF function
return raf.call(root, fn)
}
module.exports.cancel = function() {
caf.apply(root, arguments)
}
module.exports.polyfill = function(object) {
if (!object) {
object = root;
}
object.requestAnimationFrame = raf
object.cancelAnimationFrame = caf
}
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "./node_modules/regenerator-runtime/runtime.js":
/*!*****************************************************!*\
!*** ./node_modules/regenerator-runtime/runtime.js ***!
\*****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2014-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var runtime = (function (exports) {
"use strict";
var Op = Object.prototype;
var hasOwn = Op.hasOwnProperty;
var undefined; // More compressible than void 0.
var $Symbol = typeof Symbol === "function" ? Symbol : {};
var iteratorSymbol = $Symbol.iterator || "@@iterator";
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
function define(obj, key, value) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
return obj[key];
}
try {
// IE 8 has a broken Object.defineProperty that only works on DOM objects.
define({}, "");
} catch (err) {
define = function(obj, key, value) {
return obj[key] = value;
};
}
function wrap(innerFn, outerFn, self, tryLocsList) {
// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
var generator = Object.create(protoGenerator.prototype);
var context = new Context(tryLocsList || []);
// The ._invoke method unifies the implementations of the .next,
// .throw, and .return methods.
generator._invoke = makeInvokeMethod(innerFn, self, context);
return generator;
}
exports.wrap = wrap;
// Try/catch helper to minimize deoptimizations. Returns a completion
// record like context.tryEntries[i].completion. This interface could
// have been (and was previously) designed to take a closure to be
// invoked without arguments, but in all the cases we care about we
// already have an existing method we want to call, so there's no need
// to create a new function object. We can even get away with assuming
// the method takes exactly one argument, since that happens to be true
// in every case, so we don't have to touch the arguments object. The
// only additional allocation required is the completion record, which
// has a stable shape and so hopefully should be cheap to allocate.
function tryCatch(fn, obj, arg) {
try {
return { type: "normal", arg: fn.call(obj, arg) };
} catch (err) {
return { type: "throw", arg: err };
}
}
var GenStateSuspendedStart = "suspendedStart";
var GenStateSuspendedYield = "suspendedYield";
var GenStateExecuting = "executing";
var GenStateCompleted = "completed";
// Returning this object from the innerFn has the same effect as
// breaking out of the dispatch switch statement.
var ContinueSentinel = {};
// Dummy constructor functions that we use as the .constructor and
// .constructor.prototype properties for functions that return Generator
// objects. For full spec compliance, you may wish to configure your
// minifier not to mangle the names of these two functions.
function Generator() {}
function GeneratorFunction() {}
function GeneratorFunctionPrototype() {}
// This is a polyfill for %IteratorPrototype% for environments that
// don't natively support it.
var IteratorPrototype = {};
IteratorPrototype[iteratorSymbol] = function () {
return this;
};
var getProto = Object.getPrototypeOf;
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
if (NativeIteratorPrototype &&
NativeIteratorPrototype !== Op &&
hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
// This environment has a native %IteratorPrototype%; use it instead
// of the polyfill.
IteratorPrototype = NativeIteratorPrototype;
}
var Gp = GeneratorFunctionPrototype.prototype =
Generator.prototype = Object.create(IteratorPrototype);
GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
GeneratorFunctionPrototype.constructor = GeneratorFunction;
GeneratorFunction.displayName = define(
GeneratorFunctionPrototype,
toStringTagSymbol,
"GeneratorFunction"
);
// Helper for defining the .next, .throw, and .return methods of the
// Iterator interface in terms of a single ._invoke method.
function defineIteratorMethods(prototype) {
["next", "throw", "return"].forEach(function(method) {
define(prototype, method, function(arg) {
return this._invoke(method, arg);
});
});
}
exports.isGeneratorFunction = function(genFun) {
var ctor = typeof genFun === "function" && genFun.constructor;
return ctor
? ctor === GeneratorFunction ||
// For the native GeneratorFunction constructor, the best we can
// do is to check its .name property.
(ctor.displayName || ctor.name) === "GeneratorFunction"
: false;
};
exports.mark = function(genFun) {
if (Object.setPrototypeOf) {
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
} else {
genFun.__proto__ = GeneratorFunctionPrototype;
define(genFun, toStringTagSymbol, "GeneratorFunction");
}
genFun.prototype = Object.create(Gp);
return genFun;
};
// Within the body of any async function, `await x` is transformed to
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
// `hasOwn.call(value, "__await")` to determine if the yielded value is
// meant to be awaited.
exports.awrap = function(arg) {
return { __await: arg };
};
function AsyncIterator(generator, PromiseImpl) {
function invoke(method, arg, resolve, reject) {
var record = tryCatch(generator[method], generator, arg);
if (record.type === "throw") {
reject(record.arg);
} else {
var result = record.arg;
var value = result.value;
if (value &&
typeof value === "object" &&
hasOwn.call(value, "__await")) {
return PromiseImpl.resolve(value.__await).then(function(value) {
invoke("next", value, resolve, reject);
}, function(err) {
invoke("throw", err, resolve, reject);
});
}
return PromiseImpl.resolve(value).then(function(unwrapped) {
// When a yielded Promise is resolved, its final value becomes
// the .value of the Promise<{value,done}> result for the
// current iteration.
result.value = unwrapped;
resolve(result);
}, function(error) {
// If a rejected Promise was yielded, throw the rejection back
// into the async generator function so it can be handled there.
return invoke("throw", error, resolve, reject);
});
}
}
var previousPromise;
function enqueue(method, arg) {
function callInvokeWithMethodAndArg() {
return new PromiseImpl(function(resolve, reject) {
invoke(method, arg, resolve, reject);
});
}
return previousPromise =
// If enqueue has been called before, then we want to wait until
// all previous Promises have been resolved before calling invoke,
// so that results are always delivered in the correct order. If
// enqueue has not been called before, then it is important to
// call invoke immediately, without waiting on a callback to fire,
// so that the async generator function has the opportunity to do
// any necessary setup in a predictable way. This predictability
// is why the Promise constructor synchronously invokes its
// executor callback, and why async functions synchronously
// execute code before the first await. Since we implement simple
// async functions in terms of async generators, it is especially
// important to get this right, even though it requires care.
previousPromise ? previousPromise.then(
callInvokeWithMethodAndArg,
// Avoid propagating failures to Promises returned by later
// invocations of the iterator.
callInvokeWithMethodAndArg
) : callInvokeWithMethodAndArg();
}
// Define the unified helper method that is used to implement .next,
// .throw, and .return (see defineIteratorMethods).
this._invoke = enqueue;
}
defineIteratorMethods(AsyncIterator.prototype);
AsyncIterator.prototype[asyncIteratorSymbol] = function () {
return this;
};
exports.AsyncIterator = AsyncIterator;
// Note that simple async functions are implemented on top of
// AsyncIterator objects; they just return a Promise for the value of
// the final result produced by the iterator.
exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
if (PromiseImpl === void 0) PromiseImpl = Promise;
var iter = new AsyncIterator(
wrap(innerFn, outerFn, self, tryLocsList),
PromiseImpl
);
return exports.isGeneratorFunction(outerFn)
? iter // If outerFn is a generator, return the full iterator.
: iter.next().then(function(result) {
return result.done ? result.value : iter.next();
});
};
function makeInvokeMethod(innerFn, self, context) {
var state = GenStateSuspendedStart;
return function invoke(method, arg) {
if (state === GenStateExecuting) {
throw new Error("Generator is already running");
}
if (state === GenStateCompleted) {
if (method === "throw") {
throw arg;
}
// Be forgiving, per 25.3.3.3.3 of the spec:
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
return doneResult();
}
context.method = method;
context.arg = arg;
while (true) {
var delegate = context.delegate;
if (delegate) {
var delegateResult = maybeInvokeDelegate(delegate, context);
if (delegateResult) {
if (delegateResult === ContinueSentinel) continue;
return delegateResult;
}
}
if (context.method === "next") {
// Setting context._sent for legacy support of Babel's
// function.sent implementation.
context.sent = context._sent = context.arg;
} else if (context.method === "throw") {
if (state === GenStateSuspendedStart) {
state = GenStateCompleted;
throw context.arg;
}
context.dispatchException(context.arg);
} else if (context.method === "return") {
context.abrupt("return", context.arg);
}
state = GenStateExecuting;
var record = tryCatch(innerFn, self, context);
if (record.type === "normal") {
// If an exception is thrown from innerFn, we leave state ===
// GenStateExecuting and loop back for another invocation.
state = context.done
? GenStateCompleted
: GenStateSuspendedYield;
if (record.arg === ContinueSentinel) {
continue;
}
return {
value: record.arg,
done: context.done
};
} else if (record.type === "throw") {
state = GenStateCompleted;
// Dispatch the exception by looping back around to the
// context.dispatchException(context.arg) call above.
context.method = "throw";
context.arg = record.arg;
}
}
};
}
// Call delegate.iterator[context.method](context.arg) and handle the
// result, either by returning a { value, done } result from the
// delegate iterator, or by modifying context.method and context.arg,
// setting context.delegate to null, and returning the ContinueSentinel.
function maybeInvokeDelegate(delegate, context) {
var method = delegate.iterator[context.method];
if (method === undefined) {
// A .throw or .return when the delegate iterator has no .throw
// method always terminates the yield* loop.
context.delegate = null;
if (context.method === "throw") {
// Note: ["return"] must be used for ES3 parsing compatibility.
if (delegate.iterator["return"]) {
// If the delegate iterator has a return method, give it a
// chance to clean up.
context.method = "return";
context.arg = undefined;
maybeInvokeDelegate(delegate, context);
if (context.method === "throw") {
// If maybeInvokeDelegate(context) changed context.method from
// "return" to "throw", let that override the TypeError below.
return ContinueSentinel;
}
}
context.method = "throw";
context.arg = new TypeError(
"The iterator does not provide a 'throw' method");
}
return ContinueSentinel;
}
var record = tryCatch(method, delegate.iterator, context.arg);
if (record.type === "throw") {
context.method = "throw";
context.arg = record.arg;
context.delegate = null;
return ContinueSentinel;
}
var info = record.arg;
if (! info) {
context.method = "throw";
context.arg = new TypeError("iterator result is not an object");
context.delegate = null;
return ContinueSentinel;
}
if (info.done) {
// Assign the result of the finished delegate to the temporary
// variable specified by delegate.resultName (see delegateYield).
context[delegate.resultName] = info.value;
// Resume execution at the desired location (see delegateYield).
context.next = delegate.nextLoc;
// If context.method was "throw" but the delegate handled the
// exception, let the outer generator proceed normally. If
// context.method was "next", forget context.arg since it has been
// "consumed" by the delegate iterator. If context.method was
// "return", allow the original .return call to continue in the
// outer generator.
if (context.method !== "return") {
context.method = "next";
context.arg = undefined;
}
} else {
// Re-yield the result returned by the delegate method.
return info;
}
// The delegate iterator is finished, so forget it and continue with
// the outer generator.
context.delegate = null;
return ContinueSentinel;
}
// Define Generator.prototype.{next,throw,return} in terms of the
// unified ._invoke helper method.
defineIteratorMethods(Gp);
define(Gp, toStringTagSymbol, "Generator");
// A Generator should always return itself as the iterator object when the
// @@iterator function is called on it. Some browsers' implementations of the
// iterator prototype chain incorrectly implement this, causing the Generator
// object to not be returned from this call. This ensures that doesn't happen.
// See https://github.com/facebook/regenerator/issues/274 for more details.
Gp[iteratorSymbol] = function() {
return this;
};
Gp.toString = function() {
return "[object Generator]";
};
function pushTryEntry(locs) {
var entry = { tryLoc: locs[0] };
if (1 in locs) {
entry.catchLoc = locs[1];
}
if (2 in locs) {
entry.finallyLoc = locs[2];
entry.afterLoc = locs[3];
}
this.tryEntries.push(entry);
}
function resetTryEntry(entry) {
var record = entry.completion || {};
record.type = "normal";
delete record.arg;
entry.completion = record;
}
function Context(tryLocsList) {
// The root entry object (effectively a try statement without a catch
// or a finally block) gives us a place to store values thrown from
// locations where there is no enclosing try statement.
this.tryEntries = [{ tryLoc: "root" }];
tryLocsList.forEach(pushTryEntry, this);
this.reset(true);
}
exports.keys = function(object) {
var keys = [];
for (var key in object) {
keys.push(key);
}
keys.reverse();
// Rather than returning an object with a next method, we keep
// things simple and return the next function itself.
return function next() {
while (keys.length) {
var key = keys.pop();
if (key in object) {
next.value = key;
next.done = false;
return next;
}
}
// To avoid creating an additional object, we just hang the .value
// and .done properties off the next function object itself. This
// also ensures that the minifier will not anonymize the function.
next.done = true;
return next;
};
};
function values(iterable) {
if (iterable) {
var iteratorMethod = iterable[iteratorSymbol];
if (iteratorMethod) {
return iteratorMethod.call(iterable);
}
if (typeof iterable.next === "function") {
return iterable;
}
if (!isNaN(iterable.length)) {
var i = -1, next = function next() {
while (++i < iterable.length) {
if (hasOwn.call(iterable, i)) {
next.value = iterable[i];
next.done = false;
return next;
}
}
next.value = undefined;
next.done = true;
return next;
};
return next.next = next;
}
}
// Return an iterator with no values.
return { next: doneResult };
}
exports.values = values;
function doneResult() {
return { value: undefined, done: true };
}
Context.prototype = {
constructor: Context,
reset: function(skipTempReset) {
this.prev = 0;
this.next = 0;
// Resetting context._sent for legacy support of Babel's
// function.sent implementation.
this.sent = this._sent = undefined;
this.done = false;
this.delegate = null;
this.method = "next";
this.arg = undefined;
this.tryEntries.forEach(resetTryEntry);
if (!skipTempReset) {
for (var name in this) {
// Not sure about the optimal order of these conditions:
if (name.charAt(0) === "t" &&
hasOwn.call(this, name) &&
!isNaN(+name.slice(1))) {
this[name] = undefined;
}
}
}
},
stop: function() {
this.done = true;
var rootEntry = this.tryEntries[0];
var rootRecord = rootEntry.completion;
if (rootRecord.type === "throw") {
throw rootRecord.arg;
}
return this.rval;
},
dispatchException: function(exception) {
if (this.done) {
throw exception;
}
var context = this;
function handle(loc, caught) {
record.type = "throw";
record.arg = exception;
context.next = loc;
if (caught) {
// If the dispatched exception was caught by a catch block,
// then let that catch block handle the exception normally.
context.method = "next";
context.arg = undefined;
}
return !! caught;
}
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
var record = entry.completion;
if (entry.tryLoc === "root") {
// Exception thrown outside of any try block that could handle
// it, so set the completion value of the entire function to
// throw the exception.
return handle("end");
}
if (entry.tryLoc <= this.prev) {
var hasCatch = hasOwn.call(entry, "catchLoc");
var hasFinally = hasOwn.call(entry, "finallyLoc");
if (hasCatch && hasFinally) {
if (this.prev < entry.catchLoc) {
return handle(entry.catchLoc, true);
} else if (this.prev < entry.finallyLoc) {
return handle(entry.finallyLoc);
}
} else if (hasCatch) {
if (this.prev < entry.catchLoc) {
return handle(entry.catchLoc, true);
}
} else if (hasFinally) {
if (this.prev < entry.finallyLoc) {
return handle(entry.finallyLoc);
}
} else {
throw new Error("try statement without catch or finally");
}
}
}
},
abrupt: function(type, arg) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.tryLoc <= this.prev &&
hasOwn.call(entry, "finallyLoc") &&
this.prev < entry.finallyLoc) {
var finallyEntry = entry;
break;
}
}
if (finallyEntry &&
(type === "break" ||
type === "continue") &&
finallyEntry.tryLoc <= arg &&
arg <= finallyEntry.finallyLoc) {
// Ignore the finally entry if control is not jumping to a
// location outside the try/catch block.
finallyEntry = null;
}
var record = finallyEntry ? finallyEntry.completion : {};
record.type = type;
record.arg = arg;
if (finallyEntry) {
this.method = "next";
this.next = finallyEntry.finallyLoc;
return ContinueSentinel;
}
return this.complete(record);
},
complete: function(record, afterLoc) {
if (record.type === "throw") {
throw record.arg;
}
if (record.type === "break" ||
record.type === "continue") {
this.next = record.arg;
} else if (record.type === "return") {
this.rval = this.arg = record.arg;
this.method = "return";
this.next = "end";
} else if (record.type === "normal" && afterLoc) {
this.next = afterLoc;
}
return ContinueSentinel;
},
finish: function(finallyLoc) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.finallyLoc === finallyLoc) {
this.complete(entry.completion, entry.afterLoc);
resetTryEntry(entry);
return ContinueSentinel;
}
}
},
"catch": function(tryLoc) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.tryLoc === tryLoc) {
var record = entry.completion;
if (record.type === "throw") {
var thrown = record.arg;
resetTryEntry(entry);
}
return thrown;
}
}
// The context.catch method must only be called with a location
// argument that corresponds to a known catch block.
throw new Error("illegal catch attempt");
},
delegateYield: function(iterable, resultName, nextLoc) {
this.delegate = {
iterator: values(iterable),
resultName: resultName,
nextLoc: nextLoc
};
if (this.method === "next") {
// Deliberately forget the last sent value so that we don't
// accidentally pass it on to the delegate.
this.arg = undefined;
}
return ContinueSentinel;
}
};
// Regardless of whether this script is executing as a CommonJS module
// or not, return the runtime object so that we can declare the variable
// regeneratorRuntime in the outer scope, which allows this module to be
// injected easily by `bin/regenerator --include-runtime script.js`.
return exports;
}(
// If this script is executing as a CommonJS module, use module.exports
// as the regeneratorRuntime namespace. Otherwise create a new empty
// object. Either way, the resulting object will be used to initialize
// the regeneratorRuntime variable at the top of this file.
true ? module.exports : undefined
));
try {
regeneratorRuntime = runtime;
} catch (accidentalStrictMode) {
// This module should not be running in strict mode, so the above
// assignment should always work unless something is misconfigured. Just
// in case runtime.js accidentally runs in strict mode, we can escape
// strict mode using a global Function call. This could conceivably fail
// if a Content Security Policy forbids using Function, but in that case
// the proper solution is to fix the accidental strict mode problem. If
// you've misconfigured your bundler to force strict mode and applied a
// CSP to forbid Function, and you're not willing to fix either of those
// problems, please detail your unique predicament in a GitHub issue.
Function("r", "regeneratorRuntime = r")(runtime);
}
/***/ }),
/***/ "./node_modules/rgbcolor/index.js":
/*!****************************************!*\
!*** ./node_modules/rgbcolor/index.js ***!
\****************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/*
Based on rgbcolor.js by Stoyan Stefanov <sstoo@gmail.com>
http://www.phpied.com/rgb-color-parser-in-javascript/
*/
module.exports = function(color_string) {
this.ok = false;
this.alpha = 1.0;
// strip any leading #
if (color_string.charAt(0) == '#') { // remove # if any
color_string = color_string.substr(1,6);
}
color_string = color_string.replace(/ /g,'');
color_string = color_string.toLowerCase();
// before getting into regexps, try simple matches
// and overwrite the input
var simple_colors = {
aliceblue: 'f0f8ff',
antiquewhite: 'faebd7',
aqua: '00ffff',
aquamarine: '7fffd4',
azure: 'f0ffff',
beige: 'f5f5dc',
bisque: 'ffe4c4',
black: '000000',
blanchedalmond: 'ffebcd',
blue: '0000ff',
blueviolet: '8a2be2',
brown: 'a52a2a',
burlywood: 'deb887',
cadetblue: '5f9ea0',
chartreuse: '7fff00',
chocolate: 'd2691e',
coral: 'ff7f50',
cornflowerblue: '6495ed',
cornsilk: 'fff8dc',
crimson: 'dc143c',
cyan: '00ffff',
darkblue: '00008b',
darkcyan: '008b8b',
darkgoldenrod: 'b8860b',
darkgray: 'a9a9a9',
darkgreen: '006400',
darkkhaki: 'bdb76b',
darkmagenta: '8b008b',
darkolivegreen: '556b2f',
darkorange: 'ff8c00',
darkorchid: '9932cc',
darkred: '8b0000',
darksalmon: 'e9967a',
darkseagreen: '8fbc8f',
darkslateblue: '483d8b',
darkslategray: '2f4f4f',
darkturquoise: '00ced1',
darkviolet: '9400d3',
deeppink: 'ff1493',
deepskyblue: '00bfff',
dimgray: '696969',
dodgerblue: '1e90ff',
feldspar: 'd19275',
firebrick: 'b22222',
floralwhite: 'fffaf0',
forestgreen: '228b22',
fuchsia: 'ff00ff',
gainsboro: 'dcdcdc',
ghostwhite: 'f8f8ff',
gold: 'ffd700',
goldenrod: 'daa520',
gray: '808080',
green: '008000',
greenyellow: 'adff2f',
honeydew: 'f0fff0',
hotpink: 'ff69b4',
indianred : 'cd5c5c',
indigo : '4b0082',
ivory: 'fffff0',
khaki: 'f0e68c',
lavender: 'e6e6fa',
lavenderblush: 'fff0f5',
lawngreen: '7cfc00',
lemonchiffon: 'fffacd',
lightblue: 'add8e6',
lightcoral: 'f08080',
lightcyan: 'e0ffff',
lightgoldenrodyellow: 'fafad2',
lightgrey: 'd3d3d3',
lightgreen: '90ee90',
lightpink: 'ffb6c1',
lightsalmon: 'ffa07a',
lightseagreen: '20b2aa',
lightskyblue: '87cefa',
lightslateblue: '8470ff',
lightslategray: '778899',
lightsteelblue: 'b0c4de',
lightyellow: 'ffffe0',
lime: '00ff00',
limegreen: '32cd32',
linen: 'faf0e6',
magenta: 'ff00ff',
maroon: '800000',
mediumaquamarine: '66cdaa',
mediumblue: '0000cd',
mediumorchid: 'ba55d3',
mediumpurple: '9370d8',
mediumseagreen: '3cb371',
mediumslateblue: '7b68ee',
mediumspringgreen: '00fa9a',
mediumturquoise: '48d1cc',
mediumvioletred: 'c71585',
midnightblue: '191970',
mintcream: 'f5fffa',
mistyrose: 'ffe4e1',
moccasin: 'ffe4b5',
navajowhite: 'ffdead',
navy: '000080',
oldlace: 'fdf5e6',
olive: '808000',
olivedrab: '6b8e23',
orange: 'ffa500',
orangered: 'ff4500',
orchid: 'da70d6',
palegoldenrod: 'eee8aa',
palegreen: '98fb98',
paleturquoise: 'afeeee',
palevioletred: 'd87093',
papayawhip: 'ffefd5',
peachpuff: 'ffdab9',
peru: 'cd853f',
pink: 'ffc0cb',
plum: 'dda0dd',
powderblue: 'b0e0e6',
purple: '800080',
rebeccapurple: '663399',
red: 'ff0000',
rosybrown: 'bc8f8f',
royalblue: '4169e1',
saddlebrown: '8b4513',
salmon: 'fa8072',
sandybrown: 'f4a460',
seagreen: '2e8b57',
seashell: 'fff5ee',
sienna: 'a0522d',
silver: 'c0c0c0',
skyblue: '87ceeb',
slateblue: '6a5acd',
slategray: '708090',
snow: 'fffafa',
springgreen: '00ff7f',
steelblue: '4682b4',
tan: 'd2b48c',
teal: '008080',
thistle: 'd8bfd8',
tomato: 'ff6347',
turquoise: '40e0d0',
violet: 'ee82ee',
violetred: 'd02090',
wheat: 'f5deb3',
white: 'ffffff',
whitesmoke: 'f5f5f5',
yellow: 'ffff00',
yellowgreen: '9acd32'
};
color_string = simple_colors[color_string] || color_string;
// emd of simple type-in colors
// array of color definition objects
var color_defs = [
{
re: /^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*((?:\d?\.)?\d)\)$/,
example: ['rgba(123, 234, 45, 0.8)', 'rgba(255,234,245,1.0)'],
process: function (bits){
return [
parseInt(bits[1]),
parseInt(bits[2]),
parseInt(bits[3]),
parseFloat(bits[4])
];
}
},
{
re: /^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,
example: ['rgb(123, 234, 45)', 'rgb(255,234,245)'],
process: function (bits){
return [
parseInt(bits[1]),
parseInt(bits[2]),
parseInt(bits[3])
];
}
},
{
re: /^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
example: ['#00ff00', '336699'],
process: function (bits){
return [
parseInt(bits[1], 16),
parseInt(bits[2], 16),
parseInt(bits[3], 16)
];
}
},
{
re: /^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
example: ['#fb0', 'f0f'],
process: function (bits){
return [
parseInt(bits[1] + bits[1], 16),
parseInt(bits[2] + bits[2], 16),
parseInt(bits[3] + bits[3], 16)
];
}
}
];
// search through the definitions to find a match
for (var i = 0; i < color_defs.length; i++) {
var re = color_defs[i].re;
var processor = color_defs[i].process;
var bits = re.exec(color_string);
if (bits) {
var channels = processor(bits);
this.r = channels[0];
this.g = channels[1];
this.b = channels[2];
if (channels.length > 3) {
this.alpha = channels[3];
}
this.ok = true;
}
}
// validate/cleanup values
this.r = (this.r < 0 || isNaN(this.r)) ? 0 : ((this.r > 255) ? 255 : this.r);
this.g = (this.g < 0 || isNaN(this.g)) ? 0 : ((this.g > 255) ? 255 : this.g);
this.b = (this.b < 0 || isNaN(this.b)) ? 0 : ((this.b > 255) ? 255 : this.b);
this.alpha = (this.alpha < 0) ? 0 : ((this.alpha > 1.0 || isNaN(this.alpha)) ? 1.0 : this.alpha);
// some getters
this.toRGB = function () {
return 'rgb(' + this.r + ', ' + this.g + ', ' + this.b + ')';
}
this.toRGBA = function () {
return 'rgba(' + this.r + ', ' + this.g + ', ' + this.b + ', ' + this.alpha + ')';
}
this.toHex = function () {
var r = this.r.toString(16);
var g = this.g.toString(16);
var b = this.b.toString(16);
if (r.length == 1) r = '0' + r;
if (g.length == 1) g = '0' + g;
if (b.length == 1) b = '0' + b;
return '#' + r + g + b;
}
// help
this.getHelpXML = function () {
var examples = new Array();
// add regexps
for (var i = 0; i < color_defs.length; i++) {
var example = color_defs[i].example;
for (var j = 0; j < example.length; j++) {
examples[examples.length] = example[j];
}
}
// add type-in colors
for (var sc in simple_colors) {
examples[examples.length] = sc;
}
var xml = document.createElement('ul');
xml.setAttribute('id', 'rgbcolor-examples');
for (var i = 0; i < examples.length; i++) {
try {
var list_item = document.createElement('li');
var list_color = new RGBColor(examples[i]);
var example_div = document.createElement('div');
example_div.style.cssText =
'margin: 3px; '
+ 'border: 1px solid black; '
+ 'background:' + list_color.toHex() + '; '
+ 'color:' + list_color.toHex()
;
example_div.appendChild(document.createTextNode('test'));
var list_item_value = document.createTextNode(
' ' + examples[i] + ' -> ' + list_color.toRGB() + ' -> ' + list_color.toHex()
);
list_item.appendChild(example_div);
list_item.appendChild(list_item_value);
xml.appendChild(list_item);
} catch(e){}
}
return xml;
}
}
/***/ }),
/***/ "./node_modules/stackblur-canvas/dist/stackblur-es.js":
/*!************************************************************!*\
!*** ./node_modules/stackblur-canvas/dist/stackblur-es.js ***!
\************************************************************/
/*! exports provided: BlurStack, canvasRGB, canvasRGBA, image, imageDataRGB, imageDataRGBA */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BlurStack", function() { return BlurStack; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "canvasRGB", function() { return processCanvasRGB; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "canvasRGBA", function() { return processCanvasRGBA; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "image", function() { return processImage; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "imageDataRGB", function() { return processImageDataRGB; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "imageDataRGBA", function() { return processImageDataRGBA; });
function _typeof(obj) {
"@babel/helpers - typeof";
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof = function (obj) {
return typeof obj;
};
} else {
_typeof = function (obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
}
return _typeof(obj);
}
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
/* eslint-disable no-bitwise -- used for calculations */
/* eslint-disable unicorn/prefer-query-selector -- aiming at
backward-compatibility */
/**
* StackBlur - a fast almost Gaussian Blur For Canvas
*
* In case you find this class useful - especially in commercial projects -
* I am not totally unhappy for a small donation to my PayPal account
* mario@quasimondo.de
*
* Or support me on flattr:
* {@link https://flattr.com/thing/72791/StackBlur-a-fast-almost-Gaussian-Blur-Effect-for-CanvasJavascript}.
*
* @module StackBlur
* @author Mario Klingemann
* Contact: mario@quasimondo.com
* Website: {@link http://www.quasimondo.com/StackBlurForCanvas/StackBlurDemo.html}
* Twitter: @quasimondo
*
* @copyright (c) 2010 Mario Klingemann
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
var mulTable = [512, 512, 456, 512, 328, 456, 335, 512, 405, 328, 271, 456, 388, 335, 292, 512, 454, 405, 364, 328, 298, 271, 496, 456, 420, 388, 360, 335, 312, 292, 273, 512, 482, 454, 428, 405, 383, 364, 345, 328, 312, 298, 284, 271, 259, 496, 475, 456, 437, 420, 404, 388, 374, 360, 347, 335, 323, 312, 302, 292, 282, 273, 265, 512, 497, 482, 468, 454, 441, 428, 417, 405, 394, 383, 373, 364, 354, 345, 337, 328, 320, 312, 305, 298, 291, 284, 278, 271, 265, 259, 507, 496, 485, 475, 465, 456, 446, 437, 428, 420, 412, 404, 396, 388, 381, 374, 367, 360, 354, 347, 341, 335, 329, 323, 318, 312, 307, 302, 297, 292, 287, 282, 278, 273, 269, 265, 261, 512, 505, 497, 489, 482, 475, 468, 461, 454, 447, 441, 435, 428, 422, 417, 411, 405, 399, 394, 389, 383, 378, 373, 368, 364, 359, 354, 350, 345, 341, 337, 332, 328, 324, 320, 316, 312, 309, 305, 301, 298, 294, 291, 287, 284, 281, 278, 274, 271, 268, 265, 262, 259, 257, 507, 501, 496, 491, 485, 480, 475, 470, 465, 460, 456, 451, 446, 442, 437, 433, 428, 424, 420, 416, 412, 408, 404, 400, 396, 392, 388, 385, 381, 377, 374, 370, 367, 363, 360, 357, 354, 350, 347, 344, 341, 338, 335, 332, 329, 326, 323, 320, 318, 315, 312, 310, 307, 304, 302, 299, 297, 294, 292, 289, 287, 285, 282, 280, 278, 275, 273, 271, 269, 267, 265, 263, 261, 259];
var shgTable = [9, 11, 12, 13, 13, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24];
/**
* @param {string|HTMLImageElement} img
* @param {string|HTMLCanvasElement} canvas
* @param {Float} radius
* @param {boolean} blurAlphaChannel
* @param {boolean} useOffsetWidth
* @returns {undefined}
*/
function processImage(img, canvas, radius, blurAlphaChannel, useOffsetWidth) {
if (typeof img === 'string') {
img = document.getElementById(img);
}
if (!img || !('naturalWidth' in img)) {
return;
}
var dimensionType = useOffsetWidth ? 'offset' : 'natural';
var w = img[dimensionType + 'Width'];
var h = img[dimensionType + 'Height'];
if (typeof canvas === 'string') {
canvas = document.getElementById(canvas);
}
if (!canvas || !('getContext' in canvas)) {
return;
}
canvas.style.width = w + 'px';
canvas.style.height = h + 'px';
canvas.width = w;
canvas.height = h;
var context = canvas.getContext('2d');
context.clearRect(0, 0, w, h);
context.drawImage(img, 0, 0, img.naturalWidth, img.naturalHeight, 0, 0, w, h);
if (isNaN(radius) || radius < 1) {
return;
}
if (blurAlphaChannel) {
processCanvasRGBA(canvas, 0, 0, w, h, radius);
} else {
processCanvasRGB(canvas, 0, 0, w, h, radius);
}
}
/**
* @param {string|HTMLCanvasElement} canvas
* @param {Integer} topX
* @param {Integer} topY
* @param {Integer} width
* @param {Integer} height
* @throws {Error|TypeError}
* @returns {ImageData} See {@link https://html.spec.whatwg.org/multipage/canvas.html#imagedata}
*/
function getImageDataFromCanvas(canvas, topX, topY, width, height) {
if (typeof canvas === 'string') {
canvas = document.getElementById(canvas);
}
if (!canvas || _typeof(canvas) !== 'object' || !('getContext' in canvas)) {
throw new TypeError('Expecting canvas with `getContext` method ' + 'in processCanvasRGB(A) calls!');
}
var context = canvas.getContext('2d');
try {
return context.getImageData(topX, topY, width, height);
} catch (e) {
throw new Error('unable to access image data: ' + e);
}
}
/**
* @param {HTMLCanvasElement} canvas
* @param {Integer} topX
* @param {Integer} topY
* @param {Integer} width
* @param {Integer} height
* @param {Float} radius
* @returns {undefined}
*/
function processCanvasRGBA(canvas, topX, topY, width, height, radius) {
if (isNaN(radius) || radius < 1) {
return;
}
radius |= 0;
var imageData = getImageDataFromCanvas(canvas, topX, topY, width, height);
imageData = processImageDataRGBA(imageData, topX, topY, width, height, radius);
canvas.getContext('2d').putImageData(imageData, topX, topY);
}
/**
* @param {ImageData} imageData
* @param {Integer} topX
* @param {Integer} topY
* @param {Integer} width
* @param {Integer} height
* @param {Float} radius
* @returns {ImageData}
*/
function processImageDataRGBA(imageData, topX, topY, width, height, radius) {
var pixels = imageData.data;
var div = 2 * radius + 1; // const w4 = width << 2;
var widthMinus1 = width - 1;
var heightMinus1 = height - 1;
var radiusPlus1 = radius + 1;
var sumFactor = radiusPlus1 * (radiusPlus1 + 1) / 2;
var stackStart = new BlurStack();
var stack = stackStart;
var stackEnd;
for (var i = 1; i < div; i++) {
stack = stack.next = new BlurStack();
if (i === radiusPlus1) {
stackEnd = stack;
}
}
stack.next = stackStart;
var stackIn = null,
stackOut = null,
yw = 0,
yi = 0;
var mulSum = mulTable[radius];
var shgSum = shgTable[radius];
for (var y = 0; y < height; y++) {
stack = stackStart;
var pr = pixels[yi],
pg = pixels[yi + 1],
pb = pixels[yi + 2],
pa = pixels[yi + 3];
for (var _i = 0; _i < radiusPlus1; _i++) {
stack.r = pr;
stack.g = pg;
stack.b = pb;
stack.a = pa;
stack = stack.next;
}
var rInSum = 0,
gInSum = 0,
bInSum = 0,
aInSum = 0,
rOutSum = radiusPlus1 * pr,
gOutSum = radiusPlus1 * pg,
bOutSum = radiusPlus1 * pb,
aOutSum = radiusPlus1 * pa,
rSum = sumFactor * pr,
gSum = sumFactor * pg,
bSum = sumFactor * pb,
aSum = sumFactor * pa;
for (var _i2 = 1; _i2 < radiusPlus1; _i2++) {
var p = yi + ((widthMinus1 < _i2 ? widthMinus1 : _i2) << 2);
var r = pixels[p],
g = pixels[p + 1],
b = pixels[p + 2],
a = pixels[p + 3];
var rbs = radiusPlus1 - _i2;
rSum += (stack.r = r) * rbs;
gSum += (stack.g = g) * rbs;
bSum += (stack.b = b) * rbs;
aSum += (stack.a = a) * rbs;
rInSum += r;
gInSum += g;
bInSum += b;
aInSum += a;
stack = stack.next;
}
stackIn = stackStart;
stackOut = stackEnd;
for (var x = 0; x < width; x++) {
var paInitial = aSum * mulSum >> shgSum;
pixels[yi + 3] = paInitial;
if (paInitial !== 0) {
var _a2 = 255 / paInitial;
pixels[yi] = (rSum * mulSum >> shgSum) * _a2;
pixels[yi + 1] = (gSum * mulSum >> shgSum) * _a2;
pixels[yi + 2] = (bSum * mulSum >> shgSum) * _a2;
} else {
pixels[yi] = pixels[yi + 1] = pixels[yi + 2] = 0;
}
rSum -= rOutSum;
gSum -= gOutSum;
bSum -= bOutSum;
aSum -= aOutSum;
rOutSum -= stackIn.r;
gOutSum -= stackIn.g;
bOutSum -= stackIn.b;
aOutSum -= stackIn.a;
var _p = x + radius + 1;
_p = yw + (_p < widthMinus1 ? _p : widthMinus1) << 2;
rInSum += stackIn.r = pixels[_p];
gInSum += stackIn.g = pixels[_p + 1];
bInSum += stackIn.b = pixels[_p + 2];
aInSum += stackIn.a = pixels[_p + 3];
rSum += rInSum;
gSum += gInSum;
bSum += bInSum;
aSum += aInSum;
stackIn = stackIn.next;
var _stackOut = stackOut,
_r = _stackOut.r,
_g = _stackOut.g,
_b = _stackOut.b,
_a = _stackOut.a;
rOutSum += _r;
gOutSum += _g;
bOutSum += _b;
aOutSum += _a;
rInSum -= _r;
gInSum -= _g;
bInSum -= _b;
aInSum -= _a;
stackOut = stackOut.next;
yi += 4;
}
yw += width;
}
for (var _x = 0; _x < width; _x++) {
yi = _x << 2;
var _pr = pixels[yi],
_pg = pixels[yi + 1],
_pb = pixels[yi + 2],
_pa = pixels[yi + 3],
_rOutSum = radiusPlus1 * _pr,
_gOutSum = radiusPlus1 * _pg,
_bOutSum = radiusPlus1 * _pb,
_aOutSum = radiusPlus1 * _pa,
_rSum = sumFactor * _pr,
_gSum = sumFactor * _pg,
_bSum = sumFactor * _pb,
_aSum = sumFactor * _pa;
stack = stackStart;
for (var _i3 = 0; _i3 < radiusPlus1; _i3++) {
stack.r = _pr;
stack.g = _pg;
stack.b = _pb;
stack.a = _pa;
stack = stack.next;
}
var yp = width;
var _gInSum = 0,
_bInSum = 0,
_aInSum = 0,
_rInSum = 0;
for (var _i4 = 1; _i4 <= radius; _i4++) {
yi = yp + _x << 2;
var _rbs = radiusPlus1 - _i4;
_rSum += (stack.r = _pr = pixels[yi]) * _rbs;
_gSum += (stack.g = _pg = pixels[yi + 1]) * _rbs;
_bSum += (stack.b = _pb = pixels[yi + 2]) * _rbs;
_aSum += (stack.a = _pa = pixels[yi + 3]) * _rbs;
_rInSum += _pr;
_gInSum += _pg;
_bInSum += _pb;
_aInSum += _pa;
stack = stack.next;
if (_i4 < heightMinus1) {
yp += width;
}
}
yi = _x;
stackIn = stackStart;
stackOut = stackEnd;
for (var _y = 0; _y < height; _y++) {
var _p2 = yi << 2;
pixels[_p2 + 3] = _pa = _aSum * mulSum >> shgSum;
if (_pa > 0) {
_pa = 255 / _pa;
pixels[_p2] = (_rSum * mulSum >> shgSum) * _pa;
pixels[_p2 + 1] = (_gSum * mulSum >> shgSum) * _pa;
pixels[_p2 + 2] = (_bSum * mulSum >> shgSum) * _pa;
} else {
pixels[_p2] = pixels[_p2 + 1] = pixels[_p2 + 2] = 0;
}
_rSum -= _rOutSum;
_gSum -= _gOutSum;
_bSum -= _bOutSum;
_aSum -= _aOutSum;
_rOutSum -= stackIn.r;
_gOutSum -= stackIn.g;
_bOutSum -= stackIn.b;
_aOutSum -= stackIn.a;
_p2 = _x + ((_p2 = _y + radiusPlus1) < heightMinus1 ? _p2 : heightMinus1) * width << 2;
_rSum += _rInSum += stackIn.r = pixels[_p2];
_gSum += _gInSum += stackIn.g = pixels[_p2 + 1];
_bSum += _bInSum += stackIn.b = pixels[_p2 + 2];
_aSum += _aInSum += stackIn.a = pixels[_p2 + 3];
stackIn = stackIn.next;
_rOutSum += _pr = stackOut.r;
_gOutSum += _pg = stackOut.g;
_bOutSum += _pb = stackOut.b;
_aOutSum += _pa = stackOut.a;
_rInSum -= _pr;
_gInSum -= _pg;
_bInSum -= _pb;
_aInSum -= _pa;
stackOut = stackOut.next;
yi += width;
}
}
return imageData;
}
/**
* @param {HTMLCanvasElement} canvas
* @param {Integer} topX
* @param {Integer} topY
* @param {Integer} width
* @param {Integer} height
* @param {Float} radius
* @returns {undefined}
*/
function processCanvasRGB(canvas, topX, topY, width, height, radius) {
if (isNaN(radius) || radius < 1) {
return;
}
radius |= 0;
var imageData = getImageDataFromCanvas(canvas, topX, topY, width, height);
imageData = processImageDataRGB(imageData, topX, topY, width, height, radius);
canvas.getContext('2d').putImageData(imageData, topX, topY);
}
/**
* @param {ImageData} imageData
* @param {Integer} topX
* @param {Integer} topY
* @param {Integer} width
* @param {Integer} height
* @param {Float} radius
* @returns {ImageData}
*/
function processImageDataRGB(imageData, topX, topY, width, height, radius) {
var pixels = imageData.data;
var div = 2 * radius + 1; // const w4 = width << 2;
var widthMinus1 = width - 1;
var heightMinus1 = height - 1;
var radiusPlus1 = radius + 1;
var sumFactor = radiusPlus1 * (radiusPlus1 + 1) / 2;
var stackStart = new BlurStack();
var stack = stackStart;
var stackEnd;
for (var i = 1; i < div; i++) {
stack = stack.next = new BlurStack();
if (i === radiusPlus1) {
stackEnd = stack;
}
}
stack.next = stackStart;
var stackIn = null;
var stackOut = null;
var mulSum = mulTable[radius];
var shgSum = shgTable[radius];
var p, rbs;
var yw = 0,
yi = 0;
for (var y = 0; y < height; y++) {
var pr = pixels[yi],
pg = pixels[yi + 1],
pb = pixels[yi + 2],
rOutSum = radiusPlus1 * pr,
gOutSum = radiusPlus1 * pg,
bOutSum = radiusPlus1 * pb,
rSum = sumFactor * pr,
gSum = sumFactor * pg,
bSum = sumFactor * pb;
stack = stackStart;
for (var _i5 = 0; _i5 < radiusPlus1; _i5++) {
stack.r = pr;
stack.g = pg;
stack.b = pb;
stack = stack.next;
}
var rInSum = 0,
gInSum = 0,
bInSum = 0;
for (var _i6 = 1; _i6 < radiusPlus1; _i6++) {
p = yi + ((widthMinus1 < _i6 ? widthMinus1 : _i6) << 2);
rSum += (stack.r = pr = pixels[p]) * (rbs = radiusPlus1 - _i6);
gSum += (stack.g = pg = pixels[p + 1]) * rbs;
bSum += (stack.b = pb = pixels[p + 2]) * rbs;
rInSum += pr;
gInSum += pg;
bInSum += pb;
stack = stack.next;
}
stackIn = stackStart;
stackOut = stackEnd;
for (var x = 0; x < width; x++) {
pixels[yi] = rSum * mulSum >> shgSum;
pixels[yi + 1] = gSum * mulSum >> shgSum;
pixels[yi + 2] = bSum * mulSum >> shgSum;
rSum -= rOutSum;
gSum -= gOutSum;
bSum -= bOutSum;
rOutSum -= stackIn.r;
gOutSum -= stackIn.g;
bOutSum -= stackIn.b;
p = yw + ((p = x + radius + 1) < widthMinus1 ? p : widthMinus1) << 2;
rInSum += stackIn.r = pixels[p];
gInSum += stackIn.g = pixels[p + 1];
bInSum += stackIn.b = pixels[p + 2];
rSum += rInSum;
gSum += gInSum;
bSum += bInSum;
stackIn = stackIn.next;
rOutSum += pr = stackOut.r;
gOutSum += pg = stackOut.g;
bOutSum += pb = stackOut.b;
rInSum -= pr;
gInSum -= pg;
bInSum -= pb;
stackOut = stackOut.next;
yi += 4;
}
yw += width;
}
for (var _x2 = 0; _x2 < width; _x2++) {
yi = _x2 << 2;
var _pr2 = pixels[yi],
_pg2 = pixels[yi + 1],
_pb2 = pixels[yi + 2],
_rOutSum2 = radiusPlus1 * _pr2,
_gOutSum2 = radiusPlus1 * _pg2,
_bOutSum2 = radiusPlus1 * _pb2,
_rSum2 = sumFactor * _pr2,
_gSum2 = sumFactor * _pg2,
_bSum2 = sumFactor * _pb2;
stack = stackStart;
for (var _i7 = 0; _i7 < radiusPlus1; _i7++) {
stack.r = _pr2;
stack.g = _pg2;
stack.b = _pb2;
stack = stack.next;
}
var _rInSum2 = 0,
_gInSum2 = 0,
_bInSum2 = 0;
for (var _i8 = 1, yp = width; _i8 <= radius; _i8++) {
yi = yp + _x2 << 2;
_rSum2 += (stack.r = _pr2 = pixels[yi]) * (rbs = radiusPlus1 - _i8);
_gSum2 += (stack.g = _pg2 = pixels[yi + 1]) * rbs;
_bSum2 += (stack.b = _pb2 = pixels[yi + 2]) * rbs;
_rInSum2 += _pr2;
_gInSum2 += _pg2;
_bInSum2 += _pb2;
stack = stack.next;
if (_i8 < heightMinus1) {
yp += width;
}
}
yi = _x2;
stackIn = stackStart;
stackOut = stackEnd;
for (var _y2 = 0; _y2 < height; _y2++) {
p = yi << 2;
pixels[p] = _rSum2 * mulSum >> shgSum;
pixels[p + 1] = _gSum2 * mulSum >> shgSum;
pixels[p + 2] = _bSum2 * mulSum >> shgSum;
_rSum2 -= _rOutSum2;
_gSum2 -= _gOutSum2;
_bSum2 -= _bOutSum2;
_rOutSum2 -= stackIn.r;
_gOutSum2 -= stackIn.g;
_bOutSum2 -= stackIn.b;
p = _x2 + ((p = _y2 + radiusPlus1) < heightMinus1 ? p : heightMinus1) * width << 2;
_rSum2 += _rInSum2 += stackIn.r = pixels[p];
_gSum2 += _gInSum2 += stackIn.g = pixels[p + 1];
_bSum2 += _bInSum2 += stackIn.b = pixels[p + 2];
stackIn = stackIn.next;
_rOutSum2 += _pr2 = stackOut.r;
_gOutSum2 += _pg2 = stackOut.g;
_bOutSum2 += _pb2 = stackOut.b;
_rInSum2 -= _pr2;
_gInSum2 -= _pg2;
_bInSum2 -= _pb2;
stackOut = stackOut.next;
yi += width;
}
}
return imageData;
}
/**
*
*/
var BlurStack =
/**
* Set properties.
*/
function BlurStack() {
_classCallCheck(this, BlurStack);
this.r = 0;
this.g = 0;
this.b = 0;
this.a = 0;
this.next = null;
};
/***/ })
}]);
|
const { SENTRY_DSN } = require("../config");
if (SENTRY_DSN) {
const Sentry = require("@sentry/node");
// eslint-disable-next-line no-unused-vars
const Tracing = require("@sentry/tracing");
Sentry.init({
dsn: SENTRY_DSN,
tracesSampleRate: .1,
});
}
|
function initMap()
{
// https://snazzymaps.com/explore
// https://github.com/atmist/snazzy-info-window
var mapStyle = [ { "featureType": "all", "elementType": "labels", "stylers": [ { "visibility": "off" } ] }, { "featureType": "poi.park", "elementType": "geometry.fill", "stylers": [ { "color": "#aadd55" } ] }, { "featureType": "road.highway", "elementType": "labels", "stylers": [ { "visibility": "on" } ] }, { "featureType": "road.arterial", "elementType": "labels.text", "stylers": [ { "visibility": "on" } ] }, { "featureType": "road.local", "elementType": "labels.text", "stylers": [ { "visibility": "on" } ] }, { "featureType": "water", "elementType": "geometry.fill", "stylers": [ { "color": "#0099dd" } ] } ]
// Create the map
var map = new google.maps.Map($('.gMap')[0], {
zoom: 15,
scrollwheel: false,
styles: mapStyle,
center: new google.maps.LatLng(51.5280422, -0.0070519)
});
var icon = {
url: 'img/core-img/map_pin.png', // url
scaledSize: new google.maps.Size(40, 50), // scaled size
origin: new google.maps.Point(0,0), // origin
anchor: new google.maps.Point(0, 0) // anchor
};
var marker = new google.maps.Marker({
map: map,
icon: icon,
position: new google.maps.LatLng(51.5280422, -0.0070519)
});
}
|
/**
* © 2022 Abraham Mitiku
* Open Source MERN Dashboard Template
*
*/
// -----------------------------------------------------------------
import React from "react";
import { useRoutes} from "react-router-dom";
import { createTheme, ThemeProvider } from '@mui/material/styles';
import routes from './routes/routes';
import {getLocalStorage} from './utils/Storage';
import {defaultTheme, chillTheme} from './constants/theme';
let siteTheme = ( getLocalStorage('theme'))?chillTheme: defaultTheme;
const theme = createTheme({
palette: {
primary: {
main: siteTheme.PRIMARY.MAIN,
dark: siteTheme.PRIMARY.DARK,
light: siteTheme.PRIMARY.LIGHT,
},
secondary: {
main: siteTheme.SECONDARY.MAIN,
dark: siteTheme.SECONDARY.DARK,
light: siteTheme.SECONDARY.LIGHT,
},
},
});
const App = () =>{
let elements = useRoutes(routes);
return (
<ThemeProvider theme={theme}>
{ elements }
</ThemeProvider>
);
}
export default App;
|
const dotenv = require("dotenv");
dotenv.config();
const {
getTeleportInCollection,
getTeleportOutCollection,
} = require("./mongo");
const {
known: { saveKnownHeights, closeKnownClient },
} = require("@statescan/common");
async function main() {
const heights = [];
let heightSet, col, arr;
col = await getTeleportInCollection();
arr = await col.find({}).toArray();
heights.push(...arr.map((t) => t.indexer.blockHeight));
heightSet = new Set(heights);
await saveKnownHeights([...heightSet]);
heights.splice(0);
col = await getTeleportOutCollection();
arr = await col.find({}).toArray();
heights.push(...arr.map((t) => t.indexer.blockHeight));
heightSet = new Set(heights);
await saveKnownHeights([...heightSet]);
heights.splice(0);
}
main()
.then(async () => {
console.log("Known heights saved");
await closeKnownClient();
process.exit(0);
})
.catch(console.error);
|
const path = require('path');
const merge = require('webpack-merge');
const baseConfig = require('./webpack.base.js');
module.exports = merge(baseConfig, {
entry: {
cookieconsent: './src/components/cookie-consent/index.js',
burger: './src/components/burger-header/index.js',
messagebox: './src/components/message-box/index.js',
},
output: {
path: path.resolve(__dirname, 'dist/public/components'),
filename: '[name].js',
publicPath: '../',
},
resolve: {
extensions: ['.js']
},
module: {
rules: [
{
test: /\.html$/,
exclude: /node_modules/,
include: path.resolve(__dirname, 'src/components'),
use: [
'html-loader'
],
},
{
test: /\.css$/,
exclude: /node_modules/,
include: path.resolve(__dirname, 'src/components'),
use: [
'to-string-loader', // Apply styles to Shadow DOMs.
'css-loader',
'postcss-loader',
],
},
],
},
});
|
/**
* React Starter Kit (https://www.reactstarterkit.com/)
*
* Copyright © 2014-present Kriasoft, LLC. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE.txt file in the root directory of this source tree.
*/
import React from 'react';
import Layout from '../../components/Layout';
import Admin from './Admin';
const title = 'Admin Page';
const isAdmin = true;
function action() {
if (!isAdmin) {
return { redirect: '/login' };
}
return {
chunks: ['admin'],
title,
component: (
<Layout>
<Admin title={title} />
</Layout>
),
};
}
export default action;
|
/* eslint-disable no-unused-vars */
import moment from 'moment';
// import Hackathon from '../api/models/Hackathon';
const Hackathon = require('../api/models/Hackathon');
module.exports = {
up: async (queryInterface, _Sequelize) => {
await Hackathon.create({
name: 'FLAM-NOV-2020',
startDate: moment().subtract('2', 'minutes').format(('YYYY-MM-DD HH:mm')),
endDate: moment().add('1', 'days').format(('YYYY-MM-DD HH:mm')),
});
/**
* Add altering commands here.
*
* Example:
* await queryInterface.createTable('users', { id: Sequelize.INTEGER });
*/
},
down: async (queryInterface, _Sequelize) => {
/**
* Add reverting commands here.
*
* Example:
* await queryInterface.dropTable('users');
*/
},
};
|
window.peopleAlsoBoughtJSON = [{"cover":"61iKfMrisQS","asin":"B097TV6P59","subHeading":"A LitRPG Series Box Set","title":"Life in Exile Books 1-3","authors":"Sean Oswald","narrators":"Peter Berkrot","length":"59 hrs and 23 mins"},{"cover":"51GrOYW9krL","asin":"B09LVSWGZ7","subHeading":"An Apocalyptic LitRPG","title":"Into Twilight","authors":"Cale Plamann","narrators":"Daniel Wisniewski","length":"11 hrs and 31 mins"},{"cover":"51eYYODKroL","asin":"B09NVTB3R2","subHeading":"A VR MMO LitRPG Adventure","title":"Extra Credit","authors":"J. Arthur Klein","narrators":"Actors Everywhere","length":"15 hrs and 23 mins"},{"cover":"51xXN2y7nqL","asin":"B09NS3CWSP","subHeading":"An Isekai LitRPG Teambuilder","title":"Arena Manager","authors":"Chad Opo","narrators":"Actors Everywhere, Marcus Jahn, Alexa Roosevelt","length":"24 hrs and 8 mins"},{"cover":"51QzypjfBPL","asin":"B09N7W75X6","subHeading":"Heaven's Laws, Book 1","title":"Prodigies","authors":"Apollos Thorne","narrators":"Cindy Kay, David Shih","length":"35 hrs and 2 mins"},{"cover":"51rmZeSjpoL","asin":"B09RX4LQTL","title":"Defiance of the Fall 4: A LitRPG Adventure","authors":"TheFirstDefier, JF Brink","narrators":"Pavi Proczko","length":"22 hrs and 47 mins"},{"cover":"51p0TAxZb8L","asin":"B08KTW51WH","subHeading":"Beast Realms, Book 1","title":"Chrysalis (A Fantasy LitRPG)","authors":"R.P. Jones, Portal Books","narrators":"Travis Baldree","length":"17 hrs and 31 mins"},{"cover":"51LYBlSGo7L","asin":"B09M99741P","subHeading":"Systems of Salvation, Book 1","title":"Reincarnation Trials: A LitRPG Apocalypse","authors":"Han Yang","narrators":"Daniel Wisniewski, Rebecca Woods","length":"21 hrs and 29 mins"},{"cover":"61kLpjo5VfL","asin":"B08JHG7DMD","title":"Battleborne","authors":"Dave Willmarth","narrators":"Daniel Wisniewski, Jessica Threet","length":"17 hrs and 14 mins"},{"cover":"51MHln6MHNL","asin":"B09GL3RYXM","subHeading":"The RPG Apocalypse, Book 1","title":"The RPG Apocalypse","authors":"Jeremy Chambless","narrators":"Maks Daniels","length":"10 hrs and 22 mins"},{"cover":"61LpsJ-w+wL","asin":"B09GHV53CX","subHeading":"Alpha Physics, Book 1","title":"Wagga","authors":"Alex Kozlowski","narrators":"Grant Cartwright","length":"15 hrs and 40 mins"},{"cover":"51xMwXOPyuL","asin":"1039402895","subHeading":"A LitRPG Adventure (Salvos, Book 1)","title":"Curious Beginnings","authors":"V.A. Lewis","narrators":"Tess Irondale","length":"11 hrs and 11 mins"},{"cover":"41J3NugN69L","asin":"B09NS1TV7H","subHeading":"Dwarf Smith from Earth","title":"The Dwarf, the Mine, and the RPG Apocalypse","authors":"Constantin Step","narrators":"Daniel Thomas May","length":"13 hrs and 25 mins"},{"cover":"51gIpmLXIQL","asin":"B09M7JG4ST","subHeading":"A LitRPG Fantasy Cooking Adventure (Morcster Chef, Book 1)","title":"Cleaver's Edge","authors":"Actus","narrators":"Peter Berkrot","length":"13 hrs and 5 mins"},{"cover":"51qgfewKpLL","asin":"B09MWP2L3T","subHeading":"Foodstuffs LitRPG Series, Book 1","title":"Easy Meat","authors":"Arthur Stone","narrators":"Kevin T. Collins","length":"10 hrs and 14 mins"},{"cover":"515a6cqijlL","asin":"1774247291","subHeading":"Beastborne, Book 1","title":"Mark of the Founder: A litRPG Saga","authors":"James T. Callum","narrators":"Eric Michael Summerer","length":"29 hrs and 33 mins"},{"cover":"51xMHA7sWSL","asin":"1515948021","subHeading":"Underdog Series, Book 1","title":"Dungeons of the Crooked Mountains","authors":"Alexey Osadchuk, Andrew Douglas Schmitt - translator","narrators":"Derek Shoales","length":"10 hrs and 8 mins"},{"cover":"517jCtks7mL","asin":"B09K4N3MK4","subHeading":"Alpha LitRPG, Book 1","title":"Alpha Zero","authors":"Arthur Stone","narrators":"Eric Jason Martin","length":"14 hrs and 13 mins"}];
window.bookSummaryJSON = "<p><b>Whether it be the hero of legends or the character in a game, few things are more defining than Class.</b></p> <p>Except maybe Class isn't always static. Tank, DPS, healer, and more. They are all just different sides of fate's die.</p> <p>Taken from life as an office drone by a trickster god, Tim finds himself in the magical world of Iocusinte, where change is his only constant. It grants him great potential, enough to be sought out by different factions looking to use him for their own ends.</p> <p>That potential, however, is mercurial. His Class and very appearance shift at random.</p> <p>If Tim is to survive long enough to enjoy this new world and the friends he's making, then he'll have to solve the riddle of his nature and learn to master the uncontrollable.</p> <p><b>Experience the next LitRPG saga from Amazon Bestseller Sean Oswald. It’s perfect for fans of Dakota Krout, Luke Chmilenko, and Troy Osgood.</b></p>";
|
var C = {
basePath : function(){
if(window.URL_ROOT){
return window.URL_ROOT;
}
return document.location.href.replace(/\/[^\/]+$/, '');
},
staticPath : function(){
return C.basePath() + '/static';
},
modURL : function(c, a){
return C.basePath() + '/?c=' + c + '&a=' + a;
},
methodURL : function(url){
return C.basePath() + '/method.php?m=' + url;
},
jsonpURL : function(url){
return C.basePath() + '/jsonp.php?m=' + url;
},
timeStr : function(timestamp, withsec){
var ec = new Date(),
et = new Date(timestamp * 1000);
var yc = ec.getFullYear(), yt = et.getFullYear(),
mc = ec.getMonth() + 1, mt = et.getMonth() + 1,
dc = ec.getDate(), dt = et.getDate();
var s = '';
function f(x){ return x < 10 ? '0' + x : x; }
switch(true){
case yc == yt && mc == mt && dc == dt:
s = '今天';
break;
case yc == yt && mc == mt && dc - dt == 1:
s = '昨天';
break;
case yc == yt && mc == mt && dc - dt == 2:
s = '前天';
break;
case ec.getTime() / 1000 - timestamp <= 86400 * 7:
s = LANG.WEEKDAY[et.getDay()];
break;
case yc == yt:
s = f(mt) + '月' + f(dt) + '日';
break;
default:
s = yt + '年' + f(mt) + '月' + f(dt) + '日';
break;
}
return s + ' ' + f(et.getHours()) + ':' + f(et.getMinutes()) + (withsec ? (":" + f(et.getSeconds())) : "");
},
defaultSkin : function(){
return C.staticPath() + '/skin/img/char.png';
},
quizSkin : function(){
return C.staticPath() + '/quiz/img/cirno.png';
}
};
var LANG = {
CONTENT_NOT_EMPTY : function(prefix){
return prefix + '的内容不能为空';
},
CONTENT_LENGTH : function(prefix, from, to){
return prefix + '的长度需为' + from + '~' + to + '位';
},
CONTENT_LENGTH_FIXED : function(prefix, length){
return prefix + '的长度需为' + length + '位';
},
CONTENT_LENGTH_LEAST : function(prefix, length){
return prefix + '的长度最少需为' + length + '位';
},
NEED_CORRECT_EMAIL : '请输入合法的email地址',
WEEKDAY : ['周日', '周一', '周二', '周三', '周四', '周五', '周六', '周日']
}
var KEYBOARD = {
ENTER : 13
}
|
const VALID_NUMBER = /^-\d+(?:\.\d+)?$/
const { SI_SYMBOL } = require("../../../utils/Constants")
module.exports = async d => {
const { code } = d.command
const inside = d.unpack()
const err = d.inside(inside)
if (err) return d.error(err)
const abbrNumber = inside.inside.toUpperCase()
let abbrIndex
for (let i = SI_SYMBOL.length - 1; i >= 0; i--) {
const sym = SI_SYMBOL[i]
if (abbrNumber.endsWith(sym.toUpperCase())) {
abbrIndex = i
break
}
}
const abbr = SI_SYMBOL[abbrIndex]
const number = abbrIndex ? abbrNumber.slice(0, -abbr.length) : abbrNumber
if (!VALID_NUMBER.test(number)) return d.aoiError.fnError(
d,
"custom",
{ inside },
"Invalid number in"
)
const num = parseFloat(number)
const multiplier = abbrIndex ? 1e3 ** abbrIndex : 1
const expanded = num * multiplier
return {
code: d.util.setCode({
function: d.func,
code,
inside,
result: `${expanded}`
})
}
}
// Usage: $expandNumber[abbrNumber]
// Example: $expandNumber[1.3m]
|
// The following are in class JS teachings
// const - constance something where the value will not change
let name = 'Corrina'
console.log(name)
const numOne = 12
const numTwo = 5
const result = numTwo % numOne
console.log(result)
// switch statement
let groceryItem = 'papaya';
switch(groceryItem) {
case 'tomato':
console.log('Tomatoes are $0.49');
break;
case 'lime':
console.log('limes are $1.49');
break;
case 'papaya':
console.log('papayas are $1.29');
break;
default:
console.log('Invalid item');
break;
}
let isNightTime = false;
isNightTime ? console.log('Turn on the lights!') : console.log('Turn off the light!');
//DEFAULT PARAMETERS allow parameters to have a predetermined value in case there is
//no argument passed into the function or if the argument is undefined when called.
function greeting (name = 'stranger'){
console.log(`Hello, ${name}!`);
}
greeting('Nick'); //output; Hello, Nick!
greeting(); //output: Hello, stranger!
function makeShoppingList(item1 = 'milk', item2 = 'bread', item3 = 'eggs'){
console.log(`Remember to buy ${item1}`);
console.log(`Remember to buy ${item2}`);
console.log(`Remember to buy ${item3}`);
}
makeShoppingList();
//In the terminal input 'node index.js' to run in terminal <don't forget to save>
// RETURN
function rectangleArea(width, height) {
if (width < 1 || height < 1) {
return 'You need positive integers to calculate area!';
}
return width * height;
}
console.log(rectangleArea(0, 0));
// The return keyword is powerful because it allows functions to produce an output.
// We can then save the output to a variable for later use.
function monitorCount(rows, columns) {
return rows * columns;
}
const numOfMonitors = monitorCount(5, 4);
console.log(numOfMonitors);
//Arrow functions - a shorter way to write functions by using the special “fat arrow” () =>
const rectangleArea = (width, height) => {
let area = width * height;
return area;
};
// same as above
const rectangleArea = function(width, height) {
let area = width * height;
return area;
};
//So if we have
const squareNum = (num) => {
return num * num;
};
// we can refactor to
const squareNum = num => num * num;
const plantNeedsWater = (day) => {
return day === 'Wednesday' ? true : false;
};
//notice the code converted to the if/else to a ternery operator
const plantNeedsWater = day => day === 'Wednesday' ? true : false;
//global scope
const color = 'blue'
const returnSkyColor = () => {
return color; // blue
};
console.log(returnSkyColor()); // blue
const satellite = 'The Moon';
const galaxy = 'The Milky Way';
const stars = 'North Star';
const callMyNightSky = () =>{
return 'Night Sky: ' + satellite + ', ' + stars + ', and ' + galaxy;
}
console.log(callMyNightSky())
//block scope (local)
const logSkyColor = () => {
let color = 'blue';
console.log(color); // blue
};
logSkyColor(); // blue
//console.log(color); // ReferenceError
//If we try to log the same variable outside the function,
//throws a ReferenceError.
const logVisibleLightWaves = () =>{
const lightWaves = 'Moonlight';
console.log(lightWaves);
}
logVisibleLightWaves();
//console.log(lightWaves); // reference error
//pollution coding - following is an eg mixture of bad and good
const logSkyColor = () => {
const dusk = true;
let color = 'blue';
if (dusk) {
let color = 'pink';
console.log(color); // pink
}
console.log(color); // blue
};
//console.log(color); // ReferenceError
// .pop() method removes the last item in the array
const newItemTracker = ['item 0', 'item 1', 'item 2'];
const removed = newItemTracker.pop();
console.log(newItemTracker);
// Output: [ 'item 0', 'item 1' ]
console.log(removed);
// Output: item 2
//2nd example
const chores = ['wash dishes', 'do laundry', 'take out trash', 'cook dinner', 'mop floor'];
chores.pop();
console.log(chores);
//remove 1st item on list .shift()
const groceryList = ['orange juice', 'bananas', 'coffee beans', 'brown rice', 'pasta', 'coconut oil', 'plantains'];
groceryList.shift();
console.log(groceryList);
//console.log(groceryList);
groceryList.unshift('popcorn');
console.log(groceryList);
console.log(groceryList.slice(1, 4));
//nested array
const nestedArr = [[1], [2, 3]];
console.log(nestedArr[1]); // Output: [2, 3]
console.log(nestedArr[1][0]); // Output: 2
//[1] is [2, 3] followed by [0] = the 1st element frm tht array
|
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","react","react-dom"],t):t((e=e||self).ReactTransitionGroup={},e.React,e.ReactDOM)}(this,function(e,t,n){"use strict";var r="default"in t?t.default:t,i="default"in n?n.default:n;function o(){return(o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function a(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function s(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function l(e,t){return e(t={exports:{}},t.exports),t.exports}var c=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable;(function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}})()&&Object.assign;var d="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";function f(){}var h=l(function(e){e.exports=function(){function e(e,t,n,r,i,o){if(o!==d){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=f,n.PropTypes=n,n}()}),E=(h.object,h.oneOfType,h.element,h.bool,h.func,l(function(e){e.exports=function(e){return e&&e.__esModule?e:{default:e}}}));s(E);var m=l(function(e,t){t.__esModule=!0,t.default=function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")},e.exports=t.default});s(m);var x=s(l(function(e,t){t.__esModule=!0,t.default=function(e,t){e.classList?e.classList.add(t):(0,n.default)(e,t)||("string"==typeof e.className?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))};var n=E(m);e.exports=t.default}));function v(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function y(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}var g=r.createContext(null),b="unmounted",C="exited",N="entering",O="entered",S=function(e){function t(t,n){var r;r=e.call(this,t,n)||this;var i,o=n&&!n.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?o?(i=C,r.appearStatus=N):i=O:i=t.unmountOnExit||t.mountOnEnter?b:C,r.state={status:i},r.nextCallback=null,r}a(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===b?{status:C}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==N&&n!==O&&(t=N):n!==N&&n!==O||(t="exiting")}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t){this.cancelNextCallback();var n=i.findDOMNode(this);t===N?this.performEnter(n,e):this.performExit(n)}else this.props.unmountOnExit&&this.state.status===C&&this.setState({status:b})},n.performEnter=function(e,t){var n=this,r=this.props.enter,i=this.context?this.context.isMounting:t,o=this.getTimeouts(),a=i?o.appear:o.enter;t||r?(this.props.onEnter(e,i),this.safeSetState({status:N},function(){n.props.onEntering(e,i),n.onTransitionEnd(e,a,function(){n.safeSetState({status:O},function(){n.props.onEntered(e,i)})})})):this.safeSetState({status:O},function(){n.props.onEntered(e)})},n.performExit=function(e){var t=this,n=this.props.exit,r=this.getTimeouts();n?(this.props.onExit(e),this.safeSetState({status:"exiting"},function(){t.props.onExiting(e),t.onTransitionEnd(e,r.exit,function(){t.safeSetState({status:C},function(){t.props.onExited(e)})})})):this.safeSetState({status:C},function(){t.props.onExited(e)})},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t,n){this.setNextCallback(n);var r=null==t&&!this.props.addEndListener;e&&!r?(this.props.addEndListener&&this.props.addEndListener(e,this.nextCallback),null!=t&&setTimeout(this.nextCallback,t)):setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if(e===b)return null;var t=this.props,n=t.children,i=y(t,["children"]);if(delete i.in,delete i.mountOnEnter,delete i.unmountOnExit,delete i.appear,delete i.enter,delete i.exit,delete i.timeout,delete i.addEndListener,delete i.onEnter,delete i.onEntering,delete i.onEntered,delete i.onExit,delete i.onExiting,delete i.onExited,"function"==typeof n)return r.createElement(g.Provider,{value:null},n(e,i));var o=r.Children.only(n);return r.createElement(g.Provider,{value:null},r.cloneElement(o,i))},t}(r.Component);function T(){}S.contextType=g,S.propTypes={},S.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:T,onEntering:T,onEntered:T,onExit:T,onExiting:T,onExited:T},S.UNMOUNTED=0,S.EXITED=1,S.ENTERING=2,S.ENTERED=3,S.EXITING=4;var k=function(e,t){return e&&t&&t.split(" ").forEach(function(t){return x(e,t)})},j=function(e,t){return e&&t&&t.split(" ").forEach(function(t){return r=t,void((n=e).classList?n.classList.remove(r):"string"==typeof n.className?n.className=v(n.className,r):n.setAttribute("class",v(n.className&&n.className.baseVal||"",r)));var n,r})},_=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).onEnter=function(e,n){var r=t.getClassNames(n?"appear":"enter").className;t.removeClasses(e,"exit"),k(e,r),t.props.onEnter&&t.props.onEnter(e,n)},t.onEntering=function(e,n){var r=t.getClassNames(n?"appear":"enter").activeClassName;t.reflowAndAddClass(e,r),t.props.onEntering&&t.props.onEntering(e,n)},t.onEntered=function(e,n){var r=t.getClassNames("appear").doneClassName,i=t.getClassNames("enter").doneClassName,o=n?r+" "+i:i;t.removeClasses(e,n?"appear":"enter"),k(e,o),t.props.onEntered&&t.props.onEntered(e,n)},t.onExit=function(e){var n=t.getClassNames("exit").className;t.removeClasses(e,"appear"),t.removeClasses(e,"enter"),k(e,n),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var n=t.getClassNames("exit").activeClassName;t.reflowAndAddClass(e,n),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var n=t.getClassNames("exit").doneClassName;t.removeClasses(e,"exit"),k(e,n),t.props.onExited&&t.props.onExited(e)},t.getClassNames=function(e){var n=t.props.classNames,r="string"==typeof n,i=r?(r&&n?n+"-":"")+e:n[e];return{className:i,activeClassName:r?i+"-active":n[e+"Active"],doneClassName:r?i+"-done":n[e+"Done"]}},t}a(t,e);var n=t.prototype;return n.removeClasses=function(e,t){var n=this.getClassNames(t),r=n.className,i=n.activeClassName,o=n.doneClassName;r&&j(e,r),i&&j(e,i),o&&j(e,o)},n.reflowAndAddClass=function(e,t){t&&(e&&e.scrollTop,k(e,t))},n.render=function(){var e=o({},this.props);return delete e.classNames,r.createElement(S,o({},e,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(r.Component);function w(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function P(e,n){var r=Object.create(null);return e&&t.Children.map(e,function(e){return e}).forEach(function(e){r[e.key]=function(e){return n&&t.isValidElement(e)?n(e):e}(e)}),r}function A(e,t,n){return null!=n[t]?n[t]:e.props[t]}function L(e,n,r){var i=P(e.children),o=function(e,t){function n(n){return n in t?t[n]:e[n]}e=e||{},t=t||{};var r,i=Object.create(null),o=[];for(var a in e)a in t?o.length&&(i[a]=o,o=[]):o.push(a);var s={};for(var l in t){if(i[l])for(r=0;r<i[l].length;r++){var c=i[l][r];s[i[l][r]]=n(c)}s[l]=n(l)}for(r=0;r<o.length;r++)s[o[r]]=n(o[r]);return s}(n,i);return Object.keys(o).forEach(function(a){var s=o[a];if(t.isValidElement(s)){var l=a in n,c=a in i,u=n[a],p=t.isValidElement(u)&&!u.props.in;!c||l&&!p?c||!l||p?c&&l&&t.isValidElement(u)&&(o[a]=t.cloneElement(s,{onExited:r.bind(null,s),in:u.props.in,exit:A(s,"exit",e),enter:A(s,"enter",e)})):o[a]=t.cloneElement(s,{in:!1}):o[a]=t.cloneElement(s,{onExited:r.bind(null,s),in:!0,exit:A(s,"exit",e),enter:A(s,"enter",e)})}}),o}_.defaultProps={classNames:""},_.propTypes={};var R=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},M=function(e){function n(t,n){var r,i=(r=e.call(this,t,n)||this).handleExited.bind(w(w(r)));return r.state={contextValue:{isMounting:!0},handleExited:i,firstRender:!0},r}a(n,e);var i=n.prototype;return i.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},i.componentWillUnmount=function(){this.mounted=!1},n.getDerivedStateFromProps=function(e,n){var r,i,o=n.children,a=n.handleExited;return{children:n.firstRender?(r=e,i=a,P(r.children,function(e){return t.cloneElement(e,{onExited:i.bind(null,e),in:!0,appear:A(e,"appear",r),enter:A(e,"enter",r),exit:A(e,"exit",r)})})):L(e,o,a),firstRender:!1}},i.handleExited=function(e,t){var n=P(this.props.children);e.key in n||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState(function(t){var n=o({},t.children);return delete n[e.key],{children:n}}))},i.render=function(){var e=this.props,t=e.component,n=e.childFactory,i=y(e,["component","childFactory"]),o=this.state.contextValue,a=R(this.state.children).map(n);return delete i.appear,delete i.enter,delete i.exit,null===t?r.createElement(g.Provider,{value:o},a):r.createElement(g.Provider,{value:o},r.createElement(t,i,a))},n}(r.Component);M.propTypes={},M.defaultProps={component:"div",childFactory:function(e){return e}};var D=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).handleEnter=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.handleLifecycle("onEnter",0,n)},t.handleEntering=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.handleLifecycle("onEntering",0,n)},t.handleEntered=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.handleLifecycle("onEntered",0,n)},t.handleExit=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.handleLifecycle("onExit",1,n)},t.handleExiting=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.handleLifecycle("onExiting",1,n)},t.handleExited=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.handleLifecycle("onExited",1,n)},t}a(t,e);var i=t.prototype;return i.handleLifecycle=function(e,t,i){var o,a=this.props.children,s=r.Children.toArray(a)[t];s.props[e]&&(o=s.props)[e].apply(o,i),this.props[e]&&this.props[e](n.findDOMNode(this))},i.render=function(){var e=this.props,t=e.children,n=e.in,i=y(e,["children","in"]),o=r.Children.toArray(t),a=o[0],s=o[1];return delete i.onEnter,delete i.onEntering,delete i.onEntered,delete i.onExit,delete i.onExiting,delete i.onExited,r.createElement(M,i,n?r.cloneElement(a,{key:"first",onEnter:this.handleEnter,onEntering:this.handleEntering,onEntered:this.handleEntered}):r.cloneElement(s,{key:"second",onEnter:this.handleExit,onEntering:this.handleExiting,onEntered:this.handleExited}))},t}(r.Component);D.propTypes={},e.CSSTransition=_,e.ReplaceTransition=D,e.Transition=S,e.TransitionGroup=M,Object.defineProperty(e,"__esModule",{value:!0})});
|
module.exports = {
name: 'apostrophe-events-page',
label: 'Events Page',
extend: 'apostrophe-pieces-pages',
piecesFilters: [
{ name: 'year' },
{ name: 'month' },
{ name: 'day' },
],
construct: function (self, options) {
// Append upcoming flag by extending pieces.indexCursor.
var superIndexCursor = self.indexCursor;
self.indexCursor = function (req) {
return superIndexCursor(req).upcoming(true);
};
}
};
|
// The Tern server object
// A server is a stateful object that manages the analysis for a
// project, and defines an interface for querying the code in the
// project.
(function(root, mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
return mod(exports, require("./infer"), require("./signal"),
require("acorn"), require("acorn/dist/walk"));
if (typeof define == "function" && define.amd) // AMD
return define(["exports", "./infer", "./signal", "acorn/dist/acorn", "acorn/dist/walk"], mod);
mod(root.tern || (root.tern = {}), tern, tern.signal, acorn, acorn.walk); // Plain browser env
})(this, function(exports, infer, signal, acorn, walk) {
"use strict";
var plugins = Object.create(null);
exports.registerPlugin = function(name, init) { plugins[name] = init; };
var defaultOptions = exports.defaultOptions = {
debug: false,
async: false,
getFile: function(_f, c) { if (this.async) c(null, null); },
defs: [],
plugins: {},
fetchTimeout: 1000,
dependencyBudget: 20000,
reuseInstances: true,
stripCRs: false
};
var queryTypes = {
completions: {
takesFile: true,
run: findCompletions
},
properties: {
run: findProperties
},
type: {
takesFile: true,
run: findTypeAt
},
documentation: {
takesFile: true,
run: findDocs
},
definition: {
takesFile: true,
run: findDef
},
refs: {
takesFile: true,
fullFile: true,
run: findRefs
},
rename: {
takesFile: true,
fullFile: true,
run: buildRename
},
files: {
run: listFiles
}
};
exports.defineQueryType = function(name, desc) { queryTypes[name] = desc; };
function File(name, parent) {
this.name = name;
this.parent = parent;
this.scope = this.text = this.ast = this.lineOffsets = null;
}
File.prototype.asLineChar = function(pos) { return asLineChar(this, pos); };
function updateText(file, text, srv) {
file.text = srv.options.stripCRs ? text.replace(/\r\n/g, "\n") : text;
infer.withContext(srv.cx, function() {
file.ast = infer.parse(file.text, srv.passes, {directSourceFile: file, allowReturnOutsideFunction: true});
});
file.lineOffsets = null;
}
var Server = exports.Server = function(options) {
this.cx = null;
this.options = options || {};
for (var o in defaultOptions) if (!options.hasOwnProperty(o))
options[o] = defaultOptions[o];
this.handlers = Object.create(null);
this.files = [];
this.fileMap = Object.create(null);
this.needsPurge = [];
this.budgets = Object.create(null);
this.uses = 0;
this.pending = 0;
this.asyncError = null;
this.passes = Object.create(null);
this.defs = options.defs.slice(0);
for (var plugin in options.plugins) if (options.plugins.hasOwnProperty(plugin) && plugin in plugins) {
var init = plugins[plugin](this, options.plugins[plugin]);
if (init && init.defs) {
if (init.loadFirst) this.defs.unshift(init.defs);
else this.defs.push(init.defs);
}
if (init && init.passes) for (var type in init.passes) if (init.passes.hasOwnProperty(type))
(this.passes[type] || (this.passes[type] = [])).push(init.passes[type]);
}
this.reset();
};
Server.prototype = signal.mixin({
addFile: function(name, /*optional*/ text, parent) {
// Don't crash when sloppy plugins pass non-existent parent ids
if (parent && !(parent in this.fileMap)) parent = null;
ensureFile(this, name, parent, text);
},
delFile: function(name) {
var file = this.findFile(name);
if (file) {
this.needsPurge.push(file.name);
this.files.splice(this.files.indexOf(file), 1);
delete this.fileMap[name];
}
},
reset: function() {
this.signal("reset");
this.cx = new infer.Context(this.defs, this);
this.uses = 0;
this.budgets = Object.create(null);
for (var i = 0; i < this.files.length; ++i) {
var file = this.files[i];
file.scope = null;
}
},
request: function(doc, c) {
var inv = invalidDoc(doc);
if (inv) return c(inv);
var self = this;
doRequest(this, doc, function(err, data) {
c(err, data);
if (self.uses > 40) {
self.reset();
analyzeAll(self, null, function(){});
}
});
},
findFile: function(name) {
return this.fileMap[name];
},
flush: function(c) {
var cx = this.cx;
analyzeAll(this, null, function(err) {
if (err) return c(err);
infer.withContext(cx, c);
});
},
startAsyncAction: function() {
++this.pending;
},
finishAsyncAction: function(err) {
if (err) this.asyncError = err;
if (--this.pending === 0) this.signal("everythingFetched");
}
});
function doRequest(srv, doc, c) {
if (doc.query && !queryTypes.hasOwnProperty(doc.query.type))
return c("No query type '" + doc.query.type + "' defined");
var query = doc.query;
// Respond as soon as possible when this just uploads files
if (!query) c(null, {});
var files = doc.files || [];
if (files.length) ++srv.uses;
for (var i = 0; i < files.length; ++i) {
var file = files[i];
if (file.type == "delete")
srv.delFile(file.name);
else
ensureFile(srv, file.name, null, file.type == "full" ? file.text : null);
}
var timeBudget = typeof doc.timeout == "number" ? [doc.timeout] : null;
if (!query) {
analyzeAll(srv, timeBudget, function(){});
return;
}
var queryType = queryTypes[query.type];
if (queryType.takesFile) {
if (typeof query.file != "string") return c(".query.file must be a string");
if (!/^#/.test(query.file)) ensureFile(srv, query.file, null);
}
analyzeAll(srv, timeBudget, function(err) {
if (err) return c(err);
var file = queryType.takesFile && resolveFile(srv, files, query.file);
if (queryType.fullFile && file.type == "part")
return c("Can't run a " + query.type + " query on a file fragment");
function run() {
var result;
try {
result = queryType.run(srv, query, file);
} catch (e) {
if (srv.options.debug && e.name != "TernError") console.error(e.stack);
return c(e);
}
c(null, result);
}
infer.withContext(srv.cx, timeBudget ? function() { infer.withTimeout(timeBudget[0], run); } : run);
});
}
function analyzeFile(srv, file) {
infer.withContext(srv.cx, function() {
file.scope = srv.cx.topScope;
srv.signal("beforeLoad", file);
infer.analyze(file.ast, file.name, file.scope, srv.passes);
srv.signal("afterLoad", file);
});
return file;
}
function ensureFile(srv, name, parent, text) {
var known = srv.findFile(name);
if (known) {
if (text != null) {
if (known.scope) {
srv.needsPurge.push(name);
known.scope = null;
}
updateText(known, text, srv);
}
if (parentDepth(srv, known.parent) > parentDepth(srv, parent)) {
known.parent = parent;
if (known.excluded) known.excluded = null;
}
return;
}
var file = new File(name, parent);
srv.files.push(file);
srv.fileMap[name] = file;
if (text != null) {
updateText(file, text, srv);
} else if (srv.options.async) {
srv.startAsyncAction();
srv.options.getFile(name, function(err, text) {
updateText(file, text || "", srv);
srv.finishAsyncAction(err);
});
} else {
updateText(file, srv.options.getFile(name) || "", srv);
}
}
function fetchAll(srv, c) {
var done = true, returned = false;
srv.files.forEach(function(file) {
if (file.text != null) return;
if (srv.options.async) {
done = false;
srv.options.getFile(file.name, function(err, text) {
if (err && !returned) { returned = true; return c(err); }
updateText(file, text || "", srv);
fetchAll(srv, c);
});
} else {
try {
updateText(file, srv.options.getFile(file.name) || "", srv);
} catch (e) { return c(e); }
}
});
if (done) c();
}
function waitOnFetch(srv, timeBudget, c) {
var done = function() {
srv.off("everythingFetched", done);
clearTimeout(timeout);
analyzeAll(srv, timeBudget, c);
};
srv.on("everythingFetched", done);
var timeout = setTimeout(done, srv.options.fetchTimeout);
}
function analyzeAll(srv, timeBudget, c) {
if (srv.pending) return waitOnFetch(srv, timeBudget, c);
var e = srv.fetchError;
if (e) { srv.fetchError = null; return c(e); }
if (srv.needsPurge.length > 0) infer.withContext(srv.cx, function() {
infer.purge(srv.needsPurge);
srv.needsPurge.length = 0;
});
var done = true;
// The second inner loop might add new files. The outer loop keeps
// repeating both inner loops until all files have been looked at.
for (var i = 0; i < srv.files.length;) {
var toAnalyze = [];
for (; i < srv.files.length; ++i) {
var file = srv.files[i];
if (file.text == null) done = false;
else if (file.scope == null && !file.excluded) toAnalyze.push(file);
}
toAnalyze.sort(function(a, b) {
return parentDepth(srv, a.parent) - parentDepth(srv, b.parent);
});
for (var j = 0; j < toAnalyze.length; j++) {
var file = toAnalyze[j];
if (file.parent && !chargeOnBudget(srv, file)) {
file.excluded = true;
} else if (timeBudget) {
var startTime = +new Date;
infer.withTimeout(timeBudget[0], function() { analyzeFile(srv, file); });
timeBudget[0] -= +new Date - startTime;
} else {
analyzeFile(srv, file);
}
}
}
if (done) c();
else waitOnFetch(srv, timeBudget, c);
}
function firstLine(str) {
var end = str.indexOf("\n");
if (end < 0) return str;
return str.slice(0, end);
}
function findMatchingPosition(line, file, near) {
var pos = Math.max(0, near - 500), closest = null;
if (!/^\s*$/.test(line)) for (;;) {
var found = file.indexOf(line, pos);
if (found < 0 || found > near + 500) break;
if (closest == null || Math.abs(closest - near) > Math.abs(found - near))
closest = found;
pos = found + line.length;
}
return closest;
}
function scopeDepth(s) {
for (var i = 0; s; ++i, s = s.prev) {}
return i;
}
function ternError(msg) {
var err = new Error(msg);
err.name = "TernError";
return err;
}
function resolveFile(srv, localFiles, name) {
var isRef = name.match(/^#(\d+)$/);
if (!isRef) return srv.findFile(name);
var file = localFiles[isRef[1]];
if (!file || file.type == "delete") throw ternError("Reference to unknown file " + name);
if (file.type == "full") return srv.findFile(file.name);
// This is a partial file
var realFile = file.backing = srv.findFile(file.name);
var offset;
file.offset = offset = resolvePos(realFile, file.offsetLines == null ? file.offset : {line: file.offsetLines, ch: 0}, true);
var line = firstLine(file.text);
var foundPos = findMatchingPosition(line, realFile.text, offset);
var pos = foundPos == null ? Math.max(0, realFile.text.lastIndexOf("\n", offset)) : foundPos;
var inObject, atFunction;
infer.withContext(srv.cx, function() {
infer.purge(file.name, pos, pos + file.text.length);
var text = file.text, m;
if (m = text.match(/(?:"([^"]*)"|([\w$]+))\s*:\s*function\b/)) {
var objNode = walk.findNodeAround(file.backing.ast, pos, "ObjectExpression");
if (objNode && objNode.node.objType)
inObject = {type: objNode.node.objType, prop: m[2] || m[1]};
}
if (foundPos && (m = line.match(/^(.*?)\bfunction\b/))) {
var cut = m[1].length, white = "";
for (var i = 0; i < cut; ++i) white += " ";
text = white + text.slice(cut);
atFunction = true;
}
var scopeStart = infer.scopeAt(realFile.ast, pos, realFile.scope);
var scopeEnd = infer.scopeAt(realFile.ast, pos + text.length, realFile.scope);
var scope = file.scope = scopeDepth(scopeStart) < scopeDepth(scopeEnd) ? scopeEnd : scopeStart;
file.ast = infer.parse(text, srv.passes, {directSourceFile: file, allowReturnOutsideFunction: true});
infer.analyze(file.ast, file.name, scope, srv.passes);
// This is a kludge to tie together the function types (if any)
// outside and inside of the fragment, so that arguments and
// return values have some information known about them.
tieTogether: if (inObject || atFunction) {
var newInner = infer.scopeAt(file.ast, line.length, scopeStart);
if (!newInner.fnType) break tieTogether;
if (inObject) {
var prop = inObject.type.getProp(inObject.prop);
prop.addType(newInner.fnType);
} else if (atFunction) {
var inner = infer.scopeAt(realFile.ast, pos + line.length, realFile.scope);
if (inner == scopeStart || !inner.fnType) break tieTogether;
var fOld = inner.fnType, fNew = newInner.fnType;
if (!fNew || (fNew.name != fOld.name && fOld.name)) break tieTogether;
for (var i = 0, e = Math.min(fOld.args.length, fNew.args.length); i < e; ++i)
fOld.args[i].propagate(fNew.args[i]);
fOld.self.propagate(fNew.self);
fNew.retval.propagate(fOld.retval);
}
}
});
return file;
}
// Budget management
function astSize(node) {
var size = 0;
walk.simple(node, {Expression: function() { ++size; }});
return size;
}
function parentDepth(srv, parent) {
var depth = 0;
while (parent) {
parent = srv.findFile(parent).parent;
++depth;
}
return depth;
}
function budgetName(srv, file) {
for (;;) {
var parent = srv.findFile(file.parent);
if (!parent.parent) break;
file = parent;
}
return file.name;
}
function chargeOnBudget(srv, file) {
var bName = budgetName(srv, file);
var size = astSize(file.ast);
var known = srv.budgets[bName];
if (known == null)
known = srv.budgets[bName] = srv.options.dependencyBudget;
if (known < size) return false;
srv.budgets[bName] = known - size;
return true;
}
// Query helpers
function isPosition(val) {
return typeof val == "number" || typeof val == "object" &&
typeof val.line == "number" && typeof val.ch == "number";
}
// Baseline query document validation
function invalidDoc(doc) {
if (doc.query) {
if (typeof doc.query.type != "string") return ".query.type must be a string";
if (doc.query.start && !isPosition(doc.query.start)) return ".query.start must be a position";
if (doc.query.end && !isPosition(doc.query.end)) return ".query.end must be a position";
}
if (doc.files) {
if (!Array.isArray(doc.files)) return "Files property must be an array";
for (var i = 0; i < doc.files.length; ++i) {
var file = doc.files[i];
if (typeof file != "object") return ".files[n] must be objects";
else if (typeof file.name != "string") return ".files[n].name must be a string";
else if (file.type == "delete") continue;
else if (typeof file.text != "string") return ".files[n].text must be a string";
else if (file.type == "part") {
if (!isPosition(file.offset) && typeof file.offsetLines != "number")
return ".files[n].offset must be a position";
} else if (file.type != "full") return ".files[n].type must be \"full\" or \"part\"";
}
}
}
var offsetSkipLines = 25;
function findLineStart(file, line) {
var text = file.text, offsets = file.lineOffsets || (file.lineOffsets = [0]);
var pos = 0, curLine = 0;
var storePos = Math.min(Math.floor(line / offsetSkipLines), offsets.length - 1);
var pos = offsets[storePos], curLine = storePos * offsetSkipLines;
while (curLine < line) {
++curLine;
pos = text.indexOf("\n", pos) + 1;
if (pos === 0) return null;
if (curLine % offsetSkipLines === 0) offsets.push(pos);
}
return pos;
}
var resolvePos = exports.resolvePos = function(file, pos, tolerant) {
if (typeof pos != "number") {
var lineStart = findLineStart(file, pos.line);
if (lineStart == null) {
if (tolerant) pos = file.text.length;
else throw ternError("File doesn't contain a line " + pos.line);
} else {
pos = lineStart + pos.ch;
}
}
if (pos > file.text.length) {
if (tolerant) pos = file.text.length;
else throw ternError("Position " + pos + " is outside of file.");
}
return pos;
};
function asLineChar(file, pos) {
if (!file) return {line: 0, ch: 0};
var offsets = file.lineOffsets || (file.lineOffsets = [0]);
var text = file.text, line, lineStart;
for (var i = offsets.length - 1; i >= 0; --i) if (offsets[i] <= pos) {
line = i * offsetSkipLines;
lineStart = offsets[i];
}
for (;;) {
var eol = text.indexOf("\n", lineStart);
if (eol >= pos || eol < 0) break;
lineStart = eol + 1;
++line;
}
return {line: line, ch: pos - lineStart};
}
var outputPos = exports.outputPos = function(query, file, pos) {
if (query.lineCharPositions) {
var out = asLineChar(file, pos);
if (file.type == "part")
out.line += file.offsetLines != null ? file.offsetLines : asLineChar(file.backing, file.offset).line;
return out;
} else {
return pos + (file.type == "part" ? file.offset : 0);
}
};
// Delete empty fields from result objects
function clean(obj) {
for (var prop in obj) if (obj[prop] == null) delete obj[prop];
return obj;
}
function maybeSet(obj, prop, val) {
if (val != null) obj[prop] = val;
}
// Built-in query types
function compareCompletions(a, b) {
if (typeof a != "string") { a = a.name; b = b.name; }
var aUp = /^[A-Z]/.test(a), bUp = /^[A-Z]/.test(b);
if (aUp == bUp) return a < b ? -1 : a == b ? 0 : 1;
else return aUp ? 1 : -1;
}
function isStringAround(node, start, end) {
return node.type == "Literal" && typeof node.value == "string" &&
node.start == start - 1 && node.end <= end + 1;
}
function pointInProp(objNode, point) {
for (var i = 0; i < objNode.properties.length; i++) {
var curProp = objNode.properties[i];
if (curProp.key.start <= point && curProp.key.end >= point)
return curProp;
}
}
var jsKeywords = ("break do instanceof typeof case else new var " +
"catch finally return void continue for switch while debugger " +
"function this with default if throw delete in try").split(" ");
function findCompletions(srv, query, file) {
if (query.end == null) throw ternError("missing .query.end field");
if (srv.passes.completion) for (var i = 0; i < srv.passes.completion.length; i++) {
var result = srv.passes.completion[i](file, query);
if (result) return result;
}
var wordStart = resolvePos(file, query.end), wordEnd = wordStart, text = file.text;
while (wordStart && acorn.isIdentifierChar(text.charCodeAt(wordStart - 1))) --wordStart;
if (query.expandWordForward !== false)
while (wordEnd < text.length && acorn.isIdentifierChar(text.charCodeAt(wordEnd))) ++wordEnd;
var word = text.slice(wordStart, wordEnd), completions = [], ignoreObj;
if (query.caseInsensitive) word = word.toLowerCase();
var wrapAsObjs = query.types || query.depths || query.docs || query.urls || query.origins;
function gather(prop, obj, depth, addInfo) {
// 'hasOwnProperty' and such are usually just noise, leave them
// out when no prefix is provided.
if ((objLit || query.omitObjectPrototype !== false) && obj == srv.cx.protos.Object && !word) return;
if (query.filter !== false && word &&
(query.caseInsensitive ? prop.toLowerCase() : prop).indexOf(word) !== 0) return;
if (ignoreObj && ignoreObj.props[prop]) return;
for (var i = 0; i < completions.length; ++i) {
var c = completions[i];
if ((wrapAsObjs ? c.name : c) == prop) return;
}
var rec = wrapAsObjs ? {name: prop} : prop;
completions.push(rec);
if (obj && (query.types || query.docs || query.urls || query.origins)) {
var val = obj.props[prop];
infer.resetGuessing();
var type = val.getType();
rec.guess = infer.didGuess();
if (query.types)
rec.type = infer.toString(val);
if (query.docs)
maybeSet(rec, "doc", val.doc || type && type.doc);
if (query.urls)
maybeSet(rec, "url", val.url || type && type.url);
if (query.origins)
maybeSet(rec, "origin", val.origin || type && type.origin);
}
if (query.depths) rec.depth = depth;
if (wrapAsObjs && addInfo) addInfo(rec);
}
var hookname, prop, objType, isKey;
var exprAt = infer.findExpressionAround(file.ast, null, wordStart, file.scope);
var memberExpr, objLit;
// Decide whether this is an object property, either in a member
// expression or an object literal.
if (exprAt) {
if (exprAt.node.type == "MemberExpression" && exprAt.node.object.end < wordStart) {
memberExpr = exprAt;
} else if (isStringAround(exprAt.node, wordStart, wordEnd)) {
var parent = infer.parentNode(exprAt.node, file.ast);
if (parent.type == "MemberExpression" && parent.property == exprAt.node)
memberExpr = {node: parent, state: exprAt.state};
} else if (exprAt.node.type == "ObjectExpression") {
var objProp = pointInProp(exprAt.node, wordEnd);
if (objProp) {
objLit = exprAt;
prop = isKey = objProp.key.name;
} else if (!word && !/:\s*$/.test(file.text.slice(0, wordStart))) {
objLit = exprAt;
prop = isKey = true;
}
}
}
if (objLit) {
// Since we can't use the type of the literal itself to complete
// its properties (it doesn't contain the information we need),
// we have to try asking the surrounding expression for type info.
objType = infer.typeFromContext(file.ast, objLit);
ignoreObj = objLit.node.objType;
} else if (memberExpr) {
prop = memberExpr.node.property;
prop = prop.type == "Literal" ? prop.value.slice(1) : prop.name;
memberExpr.node = memberExpr.node.object;
objType = infer.expressionType(memberExpr);
} else if (text.charAt(wordStart - 1) == ".") {
var pathStart = wordStart - 1;
while (pathStart && (text.charAt(pathStart - 1) == "." || acorn.isIdentifierChar(text.charCodeAt(pathStart - 1)))) pathStart--;
var path = text.slice(pathStart, wordStart - 1);
if (path) {
objType = infer.def.parsePath(path, file.scope).getObjType();
prop = word;
}
}
if (prop != null) {
srv.cx.completingProperty = prop;
if (objType) infer.forAllPropertiesOf(objType, gather);
if (!completions.length && query.guess !== false && objType && objType.guessProperties)
objType.guessProperties(function(p, o, d) {if (p != prop && p != "✖") gather(p, o, d);});
if (!completions.length && word.length >= 2 && query.guess !== false)
for (var prop in srv.cx.props) gather(prop, srv.cx.props[prop][0], 0);
hookname = "memberCompletion";
} else {
infer.forAllLocalsAt(file.ast, wordStart, file.scope, gather);
if (query.includeKeywords) jsKeywords.forEach(function(kw) {
gather(kw, null, 0, function(rec) { rec.isKeyword = true; });
});
hookname = "variableCompletion";
}
if (srv.passes[hookname])
srv.passes[hookname].forEach(function(hook) {hook(file, wordStart, wordEnd, gather);});
if (query.sort !== false) completions.sort(compareCompletions);
srv.cx.completingProperty = null;
return {start: outputPos(query, file, wordStart),
end: outputPos(query, file, wordEnd),
isProperty: !!prop,
isObjectKey: !!isKey,
completions: completions};
}
function findProperties(srv, query) {
var prefix = query.prefix, found = [];
for (var prop in srv.cx.props)
if (prop != "<i>" && (!prefix || prop.indexOf(prefix) === 0)) found.push(prop);
if (query.sort !== false) found.sort(compareCompletions);
return {completions: found};
}
var findExpr = exports.findQueryExpr = function(file, query, wide) {
if (query.end == null) throw ternError("missing .query.end field");
if (query.variable) {
var scope = infer.scopeAt(file.ast, resolvePos(file, query.end), file.scope);
return {node: {type: "Identifier", name: query.variable, start: query.end, end: query.end + 1},
state: scope};
} else {
var start = query.start && resolvePos(file, query.start), end = resolvePos(file, query.end);
var expr = infer.findExpressionAt(file.ast, start, end, file.scope);
if (expr) return expr;
expr = infer.findExpressionAround(file.ast, start, end, file.scope);
if (expr && (expr.node.type == "ObjectExpression" || wide ||
(start == null ? end : start) - expr.node.start < 20 || expr.node.end - end < 20))
return expr;
return null;
}
};
function findExprOrThrow(file, query, wide) {
var expr = findExpr(file, query, wide);
if (expr) return expr;
throw ternError("No expression at the given position.");
}
function ensureObj(tp) {
if (!tp || !(tp = tp.getType()) || !(tp instanceof infer.Obj)) return null;
return tp;
}
function findExprType(srv, query, file, expr) {
var type;
if (expr) {
infer.resetGuessing();
type = infer.expressionType(expr);
}
if (srv.passes["typeAt"]) {
var pos = resolvePos(file, query.end);
srv.passes["typeAt"].forEach(function(hook) {
type = hook(file, pos, expr, type);
});
}
if (!type) throw ternError("No type found at the given position.");
var objProp;
if (expr.node.type == "ObjectExpression" && query.end != null &&
(objProp = pointInProp(expr.node, resolvePos(file, query.end)))) {
var name = objProp.key.name;
var fromCx = ensureObj(infer.typeFromContext(file.ast, expr));
if (fromCx && fromCx.hasProp(name)) {
type = fromCx.hasProp(name);
} else {
var fromLocal = ensureObj(type);
if (fromLocal && fromLocal.hasProp(name))
type = fromLocal.hasProp(name);
}
}
return type;
}
function findTypeAt(srv, query, file) {
var expr = findExpr(file, query), exprName;
var type = findExprType(srv, query, file, expr), exprType = type;
if (query.preferFunction)
type = type.getFunctionType() || type.getType();
else
type = type.getType();
if (expr) {
if (expr.node.type == "Identifier")
exprName = expr.node.name;
else if (expr.node.type == "MemberExpression" && !expr.node.computed)
exprName = expr.node.property.name;
}
if (query.depth != null && typeof query.depth != "number")
throw ternError(".query.depth must be a number");
var result = {guess: infer.didGuess(),
type: infer.toString(exprType, query.depth),
name: type && type.name,
exprName: exprName};
if (type) storeTypeDocs(type, result);
if (!result.doc && exprType.doc) result.doc = exprType.doc;
return clean(result);
}
function findDocs(srv, query, file) {
var expr = findExpr(file, query);
var type = findExprType(srv, query, file, expr);
var result = {url: type.url, doc: type.doc, type: infer.toString(type)};
var inner = type.getType();
if (inner) storeTypeDocs(inner, result);
return clean(result);
}
function storeTypeDocs(type, out) {
if (!out.url) out.url = type.url;
if (!out.doc) out.doc = type.doc;
if (!out.origin) out.origin = type.origin;
var ctor, boring = infer.cx().protos;
if (!out.url && !out.doc && type.proto && (ctor = type.proto.hasCtor) &&
type.proto != boring.Object && type.proto != boring.Function && type.proto != boring.Array) {
out.url = ctor.url;
out.doc = ctor.doc;
}
}
var getSpan = exports.getSpan = function(obj) {
if (!obj.origin) return;
if (obj.originNode) {
var node = obj.originNode;
if (/^Function/.test(node.type) && node.id) node = node.id;
return {origin: obj.origin, node: node};
}
if (obj.span) return {origin: obj.origin, span: obj.span};
};
var storeSpan = exports.storeSpan = function(srv, query, span, target) {
target.origin = span.origin;
if (span.span) {
var m = /^(\d+)\[(\d+):(\d+)\]-(\d+)\[(\d+):(\d+)\]$/.exec(span.span);
target.start = query.lineCharPositions ? {line: Number(m[2]), ch: Number(m[3])} : Number(m[1]);
target.end = query.lineCharPositions ? {line: Number(m[5]), ch: Number(m[6])} : Number(m[4]);
} else {
var file = srv.findFile(span.origin);
target.start = outputPos(query, file, span.node.start);
target.end = outputPos(query, file, span.node.end);
}
};
function findDef(srv, query, file) {
var expr = findExpr(file, query);
var type = findExprType(srv, query, file, expr);
if (infer.didGuess()) return {};
var span = getSpan(type);
var result = {url: type.url, doc: type.doc, origin: type.origin};
if (type.types) for (var i = type.types.length - 1; i >= 0; --i) {
var tp = type.types[i];
storeTypeDocs(tp, result);
if (!span) span = getSpan(tp);
}
if (span && span.node) { // refers to a loaded file
var spanFile = span.node.sourceFile || srv.findFile(span.origin);
var start = outputPos(query, spanFile, span.node.start), end = outputPos(query, spanFile, span.node.end);
result.start = start; result.end = end;
result.file = span.origin;
var cxStart = Math.max(0, span.node.start - 50);
result.contextOffset = span.node.start - cxStart;
result.context = spanFile.text.slice(cxStart, cxStart + 50);
} else if (span) { // external
result.file = span.origin;
storeSpan(srv, query, span, result);
}
return clean(result);
}
function findRefsToVariable(srv, query, file, expr, checkShadowing) {
var name = expr.node.name;
for (var scope = expr.state; scope && !(name in scope.props); scope = scope.prev) {}
if (!scope) throw ternError("Could not find a definition for " + name + " " + !!srv.cx.topScope.props.x);
var type, refs = [];
function storeRef(file) {
return function(node, scopeHere) {
if (checkShadowing) for (var s = scopeHere; s != scope; s = s.prev) {
var exists = s.hasProp(checkShadowing);
if (exists)
throw ternError("Renaming `" + name + "` to `" + checkShadowing + "` would make a variable at line " +
(asLineChar(file, node.start).line + 1) + " point to the definition at line " +
(asLineChar(file, exists.name.start).line + 1));
}
refs.push({file: file.name,
start: outputPos(query, file, node.start),
end: outputPos(query, file, node.end)});
};
}
if (scope.originNode) {
type = "local";
if (checkShadowing) {
for (var prev = scope.prev; prev; prev = prev.prev)
if (checkShadowing in prev.props) break;
if (prev) infer.findRefs(scope.originNode, scope, checkShadowing, prev, function(node) {
throw ternError("Renaming `" + name + "` to `" + checkShadowing + "` would shadow the definition used at line " +
(asLineChar(file, node.start).line + 1));
});
}
infer.findRefs(scope.originNode, scope, name, scope, storeRef(file));
} else {
type = "global";
for (var i = 0; i < srv.files.length; ++i) {
var cur = srv.files[i];
infer.findRefs(cur.ast, cur.scope, name, scope, storeRef(cur));
}
}
return {refs: refs, type: type, name: name};
}
function findRefsToProperty(srv, query, expr, prop) {
var objType = infer.expressionType(expr).getObjType();
if (!objType) throw ternError("Couldn't determine type of base object.");
var refs = [];
function storeRef(file) {
return function(node) {
refs.push({file: file.name,
start: outputPos(query, file, node.start),
end: outputPos(query, file, node.end)});
};
}
for (var i = 0; i < srv.files.length; ++i) {
var cur = srv.files[i];
infer.findPropRefs(cur.ast, cur.scope, objType, prop.name, storeRef(cur));
}
return {refs: refs, name: prop.name};
}
function findRefs(srv, query, file) {
var expr = findExprOrThrow(file, query, true);
if (expr.node.type == "Identifier") {
return findRefsToVariable(srv, query, file, expr);
} else if (expr.node.type == "MemberExpression" && !expr.node.computed) {
var p = expr.node.property;
expr.node = expr.node.object;
return findRefsToProperty(srv, query, expr, p);
} else if (expr.node.type == "ObjectExpression") {
var pos = resolvePos(file, query.end);
for (var i = 0; i < expr.node.properties.length; ++i) {
var k = expr.node.properties[i].key;
if (k.start <= pos && k.end >= pos)
return findRefsToProperty(srv, query, expr, k);
}
}
throw ternError("Not at a variable or property name.");
}
function buildRename(srv, query, file) {
if (typeof query.newName != "string") throw ternError(".query.newName should be a string");
var expr = findExprOrThrow(file, query);
if (!expr || expr.node.type != "Identifier") throw ternError("Not at a variable.");
var data = findRefsToVariable(srv, query, file, expr, query.newName), refs = data.refs;
delete data.refs;
data.files = srv.files.map(function(f){return f.name;});
var changes = data.changes = [];
for (var i = 0; i < refs.length; ++i) {
var use = refs[i];
use.text = query.newName;
changes.push(use);
}
return data;
}
function listFiles(srv) {
return {files: srv.files.map(function(f){return f.name;})};
}
exports.version = "0.11.1";
});
|
import * as React from 'react';
import createSvgIcon from './utils/createSvgIcon';
import { jsx as _jsx } from "react/jsx-runtime";
export default createSvgIcon( /*#__PURE__*/_jsx("path", {
d: "M6.99 11L3 15l3.99 4v-3H14v-2H6.99v-3zM21 9l-3.99-4v3H10v2h7.01v3L21 9z"
}), 'SwapHoriz');
|
/* *
*
* (c) 2010-2021 Torstein Honsi
*
* License: www.highcharts.com/license
*
* Dark theme for highcharts JS
*
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
*
* */
'use strict';
import H from '../../Core/Globals.js';
import O from '../../Core/Options.js';
var setOptions = O.setOptions;
import U from '../../Core/Utilities.js';
var createElement = U.createElement;
// Load the fonts
createElement('link', {
href: 'https://fonts.googleapis.com/css?family=Unica+One',
rel: 'stylesheet',
type: 'text/css'
}, null, document.getElementsByTagName('head')[0]);
H.theme = {
colors: ['#2b908f', '#90ee7e', '#f45b5b', '#7798BF', '#aaeeee', '#ff0066',
'#eeaaee', '#55BF3B', '#DF5353', '#7798BF', '#aaeeee'],
chart: {
backgroundColor: {
linearGradient: { x1: 0, y1: 0, x2: 1, y2: 1 },
stops: [
[0, '#2a2a2b'],
[1, '#3e3e40']
]
},
style: {
fontFamily: '\'Unica One\', sans-serif'
},
plotBorderColor: '#606063'
},
title: {
style: {
color: '#E0E0E3',
textTransform: 'uppercase',
fontSize: '20px'
}
},
subtitle: {
style: {
color: '#E0E0E3',
textTransform: 'uppercase'
}
},
xAxis: {
gridLineColor: '#707073',
labels: {
style: {
color: '#E0E0E3'
}
},
lineColor: '#707073',
minorGridLineColor: '#505053',
tickColor: '#707073',
title: {
style: {
color: '#A0A0A3'
}
}
},
yAxis: {
gridLineColor: '#707073',
labels: {
style: {
color: '#E0E0E3'
}
},
lineColor: '#707073',
minorGridLineColor: '#505053',
tickColor: '#707073',
tickWidth: 1,
title: {
style: {
color: '#A0A0A3'
}
}
},
tooltip: {
backgroundColor: 'rgba(0, 0, 0, 0.85)',
style: {
color: '#F0F0F0'
}
},
plotOptions: {
series: {
dataLabels: {
color: '#F0F0F3',
style: {
fontSize: '13px'
}
},
marker: {
lineColor: '#333'
}
},
boxplot: {
fillColor: '#505053'
},
candlestick: {
lineColor: 'white'
},
errorbar: {
color: 'white'
}
},
legend: {
backgroundColor: 'rgba(0, 0, 0, 0.5)',
itemStyle: {
color: '#E0E0E3'
},
itemHoverStyle: {
color: '#FFF'
},
itemHiddenStyle: {
color: '#606063'
},
title: {
style: {
color: '#C0C0C0'
}
}
},
credits: {
style: {
color: '#666'
}
},
labels: {
style: {
color: '#707073'
}
},
drilldown: {
activeAxisLabelStyle: {
color: '#F0F0F3'
},
activeDataLabelStyle: {
color: '#F0F0F3'
}
},
navigation: {
buttonOptions: {
symbolStroke: '#DDDDDD',
theme: {
fill: '#505053'
}
}
},
// scroll charts
rangeSelector: {
buttonTheme: {
fill: '#505053',
stroke: '#000000',
style: {
color: '#CCC'
},
states: {
hover: {
fill: '#707073',
stroke: '#000000',
style: {
color: 'white'
}
},
select: {
fill: '#000003',
stroke: '#000000',
style: {
color: 'white'
}
}
}
},
inputBoxBorderColor: '#505053',
inputStyle: {
backgroundColor: '#333',
color: 'silver'
},
labelStyle: {
color: 'silver'
}
},
navigator: {
handles: {
backgroundColor: '#666',
borderColor: '#AAA'
},
outlineColor: '#CCC',
maskFill: 'rgba(255,255,255,0.1)',
series: {
color: '#7798BF',
lineColor: '#A6C7ED'
},
xAxis: {
gridLineColor: '#505053'
}
},
scrollbar: {
barBackgroundColor: '#808083',
barBorderColor: '#808083',
buttonArrowColor: '#CCC',
buttonBackgroundColor: '#606063',
buttonBorderColor: '#606063',
rifleColor: '#FFF',
trackBackgroundColor: '#404043',
trackBorderColor: '#404043'
}
};
// Apply the theme
setOptions(H.theme);
|
import React, { useState, useMemo, useEffect, useRef } from 'react';
import { graphql, navigate } from 'gatsby';
import ChapterList from './components/chapter/ChapterList';
import useChapters from '../hooks/use-chapters';
import { getChaptersIndex } from '../utils/index';
import NavBar from './components/chapter/NavBar';
import Footer from './components/chapter/Footer';
import LearningInterface from './components/chapter/LearningInterface';
import CodingInterfaceTaquito from './components/chapter/CodingInterfaceTaquito';
import SEO from 'src/components/Seo';
import userAtom from 'src/atoms/user-atom';
import isUserAtom from 'src/atoms/is-user-atom';
import { useAtom } from 'jotai';
import { updateProgress } from 'src/api';
import { trackEventWithProperties } from 'src/utils/analytics';
export const query = graphql`
query($slug: String!, $module: String!) {
mdx(frontmatter: { slug: { eq: $slug }, filterBy: { eq: $module } }) {
frontmatter {
title
chapter
slug
filterBy
editor {
language
startingCode
answer
}
}
body
}
}
`;
const ChapterWithLiveEditorTemplate = ({
data: { mdx: chapter },
location,
}) => {
const [user] = useAtom(userAtom);
const [isUser] = useAtom(isUserAtom);
const [isChapterDrawerOpen, setIsChapterDrawerOpen] = useState(false);
const progress =
typeof window !== `undefined` &&
JSON.parse(localStorage.getItem('progress') || '{}');
const chapterHeading = useMemo(
() => `${chapter.frontmatter.chapter} - ${chapter.frontmatter.title}`,
);
const chapters = useMemo(() => useChapters(chapter.frontmatter.filterBy));
const chapterIndex = useMemo(
() => getChaptersIndex(chapters, chapter.frontmatter.slug),
[chapters],
);
useEffect(() => {
trackEventWithProperties('view modules chapters', {
slug: `${chapter.frontmatter.filterBy}/${chapter.frontmatter.slug}`,
title: chapter.frontmatter.title,
});
}, []);
async function markChapterAsDone() {
if (!progress[chapter.frontmatter.filterBy])
progress[chapter.frontmatter.filterBy] = {};
progress[chapter.frontmatter.filterBy][chapter.frontmatter.slug] = true;
typeof window != 'undefined' &&
localStorage.setItem('progress', JSON.stringify(progress));
trackEventWithProperties('successfully complete modules chapters', {
slug: `${chapter.frontmatter.filterBy}/${chapter.frontmatter.slug}`,
title: chapter.frontmatter.title,
});
if (isUser) {
console.log('🔥Sync with backend');
updateProgress(
user,
Number.parseInt(chapter.frontmatter.slug.split('-')[1]),
Number.parseInt(chapter.frontmatter.filterBy.split('-')[1]),
).then(res => console.log('🔥', res));
}
}
return (
<div className={`overflow-hidden`}>
<SEO title={chapterHeading} />
<NavBar
chapter={chapterHeading}
module={chapter.frontmatter.filterBy}
location={location}
/>
<main
className={`grid grid-cols-2 gap-x-6 bg-base-900 h-full relative`}
style={{ height: 'calc(100vh - 5rem - 3.5em)' }}
>
<ChapterList
isOpen={isChapterDrawerOpen}
setIsOpen={setIsChapterDrawerOpen}
chapters={chapters}
activeSlug={chapter.frontmatter.slug}
/>
<LearningInterface
heading={chapter.frontmatter.title}
body={chapter.body}
setDrawerOpen={setIsChapterDrawerOpen}
/>
<CodingInterfaceTaquito
code={chapter.frontmatter.editor.startingCode}
answer={chapter.frontmatter.editor.answer}
/>
</main>
<Footer
chapterIndex={chapterIndex}
module={chapter.frontmatter.filterBy}
markDone={markChapterAsDone}
/>
</div>
);
};
export default ChapterWithLiveEditorTemplate;
|
import React from 'react';
import {
Show,
SimpleShowLayout,
TextField,
} from '../../core';
import PreQuestionTitle from './PreQuestionTitle';
const PreQuestionDetails = props => (
<Show title={<PreQuestionTitle />} {...props}>
<SimpleShowLayout>
<TextField source="text" />
</SimpleShowLayout>
</Show>
);
export default PreQuestionDetails;
|
/*
* Copyright 2020 Google LLC
*
* 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
*
* https://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.
*/
import {store} from '../store';
import 'wicg-inert';
export const activateSearch = store.action(() => {
// Scroll the window to the top of the page.
const html = /** @type {HTMLElement} */ (document.querySelector('html'));
html.scrollTop = 0;
// Mark all interactive elements as inert so the user can't tab out of the
// search modal.
document.querySelectorAll('[data-search-inert]').forEach(item => {
/** @type {HTMLElement} */ (item).inert = true;
});
// Prevent the user from scrolling the page underneath the search modal.
document.body.classList.add('overflow-hidden');
return {isSearchActive: true};
});
export const deactivateSearch = store.action(() => {
// Re-enable interactive elements now that the search modal is closed.
document.querySelectorAll('[data-search-inert]').forEach(item => {
/** @type {HTMLElement} */ (item).inert = false;
});
// Re-enable page scrolling.
document.body.classList.remove('overflow-hidden');
return {isSearchActive: false};
});
|
'use strict';
var app = angular.module('AlpGatewayApp', [
'ngRoute',
'mobile-angular-ui',
'mobile-angular-ui.gestures',
'mobile-angular-ui.core.sharedState',
'oc.lazyLoad'
]);
app.config(function($routeProvider) {
$routeProvider.when('/', {templateUrl: '../javascripts/home.html', reloadOnSearch: false});
$routeProvider.when('/showAdd', {templateUrl: '../javascripts/showAdd.html', reloadOnSearch: false});
$routeProvider.when('/showXbeePlug', {templateUrl: '../javascripts/showPlug.html', reloadOnSearch: false});
$routeProvider.when('/showSwitch', {templateUrl: '../javascripts/showSwitch.html', reloadOnSearch: false});
$routeProvider.when('/showBlePlug', {templateUrl: '../javascripts/showBlePlug.html', reloadOnSearch: false});
$routeProvider.when('/showBleDoor', {templateUrl: '../javascripts/showBleDoor.html', reloadOnSearch: false});
$routeProvider.when('/showBleBlind', {templateUrl: '../javascripts/showBleBlind.html', reloadOnSearch: false});
$routeProvider.when('/showRule', {templateUrl: '../javascripts/showRule.html', reloadOnSearch: false});
$routeProvider.when('/showRules', {templateUrl: '../javascripts/showRules.html', reloadOnSearch: false});
});
app.config(['$locationProvider', function($locationProvider) {
$locationProvider.hashPrefix('');
}]);
app.controller('MainController', function($rootScope, $scope, $http, SharedState, $ocLazyLoad) {
//$ocLazyLoad.load('../javascripts/client_blePlug.js');
$rootScope.waitStatus = false;
$rootScope.timeoutID = -1;
$scope.devices = [];
$rootScope.rules = [];
$scope.$on("$routeChangeStart", function(event, newUrl, oldUrl) {
if (newUrl)
if (newUrl.$$route.originalPath == "/"){
console.log("refresh devices");
clearTimeout($rootScope.timeoutID);
$scope.refreshDevices();
}else if (newUrl.$$route.originalPath == "/showRules"){
console.log("refresh rules");
clearTimeout($rootScope.timeoutID);
$scope.refreshRules();
}
});
$rootScope.$on('$routeChangeStart', function() {
$rootScope.loading = true;
});
$rootScope.$on('$routeChangeSuccess', function() {
if (!$rootScope.waitStatus)
$rootScope.loading = false;
});
$scope.showAdd = function() {
console.log("show add device");
location.href="#/showAdd"
};
$scope.refreshDevices = function(){
$scope.devices = [];
$http({
method: 'GET',
url: '/refresh'
}).then(function successCallback(response) {
//$scope.devices = response.data;
console.log(response.data);
$scope.devices = response.data;
}, function errorCallback(response) {
console.log( "failure message: " + response.data);
});
};
$scope.refreshRules = function(){
$rootScope.rules = [];
$http({
method: 'GET',
url: '/refreshRules'
}).then(function successCallback(response) {
console.log(response.data);
if(response.data.rules)
$rootScope.rules = response.data.rules;
}, function errorCallback(response) {
console.log( "failure message: " + response.data);
}
);
};
$scope.trimName = function(txt){
var regexAplha = /[^0-9a-z]/gi;
txt = txt.replace(regexAplha, '');
txt = txt.substr(txt.length-4);
return txt;
};
});
|
/**
* Copyright 2018 IBM All Rights Reserved.
*
* SPDX-License-Identifier: Apache-2.0
*/
'use strict';
const rewire = require('rewire');
const ClientUtils = rewire('../lib/client-utils');
const chai = require('chai');
const sinon = require('sinon');
const should = chai.should();
describe('client-utils', () => {
let sandbox;
let revert;
let FakeLogger;
beforeEach(() => {
revert = [];
sandbox = sinon.createSandbox();
FakeLogger = {
debug : () => {},
error: () => {}
};
sinon.stub(FakeLogger, 'debug');
sinon.stub(FakeLogger, 'error');
revert.push(ClientUtils.__set__('logger', FakeLogger));
});
afterEach(() => {
if (revert.length) {
revert.forEach(Function.prototype.call, Function.prototype.call);
}
sandbox.restore();
});
describe('#buildProposal', () => {
let ChaincodeInvocationSpecStub;
let setChaincodeSpecStub;
let ChaincodeProposalPayloadStub;
let setInputStub;
let setTransientMapStub;
let ProposalStub;
let setHeaderStub;
let setPayloadStub;
beforeEach(() => {
setChaincodeSpecStub = sandbox.stub();
ChaincodeInvocationSpecStub = sandbox.stub().returns({
setChaincodeSpec: setChaincodeSpecStub,
toBuffer: () => 'chaincode-invocation-spec'
});
revert.push(ClientUtils.__set__('_ccProto.ChaincodeInvocationSpec', ChaincodeInvocationSpecStub));
setInputStub = sandbox.stub();
setTransientMapStub = sandbox.stub();
ChaincodeProposalPayloadStub = sandbox.stub().returns({
setInput: setInputStub,
setTransientMap: setTransientMapStub,
toBuffer: () => 'payload'
});
revert.push(ClientUtils.__set__('_proposalProto.ChaincodeProposalPayload', ChaincodeProposalPayloadStub));
setHeaderStub = sandbox.stub();
setPayloadStub = sandbox.stub();
ProposalStub = sandbox.stub().returns({
setHeader: setHeaderStub,
setPayload: setPayloadStub
});
revert.push(ClientUtils.__set__('_proposalProto.Proposal', ProposalStub));
});
it('should return a valid proposal when transientMap is an object', () => {
const invokeSpec = 'invoke-spec';
const header = {toBuffer: () => 'header'};
const transientMap = {};
const proposal = ClientUtils.buildProposal(invokeSpec, header, transientMap);
sinon.assert.called(ChaincodeInvocationSpecStub);
sinon.assert.calledWith(setChaincodeSpecStub, invokeSpec);
sinon.assert.called(ChaincodeProposalPayloadStub);
sinon.assert.calledWith(setInputStub, 'chaincode-invocation-spec');
sinon.assert.calledWith(FakeLogger.debug, sinon.match(/adding in transientMap/));
sinon.assert.calledWith(setHeaderStub, 'header');
sinon.assert.calledWith(setPayloadStub, 'payload');
proposal.should.deep.equal(new ProposalStub());
});
it('should return a valid proposal when transientMap is not an object', () => {
const invokeSpec = 'invoke-spec';
const header = {toBuffer: () => 'header'};
const transientMap = undefined;
const proposal = ClientUtils.buildProposal(invokeSpec, header, transientMap);
sinon.assert.called(ChaincodeInvocationSpecStub);
sinon.assert.calledWith(setChaincodeSpecStub, invokeSpec);
sinon.assert.called(ChaincodeProposalPayloadStub);
sinon.assert.calledWith(setInputStub, 'chaincode-invocation-spec');
sinon.assert.calledWith(FakeLogger.debug, sinon.match(/not adding a transientMap/));
sinon.assert.calledWith(setHeaderStub, 'header');
sinon.assert.calledWith(setPayloadStub, 'payload');
proposal.should.deep.equal(new ProposalStub());
});
});
describe('#sendPeersProposal', () => {
let settleStub;
let sendProposalStub;
let mockPeer;
let mockResult;
beforeEach(() => {
settleStub = sandbox.stub();
revert.push(ClientUtils.__set__('settle', settleStub));
sendProposalStub = sandbox.stub();
mockPeer = {sendProposal: sendProposalStub};
mockResult = {isFulfilled: sandbox.stub(), value: sandbox.stub(), reason: sandbox.stub()};
});
it ('should return valid responses for one peer where proposals are fulfilled', async () => {
sendProposalStub.returns(Promise.resolve('proposal'));
mockResult.isFulfilled.returns(true);
mockResult.value.returns('value');
settleStub.returns([mockResult]);
const responses = await ClientUtils.sendPeersProposal(mockPeer, 'proposal', 0);
sinon.assert.calledWith(sendProposalStub, 'proposal', 0);
sinon.assert.calledWith(settleStub, [sendProposalStub()]);
sinon.assert.called(mockResult.isFulfilled);
sinon.assert.calledTwice(mockResult.value);
responses.should.deep.equal(['value']);
});
it ('should return valid responses for one peer where proposals are not fulfilled', async () => {
sendProposalStub.returns(Promise.resolve('proposal'));
mockResult.isFulfilled.returns(false);
mockResult.reason.returns('reason');
settleStub.returns([mockResult]);
const responses = await ClientUtils.sendPeersProposal(mockPeer, 'proposal', 0);
sinon.assert.calledWith(sendProposalStub, 'proposal', 0);
sinon.assert.calledWith(settleStub, [sendProposalStub()]);
sinon.assert.called(mockResult.isFulfilled);
sinon.assert.calledTwice(mockResult.reason);
responses.should.deep.equal(['reason']);
});
it('should return valid responses for two peers where one proposal is fulfilled and one is not', async () => {
sendProposalStub.returns(Promise.resolve('proposal'));
mockResult.isFulfilled.onCall(0).returns(false);
mockResult.isFulfilled.onCall(1).returns(true);
mockResult.reason.returns('reason');
mockResult.value.returns('value');
settleStub.returns([mockResult, mockResult]);
const responses = await ClientUtils.sendPeersProposal([mockPeer, mockPeer], 'proposal', 0);
sinon.assert.calledWith(sendProposalStub, 'proposal', 0);
sinon.assert.called(settleStub);
sinon.assert.calledTwice(mockResult.isFulfilled);
sinon.assert.calledTwice(mockResult.reason);
sinon.assert.calledTwice(mockResult.value);
responses.should.deep.equal(['reason', 'value']);
});
});
describe('#signProposal', () => {
let toBufferStub;
let signStub;
beforeEach(() => {
toBufferStub = sandbox.stub();
signStub = sandbox.stub();
revert.push(ClientUtils.__set__('Buffer.from', (value) => value));
});
it('should return a valid signed proposal', () => {
toBufferStub.returns('proposal');
signStub.returns('sign');
const signingIdentity = {sign: signStub};
const proposal = {toBuffer: toBufferStub};
const signedProposal = ClientUtils.signProposal(signingIdentity, proposal);
signedProposal.should.deep.equal({signature: 'sign', proposal_bytes: 'proposal'});
});
});
describe('#toEnvelope', () => {
it('should return a valid envelope', () => {
const data = {signature: 'signature', proposal_bytes: 'proposal'};
const envelope = ClientUtils.toEnvelope(data);
envelope.should.deep.equal({signature: 'signature', payload: 'proposal'});
});
});
describe('#buildChannelHeader', () => {
let channelHeaderStub;
let channelHeaderFunctionStub;
let chaincodeIDStub;
let chaincodeIDFunctionsStub;
let headerExtStub;
let headerExtFunctionStub;
beforeEach(() => {
channelHeaderStub = sandbox.stub();
channelHeaderFunctionStub = {
setType: sandbox.stub(),
setVersion: sandbox.stub(),
setChannelId: sandbox.stub(),
setTxId: sandbox.stub(),
setEpoch: sandbox.stub(),
setExtension: sandbox.stub(),
setTimestamp: sandbox.stub(),
setTlsCertHash: sandbox.stub()
};
channelHeaderStub.returns(channelHeaderFunctionStub);
revert.push(ClientUtils.__set__('_commonProto.ChannelHeader', channelHeaderStub));
sandbox.stub(ClientUtils, 'buildCurrentTimestamp').returns(null);
chaincodeIDFunctionsStub = {setName: sandbox.stub()};
chaincodeIDStub = sandbox.stub().returns(chaincodeIDFunctionsStub);
revert.push(ClientUtils.__set__('_ccProto.ChaincodeID', chaincodeIDStub));
headerExtFunctionStub = {
setChaincodeId: sandbox.stub(),
toBuffer: sandbox.stub()
};
headerExtStub = sandbox.stub().returns(headerExtFunctionStub);
revert.push(ClientUtils.__set__('_proposalProto.ChaincodeHeaderExtension', headerExtStub));
});
it('should return a channel header without any extra info', () => {
const channelHeader = ClientUtils.buildChannelHeader('type', 'channel-id', 0);
sinon.assert.called(channelHeaderStub);
sinon.assert.calledWith(channelHeaderFunctionStub.setType, 'type');
sinon.assert.calledWith(channelHeaderFunctionStub.setChannelId, 'channel-id');
sinon.assert.calledWith(channelHeaderFunctionStub.setTxId, '0');
channelHeader.should.deep.equal(channelHeaderFunctionStub);
});
it('should return a channel header with all extra info', () => {
const channelHeader = ClientUtils.buildChannelHeader('type', 'channel-id', 0, '0', 'chaincode-id', 'timestamp', 'client-cert-hash');
sinon.assert.called(channelHeaderStub);
sinon.assert.calledWith(channelHeaderFunctionStub.setType, 'type');
sinon.assert.calledWith(channelHeaderFunctionStub.setChannelId, 'channel-id');
sinon.assert.calledWith(channelHeaderFunctionStub.setTxId, '0');
sinon.assert.calledWith(channelHeaderFunctionStub.setEpoch, '0');
sinon.assert.calledWith(chaincodeIDFunctionsStub.setName, 'chaincode-id');
sinon.assert.calledWith(headerExtFunctionStub.setChaincodeId, chaincodeIDFunctionsStub);
sinon.assert.called(channelHeaderFunctionStub.setExtension);
sinon.assert.called(channelHeaderFunctionStub.setTlsCertHash);
channelHeader.should.deep.equal(channelHeaderFunctionStub);
});
});
describe('#buildHeader', () => {
let signatureHeaderFunctionStub;
let signatureHeaderStub;
let headerFunctionStub;
let headerStub;
let mockCreator;
let mockChannelHeader;
beforeEach(() => {
signatureHeaderFunctionStub = {setCreator: sandbox.stub(), setNonce: sandbox.stub(), toBuffer: sandbox.stub()};
signatureHeaderStub = sandbox.stub().returns(signatureHeaderFunctionStub);
revert.push(ClientUtils.__set__('_commonProto.SignatureHeader', signatureHeaderStub));
headerFunctionStub = {setSignatureHeader: () => {}, setChannelHeader: () => {}};
sandbox.stub(headerFunctionStub);
headerStub = sandbox.stub().returns(headerFunctionStub);
revert.push(ClientUtils.__set__('_commonProto.Header', headerStub));
mockCreator = {serialize: () => {}};
sandbox.stub(mockCreator);
mockChannelHeader = {toBuffer: () => {}};
sandbox.stub(mockChannelHeader);
});
it('should return a valid header', () => {
mockCreator.serialize.returns('serialize');
const header = ClientUtils.buildHeader(mockCreator, mockChannelHeader, 'nonce');
sinon.assert.calledWith(signatureHeaderFunctionStub.setCreator, 'serialize');
sinon.assert.calledWith(signatureHeaderFunctionStub.setNonce, 'nonce');
sinon.assert.called(headerFunctionStub.setSignatureHeader);
sinon.assert.called(headerFunctionStub.setChannelHeader);
sinon.assert.called(signatureHeaderFunctionStub.toBuffer);
header.should.deep.equal(headerStub());
});
});
describe('#checkProposalRequest', () => {
it('should return the correct error message if no data given', () => {
const result = ClientUtils.checkProposalRequest();
should.equal(result, 'Missing input request object on the proposal request');
});
it('should return the correct error message if no request.chaincodeId given', () => {
const result = ClientUtils.checkProposalRequest({chaincodeId: 0});
should.equal(result, 'Missing "chaincodeId" parameter in the proposal request');
});
it('should return the correct error message if no request.rxId is given', () => {
const result = ClientUtils.checkProposalRequest({chaincodeId: '0'}, {});
should.equal(result, 'Missing "txId" parameter in the proposal request');
});
it('should return null if no request.rxId or all are given', () => {
const result = ClientUtils.checkProposalRequest({chaincodeId: '0'});
should.equal(result, null);
});
});
describe('#checkInstallRequest', () => {
it('should return the correct error message if no data is given', () => {
const result = ClientUtils.checkInstallRequest();
should.equal(result, 'Missing input request object on the proposal request');
});
it('should return the correct error message if request.chaincodeVersion is not given', () => {
const result = ClientUtils.checkInstallRequest({});
should.equal(result, 'Missing "chaincodeVersion" parameter in the proposal request');
});
it('should return the correct error message if request.chaincodeVersion is given', () => {
const result = ClientUtils.checkInstallRequest({chaincodeVersion: '1'});
should.equal(result, null);
});
});
describe('#translateCCType', () => {
const ccTypes = {GOLANG: 'GOLANG', CAR: 'CAR', JAVA: 'JAVA', NODE: 'NODE'};
beforeEach(() => {
revert.push(ClientUtils.__set__('_ccProto.ChaincodeSpec.Type', ccTypes));
});
it('should return the correct default type', () => {
const type = ClientUtils.translateCCType();
type.should.equal('GOLANG');
});
it('should return the correct cc type', () => {
const type = ClientUtils.translateCCType('Car');
type.should.equal('CAR');
});
});
describe('#ccTypeToString', () => {
it('should return the correct string', () => {
ClientUtils.ccTypeToString(ClientUtils.__get__('_ccProto.ChaincodeSpec.Type.GOLANG')).should.equal('golang');
ClientUtils.ccTypeToString(ClientUtils.__get__('_ccProto.ChaincodeSpec.Type.CAR')).should.equal('car');
ClientUtils.ccTypeToString(ClientUtils.__get__('_ccProto.ChaincodeSpec.Type.JAVA')).should.equal('java');
ClientUtils.ccTypeToString(ClientUtils.__get__('_ccProto.ChaincodeSpec.Type.NODE')).should.equal('node');
});
});
describe('#buildCurrentTimestamp', () => {
let setSecondsStub;
let setNanosStub;
let dateStub;
let timestampStub;
let getTimeStub;
beforeEach(() => {
setSecondsStub = sandbox.stub();
setNanosStub = sandbox.stub();
getTimeStub = sandbox.stub();
dateStub = sandbox.stub().returns({getTime: getTimeStub});
timestampStub = sandbox.stub().returns({setSeconds: setSecondsStub, setNanos: setNanosStub});
revert.push(ClientUtils.__set__('_timestampProto.Timestamp', timestampStub));
revert.push(ClientUtils.__set__('Date', dateStub));
});
it('should create a valid timestamp', () => {
getTimeStub.returns(10000);
const timestamp = ClientUtils.buildCurrentTimestamp();
sinon.assert.calledWith(setSecondsStub, 10);
sinon.assert.calledWith(setNanosStub, 0);
timestamp.should.deep.equal(timestampStub());
});
});
});
|
import Vue from 'vue';
import { createComponentWithStore } from 'helpers/vue_mount_component_helper';
import { createStore } from '~/ide/stores';
import newDropdown from '~/ide/components/new_dropdown/index.vue';
describe('new dropdown component', () => {
let store;
let vm;
beforeEach(() => {
store = createStore();
const component = Vue.extend(newDropdown);
vm = createComponentWithStore(component, store, {
branch: 'master',
path: '',
mouseOver: false,
type: 'tree',
});
vm.$store.state.currentProjectId = 'abcproject';
vm.$store.state.path = '';
vm.$store.state.trees['abcproject/mybranch'] = {
tree: [],
};
vm.$mount();
jest.spyOn(vm.$refs.newModal, 'open').mockImplementation(() => {});
});
afterEach(() => {
vm.$destroy();
});
it('renders new file, upload and new directory links', () => {
const buttons = vm.$el.querySelectorAll('.dropdown-menu button');
expect(buttons[0].textContent.trim()).toBe('New file');
expect(buttons[1].textContent.trim()).toBe('Upload file');
expect(buttons[2].textContent.trim()).toBe('New directory');
});
describe('createNewItem', () => {
it('opens modal for a blob when new file is clicked', () => {
vm.$el.querySelectorAll('.dropdown-menu button')[0].click();
expect(vm.$refs.newModal.open).toHaveBeenCalledWith('blob', '');
});
it('opens modal for a tree when new directory is clicked', () => {
vm.$el.querySelectorAll('.dropdown-menu button')[2].click();
expect(vm.$refs.newModal.open).toHaveBeenCalledWith('tree', '');
});
});
describe('isOpen', () => {
it('scrolls dropdown into view', (done) => {
jest.spyOn(vm.$refs.dropdownMenu, 'scrollIntoView').mockImplementation(() => {});
vm.isOpen = true;
setImmediate(() => {
expect(vm.$refs.dropdownMenu.scrollIntoView).toHaveBeenCalledWith({
block: 'nearest',
});
done();
});
});
});
describe('delete entry', () => {
it('calls delete action', () => {
jest.spyOn(vm, 'deleteEntry').mockImplementation(() => {});
vm.$el.querySelectorAll('.dropdown-menu button')[4].click();
expect(vm.deleteEntry).toHaveBeenCalledWith('');
});
});
});
|
var fs = require('fs')
, util = require('util')
, crypto = require('crypto')
, stream = require('stream')
, path = require('path')
, mime = require('mime')
, rfc822 = require('./rfc822')
;
function File (options) {
stream.Stream.call(this)
this.writable = true
this.readable = true
this.buffers = []
var self = this
if (typeof options === 'string') options = {path:options}
if (!options.index) options.index = 'index.html'
self.writable = (typeof options.writable === "undefined") ? true : options.writable
self.readable = (typeof options.readable === "undefined") ? true : options.readable
self.path = options.path
self.index = options.index
self.on('pipe', function (src) {
this.src = src
})
this.buffering = true
this.mimetype = options.mimetype || mime.getType(this.path.slice(this.path.lastIndexOf('.')+1))
var stopBuffering = function () {
self.buffering = false
while (self.buffers.length) {
self.emit('data', self.buffers.shift())
}
if (self.ended) self.emit('end')
}
fs.stat(options.path, function (err, stats) {
var finish = function (err, stats) {
self.stat = stats
if (err && err.code === 'ENOENT' && !self.dest && !self.src) self.src = self.path
if (err && !self.dest && !self.src) return self.emit('error', err)
if (err && self.dest && !self.dest.writeHead) return self.emit('error', err)
// See if writes are disabled
if (self.src && self.src.method &&
!self.writable && self.dest.writeHead &&
(self.src.method === 'PUT' || self.src.method === 'POST')) {
self.dest.writeHead(405, {'content-type':'text/plain'})
self.dest.end(self.src.method+' Not Allowed')
return
}
if (!err) {
self.etag = crypto.createHash('md5').update(stats.ino+'/'+stats.mtime+'/'+stats.size).digest("hex")
self.lastmodified = rfc822.getRFC822Date(stats.mtime)
}
process.nextTick(function () {
stopBuffering()
})
// 404 and 500
if ( err && self.dest && self.dest.writeHead && // We have an error object and dest is an HTTP response
( // Either we have a source and it's a GET/HEAD or we don't have a src
(self.src && (self.src.method == 'GET' || self.src.method === 'HEAD')) || (!self.src)
)
) {
if (err.code === 'ENOENT') {
self.dest.statusCode = 404
self.dest.end('Not Found')
} else {
self.dest.statusCode = 500
self.dest.end(err.message)
}
return
}
// Source is an HTTP Server Request
if (self.src && (self.src.method === 'GET' || self.src.method === 'HEAD') && self.dest) {
if (self.dest.setHeader) {
self.dest.setHeader('content-type', self.mimetype)
self.dest.setHeader('etag', self.etag)
self.dest.setHeader('last-modified', self.lastmodified)
}
if (self.dest.writeHead) {
if (self.src && self.src.headers) {
if (self.src.headers['if-none-match'] === self.etag ||
// Lazy last-modifed matching but it's faster than parsing Datetime
self.src.headers['if-modified-since'] === self.lastmodified) {
self.dest.statusCode = 304
self.dest.end()
return
}
}
// We're going to return the whole file
self.dest.statusCode = 200
self.dest.setHeader('content-length', stats.size)
} else {
// Destination is not an HTTP response, GET and HEAD method are not allowed
return
}
if (self.src.method !== 'HEAD') {
fs.createReadStream(self.path).pipe(self.dest)
}
return
}
if (self.src && (self.src.method === 'PUT' || self.src.method === 'POST')) {
if (!err) {
// TODO handle overwrite case
return
}
stream.Stream.prototype.pipe.call(self, fs.createWriteStream(self.path))
if (self.dest && self.dest.writeHead) {
self.on('end', function () {
self.dest.statusCode = 201
self.dest.setHeader('content-length', 0)
self.dest.end()
})
}
return
}
// Desination is an HTTP response, we already handled 404 and 500
if (self.dest && self.dest.writeHead) {
self.dest.statusCode = 200
self.dest.setHeader('content-type', self.mimetype)
self.dest.setHeader('etag', self.etag)
self.dest.setHeader('last-modified', self.lastmodified)
self.dest.setHeader('content-length', stats.size)
fs.createReadStream(self.path).pipe(self.dest)
return
}
// Destination is not an HTTP request
if (self.src && !self.dest) {
stream.Stream.prototype.pipe.call(self, fs.createWriteStream(self.path))
} else if (self.dest && !self.src) {
fs.createReadStream(self.path).pipe(self.dest)
}
}
if (!err && stats.isDirectory()) {
self.path = path.join(self.path, self.index)
self.mimetype = mime.getType(self.path.slice(self.path.lastIndexOf('.')+1))
fs.stat(self.path, finish)
return
} else {
finish(err, stats)
}
if (!self.src && !self.dest) {
if (self.buffers.length > 0) {
stream.Stream.prototype.pipe.call(self, fs.createWriteStream(self.path))
} else if (self.listeners('data').length > 0) {
fs.createReadStream(self.path).pipe(self.dest)
} else {
fs.createReadStream(self.path).pipe(self)
}
}
})
}
util.inherits(File, stream.Stream)
File.prototype.pipe = function (dest, options) {
this.dest = dest
this.destOptions = options
dest.emit('pipe', this)
// stream.Stream.prototype.pipe.call(this, dest, options)
return dest
}
File.prototype.write = function (chunk, encoding) {
if (encoding) chunk = chunk.toString(encoding)
if (this.buffering) {
this.buffers.push(chunk)
} else {
this.emit('data', chunk)
}
}
File.prototype.end = function (chunk) {
if (chunk) this.write(chunk)
if (this.buffering) {
this.ended = true
} else {
this.emit('end')
}
}
module.exports = function (options) {
return new File(options)
}
module.exports.File = File
|
function initializevbox2060628854115() {
vbox2060628854115 = new kony.ui.Box({
"id": "vbox2060628854115",
"isVisible": true,
"orientation": constants.BOX_LAYOUT_VERTICAL,
"position": constants.BOX_POSITION_AS_NORMAL
}, {
"containerWeight": 100,
"layoutType": constants.CONTAINER_LAYOUT_BOX,
"margin": [0, 0, 0, 0],
"marginInPixel": false,
"padding": [0, 0, 0, 0],
"paddingInPixel": false,
"vExpand": false,
"widgetAlignment": constants.WIDGET_ALIGN_TOP_LEFT
}, {});
var lblFirst = new kony.ui.Label({
"id": "lblFirst",
"isVisible": true,
"skin": "lblNormal",
"text": "Label"
}, {
"containerWeight": 100,
"contentAlignment": constants.CONTENT_ALIGN_MIDDLE_LEFT,
"hExpand": true,
"margin": [2, 0, 2, 0],
"marginInPixel": false,
"padding": [2, 4, 2, 4],
"paddingInPixel": false,
"vExpand": false,
"widgetAlignment": constants.WIDGET_ALIGN_MIDDLE_LEFT
}, {
"renderAsAnchor": false,
"textCopyable": false
});
vbox2060628854115.add(lblFirst);
}
|
(this.webpackJsonpclient=this.webpackJsonpclient||[]).push([[0],{104:function(n,t){},127:function(n,t,e){"use strict";e.r(t);var a=e(0),r=e.n(a),o=e(60),i=e.n(o);Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));var s=e(66),l=e(15),c=(e(74),e(1)),p=e.n(c),d=e(2),m=e(3),x=e(5),u=e(4),h=e(10),g=e(6),f=e(7),b=e(8);function k(){var n=Object(f.a)(["\n\n \n \ndiv {\n position: absolute;\n -webkit-transform-style: preserve-3d;\n transform-style: preserve-3d;\n background: linear-gradient(45deg, #24410b 0%, #56733d 100%);\n box-sizing: border-box;\n -webkit-transition: 1000ms;\n transition: 1000ms;\n will-change: transform;\n\n /* CONTAINER */\n #showcase {\n pointer-events: none;\n position: fixed;\n z-index: 100;\n\n left: "," ;\n bottom: ",';\n \n }\n\n #showcase[data-position-on-street="-1"] {\n -webkit-transform: rotateX(-20deg) rotateY(170deg) scale(',");\n transform: rotateX(-20deg) rotateY(170deg) scale(",');\n }\n\n #showcase[data-position-on-street="0"] {\n -webkit-transform: rotateX(-20deg) rotateY(180deg) scale(',");\n transform: rotateX(-20deg) rotateY(180deg) scale(",');\n }\n\n #showcase[data-position-on-street="1"] {\n -webkit-transform: rotateX(-20deg) rotateY(190deg) scale(',");\n transform: rotateX(-20deg) rotateY(190deg) scale(",');\n }\n\n #showcase[data-direction="left"] {\n -webkit-transform: rotateX(-20deg) rotateY(210deg) scale(',");\n transform: rotateX(-20deg) rotateY(210deg) scale(",');\n }\n\n #showcase[data-direction="right"] {\n -webkit-transform: rotateX(-20deg) rotateY(150deg) scale(',");\n transform: rotateX(-20deg) rotateY(150deg) scale(",');\n }\n\n #showcase[data-apresentation] {\n -webkit-animation: drive 10000ms linear infinite;\n animation: drive 10000ms linear infinite;\n }\n\n /* SHADOW CAR */\n .shadow {\n width: 120px;\n height: 200px;\n background: none;\n -webkit-transform-origin: 50% 0%;\n transform-origin: 50% 0%;\n -webkit-transform: translate(-60px, 25px) translateZ(100px) rotateX(-90deg);\n transform: translate(-60px, 25px) translateZ(100px) rotateX(-90deg);\n\n .blur {\n width: 100%;\n height: 100%;\n background: #000;\n -webkit-filter: blur(10px);\n filter: blur(10px);\n }\n }\n\n\n /* CAR */\n .car {\n -webkit-transform: translate(-50px, 0px) translateZ(90px);\n transform: translate(-50px, 0px) translateZ(90px);\n\n .body {\n -webkit-transition: 2000ms;\n transition: 2000ms;\n\n .aero {\n -webkit-transform-origin: 50px -100px;\n transform-origin: 50px -100px;\n -webkit-transform: scale(0);\n transform: scale(0);\n\n -webkit-transform: scale(1);\n transform: scale(1);\n }\n\n /* FRONT */\n .front {\n\n -webkit-transform: translate(0, -20px);\n transform: translate(0, -20px);\n\n .bumper {\n width: 100px;\n height: 20px;\n }\n\n .bumper::before {\n content: \'\';\n position: absolute;\n background: orange;\n width: 6px;\n height: 6px;\n border-radius: 20px;\n -webkit-transform: translate(5px, 5px);\n transform: translate(5px, 5px);\n }\n\n .bumper::after {\n content: \'\';\n position: absolute;\n background: orange;\n width: 6px;\n height: 6px;\n border-radius: 20px;\n -webkit-transform: translate(89px, 5px);\n transform: translate(89px, 5px);\n }\n\n .aero .parts {\n width: 120px;\n height: 10px;\n -webkit-transform-origin: 50% 0%;\n transform-origin: 50% 0%;\n -webkit-transform: translate(-10px, 20px) rotateX(60deg);\n transform: translate(-10px, 20px) rotateX(60deg);\n }\n\n .bonnet {\n width: 100px;\n height: 70px;\n -webkit-transform-origin: 50% 0%;\n transform-origin: 50% 0%;\n -webkit-transform: translate(0px, -24px) translateZ(-66px) rotateX(70deg);\n transform: translate(0px, -24px) translateZ(-66px) rotateX(70deg);\n -webkit-clip-path: polygon(0% 0%, 100% 0%, 100% 50px, 75px 50px, 75px 100%, 25px 100%, 25px 50px, 0% 50px);\n clip-path: polygon(0% 0%, 100% 0%, 100% 50px, 75px 50px, 75px 100%, 25px 100%, 25px 50px, 0% 50px);\n }\n\n .aero .parts {\n width: 40px;\n height: 20px;\n border-radius: 0 0 3px 3px;\n background: -webkit-gradient(linear, left top, left bottom, from(rgba(0, 0, 0, 0)), color-stop(70%, rgba(0, 0, 0, 0.3)), to(black));\n background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.3) 70%, black 100%);\n -webkit-transform: translate(30px, 20px);\n transform: translate(30px, 20px);\n }\n\n .headlight {\n width: 25px;\n height: 20px;\n -webkit-transform-origin: 50% 0%;\n transform-origin: 50% 0%;\n background: none;\n }\n\n .headlight_left {\n -webkit-transform: translate(1px, -7px) translateZ(-19px) rotateX(70deg);\n transform: translate(1px, -7px) translateZ(-19px) rotateX(70deg);\n\n -webkit-transform: translate(1px, -7px) translateZ(-19px) rotateX(110deg);\n transform: translate(1px, -7px) translateZ(-19px) rotateX(110deg);\n -webkit-transition: 600ms;\n transition: 600ms;\n }\n\n .headlight_right {\n -webkit-transform: translate(74px, -7px) translateZ(-19px) rotateX(70deg);\n transform: translate(74px, -7px) translateZ(-19px) rotateX(70deg);\n\n -webkit-transform: translate(74px, -7px) translateZ(-19px) rotateX(110deg);\n transform: translate(74px, -7px) translateZ(-19px) rotateX(110deg);\n -webkit-transition: 600ms;\n transition: 600ms;\n }\n\n .headlight_cover {\n width: 25px;\n height: 20px;\n }\n\n .headlight_unit {\n width: 25px;\n height: 20px;\n background: #bcf5b9;\n -webkit-transform-origin: 50% 100%;\n transform-origin: 50% 100%;\n -webkit-transform: rotateX(70deg);\n transform: rotateX(70deg);\n }\n\n .headlight_unit::before {\n content: \'\';\n position: absolute;\n width: 20px;\n height: 20px;\n background: linear-gradient(45deg, #24410b 0%, #56733d 100%);\n -webkit-transform-origin: 0% 0%;\n transform-origin: 0% 0%;\n -webkit-transform: rotateY(-90deg);\n transform: rotateY(-90deg);\n -webkit-clip-path: polygon(100% 60%, 0% 0%, 0% 100%);\n clip-path: polygon(100% 60%, 0% 0%, 0% 100%);\n }\n\n .headlight_unit::after {\n content: \'\';\n position: absolute;\n right: 0;\n width: 20px;\n height: 20px;\n background: linear-gradient(45deg, #24410b 0%, #56733d 100%);\n -webkit-transform-origin: 100% 0%;\n transform-origin: 100% 0%;\n -webkit-transform: rotateY(90deg);\n transform: rotateY(90deg);\n -webkit-clip-path: polygon(0% 60%, 100% 0%, 100% 100%);\n clip-path: polygon(0% 60%, 100% 0%, 100% 100%);\n }\n\n .fender {\n width: 66px;\n height: 44px;\n -webkit-transform-origin: 0% 0%;\n transform-origin: 0% 0%;\n background: none;\n\n .panel {\n width: 100%;\n height: 100%;\n -webkit-clip-path: polygon(0 24px, 100% 0%, 100% 100%, 60px 100%, 50px 24px, 30px 24px, 20px 100%, 0% 100%);\n clip-path: polygon(0 24px, 100% 0%, 100% 100%, 60px 100%, 50px 24px, 30px 24px, 20px 100%, 0% 100%);\n }\n\n }\n\n\n .fender_left {\n -webkit-transform: translate(100px, -24px) rotateY(90deg);\n transform: translate(100px, -24px) rotateY(90deg);\n }\n\n .fender_left .aero .parts {\n width: 40px;\n height: 10px;\n -webkit-transform-origin: 100% 0%;\n transform-origin: 100% 0%;\n -webkit-transform: translate(-15px, 15px) rotateX(90deg) rotateY(-50deg);\n transform: translate(-15px, 15px) rotateX(90deg) rotateY(-50deg);\n }\n\n .fender_left .aero .parts::before {\n content: \'\';\n position: absolute;\n width: 40px;\n height: 10px;\n background: linear-gradient(45deg, #24410b 0%, #56733d 100%);\n -webkit-transform-origin: 0% 0%;\n transform-origin: 0% 0%;\n -webkit-transform: translate(40px, 0px) rotateY(35deg);\n transform: translate(40px, 0px) rotateY(35deg);\n }\n\n .fender_right {\n -webkit-transform: translate(0px, -24px) rotateY(90deg);\n transform: translate(0px, -24px) rotateY(90deg);\n }\n\n .fender_right .aero .parts {\n width: 40px;\n height: 10px;\n -webkit-transform-origin: 100% 0%;\n transform-origin: 100% 0%;\n -webkit-transform: translate(-15px, 15px) translateZ(-10px) rotateX(90deg) rotateY(-50deg);\n transform: translate(-15px, 15px) translateZ(-10px) rotateX(90deg) rotateY(-50deg);\n }\n\n .fender_right .aero .parts::before {\n content: \'\';\n position: absolute;\n width: 40px;\n height: 10px;\n background: linear-gradient(45deg, #24410b 0%, #56733d 100%);\n -webkit-transform-origin: 0% 0%;\n transform-origin: 0% 0%;\n -webkit-transform: translate(40px, 0px) rotateY(35deg);\n transform: translate(40px, 0px) rotateY(35deg);\n }\n\n .under {\n width: 100px;\n height: 66px;\n -webkit-transform-origin: 50% 100%;\n transform-origin: 50% 100%;\n -webkit-transform: translate(0, -46px) rotateX(90deg);\n transform: translate(0, -46px) rotateX(90deg);\n -webkit-clip-path: polygon(10px 0%, 90px 0%, 90px 100%, 10px 100%);\n clip-path: polygon(10px 0%, 90px 0%, 90px 100%, 10px 100%);\n }\n\n }\n }\n\n /* BODY */\n .cockpit {\n\n -webkit-transform: translate(0, -44px) translateZ(-66px);\n transform: translate(0, -44px) translateZ(-66px);\n\n .handle {\n width: 30px;\n height: 30px;\n border-radius: 100%;\n -webkit-transform: translate(15px, -5px) translateZ(-15px) rotateX(-20deg);\n transform: translate(15px, -5px) translateZ(-15px) rotateX(-20deg);\n background: none;\n border: 5px solid #323232;\n }\n\n .seat {\n width: 30px;\n height: 60px;\n background: whitesmoke;\n -webkit-transform-origin: 50% 100%;\n transform-origin: 50% 100%;\n border-radius: 5px 5px 0 0;\n }\n\n .seat::before {\n content: \'\';\n position: absolute;\n bottom: 0;\n width: 30px;\n height: 30px;\n background: whitesmoke;\n -webkit-transform-origin: 50% 100%;\n transform-origin: 50% 100%;\n -webkit-transform: rotateX(-100deg);\n transform: rotateX(-100deg);\n }\n\n .seat_left {\n -webkit-transform: translate(55px, -20px) translateZ(-45px) rotateX(22deg);\n transform: translate(55px, -20px) translateZ(-45px) rotateX(22deg);\n }\n\n .seat_right {\n -webkit-transform: translate(15px, -20px) translateZ(-45px) rotateX(22deg);\n transform: translate(15px, -20px) translateZ(-45px) rotateX(22deg);\n }\n\n .inner_front {\n width: 100px;\n height: 44px;\n background: linear-gradient(45deg, #323232 0%, #646464 100%);\n }\n\n .inner_back {\n width: 100px;\n height: 48px;\n -webkit-transform-origin: 50% 0%;\n transform-origin: 50% 0%;\n -webkit-transform: translateZ(-70px) rotateX(24deg);\n transform: translateZ(-70px) rotateX(24deg);\n background: linear-gradient(45deg, #323232 0%, #646464 100%);\n }\n\n .door {\n width: 70px;\n height: 44px;\n -webkit-transform-origin: 0% 0%;\n transform-origin: 0% 0%;\n background: none;\n }\n\n .door {\n\n .gull {\n -webkit-transition: 1200ms;\n transition: 1200ms;\n }\n\n .window {\n width: 70px;\n height: 30px;\n -webkit-transform-origin: 0% 0%;\n transform-origin: 0% 0%;\n -webkit-transform: translate(0px, -30px);\n transform: translate(0px, -30px);\n background: none;\n overflow: hidden;\n\n .glass {\n width: 70px;\n height: 30px;\n -webkit-clip-path: polygon(30px 0%, 100% 0%, 100% 100%, 0% 100%);\n clip-path: polygon(30px 0%, 100% 0%, 100% 100%, 0% 100%);\n -webkit-transition: 1500ms;\n transition: 1500ms;\n -webkit-transition-timing-function: linear;\n transition-timing-function: linear;\n\n -webkit-transform: translateY(30px);\n transform: translateY(30px);\n\n }\n }\n\n .panel {\n width: 70px;\n height: 44px;\n -webkit-clip-path: polygon(0% 0%, 100% 0%, 50px 100%, 0% 100%);\n clip-path: polygon(0% 0%, 100% 0%, 50px 100%, 0% 100%);\n }\n\n .mirror {\n width: 20px;\n height: 10px;\n -webkit-transform-origin: 0% 0%;\n transform-origin: 0% 0%;\n }\n\n }\n \n .door_left {\n -webkit-transform: translate(100px, 0px) rotateY(90deg);\n transform: translate(100px, 0px) rotateY(90deg);\n\n .aero .parts {\n width: 56px;\n height: 13px;\n -webkit-transform-origin: 0% 0%;\n transform-origin: 0% 0%;\n -webkit-transform: translate(-6px, 44px) rotateX(45deg);\n transform: translate(-6px, 44px) rotateX(45deg);\n }\n\n .mirror {\n -webkit-transform: translate(10px, -10px) rotateY(-60deg);\n transform: translate(10px, -10px) rotateY(-60deg);\n }\n\n .mirror::before {\n content: \'\';\n position: absolute;\n width: 20px;\n height: 10px;\n background: silver;\n border: 2px solid #24410b;\n -webkit-transform: translateZ(-1px);\n transform: translateZ(-1px);\n box-sizing: border-box;\n }\n .panel::before {\n position: absolute;\n width: 100%;\n height: 100%;\n background: linear-gradient(45deg, #323232 0%, #646464 100%);\n -webkit-transform: translateZ(-1px);\n transform: translateZ(-1px);\n -webkit-clip-path: polygon(1% 1%, 99% 1%, 50px 99%, 1% 99%);\n clip-path: polygon(1% 1%, 99% 1%, 50px 99%, 1% 99%);\n }\n }\n\n .door_right {\n -webkit-transform: translate(0px, 0px) rotateY(90deg);\n transform: translate(0px, 0px) rotateY(90deg);\n\n .aero .parts {\n width: 56px;\n height: 13px;\n -webkit-transform-origin: 0% 0%;\n transform-origin: 0% 0%;\n -webkit-transform: translate(-6px, 44px) rotateX(-45deg);\n transform: translate(-6px, 44px) rotateX(-45deg);\n }\n \n .mirror {\n -webkit-transform: translate(10px, -10px) rotateY(60deg);\n transform: translate(10px, -10px) rotateY(60deg);\n }\n\n .mirror::before {\n content: \'\';\n position: absolute;\n width: 20px;\n height: 10px;\n background: silver;\n border: 2px solid #24410b;\n -webkit-transform: translateZ(1px);\n transform: translateZ(1px);\n box-sizing: border-box;\n -webkit-backface-visibility: hidden;\n backface-visibility: hidden;\n }\n \n .panel::before {\n position: absolute;\n width: 100%;\n height: 100%;\n background: linear-gradient(45deg, #323232 0%, #646464 100%);\n -webkit-transform: translateZ(1px);\n transform: translateZ(1px);\n -webkit-clip-path: polygon(1% 1%, 99% 1%, 50px 99%, 1% 99%);\n clip-path: polygon(1% 1%, 99% 1%, 50px 99%, 1% 99%);\n }\n\n }\n \n .under {\n width: 100px;\n height: 50px;\n -webkit-transform-origin: 50% 100%;\n transform-origin: 50% 100%;\n -webkit-transform: translate(0, -6px) rotateX(90deg);\n transform: translate(0, -6px) rotateX(90deg);\n background: linear-gradient(45deg, #323232 0%, #646464 100%);\n }\n\n .roof {\n width: 100px;\n -webkit-transform-origin: 50% 10px;\n transform-origin: 50% 10px;\n -webkit-transform: translate(0px, -10px) translateZ(-70px) rotateX(0deg);\n transform: translate(0px, -10px) translateZ(-70px) rotateX(0deg);\n -webkit-transition: 2000ms;\n transition: 2000ms;\n\n -webkit-transform: translate(0px, -10px) translateZ(-80px) rotateX(90deg);\n transform: translate(0px, -10px) translateZ(-80px) rotateX(90deg);\n -webkit-transition-delay: 300ms;\n transition-delay: 300ms;\n }\n\n .roof_top {\n width: 100px;\n height: 40px;\n -webkit-transform-origin: 50% 100%;\n transform-origin: 50% 100%;\n -webkit-transform: translate(0px, -60px) rotateX(-90deg);\n transform: translate(0px, -60px) rotateX(-90deg);\n\n -webkit-transform: translate(0px, -60px) rotateX(-180deg);\n transform: translate(0px, -60px) rotateX(-180deg);\n -webkit-transition-delay: 800ms;\n transition-delay: 800ms;\n }\n\n .roof_back {\n width: 100px;\n height: 36px;\n -webkit-transform-origin: 50% 0%;\n transform-origin: 50% 0%;\n -webkit-transform: translate(0px, -20px) rotateX(-35deg);\n transform: translate(0px, -20px) rotateX(-35deg);\n -webkit-clip-path: polygon(0% 0%, 12px 100%, 88px 100%, 100% 0%);\n clip-path: polygon(0% 0%, 12px 100%, 88px 100%, 100% 0%);\n }\n\n .roof_left {\n width: 24px;\n height: 30px;\n -webkit-transform-origin: 0% 0%;\n transform-origin: 0% 0%;\n -webkit-transform: translate(100px, -20px) rotateY(120deg);\n transform: translate(100px, -20px) rotateY(120deg);\n -webkit-clip-path: polygon(0% 0%, 100% 100%, 0% 100%);\n clip-path: polygon(0% 0%, 100% 100%, 0% 100%);\n }\n\n .roof_right {\n width: 24px;\n height: 30px;\n -webkit-transform-origin: 0% 0%;\n transform-origin: 0% 0%;\n -webkit-transform: translate(0px, -20px) rotateY(60deg);\n transform: translate(0px, -20px) rotateY(60deg);\n -webkit-clip-path: polygon(0% 0%, 100% 100%, 0% 100%);\n clip-path: polygon(0% 0%, 100% 100%, 0% 100%);\n }\n\n .roof_bottom {\n width: 100px;\n height: 20px;\n -webkit-transform-origin: 50% 100%;\n transform-origin: 50% 100%;\n -webkit-transform: translate(0px, -10px) rotateX(90deg);\n transform: translate(0px, -10px) rotateX(90deg);\n -webkit-clip-path: polygon(0% 100%, 10px 0%, 90px 0%, 100% 100%);\n clip-path: polygon(0% 100%, 10px 0%, 90px 0%, 100% 100%);\n }\n\n .window {\n background: rgba(0, 70, 150, 0.6);\n }\n\n .window_front {\n width: 100px;\n height: 42px;\n -webkit-transform-origin: 50% 100%;\n transform-origin: 50% 100%;\n -webkit-transform: translate(0px, -42px) rotateX(45deg);\n transform: translate(0px, -42px) rotateX(45deg);\n }\n .window_front::before {\n content: \'\';\n position: absolute;\n width: 5px;\n height: 42px;\n background: linear-gradient(45deg, #24410b 0%, #56733d 100%);\n }\n\n .window_front::after {\n content: \'\';\n position: absolute;\n right: 0;\n width: 5px;\n height: 42px;\n background: linear-gradient(45deg, #24410b 0%, #56733d 100%);\n }\n\n .window_left {\n width: 70px;\n height: 30px;\n -webkit-transform-origin: 0% 0%;\n transform-origin: 0% 0%;\n -webkit-transform: translate(100px, -30px) rotateY(90deg);\n transform: translate(100px, -30px) rotateY(90deg);\n -webkit-clip-path: polygon(30px 0%, 100% 0%, 100% 100%, 0% 100%);\n clip-path: polygon(30px 0%, 100% 0%, 100% 100%, 0% 100%);\n }\n\n .window_right {\n width: 70px;\n height: 30px;\n -webkit-transform-origin: 0% 0%;\n transform-origin: 0% 0%;\n -webkit-transform: translate(0px, -30px) rotateY(90deg);\n transform: translate(0px, -30px) rotateY(90deg);\n -webkit-clip-path: polygon(30px 0%, 100% 0%, 100% 100%, 0% 100%);\n clip-path: polygon(30px 0%, 100% 0%, 100% 100%, 0% 100%);\n }\n\n }\n\n .window, .glass {\n background: rgba(0, 70, 150, 0.6);\n }\n\n /* REAR */\n\n .rear {\n -webkit-transform: translate(0px, -44px) translateZ(-116px);\n transform: translate(0px, -44px) translateZ(-116px);\n\n .bumper {\n\n width: 100px;\n height: 44px;\n -webkit-transform: translateZ(-60px);\n transform: translateZ(-60px);\n \n\n .aero {\n\n -webkit-transform: scale(1);\n transform: scale(1);\n\n .parts {\n\n .arm_right {\n\n width: 10px;\n height: 50px;\n -webkit-transform-origin: 0% 0%;\n transform-origin: 0% 0%;\n -webkit-transform: translate(18px, -20px) rotateY(90deg);\n transform: translate(18px, -20px) rotateY(90deg);\n border-radius: 0 0 100% 0;\n\n }\n\n .arm_left {\n width: 10px;\n height: 50px;\n -webkit-transform-origin: 0% 0%;\n transform-origin: 0% 0%;\n -webkit-transform: translate(82px, -20px) rotateY(90deg);\n transform: translate(82px, -20px) rotateY(90deg);\n border-radius: 0 0 100% 0;\n }\n\n .wing {\n width: 120px;\n height: 20px;\n -webkit-transform-origin: 50% 100%;\n transform-origin: 50% 100%;\n -webkit-transform: translate(-10px, -35px) rotateX(70deg);\n transform: translate(-10px, -35px) rotateX(70deg);\n }\n\n .garnish {\n width: 100px;\n height: 10px;\n -webkit-transform: translateZ(-0.1px);\n transform: translateZ(-0.1px);\n }\n\n .bottom {\n width: 100px;\n height: 10px;\n -webkit-transform-origin: 50% 0%;\n transform-origin: 50% 0%;\n -webkit-transform: translate(0px, 44px) rotateX(-40deg);\n transform: translate(0px, 44px) rotateX(-40deg);\n }\n\n }\n\n } \n\n .taillight {\n content: \'\';\n position: absolute;\n top: 4px;\n width: 12px;\n height: 12px;\n background: #c80000;\n border-radius: 100%;\n -webkit-transform: translateZ(-1px);\n transform: translateZ(-1px);\n }\n\n .taillight_right {\n right: 5px;\n }\n\n .taillight_right::before {\n content: \'\';\n position: absolute;\n right: 14px;\n width: 12px;\n height: 12px;\n border-radius: 100%;\n background: #c80000;\n }\n\n .taillight_left {\n left: 5px;\n }\n\n .taillight_left::before {\n content: \'\';\n position: absolute;\n left: 14px;\n width: 12px;\n height: 12px;\n border-radius: 100%;\n background: #c80000;\n }\n\n }\n\n .fender {\n width: 60px;\n height: 44px;\n background: none;\n -webkit-transform-origin: 0% 0%;\n transform-origin: 0% 0%;\n\n .panel {\n width: 100%;\n height: 100%;\n -webkit-clip-path: polygon(20px 0%, 100% 0%, 100% 100%, 50px 100%, 40px 24px, 20px 24px, 10px 100%, 0% 100%);\n clip-path: polygon(20px 0%, 100% 0%, 100% 100%, 50px 100%, 40px 24px, 20px 24px, 10px 100%, 0% 100%);\n }\n }\n\n .fender_left {\n -webkit-transform: translate(100px, 0px) rotateY(90deg);\n transform: translate(100px, 0px) rotateY(90deg);\n\n .aero .parts {\n width: 47px;\n height: 10px;\n -webkit-transform-origin: 100% 0%;\n transform-origin: 100% 0%;\n -webkit-transform: translate(-30px, 10px) rotateX(90deg) rotateY(-65deg);\n transform: translate(-30px, 10px) rotateX(90deg) rotateY(-65deg);\n }\n\n .fender_left .aero .parts::before {\n content: \'\';\n position: absolute;\n width: 42px;\n height: 10px;\n background: linear-gradient(45deg, #24410b 0%, #56733d 100%);\n -webkit-transform-origin: 100% 0%;\n transform-origin: 100% 0%;\n -webkit-transform: translate(5px, 0px) rotateY(-115deg);\n transform: translate(5px, 0px) rotateY(-115deg);\n }\n }\n\n .fender_right {\n -webkit-transform: rotateY(90deg);\n transform: rotateY(90deg);\n\n .aero .parts {\n width: 47px;\n height: 10px;\n -webkit-transform-origin: 100% 0%;\n transform-origin: 100% 0%;\n -webkit-transform: translate(-30px, 10px) rotateX(-90deg) rotateY(65deg);\n transform: translate(-30px, 10px) rotateX(-90deg) rotateY(65deg);\n }\n\n .aero .parts::before {\n content: \'\';\n position: absolute;\n width: 42px;\n height: 10px;\n background: linear-gradient(45deg, #24410b 0%, #56733d 100%);\n -webkit-transform-origin: 100% 0%;\n transform-origin: 100% 0%;\n -webkit-transform: translate(5px, 0px) rotateY(115deg);\n transform: translate(5px, 0px) rotateY(115deg);\n }\n \n }\n\n .under {\n width: 100px;\n height: 60px;\n -webkit-transform-origin: 50% 100%;\n transform-origin: 50% 100%;\n -webkit-transform: translate(0px, -16px) rotateX(90deg);\n transform: translate(0px, -16px) rotateX(90deg);\n -webkit-clip-path: polygon(10px 0%, 90px 0%, 90px 100%, 10px 100%);\n clip-path: polygon(10px 0%, 90px 0%, 90px 100%, 10px 100%);\n }\n\n .luggage {\n width: 100px;\n height: 40px;\n -webkit-transform-origin: 50% 100%;\n transform-origin: 50% 100%;\n -webkit-transform: translate(0px, -40px) translateZ(-20px) rotateX(90deg);\n transform: translate(0px, -40px) translateZ(-20px) rotateX(90deg);\n background: none;\n\n .panel {\n width: 100px;\n height: 40px;\n -webkit-transform-origin: 50% 100%;\n transform-origin: 50% 100%;\n -webkit-clip-path: polygon(0% 0%, 0% 100%, 10px 20px, 90px 20px, 100% 100%, 100% 0%);\n clip-path: polygon(0% 0%, 0% 100%, 10px 20px, 90px 20px, 100% 100%, 100% 0%);\n -webkit-transition-delay: 500ms;\n transition-delay: 500ms;\n\n -webkit-transform-origin: 50% 0%;\n transform-origin: 50% 0%;\n -webkit-transform: rotateX(-40deg);\n transform: rotateX(-40deg);\n -webkit-transition-delay: 0ms;\n transition-delay: 0ms;\n }\n }\n \n }\n\n .wheel {\n\n .tire {\n width: 40px;\n height: 40px;\n border-radius: 100%;\n background: #646464;\n border: 8px solid black;\n -webkit-transition: 500ms;\n transition: 500ms;\n -webkit-transition-delay: 500ms;\n transition-delay: 500ms;\n\n background: #287018;\n border-width: 3px;\n }\n\n .tire_left {\n -webkit-transform: translate(75px, -15px) rotateY(90deg);\n transform: translate(75px, -15px) rotateY(90deg);\n }\n\n .tire_right {\n -webkit-transform: translate(-15px, -15px) rotateY(90deg);\n transform: translate(-15px, -15px) rotateY(90deg);\n }\n\n .shaft {\n width: 90px;\n height: 10px;\n background: #646464;\n -webkit-transform: translate(5px, 0px);\n transform: translate(5px, 0px);\n -webkit-transition: 500ms;\n transition: 500ms;\n -webkit-transition-delay: 500ms;\n transition-delay: 500ms;\n background: #287018;\n }\n\n .shaft::before {\n content: \'\';\n position: absolute;\n width: 100%;\n height: 100%;\n background: #646464;\n -webkit-transform: rotateX(90deg);\n transform: rotateX(90deg);\n background: #287018;\n }\n\n .front {\n -webkit-transform: translate(0px, 0px) translateZ(-40px);\n transform: translate(0px, 0px) translateZ(-40px);\n }\n\n .rear {\n -webkit-transform: translate(0px, 0px) translateZ(-145px);\n transform: translate(0px, 0px) translateZ(-145px);\n }\n\n }\n\n\n }\n\n}\n\n@-webkit-keyframes drive {\n 0% {\n -webkit-transform: rotateX(-30deg) rotateY(0deg);\n transform: rotateX(-30deg) rotateY(0deg);\n }\n 100% {\n -webkit-transform: rotateX(-30deg) rotateY(-360deg);\n transform: rotateX(-30deg) rotateY(-360deg);\n }\n}\n\n@keyframes drive {\n 0% {\n -webkit-transform: rotateX(-30deg) rotateY(0deg);\n transform: rotateX(-30deg) rotateY(0deg);\n }\n 100% {\n -webkit-transform: rotateX(-30deg) rotateY(-360deg);\n transform: rotateX(-30deg) rotateY(-360deg);\n }\n}\n\n\n/* .action.door[type="checkbox"]:checked ~ #showcase .door_left {\n -webkit-transform: translate(100px, 0px) rotateY(30deg);\n transform: translate(100px, 0px) rotateY(30deg);\n}\n.action.door[type="checkbox"]:checked ~ #showcase .door_right {\n -webkit-transform: translate(0px, 0px) rotateY(150deg);\n transform: translate(0px, 0px) rotateY(150deg);\n} */\n\n\n\n/* //log\n.action.roof[type="checkbox"]:checked ~ #showcase .roof {\n -webkit-transform: translate(0px, -10px) translateZ(-80px) rotateX(90deg);\n transform: translate(0px, -10px) translateZ(-80px) rotateX(90deg);\n -webkit-transition-delay: 300ms;\n transition-delay: 300ms;\n} */\n\n\n/* //log2\n.action.roof[type="checkbox"]:checked ~ #showcase .roof_top {\n -webkit-transform: translate(0px, -60px) rotateX(-180deg);\n transform: translate(0px, -60px) rotateX(-180deg);\n -webkit-transition-delay: 800ms;\n transition-delay: 800ms;\n} */\n\n/* //log3\n.action.roof[type="checkbox"]:checked ~ #showcase .luggage .panel {\n -webkit-transform-origin: 50% 0%;\n transform-origin: 50% 0%;\n -webkit-transform: rotateX(-40deg);\n transform: rotateX(-40deg);\n -webkit-transition-delay: 0ms;\n transition-delay: 0ms;\n} */\n\n/* .action.luggage[type="checkbox"]:checked ~ #showcase .luggage .panel {\n -webkit-transform: rotateX(-40deg);\n transform: rotateX(-40deg);\n -webkit-transition-delay: 500ms;\n transition-delay: 500ms;\n}\n.action.window[type="checkbox"]:checked ~ #showcase .window .glass {\n -webkit-transform: translateY(30px);\n transform: translateY(30px);\n}\n.action.headlight[type="checkbox"]:checked ~ #showcase .headlight_left {\n -webkit-transform: translate(1px, -7px) translateZ(-19px) rotateX(110deg);\n transform: translate(1px, -7px) translateZ(-19px) rotateX(110deg);\n -webkit-transition: 600ms;\n transition: 600ms;\n}\n.action.headlight[type="checkbox"]:checked ~ #showcase .headlight_right {\n -webkit-transform: translate(74px, -7px) translateZ(-19px) rotateX(110deg);\n transform: translate(74px, -7px) translateZ(-19px) rotateX(110deg);\n -webkit-transition: 600ms;\n transition: 600ms;\n}\n.action.gull[type="checkbox"]:checked ~ #showcase .door_left .gull {\n -webkit-transform: rotateY(-20deg) rotateZ(-60deg);\n transform: rotateY(-20deg) rotateZ(-60deg);\n}\n.action.gull[type="checkbox"]:checked ~ #showcase .door_right .gull {\n -webkit-transform: rotateY(20deg) rotateZ(-60deg);\n transform: rotateY(20deg) rotateZ(-60deg);\n}\n.action.night[type="checkbox"]:checked ~ #field {\n background: #282828;\n}\n.action.night[type="checkbox"]:checked ~ #showcase .shadow .blur {\n background: #141414;\n}\n.action.night[type="checkbox"]:checked ~ .action::before {\n color: #fff;\n}\n.action.night[type="checkbox"]:checked::before {\n color: #fff;\n}\n.action.neon[type="checkbox"]:checked ~ #showcase .shadow .blur {\n background: #b7977b;\n}\n.action.run[type="checkbox"]:checked ~ #showcase .car {\n -webkit-transform: translate(200px, 0px) translateZ(90px);\n transform: translate(200px, 0px) translateZ(90px);\n}\n.action.run[type="checkbox"]:checked ~ #showcase .shadow {\n -webkit-transform: translate(190px, 25px) translateZ(100px) rotateX(-90deg);\n transform: translate(190px, 25px) translateZ(100px) rotateX(-90deg);\n}\n.action.lowdown[type="checkbox"]:checked ~ #showcase .body {\n -webkit-transform: translate(0px, 16px);\n transform: translate(0px, 16px);\n}\n.action.lowdown[type="checkbox"]:checked ~ #showcase .tire_left {\n -webkit-transform: translate(90px, -15px) rotateZ(-12deg) rotateY(90deg);\n transform: translate(90px, -15px) rotateZ(-12deg) rotateY(90deg);\n -webkit-transition-delay: 0ms;\n transition-delay: 0ms;\n}\n.action.lowdown[type="checkbox"]:checked ~ #showcase .tire_right {\n -webkit-transform: translate(-30px, -15px) rotateZ(12deg) rotateY(90deg);\n transform: translate(-30px, -15px) rotateZ(12deg) rotateY(90deg);\n -webkit-transition-delay: 0ms;\n transition-delay: 0ms;\n}\n.action.lowdown[type="checkbox"]:checked ~ #showcase .shaft {\n width: 120px;\n -webkit-transform: translate(-10px, 0px);\n transform: translate(-10px, 0px);\n -webkit-transition-delay: 0ms;\n transition-delay: 0ms;\n}\n.action.aero[type="checkbox"]:checked ~ #showcase .aero {\n -webkit-transform: scale(1);\n transform: scale(1);\n}\n.action.aero[type="checkbox"]:checked ~ #showcase .tire {\n background: #287018;\n border-width: 3px;\n}\n.action.aero[type="checkbox"]:checked ~ #showcase .shaft {\n background: #287018;\n}\n.action.aero[type="checkbox"]:checked ~ #showcase .shaft::before {\n background: #287018;\n}\n.action.zoom[type="checkbox"]:checked ~ #showcase .camera {\n -webkit-transform: scale3d(2, 2, 2);\n transform: scale3d(2, 2, 2);\n}\n.action.ride[type="checkbox"]:checked ~ #showcase .camera {\n -webkit-transform: scale3d(50, 50, 50) translate(20px, 42px) translateZ(17px);\n transform: scale3d(50, 50, 50) translate(20px, 42px) translateZ(17px);\n} */\n\n']);return k=function(){return n},n}function w(){var n=Object(f.a)(["\n width: 100px;\n height: 100px;\n background: #000;\n"]);return w=function(){return n},n}b.a.div(w());var v=b.a.div(k(),(function(n){return n.me&&n.me?n.funcPositionOnStreet(-350,n.position_on_street)+"px":""}),(function(n){return n.me&&n.me?"-350px !important":""}),(function(n){return n.me&&n.me?n.funcProcessScale(-350):1}),(function(n){return n.me&&n.me?n.funcProcessScale(-350):1}),(function(n){return n.me&&n.me?n.funcProcessScale(-350):1}),(function(n){return n.me&&n.me?n.funcProcessScale(-350):1}),(function(n){return n.me&&n.me?n.funcProcessScale(-350):1}),(function(n){return n.me&&n.me?n.funcProcessScale(-350):1}),(function(n){return n.me&&n.me?n.funcProcessScale(-350):1}),(function(n){return n.me&&n.me?n.funcProcessScale(-350):1}),(function(n){return n.me&&n.me?n.funcProcessScale(-350):1}),(function(n){return n.me&&n.me?n.funcProcessScale(-350):1})),y=function(n){function t(n){var e;return Object(d.a)(this,t),(e=Object(x.a)(this,Object(u.a)(t).call(this))).state={direction:"ahead",position_on_street:0,velocity:1,max_velocity:10,min_velocity:1,socket:n.socket?n.socket:null,me:!!n.me&&n.me},e.processScaleCar.bind(Object(h.a)(e)),e.processPositionOnStreet.bind(Object(h.a)(e)),e}return Object(g.a)(t,n),Object(m.a)(t,[{key:"switchToLeftPosition",value:function(){var n=this.state.position_on_street,t=this;n>-1&&(n--,this.setState({direction:"left",position_on_street:n})),setTimeout((function(){t.setState({direction:"ahead"})}),600)}},{key:"switchToRightPosition",value:function(){var n=this.state.position_on_street,t=this;n<1&&(n++,this.setState({direction:"right",position_on_street:n})),setTimeout((function(){t.setState({direction:"ahead"})}),600)}},{key:"componentDidMount",value:function(){var n=this,t=this,e=this.props.funcUpdateVelocity,a=this.state,r=a.socket,o=a.me,i=a.velocity,s=a.max_velocity,l=a.min_velocity;o&&null!==r&&(r.on("accelerator",(function(){i+1<=s&&(++i,n.setState({velocity:i}),e(i))})),r.on("stop",(function(){i-1>=l&&(i--,n.setState({velocity:i}),e(i))})),r.on("turn_left",(function(){return p.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:t.switchToLeftPosition();case 1:case"end":return n.stop()}}))})),r.on("turn_right",(function(){return p.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:t.switchToRightPosition();case 1:case"end":return n.stop()}}))})),r.on("accelerator",(function(){})),r.on("stop",(function(){})))}},{key:"processScaleCar",value:function(n){return.006*(n=n<0?-1*n:n)}},{key:"processPositionOnStreet",value:function(n,t){var e,a=350-(n=n<0?-1*n:n);switch(t){case-1:return e=140*(Math.PI/180),250-Math.cos(e)*a;case 0:return 600;case 1:return e=40*(Math.PI/180),950-Math.cos(e)*a}}},{key:"render",value:function(){var n=this.state,t=n.direction,e=n.me,a=n.position_on_street;return r.a.createElement("div",null,r.a.createElement(v,{me:e,position_on_street:a,funcProcessScale:this.processScaleCar,funcPositionOnStreet:this.processPositionOnStreet},r.a.createElement("div",null,r.a.createElement("div",{id:"showcase","data-direction":t,"data-position-on-street":a},r.a.createElement("div",{class:"camera"},r.a.createElement("div",{class:"shadow"},r.a.createElement("div",{class:"blur"})),r.a.createElement("div",{class:"car"},r.a.createElement("div",{class:"body"},r.a.createElement("div",{class:"front"},r.a.createElement("div",{class:"bumper"},r.a.createElement("div",{class:"aero"},r.a.createElement("div",{class:"parts"}))),r.a.createElement("div",{class:"bonnet"},r.a.createElement("div",{class:"aero"},"The One",r.a.createElement("div",{class:"parts"}))),r.a.createElement("div",{class:"headlight headlight_left"},r.a.createElement("div",{class:"headlight_cover"}),r.a.createElement("div",{class:"headlight_unit"}),r.a.createElement("div",{class:"headlight_unit_left"}),r.a.createElement("div",{class:"headlight_unit_right"})),r.a.createElement("div",{class:"headlight headlight_right"},r.a.createElement("div",{class:"headlight_cover"}),r.a.createElement("div",{class:"headlight_unit"}),r.a.createElement("div",{class:"headlight_unit_left"}),r.a.createElement("div",{class:"headlight_unit_right"})),r.a.createElement("div",{class:"fender fender_left"},r.a.createElement("div",{class:"aero"},r.a.createElement("div",{class:"parts"})),r.a.createElement("div",{class:"panel"})),r.a.createElement("div",{class:"fender fender_right"},r.a.createElement("div",{class:"aero"},r.a.createElement("div",{class:"parts"})),r.a.createElement("div",{class:"panel"})),r.a.createElement("div",{class:"under"})),r.a.createElement("div",{class:"cockpit"},r.a.createElement("div",{class:"inner inner_front"}),r.a.createElement("div",{class:"inner inner_back"}),r.a.createElement("div",{class:"window window_front"}),r.a.createElement("div",{class:"roof"},r.a.createElement("div",{class:"roof_top"}),r.a.createElement("div",{class:"roof_back window"}),r.a.createElement("div",{class:"roof_left"}),r.a.createElement("div",{class:"roof_right"}),r.a.createElement("div",{class:"roof_bottom"})),r.a.createElement("div",{class:"door door_left"},r.a.createElement("div",{class:"gull"},r.a.createElement("div",{class:"window"},r.a.createElement("div",{class:"glass"})),r.a.createElement("div",{class:"panel"}),r.a.createElement("div",{class:"mirror"}),r.a.createElement("div",{class:"aero"},r.a.createElement("div",{class:"parts"})))),r.a.createElement("div",{class:"door door_right"},r.a.createElement("div",{class:"gull"},r.a.createElement("div",{class:"window"},r.a.createElement("div",{class:"glass"})),r.a.createElement("div",{class:"panel"}),r.a.createElement("div",{class:"mirror"}),r.a.createElement("div",{class:"aero"},r.a.createElement("div",{class:"parts"})))),r.a.createElement("div",{class:"under"}),r.a.createElement("div",{class:"seat seat_left"}),r.a.createElement("div",{class:"seat seat_right"}),r.a.createElement("div",{class:"handle"}),r.a.createElement("div",{class:"back_mirror"})),r.a.createElement("div",{class:"rear"},r.a.createElement("div",{class:"bumper"},r.a.createElement("div",{class:"taillight taillight_left"}),r.a.createElement("div",{class:"taillight taillight_right"}),r.a.createElement("div",{class:"aero"},r.a.createElement("div",{class:"parts"},r.a.createElement("div",{class:"arm arm_left"}),r.a.createElement("div",{class:"arm arm_right"}),r.a.createElement("div",{class:"wing"}),r.a.createElement("div",{class:"bottom"})))),r.a.createElement("div",{class:"fender fender_left"},r.a.createElement("div",{class:"panel"}),r.a.createElement("div",{class:"aero"},r.a.createElement("div",{class:"parts"}))),r.a.createElement("div",{class:"fender fender_right"},r.a.createElement("div",{class:"panel"}),r.a.createElement("div",{class:"aero"},r.a.createElement("div",{class:"parts"}))),r.a.createElement("div",{class:"luggage"},r.a.createElement("div",{class:"panel"})),r.a.createElement("div",{class:"under"}),r.a.createElement("div",{class:"lamp lamp_left"}),r.a.createElement("div",{class:"lamp lamp_right"}),r.a.createElement("div",{class:"muffler"}))),r.a.createElement("div",{class:"wheel"},r.a.createElement("div",{class:"front"},r.a.createElement("div",{class:"shaft"}),r.a.createElement("div",{class:"tire tire_left"}),r.a.createElement("div",{class:"tire tire_right"})),r.a.createElement("div",{class:"rear"},r.a.createElement("div",{class:"shaft"}),r.a.createElement("div",{class:"tire tire_left"}),r.a.createElement("div",{class:"tire tire_right"})))))))))}}]),t}(a.Component),E=function(n){function t(n){var e;return Object(d.a)(this,t),(e=Object(x.a)(this,Object(u.a)(t).call(this))).state={id:n.id?n.id:null,socket:n.socket?n.socket:null,me:n.me?n.me:null},e}return Object(g.a)(t,n),Object(m.a)(t,[{key:"render",value:function(){var n=this.state,t=n.me,e=n.socket,a=this.props.funcUpdateVelocity;return r.a.createElement("div",null,r.a.createElement(y,{me:t,socket:e,funcUpdateVelocity:a}))}}],[{key:"getDerivedStateFromProps",value:function(n,t){return n}}]),t}(a.Component),_={map:[{loop:1,obstacles:[0,0,1]},{loop:1,obstacles:[0,0,1]},{loop:1,obstacles:[0,0,1]},{loop:1,obstacles:[0,0,1]},{loop:1,obstacles:[0,0,1]},{loop:1,obstacles:[0,0,1]},{loop:1,obstacles:[0,0,1]},{loop:1,obstacles:[0,0,1]},{loop:1,obstacles:[0,0,1]},{loop:1,obstacles:[0,0,1]},{loop:1,obstacles:[0,0,1]},{loop:1,obstacles:[0,0,1]},{loop:1,obstacles:[0,0,1]},{loop:1,obstacles:[0,0,1]},{loop:1,obstacles:[0,0,1]},{loop:2,obstacles:[0,0,1]},{loop:2,obstacles:[0,0,1]},{loop:2,obstacles:[0,0,1]},{loop:2,obstacles:[0,0,1]},{loop:2,obstacles:[0,0,1]},{loop:2,obstacles:[0,0,1]},{loop:2,obstacles:[0,0,1]},{loop:2,obstacles:[0,0,1]},{loop:2,obstacles:[0,0,1]},{loop:2,obstacles:[0,0,1]},{loop:2,obstacles:[0,0,1]},{loop:2,obstacles:[0,0,1]},{loop:2,obstacles:[0,0,1]},{loop:2,obstacles:[0,0,1]},{loop:2,obstacles:[0,0,1]},{loop:2,obstacles:[0,0,1]},{loop:2,obstacles:[0,0,1]},{loop:2,obstacles:[0,0,1]},{loop:2,obstacles:[0,0,1]},{loop:3,obstacles:[0,0,1]},{loop:3,obstacles:[0,0,1]},{loop:3,obstacles:[0,0,1]},{loop:3,obstacles:[0,0,1]},{loop:3,obstacles:[0,0,1]},{loop:3,obstacles:[0,0,1]},{loop:3,obstacles:[0,0,1]},{loop:3,obstacles:[0,0,1]},{loop:3,obstacles:[0,0,1]},{loop:3,obstacles:[0,0,1]},{loop:3,obstacles:[0,0,1]},{loop:3,obstacles:[0,0,1]},{loop:3,obstacles:[0,0,1]},{loop:3,obstacles:[0,0,1]},{loop:3,obstacles:[0,0,1]},{loop:3,obstacles:[0,0,1]},{loop:3,obstacles:[0,0,1]},{loop:3,obstacles:[0,0,1]},{loop:3,obstacles:[0,0,1]},{loop:4,obstacles:[0,0,1]},{loop:4,obstacles:[0,0,1]},{loop:4,obstacles:[0,0,1]},{loop:4,obstacles:[0,0,1]},{loop:4,obstacles:[0,0,1]},{loop:4,obstacles:[0,0,1]},{loop:4,obstacles:[0,0,1]},{loop:4,obstacles:[0,0,1]},{loop:4,obstacles:[0,0,1]},{loop:4,obstacles:[0,0,1]},{loop:4,obstacles:[0,0,1]},{loop:4,obstacles:[0,0,1]},{loop:4,obstacles:[0,0,1]},{loop:4,obstacles:[0,0,1]},{loop:4,obstacles:[0,0,1]},{loop:4,obstacles:[0,0,1]},{loop:4,obstacles:[0,0,1]},{loop:4,obstacles:[0,0,1]},{loop:4,obstacles:[0,0,1]}],scene:[{sec:30,event:"plane"},{sec:30,event:"night"}]};function O(){var n=Object(f.a)(["\n \n .left {\n left: -300px;\n transform: skewX(-55deg);\n height: 600px;\n position: absolute;\n bottom: 0px;\n width: calc( 100% - 700px );\n background: #444;\n z-index: 5;\n\n .move-tracks {\n \n\n ul li div {\n margin-left: calc( 100% - 30px );\n }\n }\n }\n\n ul li div {\n border-left: solid 1px #555;\n border-right: solid 1px #555;\n }\n\n .right {\n right: -300px;\n transform: skewX(55deg);\n height: 600px;\n position: absolute;\n bottom: 0px;\n width: calc( 100% - 700px );\n background: #444;\n z-index: 5;\n }\n\n div {\n\n .move-tracks {\n top: -510px;\n position: absolute;\n animation: move-velocity ",'s linear infinite;\n\n ul {\n\n list-style: none;\n padding: 0px;\n\n li {\n height: 100px;\n width: 500px;\n }\n\n li:nth-child(odd) {\n background-color:#00b33c;\n\n div:nth-child(odd) {\n width: 30px;\n height: 33.3px;\n background: #FFF;\n }\n\n div:nth-child(even) {\n width: 30px;\n height: 33.3px;\n background: #CC6666;\n }\n\n }\n\n li:nth-child(even) {\n background-color:#006622;\n\n div:nth-child(odd) {\n width: 30px;\n height: 33.3px;\n background: #CC6666;\n }\n\n div:nth-child(even) {\n width: 30px;\n height: 33.3px;\n background: #FFF;\n }\n\n }\n\n }\n\n }\n\n .move-tracks[data-stoped="true"] {\n animation: none;\n }\n\n }\n\n @keyframes move-velocity {\n 100% {\n top: -20px;\n }\n }\n']);return O=function(){return n},n}function X(){var n=Object(f.a)(["\n width: 800px;\n height: calc( 100% - 300px );\n position: fixed;\n\n .container-asphalt-tracks {\n height: 500px;\n width: 15px;\n background: 0px;\n position: absolute;\n }\n\n .container-asphalt-tracks.left {\n transform: skewX(-20deg);\n margin-left: 455px;\n }\n\n .container-asphalt-tracks.right {\n transform: skewX(20deg);\n margin-left: 725px;\n }\n\n /* .container-asphalt-tracks div:nth-child(odd) {\n height: 30px;\n }\n\n .container-asphalt-tracks div:nth-child(even) {\n \n background: #FFF;\n height: 50px;\n } */\n\n \n\n .container-asphalt-tracks .move-tracks {\n top: -510px;\n position: absolute;\n animation: move-velocity ",'s linear infinite;\n }\n\n .container-asphalt-tracks div {\n width: 20px;\n top: 5px;\n background: #FFF;\n height: 50px;\n margin-top: 30px;\n }\n\n .move-tracks[data-stoped="true"] {\n animation: none;\n }\n\n']);return X=function(){return n},n}function j(){var n=Object(f.a)(["\n width: 1200px;\n overflow:hidden;\n margin: 0 auto;\n height: 500px;\n bottom: 0px;\n position: fixed;\n background: #302C33;\n left: calc( 50% - 600px )\n"]);return j=function(){return n},n}var Y=b.a.div(j()),Z=b.a.div(X(),(function(n){return n.velocity?11-n.velocity:11})),F=b.a.div(O(),(function(n){return n.velocity?11-n.velocity:11}));function S(){var n=Object(f.a)(["\n width: 170px;\n height: 100px;\n background: #CCC;\n z-index: 10;\n position: absolute;\n border-bottom-right-radius: 3px;\n opacity: 0.8;\n\n ul {\n list-style: none;\n padding: 0px;\n\n li {\n color: #000;\n padding: 10px;\n padding-top: 0px;\n }\n }\n"]);return S=function(){return n},n}var C=b.a.div(S()),D=function(n){function t(n){var e;return Object(d.a)(this,t),(e=Object(x.a)(this,Object(u.a)(t).call(this))).state={velocity:n.velocity?n.velocity:1,loop:n.loop?n.loop:"--",percent:n.percent?n.percent:"--"},e}return Object(g.a)(t,n),Object(m.a)(t,[{key:"render",value:function(){var n=this.state,t=n.velocity,e=n.loop,a=n.percent;return r.a.createElement(C,null,r.a.createElement("div",null,r.a.createElement("ul",null,r.a.createElement("li",null,"Velocidade: ",10*t),r.a.createElement("li",null,"Volta: ",e),r.a.createElement("li",null,"% Percurso: ",a,"%"))))}}],[{key:"getDerivedStateFromProps",value:function(n,t){return n}}]),t}(a.Component),P=function(n){function t(){return Object(d.a)(this,t),Object(x.a)(this,Object(u.a)(t).apply(this,arguments))}return Object(g.a)(t,n),Object(m.a)(t,[{key:"render",value:function(){return null}}]),t}(a.Component),z=function(n){function t(n){var e;return Object(d.a)(this,t),(e=Object(x.a)(this,Object(u.a)(t).call(this))).state={finished:!1,position:0,velocity:1,started:!1,my_id:n.my_id?n.my_id:null,socket:n.socket?n.socket:null,cars:n.cars?n.cars:[],seconds:0},e}return Object(g.a)(t,n),Object(m.a)(t,[{key:"processMap",value:function(){var n=this,t=this,e=this.props.funcFinishRace,a=this.state,r=a.velocity,o=a.position,i=a.seconds;setTimeout((function(){++o>_.map.length?(e(i),n.setState({finished:!0})):(t.setState({position:o}),n.processMap())}),11/r*100)}},{key:"processObstacles",value:function(){var n=this.state.position;return _.map.slice(n,parseFloat(n)+5).map((function(n,t){var e=70*(t+1)*-1;return r.a.createElement(P,{positions:n.obstacles,distance:500-e})}))}},{key:"counterTime",value:function(){var n=this,t=setInterval((function(){var e=n.state,a=e.seconds,r=e.finished;n.setState({seconds:a+1}),r&&clearInterval(t)}),1e3)}},{key:"processStreet",value:function(){var n=this,t=this.state,e=t.velocity,a=t.cars,o=t.started,i=t.position,s=t.socket,l=_.map,c=e<1,p=["","","","","","","","","","","","","",""],d=["","","","","","","","","","","","",""];return a.length>0&&!1===o&&(setTimeout((function(){n.processMap(),n.counterTime(),s.emit("process_accelerator",{})}),3e3),this.setState({started:!0,velocity:0})),r.a.createElement("div",null,r.a.createElement(Y,null,r.a.createElement(F,{velocity:e},r.a.createElement("div",{className:"left"},r.a.createElement("div",{className:"move-tracks","data-stoped":c},r.a.createElement("ul",null,p.map((function(n){return r.a.createElement("li",null,r.a.createElement("div",null),r.a.createElement("div",null),r.a.createElement("div",null))}))))),r.a.createElement("div",{className:"right"},r.a.createElement("div",{className:"move-tracks","data-stoped":c},r.a.createElement("ul",null,p.map((function(n){return r.a.createElement("li",null,r.a.createElement("div",null),r.a.createElement("div",null),r.a.createElement("div",null))})))))),r.a.createElement(Z,{velocity:e},r.a.createElement("div",{className:"container-asphalt-tracks left"},r.a.createElement("div",{className:"move-tracks","data-stoped":c},d.map((function(n,t){return r.a.createElement("div",{style:{top:80*t}})})))),r.a.createElement("div",{className:"container-asphalt-tracks right"},r.a.createElement("div",{className:"move-tracks","data-stoped":c},d.map((function(n){return r.a.createElement("div",null)}))))),o?r.a.createElement(D,{velocity:e,loop:l[i]?l[i].loop:"--",percent:(100/l.length*i).toFixed(0)}):null,a,this.processObstacles()))}},{key:"render",value:function(){return r.a.createElement("div",null,this.processStreet())}}],[{key:"getDerivedStateFromProps",value:function(n,t){return n}}]),t}(a.Component),R=e(64),A=e.n(R);function N(){var n=Object(f.a)(["\n width: 400px;\n min-height: 0px;\n background: #FFF;\n box-shadow: 0px 0px 3px #DDD;\n border-radius: 2px;\n\n * {\n outline: none;\n }\n\n div.header {\n padding: 5px;\n border-bottom: solid 1px #DDD;\n font-size: 12px;\n\n button {\n float: right;\n border: none;\n background: #668FAF;\n border-radius: 2px;\n cursor: pointer;\n color: #FFF;\n }\n }\n\n button.ready {\n float: right;\n margin: 10px;\n margin-top: 0px;\n background: #668FAF;\n border-radius: 2px;\n color: #FFF;\n padding: 5px 10px;\n border: none;\n cursor: pointer;\n }\n\n p.waiting-others-players {\n text-align: center;\n font-size: 12px;\n color: #555;\n }\n\n ul {\n list-style: none;\n padding-left: 0px;\n\n li {\n border-bottom: solid 1px #DDD;\n padding: 5px;\n overflow:hidden;\n line-height: 30px;\n font-size: 13px;\n\n i {\n width: 30px;\n height: 30px;\n border-radius: 3px;\n background: #CCC;\n float: left;\n line-height: 30px;\n text-align: center;\n background: #555;\n color: #FFF;\n font-size: 14px;\n margin-right: 10px;\n }\n\n i.ready {\n float: right;\n color: #333;\n background: transparent;\n }\n\n }\n }\n\n \n"]);return N=function(){return n},n}function T(){var n=Object(f.a)(["\n display: flex;\n align-items: center;\n justify-content: center;\n position: fixed;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n z-index: 1;\n"]);return T=function(){return n},n}var I=b.a.div(T()),M=b.a.div(N()),L=function(n){function t(n){var e;return Object(d.a)(this,t),(e=Object(x.a)(this,Object(u.a)(t).call(this))).state={copyed:!1,ready:!1,room:n.room?n.room:null,socket:n.socket?n.socket:null,users:n.users?n.users:[]},e.setReady=e.setReady.bind(Object(h.a)(e)),e}return Object(g.a)(t,n),Object(m.a)(t,[{key:"getTitleAcronym",value:function(n){if(n.indexOf(" ")>0){var t=n.split(" ");return(t[0].substr(0,1)+t[1].substr(0,1)).toUpperCase()}return n.substr(0,2).toUpperCase()}},{key:"processlistUsers",value:function(){var n=this,t=this.state.users;return r.a.createElement("ul",null,t.map((function(t,e){return r.a.createElement("li",{key:e},r.a.createElement("i",null,n.getTitleAcronym(t.name)),t.name,t.ready_to_race&&!0===t.ready_to_race?r.a.createElement("i",{className:"ready icon-check"}):null)})))}},{key:"copyLink",value:function(){var n,t;return p.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.state.room,(t=document.createElement("input")).value="http://localhost:3000/room/"+n,t.id="copy_field",e.next=6,p.a.awrap(window.document.body.appendChild(t));case 6:return e.next=8,p.a.awrap(window.document.getElementById("copy_field"));case 8:return t=e.sent,e.next=11,p.a.awrap(t.focus());case 11:return e.next=13,p.a.awrap(t.select());case 13:return e.next=15,p.a.awrap(window.document.execCommand("copy"));case 15:return window.document.body.removeChild(t),e.next=18,p.a.awrap(this.setState({copyed:!0}));case 18:case"end":return e.stop()}}),null,this)}},{key:"setReady",value:function(){var n,t,e;return p.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:n=this.state,t=n.socket,e=n.room,t.emit("set_ready_to_race",{room:e}),this.setState({ready:!0});case 3:case"end":return a.stop()}}),null,this)}},{key:"render",value:function(){var n=this,t=this.state,e=t.copyed,a=t.ready;return r.a.createElement(I,null,r.a.createElement(M,null,r.a.createElement("div",null,r.a.createElement("div",{className:"header"},"Competidores",r.a.createElement("button",{onClick:function(){return n.copyLink()}},!1===e?"Copiar Link":"Copiado")),this.processlistUsers(),a?r.a.createElement("p",{className:"waiting-others-players"},"Aguardando os outros jogadores..."):r.a.createElement("button",{className:"ready",onClick:this.setReady},"Estou Pronto"))))}}],[{key:"getDerivedStateFromProps",value:function(n,t){return n}}]),t}(a.Component);function V(){var n=Object(f.a)(["\n width: 100%;\n height: 100px;\n /* background: #FFF; */\n position: fixed;\n top: calc( 50% - 50px );\n /* box-shadow: 0px 0px 3px #CCC; */\n z-index: 5;\n\n i, p {\n margin: 0 auto;\n display: block;\n line-height: 100px;\n font-size: 70px;\n text-align: center;\n color: #555;\n }\n"]);return V=function(){return n},n}var U=b.a.div(V()),B=function(n){function t(n){var e;return Object(d.a)(this,t),(e=Object(x.a)(this,Object(u.a)(t).call(this))).state={since:3},e}return Object(g.a)(t,n),Object(m.a)(t,[{key:"renderCounter",value:function(){var n=this.state.since,t=this;return setTimeout((function(){n--,t.setState({since:n})}),1e3),r.a.createElement(U,null,r.a.createElement("div",null,n>0?r.a.createElement("i",{className:"icon-filter_"+n}):r.a.createElement("p",null,"Vai!")))}},{key:"render",value:function(){return this.state.since<0?null:this.renderCounter()}}],[{key:"getDerivedStateFromProps",value:function(n,t){return n}}]),t}(a.Component);function q(){var n=Object(f.a)(["\n width: 100%;\n height: 100%;\n position: fixed;\n left: 0px;\n top: 0px;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 100;\n\n div {\n width: 200px;\n height: 70px;\n background: #FFF;\n border-radius: 2px;\n box-shadow: 0px 0px 3px #555;\n\n i {\n display: block;\n padding: 10px;\n text-align: center;\n animation: spinner .6s linear infinite;\n }\n\n p {\n text-align: center;\n margin-top: 5px;\n margin-bottom: 10px;\n }\n }\n\n @keyframes spinner {\n to {\n transform: rotate(360deg);\n }\n }\n"]);return q=function(){return n},n}var W=b.a.div(q()),G=function(n){function t(){return Object(d.a)(this,t),Object(x.a)(this,Object(u.a)(t).apply(this,arguments))}return Object(g.a)(t,n),Object(m.a)(t,[{key:"componentDidMount",value:function(){}},{key:"render",value:function(){return r.a.createElement(W,null,r.a.createElement("div",null,r.a.createElement("i",{className:"icon-loopsync"}),r.a.createElement("p",null,"Carregando seus dados...")))}}]),t}(a.Component),J=e(65);function H(){var n=Object(f.a)(["\n position: fixed;\n width: 100%;\n height: 100%;\n left: 0px;\n top: 0px;\n display: flex;\n align-items: center;\n z-index: 1000;\n justify-content: center;\n\n * {\n outline: none;\n }\n\n div{\n width: 500px;\n height: 190px;\n\n div {\n float: left;\n height: 190px;\n }\n\n .controls {\n background: #FFF;\n width: 210px;\n padding-left: 10px;\n padding-top: 5px;\n\n div {\n border-bottom: solid 1px #AAA;\n color: #555;\n padding: 5px;\n margin-bottom: 5px;\n height: 20px;\n width: 190px;\n }\n\n p {\n margin-top: 5px;\n font-size: 12px;\n color: #777;\n display: block;\n overflow: hidden;\n width: 200px;\n\n span {\n font-size: 13px;\n color: #444;\n }\n }\n }\n\n .register {\n background: #EFEFEF;\n width: 250px;\n padding-top: 5px;\n\n p {\n font-size: 14px;\n padding: 10px;\n margin-top: 0px;\n }\n }\n\n form {\n \n div {\n border: solid 1px #AAA;\n border-radius: 2px;\n width: 200px;\n margin-left: 22px;\n height: 30px;\n overflow: hidden;\n background: #FEFEFE;\n\n i {\n width: 30px;\n height: 30px;\n border-right: solid 1px #AAA;\n text-align: center;\n line-height: 30px;\n background: #EEE;\n color: #555;\n float: left;\n }\n\n input {\n height: 30px;\n width: calc( 100% - 43px );\n border: none;\n float: left;\n background: transparent;\n padding-left: 10px;\n }\n }\n \n }\n\n button {\n width: 200px;\n border: none;\n background: #668FAF;\n color: #FFF;\n margin-left: 22px;\n height: 30px;\n border-radius: 3px;\n margin-top: 10px;\n cursor: pointer;\n }\n\n }\n"]);return H=function(){return n},n}var $=b.a.div(H()),K=function(){var n,t,e;return p.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return n=localStorage.getItem("auth_token"),t=localStorage.getItem("nickname"),e={success:!1},t&&void 0!==t&&n&&void 0!==n&&(e={success:!0,metadata:{token:n,nickname:t}}),a.abrupt("return",e);case 5:case"end":return a.stop()}}))},Q=function(n,t){return p.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:return localStorage.setItem("auth_token",t),localStorage.setItem("nickname",n),e.abrupt("return",{success:!0,metadata:{token:t,nickname:n}});case 3:case"end":return e.stop()}}))},nn=e(107),tn=function(){var n;return p.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return n=(new Date).getTime(),t.next=3,p.a.awrap(nn.sha1(n));case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}))},en=function(){var n;return p.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return n=(new Date).getTime(),t.next=3,p.a.awrap(nn.sha1(n));case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}))},an=function(n){function t(n){var e;return Object(d.a)(this,t),(e=Object(x.a)(this,Object(u.a)(t).call(this))).state={name:n.nickname?n.nickname:"",room_id:n.room_id?n.room_id:null},e.saveData=e.saveData.bind(Object(h.a)(e)),e}return Object(g.a)(t,n),Object(m.a)(t,[{key:"updateState",value:function(n,t){this.setState(Object(J.a)({},n,t))}},{key:"saveData",value:function(n){var t,e,a,r,o;return p.a.async((function(i){for(;;)switch(i.prev=i.next){case 0:return n.preventDefault(),t=this.state,e=t.name,a=t.room_id,i.next=4,p.a.awrap(tn());case 4:return r=i.sent,i.next=7,p.a.awrap(Q(e,r));case 7:if(!i.sent.success){i.next=18;break}if(null===a){i.next=13;break}i.t0=a,i.next=16;break;case 13:return i.next=15,p.a.awrap(en());case 15:i.t0=i.sent;case 16:o=i.t0,window.location.href="/room/"+o;case 18:case"end":return i.stop()}}),null,this)}},{key:"render",value:function(){var n=this,t=this.state,e=t.name,a=t.room_id;return r.a.createElement($,null,r.a.createElement("div",null,r.a.createElement("div",{className:"controls"},r.a.createElement("div",null,"Controles"),r.a.createElement("p",null,r.a.createElement("span",null,"A ou Left")," - Ir para a pista da direita"),r.a.createElement("p",null,r.a.createElement("span",null,"D ou Right")," - Ir para a pista da esquerda"),r.a.createElement("p",null,r.a.createElement("span",null,"W ou Up")," - Acelerar(substitui o turbo)"),r.a.createElement("p",null,r.a.createElement("span",null,"S ou Down")," - Desacelerar"),r.a.createElement("p",null,r.a.createElement("span",null,"ESC")," - Pausar(Apenas no Single Player)")),r.a.createElement("div",{className:"register"},r.a.createElement("p",null,"The Race Game"),r.a.createElement("form",{onSubmit:this.saveData},r.a.createElement("div",null,r.a.createElement("i",{className:"icon-user"}),r.a.createElement("input",{type:"text",placeholder:"Digite nickname",onChange:function(t){n.updateState("name",t.target.value)},value:e})),r.a.createElement("button",null,null!==a?"Entrar na Sala":"Criar uma Corrida")))))}}]),t}(a.Component);function rn(){var n=Object(f.a)(["\n width: 100%;\n height: 100%;\n position: fixed;\n left: 0px;\n top: 0px;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 100;\n\n * {\n outline: none;\n }\n\n div {\n width: 450px;\n height: 230px;\n background: #FFF;\n border-radius: 2px;\n box-shadow: 0px 0px 3px #555;\n\n h1 {\n font-size: 20px;\n text-align: center;\n margin-bottom: 10px;\n padding: 10px;\n }\n\n p[data-description] {\n font-size: 14px;\n text-align: center;\n margin-top: 0px;\n }\n\n p[data-time] {\n font-size: 22px;\n font-weight: bold;\n text-align: center;\n margin-top: 0px;\n }\n\n button {\n border-radius: 3px;\n padding: 10px;\n background: #668FAF;\n color: #FFF;\n margin: 0 auto;\n display: block;\n margin-top: 10px;\n border: none;\n cursor: pointer;\n }\n\n }\n"]);return rn=function(){return n},n}var on=b.a.div(rn()),sn=e(33),ln=e.n(sn),cn=function(){var n;return p.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,p.a.awrap(ln.a.post("http://localhost:8085/",{query:"{\n listRank {\n seconds\n name\n }\n }"}));case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}))},pn=function(n,t){var e;return p.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,p.a.awrap(ln.a.post("http://localhost:8085/",{query:'mutation {\n addLeaderBoard(name: "'.concat(n,'", seconds: ').concat(t,") {\n name\n seconds\n }\n }")}));case 2:return e=a.sent,a.abrupt("return",e.data);case 4:case"end":return a.stop()}}))},dn=function(n){function t(n){var e;return Object(d.a)(this,t),(e=Object(x.a)(this,Object(u.a)(t).call(this))).state={seconds:n.seconds?n.seconds:0},e}return Object(g.a)(t,n),Object(m.a)(t,[{key:"componentDidMount",value:function(){var n,t;return p.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.state.seconds,e.next=3,p.a.awrap(K());case 3:(t=e.sent).success&&n>0&&pn(t.metadata.nickname,n);case 5:case"end":return e.stop()}}),null,this)}},{key:"switchOtherRoom",value:function(){var n;return p.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,p.a.awrap(en());case 2:n=t.sent,window.location.href="/room/"+n;case 4:case"end":return t.stop()}}))}},{key:"render",value:function(){var n=this,t=this.state.seconds;return r.a.createElement(on,null,r.a.createElement("div",null,r.a.createElement("h1",null,"Parab\xe9ns! Voc\xea completou todo o percurso da corrida"),r.a.createElement("p",{"data-description":!0},"Seu tempo foi:"),r.a.createElement("p",{"data-time":!0},t," Segundos"),r.a.createElement("button",{onClick:function(){return n.switchOtherRoom()}},"Ir para outra corrida")))}}]),t}(a.Component),mn=function(n){function t(){var n;return Object(d.a)(this,t),(n=Object(x.a)(this,Object(u.a)(t).call(this))).state={seconds:0,finished:!1,my_id:null,users:[],loading_data:!0,room:null,velocity:0},n.componentDidMount=n.componentDidMount.bind(Object(h.a)(n)),n.manageControls=n.manageControls.bind(Object(h.a)(n)),n.manageStopControls=n.manageStopControls.bind(Object(h.a)(n)),n.updateVelocity=n.updateVelocity.bind(Object(h.a)(n)),n.finishRace=n.finishRace.bind(Object(h.a)(n)),n}return Object(g.a)(t,n),Object(m.a)(t,[{key:"componentDidMount",value:function(){var n,t,e,a,r,o=this;return p.a.async((function(i){for(;;)switch(i.prev=i.next){case 0:return document.title="The Race Game",i.next=3,p.a.awrap(K());case 3:if(!(n=i.sent).success){i.next=18;break}return t=this.props.match.params.room_id,e=n.metadata.nickname,a=n.metadata.token,i.next=10,p.a.awrap(A()("http://localhost:8000/",{query:"name=".concat(e,"&token=").concat(a,"&ready_to_race=false")}));case 10:(r=i.sent).emit("authenticate",{name:e,token:a,room_name:t}),r.on("connected",(function(n){return p.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:n.success&&o.setState({my_id:n.id,users:n.users,ready_to_race:n.ready_to_race,socket:r,room:t,loading_data:!1});case 1:case"end":return e.stop()}}))})),r.on("room_users",(function(n){return p.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:if(!n.success){t.next=3;break}return t.next=3,p.a.awrap(o.setState({users:n.users}));case 3:case"end":return t.stop()}}))})),document.addEventListener("keydown",this.manageControls,!1),document.addEventListener("keyup",this.manageStopControls,!1),i.next=19;break;case 18:this.setState({loading_data:!1});case 19:case"end":return i.stop()}}),null,this)}},{key:"manageStopControls",value:function(n){if(null===this.state.socket)return null}},{key:"manageControls",value:function(n){var t=this.state.socket;if(null===t)return null;switch(n.keyCode){case 39:case 68:t.emit("process_turn_right",{});break;case 65:case 37:t.emit("process_turn_left",{});break;case 27:t.emit("process_pause",{});break;case 38:case 87:t.emit("process_accelerator",{});break;case 40:case 83:t.emit("process_stop",{})}}},{key:"processCars",value:function(){var n=this,t=this.state,e=t.users,a=t.socket,o=t.my_id;return e.map((function(t){return r.a.createElement(E,{id:t.id,socket:a,me:t.id===o,funcUpdateVelocity:n.updateVelocity})}))}},{key:"updateVelocity",value:function(n){this.setState({velocity:n})}},{key:"finishRace",value:function(n){this.setState({finished:!0,velocity:1,seconds:n})}},{key:"renderRace",value:function(){var n=this.processCars(),t=this.state,e=t.socket,a=t.velocity,o=t.finished,i=t.seconds;return o?r.a.createElement("div",null,r.a.createElement(dn,{seconds:i}),r.a.createElement(z,{cars:[]})):r.a.createElement("div",null,r.a.createElement(B,null),r.a.createElement(z,{funcFinishRace:this.finishRace,velocity:a,socket:e,cars:n}))}},{key:"renderLoading",value:function(){var n=this.state,t=n.users,e=n.socket,a=n.room,o=n.my_id;return!0===n.loading_data?r.a.createElement("div",null,r.a.createElement(G,null),r.a.createElement(z,{cars:[]})):null===o?r.a.createElement("div",null,r.a.createElement(an,{room_id:a}),r.a.createElement(z,{cars:[]})):r.a.createElement("div",null,r.a.createElement("div",null,r.a.createElement(L,{socket:e,users:t,velocity:5,room:a})),r.a.createElement(z,{cars:[]}))}},{key:"render",value:function(){var n=this.state.users;return 0===n.filter((function(n){return!n.ready_to_race||!0!==n.ready_to_race})).length&&n.length>0?this.renderRace():this.renderLoading()}}]),t}(a.Component);function xn(){var n=Object(f.a)(["\n\n position: fixed;\n width: 100%;\n height: 100%;\n left: 0px;\n top: 0px;\n display: flex;\n align-items: center;\n justify-content: center;\n\n i {\n width: 30px;\n height: 30px;\n text-align: center;\n line-height: 30px;\n font-size: 30px;\n display: block;\n animation: spinner .6s linear infinite;\n }\n\n @keyframes spinner {\n to {\n transform: rotate(360deg);\n }\n }\n"]);return xn=function(){return n},n}var un=b.a.div(xn()),hn=function(n){function t(n){return Object(d.a)(this,t),Object(x.a)(this,Object(u.a)(t).call(this))}return Object(g.a)(t,n),Object(m.a)(t,[{key:"render",value:function(){return r.a.createElement(un,null,r.a.createElement("div",null,r.a.createElement("i",{className:"icon-loopsync"})))}}]),t}(a.Component);function gn(){var n=Object(f.a)(['\n\n * {\n outline: none;\n }\n\n div.container-board {\n\n width: 400px;\n position: fixed;\n height: 100%;\n top: 0px;\n right: 0px;\n z-index: 10000;\n\n }\n \n\n div[data-status="closed"] {\n transition: 0.3s;\n right: -350px;\n }\n\n div[data-status="opened"] {\n transition: 0.3s;\n right: 0px;\n }\n\n button {\n position: absolute;\n top: 50%;\n margin-top: -25px;\n width: 50px;\n height: 50px;\n background: #DDD;\n border: none;\n cursor: pointer;\n }\n\n .board {\n width: 350px;\n position: absolute;\n height: 100%;\n background: #DDD;\n margin-left: 50px;\n\n .header {\n border-bottom: solid 1px #AAA;\n padding: 10px;\n font-size: 20px;\n margin: 10px;\n }\n\n ul {\n list-style: none;\n\n li {\n display: block;\n overflow: hidden;\n\n i {\n float: left;\n width: 30px;\n height: 30px;\n text-align: center;\n line-height: 30px;\n margin-right: 10px;\n }\n\n span {\n font-size: 14px;\n line-height: 30px;\n }\n\n span[data-time] {\n font-size: 11px;\n margin-left: 5px;\n }\n }\n\n }\n\n }\n']);return gn=function(){return n},n}var fn=b.a.div(gn()),bn=function(n){function t(n){var e;return Object(d.a)(this,t),(e=Object(x.a)(this,Object(u.a)(t).call(this))).state={status:"closed",rank:n.rank?n.rank:[]},e}return Object(g.a)(t,n),Object(m.a)(t,[{key:"toggleBoard",value:function(){var n;return p.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return n="closed"===(n=this.state.status)?"opened":"closed",t.next=4,p.a.awrap(this.setState({status:n}));case 4:case"end":return t.stop()}}),null,this)}},{key:"render",value:function(){var n=this,t=this.state,e=t.status,a=t.rank;return r.a.createElement(fn,null,r.a.createElement("div",{"data-status":e,className:"container-board"},r.a.createElement("button",{className:"icon-flag",onClick:function(){return n.toggleBoard()}}),r.a.createElement("div",{className:"board"},r.a.createElement("div",{className:"header"},"Rank"),r.a.createElement("ul",null,a.map((function(n){return r.a.createElement("li",null,r.a.createElement("i",{className:"icon-flag"}),r.a.createElement("span",null,n.name),r.a.createElement("span",{"data-time":!0},n.seconds,"seg"))}))))))}}],[{key:"getDerivedStateFromProps",value:function(n,t){return n}}]),t}(a.Component),kn=function(n){function t(n){var e;return Object(d.a)(this,t),(e=Object(x.a)(this,Object(u.a)(t).call(this))).state={loading:!0,nickname:null},e}return Object(g.a)(t,n),Object(m.a)(t,[{key:"componentDidMount",value:function(){var n,t,e,a;return p.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,p.a.awrap(K());case 2:return n=r.sent,r.next=5,p.a.awrap(cn());case 5:t=r.sent,e=t.data.listRank,n.success?(a=n.metadata.nickname,this.setState({nickname:a,loading:!1,rank:e})):this.setState({loading:!1,rank:e});case 8:case"end":return r.stop()}}),null,this)}},{key:"renderLoading",value:function(){return r.a.createElement(hn,null)}},{key:"renderPanel",value:function(){var n=this.state,t=n.nickname,e=n.rank;return r.a.createElement("div",null,r.a.createElement(an,{nickname:t}),r.a.createElement(bn,{rank:e}))}},{key:"render",value:function(){return this.state.loading?this.renderLoading():this.renderPanel()}}]),t}(a.Component);i.a.render(r.a.createElement(s.a,null,r.a.createElement(l.c,null,r.a.createElement(l.a,{path:"/",component:kn,exact:!0}),r.a.createElement(l.a,{path:"/room/:room_id",component:mn,exact:!0}))),document.getElementById("root")),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((function(n){n.unregister()}))},69:function(n,t,e){n.exports=e(127)},74:function(n,t,e){}},[[69,1,2]]]);
//# sourceMappingURL=main.4fe9eca9.chunk.js.map
|
var class_mechanism_parameters =
[
[ "MECHANISM_PARAM_TYPE", "class_mechanism_parameters.html#a33645fbdee2537b07f48e371662ab14e", [
[ "MECHANISM_PARAM_UNKNOWN", "class_mechanism_parameters.html#a33645fbdee2537b07f48e371662ab14ea308877e2743e85bce63fa0a77bd2c575", null ],
[ "LEGAL_STARTING_ANGLE", "class_mechanism_parameters.html#a33645fbdee2537b07f48e371662ab14ea4104b085e185c94e0b4ea0fef9e1e64e", null ],
[ "TEST_STARTING_ANGLE", "class_mechanism_parameters.html#a33645fbdee2537b07f48e371662ab14ea7e912093cdb3216546459bb09a5b2a2a", null ],
[ "EXTENDER_LEGAL_STARTING_INCHES", "class_mechanism_parameters.html#a33645fbdee2537b07f48e371662ab14ea28695eed2207077bcb2c79968a5a3274", null ],
[ "EXTENDER_TEST_STARTING_INCHES", "class_mechanism_parameters.html#a33645fbdee2537b07f48e371662ab14ea56ac972f37e32d3475d8a968844fc10d", null ],
[ "HATCH_FLOOR_ANGLE", "class_mechanism_parameters.html#a33645fbdee2537b07f48e371662ab14ea7b446b7731ca88d0f19467b456dac4f8", null ],
[ "HATCH_HP_SECOND_ANGLE", "class_mechanism_parameters.html#a33645fbdee2537b07f48e371662ab14ea50fbfaa5908570cfc9274dbbe50c565b", null ],
[ "HATCH_LOW_ANGLE", "class_mechanism_parameters.html#a33645fbdee2537b07f48e371662ab14eacc7e849e379b920d3b402bb276304d5b", null ],
[ "HATCH_MID_ANGLE", "class_mechanism_parameters.html#a33645fbdee2537b07f48e371662ab14ead10a9688cfef58d82693948f29dc933a", null ],
[ "HATCH_HIGH_ANGLE", "class_mechanism_parameters.html#a33645fbdee2537b07f48e371662ab14ea4d719df25ac5a231b4c1b8b7b6ce4b60", null ],
[ "HATCH_LOW_SECOND_ANGLE", "class_mechanism_parameters.html#a33645fbdee2537b07f48e371662ab14ea3e5e971fc3752a3cb0a3f1eb1a1da246", null ],
[ "HATCH_MID_SECOND_ANGLE", "class_mechanism_parameters.html#a33645fbdee2537b07f48e371662ab14ea464199d5fb9092193fcbd71d5fe4673e", null ],
[ "HATCH_HIGH_SECOND_ANGLE", "class_mechanism_parameters.html#a33645fbdee2537b07f48e371662ab14ead166fe2d21a963404766378814a59031", null ],
[ "CARGO_FLOOR_ANGLE", "class_mechanism_parameters.html#a33645fbdee2537b07f48e371662ab14ea43d92f6b4517deef20b6c5b75dbe512a", null ],
[ "CARGO_HP_ANGLE", "class_mechanism_parameters.html#a33645fbdee2537b07f48e371662ab14eabe5831d0e16b31c0cffcbb53ecfe5a68", null ],
[ "CARGO_SHIP_ANGLE", "class_mechanism_parameters.html#a33645fbdee2537b07f48e371662ab14eadbfb5f2bb91ab2002b14a9ebbb68a5ec", null ],
[ "CARGO_LOW_ANGLE", "class_mechanism_parameters.html#a33645fbdee2537b07f48e371662ab14eafa12397bc35855aedfeb1d995fc2750f", null ],
[ "CARGO_MID_ANGLE", "class_mechanism_parameters.html#a33645fbdee2537b07f48e371662ab14eae70a93252fd5328ca9441380afa88b9c", null ],
[ "CARGO_HIGH_ANGLE", "class_mechanism_parameters.html#a33645fbdee2537b07f48e371662ab14ea5787980f3e5553f96ed7a46a1de16170", null ],
[ "HATCH_FLOOR_EXTENSION", "class_mechanism_parameters.html#a33645fbdee2537b07f48e371662ab14ea23e64de11920ca7fa020400a00e4be4f", null ],
[ "HATCH_HP_SECOND_EXTENSION", "class_mechanism_parameters.html#a33645fbdee2537b07f48e371662ab14ea17764064b3a07e693dc554d5fd27b7cc", null ],
[ "HATCH_LOW_EXTENSION", "class_mechanism_parameters.html#a33645fbdee2537b07f48e371662ab14eaece69f28186d56831ef23f19c213d68e", null ],
[ "HATCH_MID_EXTENSION", "class_mechanism_parameters.html#a33645fbdee2537b07f48e371662ab14eac599781e9161cd16543bbade6793950c", null ],
[ "HATCH_HIGH_EXTENSION", "class_mechanism_parameters.html#a33645fbdee2537b07f48e371662ab14eaa1425ae36ee7a841efab26a8a676f0e7", null ],
[ "HATCH_LOW_SECOND_EXTENSION", "class_mechanism_parameters.html#a33645fbdee2537b07f48e371662ab14ead0518be19ed76f452f0a29c228a36e8a", null ],
[ "HATCH_MID_SECOND_EXTENSION", "class_mechanism_parameters.html#a33645fbdee2537b07f48e371662ab14eaecb590c8ab29f3fcd38d6678a9950362", null ],
[ "HATCH_HIGH_SECOND_EXTENSION", "class_mechanism_parameters.html#a33645fbdee2537b07f48e371662ab14eac026e1112ba074f25db8b710c3894345", null ],
[ "CARGO_FLOOR_EXTENSION", "class_mechanism_parameters.html#a33645fbdee2537b07f48e371662ab14ea9d4c848c93eb7131f65222d85882878f", null ],
[ "CARGO_HP_EXTENSION", "class_mechanism_parameters.html#a33645fbdee2537b07f48e371662ab14ea3695cf4b724d018f80cf411397a0ecc6", null ],
[ "CARGO_HP_HOLE_EXTENSION", "class_mechanism_parameters.html#a33645fbdee2537b07f48e371662ab14ea4befafb9074da3a1c699914b590ba66a", null ],
[ "CARGO_SHIP_EXTENSION", "class_mechanism_parameters.html#a33645fbdee2537b07f48e371662ab14eaebee40d9defde37aa93b68c35d9fb34d", null ],
[ "CARGO_LOW_EXTENSION", "class_mechanism_parameters.html#a33645fbdee2537b07f48e371662ab14ea3ea38352fedfe978ef53613f1292b359", null ],
[ "CARGO_MID_EXTENSION", "class_mechanism_parameters.html#a33645fbdee2537b07f48e371662ab14ead2feda35b2a35d094e359a0fbbc88d66", null ],
[ "CARGO_HIGH_EXTENSION", "class_mechanism_parameters.html#a33645fbdee2537b07f48e371662ab14ea742cc7f82dbe1e315739d49232551f4e", null ],
[ "CARGO_INTAKE_SPEED_PARAM", "class_mechanism_parameters.html#a33645fbdee2537b07f48e371662ab14ea30db229dc1d8c0ebde1ab0a02ad380c4", null ],
[ "CARGO_OUTTAKE_SPEED_PARAM", "class_mechanism_parameters.html#a33645fbdee2537b07f48e371662ab14ea73b0b4897ec0a64a8de5de29ab45f004", null ],
[ "HATCH_INTAKE_SPEED_PARAM", "class_mechanism_parameters.html#a33645fbdee2537b07f48e371662ab14eaacf72a503fd81949d4009a3459e87f8d", null ],
[ "HATCH_OUTTAKE_SPEED_PARAM", "class_mechanism_parameters.html#a33645fbdee2537b07f48e371662ab14eaa299ae32ab89ec738c047235125b41dc", null ],
[ "SERVO_LOCKED_POSITION_PARAM", "class_mechanism_parameters.html#a33645fbdee2537b07f48e371662ab14ea313258d9c747ff0d9c11e71392654b64", null ],
[ "SERVO_DROPPED_POSITION_PARAM", "class_mechanism_parameters.html#a33645fbdee2537b07f48e371662ab14eadb58ee366b4fd62a063c481a799827b8", null ],
[ "HATCH_MECH_OPEN_ROTATIONS", "class_mechanism_parameters.html#a33645fbdee2537b07f48e371662ab14ea1922d787bcea639352af1d116e053471", null ],
[ "MAX_MECHANISM_PARAM_TYPES", "class_mechanism_parameters.html#a33645fbdee2537b07f48e371662ab14ea2084a06934c1683b9f0ac59d10ee9c74", null ]
] ]
];
|
export default value => typeof value === 'number' && !Number.isNaN(value);
|
var searchData=
[
['setup_5fio',['setup_io',['../gpio_8c.html#ac64388911fd8e6e1c8756c9abb8b3824',1,'gpio.c']]],
['status',['status',['../classstatus.html',1,'']]]
];
|
const Chunks = require('prismarine-chunk')
const mcData = require('minecraft-data')
function columnKey (x, z) {
return `${x},${z}`
}
function posInChunk (pos) {
pos = pos.floored()
pos.x &= 15
pos.z &= 15
return pos
}
function isCube (shapes) {
if (!shapes || shapes.length !== 1) return false
const shape = shapes[0]
return shape[0] === 0 && shape[1] === 0 && shape[2] === 0 && shape[3] === 1 && shape[4] === 1 && shape[5] === 1
}
class World {
constructor (version) {
this.Chunk = Chunks(version)
this.columns = {}
this.blockCache = {}
this.biomeCache = mcData(version).biomes
}
addColumn (x, z, json) {
const chunk = this.Chunk.fromJson(json)
this.columns[columnKey(x, z)] = chunk
return chunk
}
removeColumn (x, z) {
delete this.columns[columnKey(x, z)]
}
getColumn (x, z) {
return this.columns[columnKey(x, z)]
}
setBlockStateId (pos, stateId) {
const key = columnKey(Math.floor(pos.x / 16) * 16, Math.floor(pos.z / 16) * 16)
const column = this.columns[key]
// null column means chunk not loaded
if (!column) return false
column.setBlockStateId(posInChunk(pos.floored()), stateId)
return true
}
getBlock (pos) {
const key = columnKey(Math.floor(pos.x / 16) * 16, Math.floor(pos.z / 16) * 16)
const column = this.columns[key]
// null column means chunk not loaded
if (!column) return null
const loc = pos.floored()
const locInChunk = posInChunk(loc)
const stateId = column.getBlockStateId(locInChunk)
if (!this.blockCache[stateId]) {
const b = column.getBlock(locInChunk)
b.isCube = isCube(b.shapes)
this.blockCache[stateId] = b
}
const block = this.blockCache[stateId]
block.position = loc
block.biome = this.biomeCache[column.getBiome(locInChunk)]
return block
}
}
module.exports = { World }
|
const test = require("tape");
const fs = require("fs");
const testUtils = require("../../../bin/tools/utils");
const path = require("path");
const testDir = path.join(__dirname, "test-qx-package");
const appDir = path.join(testDir, "myapp");
// set DEBUG envvar to get colorized verbose output
const debug = Boolean(process.env.DEBUG);
const qxCmdPath = testUtils.getCompiler(debug ? "source":"build");
let debugArg = "";
if (debug) {
const colorize = require('tap-colorize');
test.createStream().pipe(colorize()).pipe(process.stdout);
debugArg += "--debug --colorize";
}
test("Create app", async assert => {
try {
await testUtils.deleteRecursive(appDir);
let result;
result = await testUtils.runCommand(testDir, qxCmdPath, "create", "myapp", "-I");
assert.ok(result.exitCode === 0);
assert.ok(fs.existsSync(path.join(appDir, "compile.json")));
result = await testUtils.runCommand(appDir, qxCmdPath, "package", "list", "--all", "--verbose");
assert.ok(result.exitCode === 0);
assert.end();
} catch (ex) {
assert.end(ex);
}
});
test("Install qxl.test1, latest version", async assert => {
try {
let result;
result = await testUtils.runCommand(appDir, qxCmdPath, "package", "install", "qooxdoo/qxl.test1@latest");
assert.ok(result.exitCode === 0);
result = await testUtils.runCommand(appDir, qxCmdPath, "package", "list", "--short", "--noheaders", "--installed", "--all");
assert.ok(result.exitCode === 0);
assert.equal(result.output.split("\n").length, 3, "Output should be 3 lines");
result = await testUtils.runCompiler(appDir);
assert.ok(result.exitCode === 0);
result = await testUtils.runCommand(appDir, qxCmdPath, "package", "remove", "qooxdoo/qxl.test1");
assert.ok(result.exitCode === 0);
assert.end();
} catch (ex) {
assert.end(ex);
}
});
test("Install qxl.test2/qxl.test2A, latest version", async assert => {
try {
let result;
result = await testUtils.runCommand(appDir, qxCmdPath, "package", "install", "qooxdoo/qxl.test2/qxl.test2A@2.0.2");
assert.ok(result.exitCode === 0);
result = await testUtils.runCommand(appDir, qxCmdPath, "package", "list", "--short", "--noheaders", "--installed", "--all");
assert.ok(result.exitCode === 0);
assert.equal(result.output.split("\n").length, 4, "Output should be 4 lines");
result = await testUtils.runCompiler(appDir);
assert.ok(result.exitCode === 0);
result = await testUtils.runCommand(appDir, qxCmdPath, "package", "remove", "qooxdoo/qxl.test2/qxl.test2A");
assert.ok(result.exitCode === 0);
assert.end();
} catch (ex) {
assert.end(ex);
}
});
test("Install qxl.test1@release then migrate and upgrade", async assert => {
try {
let result;
result = await testUtils.runCommand(appDir, qxCmdPath, "package", "install", "qooxdoo/qxl.test1@v1.2.1");
assert.ok(result.exitCode === 0);
result = await testUtils.runCommand(appDir, qxCmdPath, "package", "list", "--short", "--noheaders", "--installed", "--all");
assert.ok(result.exitCode === 0);
assert.equal(result.output.split("\n").length, 4, "Output should be 4 lines");
result = await testUtils.runCommand(path.join(appDir, "qx_packages/qooxdoo_qxl_test1_v1_2_1"), qxCmdPath, "migrate");
assert.ok(result.exitCode === 0);
result = await testUtils.runCompiler(appDir);
assert.ok(result.exitCode === 0);
result = await testUtils.runCommand(appDir, qxCmdPath, "package", "upgrade");
assert.ok(result.exitCode === 0);
result = await testUtils.runCompiler(appDir);
assert.ok(result.exitCode === 0);
result = await testUtils.runCommand(appDir, qxCmdPath, "package", "remove", "qooxdoo/qxl.test1");
assert.ok(result.exitCode === 0);
assert.end();
} catch (ex) {
assert.end(ex);
}
});
test("Install qxl.test1@commit", async assert => {
try {
let result;
result = await testUtils.runCommand(appDir, qxCmdPath, "package", "install", "qooxdoo/qxl.test1@b1125235c1002aadf84134c0fa52f5f037f466cd");
assert.ok(result.exitCode === 0);
result = await testUtils.runCommand(appDir, qxCmdPath, "package", "list", "--short", "--noheaders", "--installed", "--all");
assert.ok(result.exitCode === 0);
assert.ok(result.output.split("\n").length === 4);
result = await testUtils.runCompiler(appDir);
assert.ok(result.exitCode === 0);
assert.end();
} catch (ex) {
assert.end(ex);
}
});
|
// TODO: is there a different ability if the shield duty action isn't used properly?
// TODO: is there an ability from Raiden (the bird) if you get eaten?
// TODO: maybe chain lightning warning if you get hit while you have system shock (8B8)
let noOrb = (str) => {
return {
en: str + ' (no orb)',
de: str + ' (kein Orb)',
fr: str + ' (pas d\'orbe)',
ja: str + ' (雷玉無し)',
cn: str + ' (没吃球)',
ko: str + ' (구슬 없음)',
};
};
[{
zoneId: ZoneId.EdensVerseFulminationSavage,
damageWarn: {
'E5S Impact': '4E3B', // Stratospear landing AoE
'E5S Gallop': '4BB4', // Sideways add charge
'E5S Shock Strike': '4BC1', // Small AoE circles during Thunderstorm
'E5S Stepped Leader Twister': '4BC7', // Twister stepped leader
'E5S Stepped Leader Donut': '4BC8', // Donut stepped leader
'E5S Shock': '4E3D', // Hated of Levin Stormcloud-cleansable exploding debuff
},
damageFail: {
'E5S Judgment Jolt': '4BA7', // Stratospear explosions
},
shareWarn: {
'E5S Volt Strike Double': '4BC3', // Large AoE circles during Thunderstorm
'E5S Crippling Blow': '4BCA',
'E5S Chain Lightning Double': '4BC5',
},
triggers: [
{
// Helper for orb pickup failures
id: 'E5S Orb Gain',
netRegex: NetRegexes.gainsEffect({ effectId: '8B4' }),
run: function(e, data, matches) {
data.hasOrb = data.hasOrb || {};
data.hasOrb[matches.target] = true;
},
},
{
id: 'E5S Orb Lose',
netRegex: NetRegexes.losesEffect({ effectId: '8B4' }),
run: function(e, data, matches) {
data.hasOrb = data.hasOrb || {};
data.hasOrb[matches.target] = false;
},
},
{
id: 'E5S Divine Judgement Volts',
damageRegex: '4BB7',
condition: function(e, data) {
return !data.hasOrb || !data.hasOrb[e.targetName];
},
mistake: function(e) {
return { type: 'fail', blame: e.targetName, text: noOrb(e.abilityName) };
},
},
{
id: 'E5S Volt Strike Orb',
damageRegex: '4BC3',
condition: function(e, data) {
return !data.hasOrb || !data.hasOrb[e.targetName];
},
mistake: function(e) {
return { type: 'fail', blame: e.targetName, text: noOrb(e.abilityName) };
},
},
{
id: 'E5S Deadly Discharge Big Knockback',
damageRegex: '4BB2',
condition: function(e, data) {
return !data.hasOrb || !data.hasOrb[e.targetName];
},
mistake: function(e) {
return { type: 'fail', blame: e.targetName, text: noOrb(e.abilityName) };
},
},
{
id: 'E5S Lightning Bolt',
damageRegex: '4BB9',
condition: function(e, data) {
// Having a non-idempotent condition function is a bit <_<
// Only consider lightning bolt damage if you have a debuff to clear.
if (!data.hated || !data.hated[e.targetName])
return true;
delete data.hated[e.targetName];
return false;
},
mistake: function(e, data) {
return { type: 'warn', blame: e.targetName, text: e.abilityName };
},
},
{
id: 'E5S Hated of Levin',
netRegex: NetRegexes.headMarker({ id: '00D2' }),
run: function(e, data, matches) {
data.hated = data.hated || {};
data.hated[matches.target] = true;
},
},
{
id: 'E5S Stormcloud Target Tracking',
netRegex: NetRegexes.headMarker({ id: '006E' }),
run: function(e, data, matches) {
data.cloudMarkers = data.cloudMarkers || [];
data.cloudMarkers.push(matches.target);
},
},
{
// This ability is seen only if players stacked the clouds instead of spreading them.
id: 'E5S The Parting Clouds',
damageRegex: '4BBA',
suppressSeconds: 30,
mistake: function(e, data) {
for (let m of data.cloudMarkers) {
return {
type: 'fail',
blame: data.cloudMarkers[m],
text: e.abilityName + '(clouds too close)',
};
}
},
},
{
id: 'E5S Stormcloud cleanup',
netRegex: NetRegexes.headMarker({ id: '006E' }),
// Stormclouds resolve well before this.
delaySeconds: 30,
run: function(e, data) {
delete data.cloudMarkers;
delete data.hated;
},
},
],
}];
|
module.exports = {
parser: '@typescript-eslint/parser',
extends: [
'torchbox',
'plugin:@typescript-eslint/recommended',
],
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
},
rules: {
'@typescript-eslint/explicit-member-accessibility': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'react/jsx-filename-extension': [1, { 'extensions': ['.jsx', '.tsx'] }],
},
settings: {
'import/resolver': {
'node': {
'extensions': ['.js', '.jsx', '.ts', '.tsx']
}
}
},
};
|
enyo.kind({
name: "Analyzer",
kind: "Component",
events: {
onIndexReady: ""
},
create: function() {
this.index = new Indexer();
this.inherited(arguments);
},
analyze: function(inPaths) {
this.walk(inPaths);
},
walk: function(inPaths) {
var modules = [];
var next = function(inSender, inData) {
if (inData) {
modules = modules.concat(inData.modules);
}
var path = inPaths.shift();
if (path) {
new Walker().walk(path).response(this, next);
} else {
this.walkFinished(modules);
}
};
next.call(this);
},
walkFinished: function(inModules) {
this.read(inModules);
},
read: function(inModules) {
new Reader()
.go({modules: inModules})
.response(this, function(inSender, inData) {
this.indexModules(inData.modules);
})
;
},
indexModules: function(inModules) {
this.index.addModules(inModules);
this.doIndexReady();
}
});
|
//Class representing an e-commerce cart
class ECommerceCart {
constructor() {
this.cart_id = "";
this.products = [];
}
addProducts(productsToBeAdded) {
if (productsToBeAdded) {
//add only if not-null
this.products.push(...productsToBeAdded);
}
return this; //to aid builder pattern
}
addProduct(productToBeAdded) {
if (productToBeAdded) {
//add only if not-null
this.products.push(productToBeAdded);
}
return this; //to aid builder pattern
}
}
module.exports = {
ECommerceCart: ECommerceCart
};
|
'use strict';
function Airport(weather){
this._weather = typeof weather !== 'undefined' ? weather : new Weather();
this._hangar = [];
};
Airport.prototype.planes = function(){
return this._hangar;
};
Airport.prototype.clearForLanding = function(plane){
if(this._weather.isStormy()) {
throw new Error('cannot land during storm');
}
this._hangar.push(plane)
};
Airport.prototype.clearForTakeoff = function(plane){
if(this._weather.isStormy()) {
throw new Error('cannot takeoff during storm');
}
this._hangar = [];
};
|
var _ = require('lodash');
var Type = require('../../lib/type');
var elasticsearch = require('elasticsearch');
module.exports = new Type('string', {
help: 'Some letters strung together. Words and such',
to: {
stringList: function (str) {
return str.split(',').map(function (trimmable) {
return trimmable.trim();
});
},
numberList: function (str) {
return str.split(',').map(function (trimmable) {
return parseFloat(trimmable.trim());
});
}
}
});
|
function detectKey(measures) {
// Information for sharps and flats in each key
var majorKeys = [
// ["A", "B", "C", "D", "E", "F", "G"]
{
name: "Ab",
notes: ["b", "b", "n", "b", "b", "n", "n"],
points: 0
},
{
name: "A",
notes: ["n", "n", "#", "n", "n", "#", "#"],
points: 0
},
{
name: "Bb",
notes: ["n", "b", "n", "n", "b", "n", "n"],
points: 0
},
{
name: "B",
notes: ["#", "n", "#", "#", "n", "#", "#"],
points: 0
},
{
name: "C",
notes: ["n", "n", "n", "n", "n", "n", "n"],
points: 0
},
{
name: "Db",
notes: ["b", "b", "n", "b", "b", "n", "b"],
points: 0
},
{
name: "D",
notes: ["n", "n", "#", "n", "n", "#", "n"],
points: 0
},
{
name: "Eb",
notes: ["b", "b", "n", "n", "b", "n", "n"],
points: 0
},
{
name: "E",
notes: ["n", "n", "#", "#", "n", "#", "#"],
points: 0
},
{
name: "F",
notes: ["n", "b", "n", "n", "n", "n", "n"],
points: 0
},
{
name: "F#",
notes: ["#", "n", "#", "#", "#", "#", "#"],
points: 0
},
{
name: "Gb",
notes: ["b", "b", "b", "b", "b", "n", "b"],
points: 0
},
{
name: "G",
notes: ["n", "n", "n", "n", "n", "#", "n"],
points: 0
}
];
const notePos ="ABCDEFG";
const noteNames = [
[{note: "G", accidental: "#"}, {note: "A", accidental: "b"}],
[{note: "A"}],
[{note: "A", accidental: "#"}, {note: "B", accidental: "b"}],
[{note: "B"}, {note: "C", accidental: "b"}],
[{note: "B", accidental: "#"}, {note: "C"}],
[{note: "C", accidental: "#"}, {note: "D", accidental: "b"}],
[{note: "D"}],
[{note: "D", accidental: "#"}, {note: "E", accidental: "b"}],
[{note: "E"}, {note: "F", accidental: "b"}],
[{note: "E", accidental: "#"}, {note: "F"}],
[{note: "F", accidental: "#"}, {note: "G", accidental: "b"}],
[{note: "G"}],
];
// Find best key signature
for (let measure of measures) {
for (let note of measure) {
if (note.note != "rest") {
// If note fits in the key, add points to that key
// Points are based on note length
for (let noteName of noteNames) {
for (let noteN of noteName) {
if ((note.note == noteN.note) && ((note.accidental == noteN.accidental) || (!note.accidental && !noteN.accidental))) {
for (let noteN2 of noteName) {
var pos = notePos.indexOf(noteN2.note);
for (let key of majorKeys) {
if (noteN2.accidental) {
if (noteN2.accidental == key.notes[pos]) {
key.points += note.note_length;
}
} else {
if (key.notes[pos] == "n") {
key.points += note.note_length;
}
}
}
}
}
}
}
}
}
}
console.log(majorKeys);
var maxPoints = 0;
var bestKey = undefined;
// Key with the most points is the best key
for (let key of majorKeys) {
if (key.points > maxPoints) {
bestKey = key.name;
maxPoints = key.points;
}
}
console.log("Best key:", bestKey);
return bestKey;
}
|
;(function(Agent) {
Agent.serializeElement = function (element, uiName, recurse) {
var obj = {};
var $el;
//detect a jQuery object
//todo: support zepto
if (_.isObject(element) && !(element instanceof HTMLElement) && element.jquery) {
$el = element
} else {
$el = nanodom(element)
}
var el = $el && $el[0];
if (!el) {
return {};
}
obj.tagName = el.tagName;
obj.attributes = _.map(el.attributes, function(v) {
return {
name: v.name,
value: v.value
};
});
if (recurse) {
obj.children = _.map(el.children, function(child){
// the element does not have a name because it's a child
// Agent.serializeElement(child, name, true);
return Agent.serializeElement(child, '', true);
});
}
return {
name: uiName,
value: obj,
type: 'type-element'
};
};
}(Agent));
|
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.touch = void 0;
var MIN_DISTANCE = 10;
function getDirection(x, y) {
if (x > y && x > MIN_DISTANCE) {
return 'horizontal';
}
if (y > x && y > MIN_DISTANCE) {
return 'vertical';
}
return '';
}
exports.touch = Behavior({
methods: {
resetTouchStatus: function () {
this.direction = '';
this.deltaX = 0;
this.deltaY = 0;
this.offsetX = 0;
this.offsetY = 0;
},
touchStart: function (event) {
this.resetTouchStatus();
var touch = event.touches[0];
this.startX = touch.clientX;
this.startY = touch.clientY;
},
touchMove: function (event) {
var touch = event.touches[0];
this.deltaX = touch.clientX - this.startX;
this.deltaY = touch.clientY - this.startY;
this.offsetX = Math.abs(this.deltaX);
this.offsetY = Math.abs(this.deltaY);
this.direction =
this.direction || getDirection(this.offsetX, this.offsetY);
},
},
});
|
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from "./store";
import FastClick from "fastclick"
import vueLazyLoad from "vue-lazyload"
import VueLazyload from "vue-lazyload";
Vue.config.productionTip = false
Vue.prototype.$bus = new Vue()
//移动端300ms的延迟
FastClick.attach(document.body)
//使用懒加载插件
Vue.use(VueLazyload)
new Vue({
render: h => h(App),
router,
store,
}).$mount('#app')
|
var Exporter = require('./exporter'),
SwaggerExporter = require('./swagger'),
_ = require('lodash');
function StopLightX() {}
var prefix = 'x-stoplight';
var testsPrefix = 'x-tests';
StopLightX.prototype = new Exporter();
StopLightX.prototype._mapEndpoints = function() {
var self = this;
self.project.Endpoints.forEach(function(endpoint) {
self.data.paths[endpoint.Path][endpoint.Method][prefix] = {
id: endpoint.Id,
beforeScript: endpoint.Before || null,
afterScript: endpoint.After || null,
public: endpoint.Public,
mock: endpoint.Mock
};
});
};
StopLightX.prototype._mapSchemas = function() {
var self = this;
self.project.Schemas.forEach(function(schema) {
var obj = {
id: schema.Id,
name: schema.Name
};
if (!_.isEmpty(schema.Summary)) {
obj.summary = schema.Summary;
}
if (!_.isEmpty(schema.Description)) {
obj.description = schema.Description;
}
obj.public = schema.Public;
self.data.definitions[schema.namespace][prefix] = obj;
});
};
StopLightX.prototype._mapTests = function(tests, namespace) {
return tests.reduce(function(res, test) {
var exportTest = {
id: test._id,
name: test.name,
initialVariables: {}
};
try {
exportTest.initialVariables = JSON.parse(test.initialVariables);
} catch (e) {
}
exportTest.steps = test.steps.map(function(step) {
if (step.test) {
return {
$ref: '#/' + namespace + '/' + step.test
};
}
var request = step.request;
delete request.endpoint;
if (_.get(request, 'authentication.authType') === 'none') {
request.authentication = {};
}
if (!_.get(request, 'postData.params.length') && !_.get(request, 'postData.text.length')) {
request.postData = {};
} else {
delete request.postData.stored;
}
var assertions = step.assertions.map(function(a) {
if (a.op && a.op.match(/validate/) && a.value) {
try {
a.value = JSON.parse(a.value);
} catch (e) {
}
}
return a;
});
return {
id: step._id || step.id,
name: step.name,
beforeScript: step.middlewareBefore || step.beforeScript,
afterScript: step.middlewareAfter || step.afterScript,
capture: step.capture,
request: request,
assertions: assertions
};
});
res[test._id] = exportTest;
return res;
}, {});
};
StopLightX.prototype._export = function() {
var swaggerExporter = new SwaggerExporter();
swaggerExporter.loadProject(this.project);
swaggerExporter._export();
this.data = swaggerExporter.data;
var env = this.project.Environment;
this._mapEndpoints();
this._mapSchemas();
this.data[prefix] = {
beforeScript: env.MiddlewareBefore,
afterScript: env.MiddlewareAfter,
version: env.toJSON(),
functions: this.project.UtilityFunctions.reduce(function(res, item) {
res[item.name] = item.toJSON();
return res;
}, {}),
textSections: this.project.Texts.reduce(function(res, item) {
res[item.Id] = item.toJSON();
return res;
}, {})
};
this.data[testsPrefix] = this._mapTests(this.project.Tests, testsPrefix);
if (env.proxy.mock) {
this.data[prefix].mock = env.proxy.mock;
}
};
module.exports = StopLightX;
|
var searchData=
[
['textfield_2ecpp',['TextField.cpp',['../_text_field_8cpp.html',1,'']]],
['textfield_2eh',['TextField.h',['../_text_field_8h.html',1,'']]],
['textfileutil_2ecpp',['TextFileUtil.cpp',['../_text_file_util_8cpp.html',1,'']]],
['textfileutil_2eh',['TextFileUtil.h',['../_text_file_util_8h.html',1,'']]],
['textrasterrenderer_2ecpp',['TextRasterRenderer.cpp',['../_text_raster_renderer_8cpp.html',1,'']]],
['textrasterrenderer_2eh',['TextRasterRenderer.h',['../_text_raster_renderer_8h.html',1,'']]],
['texture_2ecpp',['Texture.cpp',['../_texture_8cpp.html',1,'']]],
['texture_2eh',['Texture.h',['../_texture_8h.html',1,'']]],
['triangulator_2ecpp',['Triangulator.cpp',['../_triangulator_8cpp.html',1,'']]],
['triangulator_2eh',['Triangulator.h',['../_triangulator_8h.html',1,'']]]
];
|
import axios from "axios";
const api = axios.create({
baseURL: "http://192.168.0.11:3333",
});
export default api;
|
export const createMovielike = async (itemId) => {
const data = JSON.stringify({ item_id: itemId });
const resp = await fetch('https://us-central1-involvement-api.cloudfunctions.net/capstoneApi/apps/pk9RMX2Es1GYRfVPhxJy/likes/', {
method: 'POST',
headers: {
'Content-type': 'application/json; Charset=UTF-8',
},
body: data,
});
return resp.text();
};
export const getMovielike = async () => {
const resp = await fetch('https://us-central1-involvement-api.cloudfunctions.net/capstoneApi/apps/pk9RMX2Es1GYRfVPhxJy/likes/', {
});
return resp.text();
};
export const createMoviecomment = async (id, userName, userComment) => {
const data = JSON.stringify({ item_id: id, username: userName, comment: userComment });
const resp = await fetch('https://us-central1-involvement-api.cloudfunctions.net/capstoneApi/apps/pk9RMX2Es1GYRfVPhxJy/comments/', {
method: 'POST',
headers: {
'Content-type': 'application/json; Charset=UTF-8',
},
body: data,
});
return resp.text();
};
export const getMoviecomment = async (itemId) => {
const resp = await fetch(`https://us-central1-involvement-api.cloudfunctions.net/capstoneApi/apps/pk9RMX2Es1GYRfVPhxJy/comments?item_id=${itemId}`, {
});
return resp.text();
};
|
(function(){
'use strict';
angular.module('RoofRunnerApp')
.factory('modeService', modeService);
modeService.$inject = ['$http', 'SweetAlert', '$q', 'expIdService'];
function modeService($http, SweetAlert, $q, expIdService){
var modeService = {};
//modeService.mode;
modeService.getMode = function(){
var defer = $q.defer();
var d = new Date();
expIdService.getExpId().then(
function(result){
var promise = $http.get('experiments/' + result + '/experimentInfo.json?' + d.getTime());
promise.then(function(result){
//modeService.mode = result.data.mode;
defer.resolve(result.data.mode);
//console.log(modeService.mode);
})
promise.error(function(data, status, headers, config){
defer.reject();
SweetAlert.swal({
title: "Error!",
text: "Could not get experiment info. Please contact the requester for more details.",
type: "error"
});
})
}
)
return(defer.promise);
}
return(modeService)
}
})()
|
!function(t,n){if("object"==typeof exports&&"object"==typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var e=n();for(var r in e)("object"==typeof exports?exports:t)[r]=e[r]}}("undefined"!=typeof self?self:this,function(){return function(t){function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}var e={};return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},n.p="/dist/",n(n.s=389)}({0:function(t,n){function e(t,n){var e=t[1]||"",o=t[3];if(!o)return e;if(n&&"function"==typeof btoa){var i=r(o);return[e].concat(o.sources.map(function(t){return"/*# sourceURL="+o.sourceRoot+t+" */"})).concat([i]).join("\n")}return[e].join("\n")}function r(t){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t))))+" */"}t.exports=function(t){var n=[];return n.toString=function(){return this.map(function(n){var r=e(n,t);return n[2]?"@media "+n[2]+"{"+r+"}":r}).join("")},n.i=function(t,e){"string"==typeof t&&(t=[[null,t,""]]);for(var r={},o=0;o<this.length;o++){var i=this[o][0];"number"==typeof i&&(r[i]=!0)}for(o=0;o<t.length;o++){var s=t[o];"number"==typeof s[0]&&r[s[0]]||(e&&!s[2]?s[2]=e:e&&(s[2]="("+s[2]+") and ("+e+")"),n.push(s))}},n}},1:function(t,n,e){function r(t,n){for(var e=0;e<t.length;e++){var r=t[e],o=v[r.id];if(o){o.refs++;for(var i=0;i<o.parts.length;i++)o.parts[i](r.parts[i]);for(;i<r.parts.length;i++)o.parts.push(c(r.parts[i],n))}else{for(var s=[],i=0;i<r.parts.length;i++)s.push(c(r.parts[i],n));v[r.id]={id:r.id,refs:1,parts:s}}}}function o(t,n){for(var e=[],r={},o=0;o<t.length;o++){var i=t[o],s=n.base?i[0]+n.base:i[0],a=i[1],u=i[2],d=i[3],l={css:a,media:u,sourceMap:d};r[s]?r[s].parts.push(l):e.push(r[s]={id:s,parts:[l]})}return e}function i(t,n){var e=y(t.insertInto);if(!e)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var r=w[w.length-1];if("top"===t.insertAt)r?r.nextSibling?e.insertBefore(n,r.nextSibling):e.appendChild(n):e.insertBefore(n,e.firstChild),w.push(n);else if("bottom"===t.insertAt)e.appendChild(n);else{if("object"!=typeof t.insertAt||!t.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var o=y(t.insertAt.before,e);e.insertBefore(n,o)}}function s(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t);var n=w.indexOf(t);n>=0&&w.splice(n,1)}function a(t){var n=document.createElement("style");if(void 0===t.attrs.type&&(t.attrs.type="text/css"),void 0===t.attrs.nonce){var e=l();e&&(t.attrs.nonce=e)}return d(n,t.attrs),i(t,n),n}function u(t){var n=document.createElement("link");return void 0===t.attrs.type&&(t.attrs.type="text/css"),t.attrs.rel="stylesheet",d(n,t.attrs),i(t,n),n}function d(t,n){Object.keys(n).forEach(function(e){t.setAttribute(e,n[e])})}function l(){return e.nc}function c(t,n){var e,r,o,i;if(n.transform&&t.css){if(!(i="function"==typeof n.transform?n.transform(t.css):n.transform.default(t.css)))return function(){};t.css=i}if(n.singleton){var d=g++;e=j||(j=a(n)),r=f.bind(null,e,d,!1),o=f.bind(null,e,d,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(e=u(n),r=h.bind(null,e,n),o=function(){s(e),e.href&&URL.revokeObjectURL(e.href)}):(e=a(n),r=p.bind(null,e),o=function(){s(e)});return r(t),function(n){if(n){if(n.css===t.css&&n.media===t.media&&n.sourceMap===t.sourceMap)return;r(t=n)}else o()}}function f(t,n,e,r){var o=e?"":r.css;if(t.styleSheet)t.styleSheet.cssText=U(n,o);else{var i=document.createTextNode(o),s=t.childNodes;s[n]&&t.removeChild(s[n]),s.length?t.insertBefore(i,s[n]):t.appendChild(i)}}function p(t,n){var e=n.css,r=n.media;if(r&&t.setAttribute("media",r),t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}function h(t,n,e){var r=e.css,o=e.sourceMap,i=void 0===n.convertToAbsoluteUrls&&o;(n.convertToAbsoluteUrls||i)&&(r=x(r)),o&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");var s=new Blob([r],{type:"text/css"}),a=t.href;t.href=URL.createObjectURL(s),a&&URL.revokeObjectURL(a)}var v={},b=function(t){var n;return function(){return void 0===n&&(n=t.apply(this,arguments)),n}}(function(){return window&&document&&document.all&&!window.atob}),m=function(t,n){return n?n.querySelector(t):document.querySelector(t)},y=function(t){var n={};return function(t,e){if("function"==typeof t)return t();if(void 0===n[t]){var r=m.call(this,t,e);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(t){r=null}n[t]=r}return n[t]}}(),j=null,g=0,w=[],x=e(2);t.exports=function(t,n){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");n=n||{},n.attrs="object"==typeof n.attrs?n.attrs:{},n.singleton||"boolean"==typeof n.singleton||(n.singleton=b()),n.insertInto||(n.insertInto="head"),n.insertAt||(n.insertAt="bottom");var e=o(t,n);return r(e,n),function(t){for(var i=[],s=0;s<e.length;s++){var a=e[s],u=v[a.id];u.refs--,i.push(u)}if(t){r(o(t,n),n)}for(var s=0;s<i.length;s++){var u=i[s];if(0===u.refs){for(var d=0;d<u.parts.length;d++)u.parts[d]();delete v[u.id]}}}};var U=function(){var t=[];return function(n,e){return t[n]=e,t.filter(Boolean).join("\n")}}()},2:function(t,n){t.exports=function(t){var n="undefined"!=typeof window&&window.location;if(!n)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var e=n.protocol+"//"+n.host,r=e+n.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(t,n){var o=n.trim().replace(/^"(.*)"$/,function(t,n){return n}).replace(/^'(.*)'$/,function(t,n){return n});if(/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(o))return t;var i;return i=0===o.indexOf("//")?o:0===o.indexOf("/")?e+o:r+o.replace(/^\.\//,""),"url("+JSON.stringify(i)+")"})}},23:function(t,n,e){var r=e(24);"string"==typeof r&&(r=[[t.i,r,""]]);var o={hmr:!0};o.transform=void 0,o.insertInto=void 0;e(1)(r,o);r.locals&&(t.exports=r.locals)},24:function(t,n,e){n=t.exports=e(0)(!1),n.push([t.i,".androidstudio {\n /*\nDate: 24 Fev 2015\nAuthor: Pedro Oliveira <kanytu@gmail . com>\n*/ }\n .androidstudio .hljs {\n color: #a9b7c6;\n background: #282b2e;\n display: block;\n overflow-x: auto;\n padding: 0.5em; }\n .androidstudio .hljs-number,\n .androidstudio .hljs-literal,\n .androidstudio .hljs-symbol,\n .androidstudio .hljs-bullet {\n color: #6897BB; }\n .androidstudio .hljs-keyword,\n .androidstudio .hljs-selector-tag,\n .androidstudio .hljs-deletion {\n color: #cc7832; }\n .androidstudio .hljs-variable,\n .androidstudio .hljs-template-variable,\n .androidstudio .hljs-link {\n color: #629755; }\n .androidstudio .hljs-comment,\n .androidstudio .hljs-quote {\n color: #808080; }\n .androidstudio .hljs-meta {\n color: #bbb529; }\n .androidstudio .hljs-string,\n .androidstudio .hljs-attribute,\n .androidstudio .hljs-addition {\n color: #6A8759; }\n .androidstudio .hljs-section,\n .androidstudio .hljs-title,\n .androidstudio .hljs-type {\n color: #ffc66d; }\n .androidstudio .hljs-name,\n .androidstudio .hljs-selector-id,\n .androidstudio .hljs-selector-class {\n color: #e8bf6a; }\n .androidstudio .hljs-emphasis {\n font-style: italic; }\n .androidstudio .hljs-strong {\n font-weight: bold; }\n",""])},389:function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=e(23)}})});
//# sourceMappingURL=androidstudio.js.js.map
|
(function(e){const t=e["hu"]=e["hu"]||{};t.dictionary=Object.assign(t.dictionary||{},{"%0 of %1":"%0 / %1","Align cell text to the bottom":"Szöveg igazítása a cellában alulra","Align cell text to the center":"Szöveg igazítása a cellában középre","Align cell text to the left":"Szöveg igazítása a cellában balra","Align cell text to the middle":"Szöveg igazítása a cellában középre","Align cell text to the right":"Szöveg igazítása a cellában jobbra","Align cell text to the top":"Szöveg igazítása a cellában felülre","Align center":"Középre igazítás","Align left":"Balra igazítás","Align right":"Jobbra igazítás","Align table to the left":"Tábla igazítása balra","Align table to the right":"Tábla igazítása jobbra",Alignment:"Igazítás","Almost equal to":"",Angle:"","Approximately equal to":"",Aquamarine:"Kékeszöld","Asterisk operator":"","Austral sign":"","back with leftwards arrow above":"",Background:"Háttér",Big:"Nagy","Bitcoin sign":"Bitcoin jel",Black:"Fekete","Block quote":"Idézet",Blue:"Kék","Blue marker":"Kék kiemelő",Bold:"Félkövér",Border:"Keret","Break text":"Sortörés","Bulleted List":"Pontozott lista","Bulleted list styles toolbar":"",Cancel:"Mégsem","Cedi sign":"","Cell properties":"Cella tulajdonságok","Cent sign":"Cent jel","Center table":"Tábla igazítása középre","Centered image":"Középre igazított kép","Change image text alternative":"Helyettesítő szöveg módosítása","Character categories":"","Characters: %0":"Karakterek: %0","Choose heading":"Stílus megadása",Circle:"Kör",Code:"Forráskód","Colon sign":"Kettőspont",Color:"Szín","Color picker":"Szín választása",Column:"Oszlop","Contains as member":"","Copyright sign":"Copyright jele","Cruzeiro sign":"","Currency sign":"Pénznem jel",Dashed:"Szaggatott",Decimal:"Szám","Decimal with leading zero":"Nullával kezdődő szám","Decrease indent":"Behúzás csökkentése",Default:"Alapértelmezett","Degree sign":"","Delete column":"Oszlop törlése","Delete row":"Sor törlése","Dim grey":"Halvány szürke",Dimensions:"Méretek","Disable editing":"Szerkesztés letiltása",Disc:"Korong","Division sign":"","Document colors":"Dokumentum színek","Dollar sign":"Dollár jel","Dong sign":"",Dotted:"Pontozott",Double:"Dupla","Double dagger":"","Double exclamation mark":"","Double low-9 quotation mark":"","Double question mark":"",Downloadable:"Letölthető","downwards arrow to bar":"","downwards dashed arrow":"szaggatott nyíl lefelé","downwards double arrow":"dupla nyíl lefelé","Drachma sign":"","Dropdown toolbar":"Lenyíló eszköztár","Edit block":"Blokk szerkesztése","Edit link":"Link szerkesztése","Editor toolbar":"Szerkesztő eszköztár","Element of":"","Em dash":"","Empty set":"","En dash":"","Enable editing":"Szerkesztés engedélyezése","end with leftwards arrow above":"","Enter image caption":"Képaláírás megadása","Enter table caption":"Táblázat feliratának megadása","Euro sign":"Euró jel","Euro-currency sign":"Euró pénznem jel","Exclamation question mark":"",Find:"Keresés","Find and replace":"Keresés és csere","Find in text…":"Keresés szövegben...","Font Background Color":"Betű háttérszín","Font Color":"Betűszín","Font Family":"Betűtípus","Font Size":"Betűméret","For all":"","Fraction slash":"","French franc sign":"Francia frank jel","Full size image":"Teljes méretű kép","German penny sign":"","Greater-than or equal to":"","Greater-than sign":"",Green:"Zöld","Green marker":"Zöld kiemelő","Green pen":"Zöld toll",Grey:"Szürke",Groove:"Árok","Guarani sign":"","Header column":"Oszlop fejléc","Header row":"Sor fejléc",Heading:"Stílusok","Heading 1":"Címsor 1","Heading 2":"Címsor 2","Heading 3":"Címsor 3","Heading 4":"Címsor 4","Heading 5":"Címsor 5","Heading 6":"Címsor 6",Height:"Magasság",Highlight:"Kiemelés","Horizontal ellipsis":"","Horizontal line":"Vízszintes elválasztóvonal","Horizontal text alignment toolbar":"Vízszintes szövegigazítási eszköztár","Hryvnia sign":"","HTML object":"HTML objektum",Huge:"Hatalmas","Identical to":"","Image resize list":"Kép átméretezési lista","Image toolbar":"Kép eszköztár","image widget":"képmodul","In line":"Soron belül","Increase indent":"Behúzás növelése","Indian rupee sign":"",Infinity:"","Insert code block":"Kód blokk beszúrása","Insert column left":"Oszlop beszúrása balra","Insert column right":"Oszlop beszúrása jobbra","Insert image":"Kép beszúrása","Insert paragraph after block":"Bekezdés beszúrása utána","Insert paragraph before block":"Bekezdés beszúrása elé","Insert row above":"Sor beszúrása fölé","Insert row below":"Sor beszúrása alá","Insert table":"Táblázat beszúrása",Inset:"Mélyített",Integral:"",Intersection:"","Inverted exclamation mark":"","Inverted question mark":"Fordított kérdőjel",Italic:"Dőlt",Justify:"Sorkizárt","Justify cell text":"Szöveg igazítása a cellában sorkizártra","Kip sign":"","Latin capital letter a with breve":"","Latin capital letter a with macron":"","Latin capital letter a with ogonek":"","Latin capital letter c with acute":"","Latin capital letter c with caron":"","Latin capital letter c with circumflex":"","Latin capital letter c with dot above":"","Latin capital letter d with caron":"","Latin capital letter d with stroke":"","Latin capital letter e with breve":"","Latin capital letter e with caron":"","Latin capital letter e with dot above":"","Latin capital letter e with macron":"","Latin capital letter e with ogonek":"","Latin capital letter eng":"","Latin capital letter g with breve":"","Latin capital letter g with cedilla":"","Latin capital letter g with circumflex":"","Latin capital letter g with dot above":"","Latin capital letter h with circumflex":"","Latin capital letter h with stroke":"","Latin capital letter i with breve":"","Latin capital letter i with dot above":"","Latin capital letter i with macron":"","Latin capital letter i with ogonek":"","Latin capital letter i with tilde":"","Latin capital letter j with circumflex":"","Latin capital letter k with cedilla":"","Latin capital letter l with acute":"","Latin capital letter l with caron":"","Latin capital letter l with cedilla":"","Latin capital letter l with middle dot":"","Latin capital letter l with stroke":"","Latin capital letter n with acute":"","Latin capital letter n with caron":"","Latin capital letter n with cedilla":"","Latin capital letter o with breve":"","Latin capital letter o with double acute":"","Latin capital letter o with macron":"","Latin capital letter r with acute":"","Latin capital letter r with caron":"","Latin capital letter r with cedilla":"","Latin capital letter s with acute":"","Latin capital letter s with caron":"","Latin capital letter s with cedilla":"","Latin capital letter s with circumflex":"","Latin capital letter t with caron":"","Latin capital letter t with cedilla":"","Latin capital letter t with stroke":"","Latin capital letter u with breve":"","Latin capital letter u with double acute":"","Latin capital letter u with macron":"","Latin capital letter u with ogonek":"","Latin capital letter u with ring above":"","Latin capital letter u with tilde":"","Latin capital letter w with circumflex":"","Latin capital letter y with circumflex":"","Latin capital letter y with diaeresis":"","Latin capital letter z with acute":"","Latin capital letter z with caron":"","Latin capital letter z with dot above":"","Latin capital ligature ij":"","Latin capital ligature oe":"","Latin small letter a with breve":"","Latin small letter a with macron":"","Latin small letter a with ogonek":"","Latin small letter c with acute":"","Latin small letter c with caron":"","Latin small letter c with circumflex":"","Latin small letter c with dot above":"","Latin small letter d with caron":"","Latin small letter d with stroke":"","Latin small letter dotless i":"","Latin small letter e with breve":"","Latin small letter e with caron":"","Latin small letter e with dot above":"","Latin small letter e with macron":"","Latin small letter e with ogonek":"","Latin small letter eng":"","Latin small letter f with hook":"","Latin small letter g with breve":"","Latin small letter g with cedilla":"","Latin small letter g with circumflex":"","Latin small letter g with dot above":"","Latin small letter h with circumflex":"","Latin small letter h with stroke":"","Latin small letter i with breve":"","Latin small letter i with macron":"","Latin small letter i with ogonek":"","Latin small letter i with tilde":"","Latin small letter j with circumflex":"","Latin small letter k with cedilla":"","Latin small letter kra":"","Latin small letter l with acute":"","Latin small letter l with caron":"","Latin small letter l with cedilla":"","Latin small letter l with middle dot":"","Latin small letter l with stroke":"","Latin small letter long s":"","Latin small letter n preceded by apostrophe":"","Latin small letter n with acute":"","Latin small letter n with caron":"","Latin small letter n with cedilla":"","Latin small letter o with breve":"","Latin small letter o with double acute":"","Latin small letter o with macron":"","Latin small letter r with acute":"","Latin small letter r with caron":"","Latin small letter r with cedilla":"","Latin small letter s with acute":"","Latin small letter s with caron":"","Latin small letter s with cedilla":"","Latin small letter s with circumflex":"","Latin small letter t with caron":"","Latin small letter t with cedilla":"","Latin small letter t with stroke":"","Latin small letter u with breve":"","Latin small letter u with double acute":"","Latin small letter u with macron":"","Latin small letter u with ogonek":"","Latin small letter u with ring above":"","Latin small letter u with tilde":"","Latin small letter w with circumflex":"","Latin small letter y with circumflex":"","Latin small letter z with acute":"","Latin small letter z with caron":"","Latin small letter z with dot above":"","Latin small ligature ij":"","Latin small ligature oe":"","Left aligned image":"Balra igazított kép","Left double quotation mark":"","Left single quotation mark":"","Left-pointing double angle quotation mark":"","leftwards arrow to bar":"","leftwards dashed arrow":"szaggatott nyíl balra","leftwards double arrow":"dupla nyíl balra","Less-than or equal to":"","Less-than sign":"","Light blue":"Világoskék","Light green":"Világoszöld","Light grey":"Világosszürke",Link:"Link","Link URL":"URL link","Lira sign":"Líra jel","Livre tournois sign":"","Logical and":"","Logical or":"","Lower-latin":"Kisbetűs latin szám","Lower–roman":"Kisbetűs római szám",Macron:"","Manat sign":"","Match case":"Nagybetű érzékeny","Merge cell down":"Cellák egyesítése lefelé","Merge cell left":"Cellák egyesítése balra","Merge cell right":"Cellák egyesítése jobbra","Merge cell up":"Cellák egyesítése felfelé","Merge cells":"Cellaegyesítés","Mill sign":"","Minus sign":"","Multiplication sign":"","N-ary product":"","N-ary summation":"",Nabla:"","Naira sign":"","New sheqel sign":"",Next:"Következő","Next result":"Következő találat",None:"Nincs","Nordic mark sign":"","Not an element of":"","Not equal to":"","Not sign":"","Numbered List":"Számozott lista","Numbered list styles toolbar":"","on with exclamation mark with left right arrow above":"","Open in a new tab":"Megnyitás új lapon","Open link in new tab":"Link megnyitása új ablakban",Orange:"Narancs",Original:"Eredeti",Outset:"Kiemelkedő",Overline:"",Padding:"Térköz","Page break":"Oldaltörés",Paragraph:"Bekezdés","Paragraph sign":"","Partial differential":"","Per mille sign":"","Per ten thousand sign":"","Peseta sign":"","Peso sign":"","Pink marker":"Rózsaszín kiemelő","Plain text":"Egyszerű szöveg","Plus-minus sign":"","Pound sign":"Font jel",Previous:"Előző","Previous result":"Előző találat","Proportional to":"",Purple:"Lila","Question exclamation mark":"",Red:"Piros","Red pen":"Piros toll",Redo:"Újra","Registered sign":"","Remove color":"Szín eltávolítása","Remove Format":"Formázás eltávolítása","Remove highlight":"Kiemelés eltávolítása",Replace:"Csere","Replace all":"Mind cserél","Replace with…":"Csere erre...","Resize image":"Kép átméretezése","Resize image to %0":"Kép méretezése %0","Resize image to the original size":"Kép méretezése az eredeti méretre","Restore default":"Alapértelmezés visszaállítása","Reversed paragraph sign":"","Rich Text Editor":"Bővített szövegszerkesztő","Rich Text Editor, %0":"Bővített szövegszerkesztő, %0",Ridge:"Gerinc","Right aligned image":"Jobbra igazított kép","Right double quotation mark":"","Right single quotation mark":"","Right-pointing double angle quotation mark":"","rightwards arrow to bar":"","rightwards dashed arrow":"szaggatott nyíl jobbra","rightwards double arrow":"dupla nyíl jobbra",Row:"Sor","Ruble sign":"","Rupee sign":"",Save:"Mentés","Section sign":"","Select all":"Mindet kijelöl","Select column":"Oszlop kijelölése","Select row":"Sor kijelölése","Show more items":"További elemek","Show options":"Beállítások megjelenítése","Side image":"Oldalsó kép","Single left-pointing angle quotation mark":"","Single low-9 quotation mark":"","Single right-pointing angle quotation mark":"",Small:"Kicsi",Solid:"Tömör","soon with rightwards arrow above":"","Special characters":"Speciális karakterek","Spesmilo sign":"","Split cell horizontally":"Cella felosztása vízszintesen","Split cell vertically":"Cella felosztása függőlegesen",Square:"Négyzet","Square root":"",Strikethrough:"Áthúzott",Style:"Stílus",Subscript:"Alsó index",Superscript:"Felső index","Table alignment toolbar":"Táblázatigazítási eszköztár","Table cell text alignment":"Szöveg igazítása a cellában","Table properties":"Táblázat tulajdonságai","Table toolbar":"Táblázat eszköztár","Tenge sign":"","Text alignment":"Szöveg igazítása","Text alignment toolbar":"Szöveg igazítás eszköztár","Text alternative":"Helyettesítő szöveg","Text highlight toolbar":"Szöveg kiemelés eszköztár","Text to find must not be empty.":"A keresendő szöveg nem lehet üres.",'The color is invalid. Try "#FF0000" or "rgb(255,0,0)" or "red".':'A szín érványtelen. Próbáld így "#FF0000" vagy "rgb(255,0,0)" vagy "red".','The value is invalid. Try "10px" or "2em" or simply "2".':'Az érték érvénytelen. Próbáld így "10px" vagy "2em" vagy csak egyszerűen "2".',"There exists":"","This link has no URL":"A link nem tartalmaz URL-t","Tilde operator":"",Tiny:"Apró","Tip: Find some text first in order to replace it.":"Tipp: Először keressen egy szöveget, hogy lecserélhesse.","To-do List":"Tennivaló lista","Toggle caption off":"Felirat kikapcsolása","Toggle caption on":"Felirat bekapcsolása","Toggle the circle list style":"","Toggle the decimal list style":"","Toggle the decimal with leading zero list style":"","Toggle the disc list style":"","Toggle the lower–latin list style":"","Toggle the lower–roman list style":"","Toggle the square list style":"","Toggle the upper–latin list style":"","Toggle the upper–roman list style":"","top with upwards arrow above":"","Trade mark sign":"","Tugrik sign":"","Turkish lira sign":"",Turquoise:"Türkiz","Two dot leader":"","Type or paste your content here.":"Írja be, vagy illessze be a tartalmat.","Type your title":"Adja meg a címet",Underline:"Aláhúzott",Undo:"Visszavonás",Union:"",Unlink:"Link eltávolítása","up down arrow with base":"","Upload failed":"A feltöltés nem sikerült","Upload in progress":"A feltöltés folyamatban","Upper-latin":"Nagybetűs latin szám","Upper-roman":"Nagybetűs római szám","upwards arrow to bar":"","upwards dashed arrow":"szaggatott nyíl felfelé","upwards double arrow":"dupla nyíl felfelé","Vertical text alignment toolbar":"Függőleges szövegigazítási eszköztár","Vulgar fraction one half":"","Vulgar fraction one quarter":"","Vulgar fraction three quarters":"",White:"Fehér","Whole words only":"Csak teljes szavak","Widget toolbar":"Widget eszköztár",Width:"Szélesség","Won sign":"","Words: %0":"Szavak: %0","Wrap text":"Körbefuttatás",Yellow:"Sárga","Yellow marker":"Sárga kiemelő","Yen sign":"Yen jel"});t.getPluralForm=function(e){return e!=1}})(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
import { filter, get, groupBy, map, reverse, sortBy } from 'lodash-es';
export default /* @ngInject */ ($stateProvider, $urlRouterProvider) => {
$stateProvider.state('app.dashboard', {
url: '/?expand',
params: {
expand: {
value: null,
squash: true,
dynamic: true,
},
},
resolve: {
products: /* @ngInject */ (catalog, order, services) =>
get(services, 'data.count') === 0 && !order
? groupBy(
filter(catalog.data, ({ highlight }) => highlight),
'universe',
)
: reverse(
sortBy(
map(services.data?.data, (service, productType) => ({
...service,
productType,
})),
'count',
),
),
goToProductPage: /* @ngInject */ ($state, atInternet, trackingPrefix) => (
product,
) => {
atInternet.trackClick({
name: `${trackingPrefix}::product::${product
.toLowerCase()
.replace(/_/g, '-')}::show-all`,
type: 'action',
});
return (
$state
.go(`app.dashboard.${product.toLowerCase()}`)
// If the transition error, it means the state doesn't exist
.catch(() =>
$state.go('app.dashboard.products', {
product: product.toLowerCase(),
}),
)
);
},
trackingPrefix: () => 'hub::dashboard',
expandProducts: /* @ngInject */ ($state) => (expand) =>
$state.go('.', {
expand,
}),
expand: /* @ngInject */ ($transition$) => $transition$.params().expand,
hideBreadcrumb: () => true,
breadcrumb: /* @ngInject */ ($translate) =>
$translate.instant('manager_hub_dashboard'),
},
componentProvider: /* @ngInject */ (order, services) =>
get(services, 'data.count') === 0 && !order
? 'hubOrderDashboard'
: 'hubDashboard',
});
$urlRouterProvider.otherwise('/');
};
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.